Class NumberSpectrumViewer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.chart.JLChart
fr.esrf.tangoatk.widget.util.chart.AdvancedJLChart
fr.esrf.tangoatk.widget.attribute.NumberSpectrumViewer
- All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener,fr.esrf.tangoatk.core.IErrorListener,fr.esrf.tangoatk.core.INumberScalarListener,fr.esrf.tangoatk.core.ISpectrumListener,IJLChartActionListener,IJLChartListener,JDrawable,ActionListener,MouseListener,MouseMotionListener,MouseWheelListener,ImageObserver,MenuContainer,Serializable,EventListener
public class NumberSpectrumViewer
extends AdvancedJLChart
implements fr.esrf.tangoatk.core.ISpectrumListener, fr.esrf.tangoatk.core.INumberScalarListener, IJLChartActionListener, IJLChartListener, JDrawable
A class to display a scalar spectrum attribute . The NumberSpectrumViewer
displays the spectrum according to index value (x axis shows value index).
- Author:
- E.S.R.F
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected doubleprotected static final Stringprotected static final Stringprotected JLDataViewprotected Stringprotected fr.esrf.tangoatk.core.INumberSpectrumprotected SimplePropertyFrameprotected booleanprotected static final Stringprotected booleanprotected StringFields inherited from class fr.esrf.tangoatk.widget.util.chart.AdvancedJLChart
dataViewMenu, dataViewOptionItem, loadFileMenuItem, MENU_DATALOAD, MENU_RESET, removeDataViewMenuItem, resetMenuItemFields inherited from class fr.esrf.tangoatk.widget.util.chart.JLChart
chartMenu, dialogParent, FR_DATE_FORMAT, LABEL_DOWN, LABEL_LEFT, LABEL_RIGHT, LABEL_ROW, LABEL_UP, labelRect, lastDataFileLocation, lastFileFilter, lastSnapshotLocation, maxDisplayDuration, MENU_CHARTPROP, MENU_DATASAVE, MENU_DVPROP, MENU_PRINT, MENU_STAT, MENU_TABLE, modalDialog, noValueString, parentFrame, preferDialog, tableDialog, US_DATE_FORMATFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when the user select a user action (available from contextual chart menu)voidclearModelremoves the model.String[]Called when the user click on the chartvoiderrorChange(fr.esrf.tangoatk.core.ErrorEvent errorEvent) booleanCalled when the the action name starting with 'chk' (displayed as check box menu item) and each time the chart menu is shown.getDescription(String name) Get a description of this extensions.getExtendedParam(String name) Returns the specified parameter value.String[]booleanReturn configuration.voidCall after a component of a JDSwingObject is created, this give a default look and feel for editing.booleanbooleanReturns whether unit shoud be visible or notstatic voidvoidnumberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent evt) protected booleanprepareDataViewMenu(JLDataView dataView) voidremoveDataView(JLDataView view) booleansetExtendedParam(String name, String value, boolean popupErr) Sets the specified param.voidsetManageXaxis(boolean b) Sets if the viewer should manage the X axis according to a min and max value.voidsetModel(fr.esrf.tangoatk.core.INumberSpectrum v) setModelSet the model.voidsetQualityVisible(boolean qualityVisible) setSettings(String cfg) Apply configuration.voidvoidsetUnitVisible(boolean displayUnit) Sets whether unit shoud be visible or notvoidsetXAxisAffineTransform(double a0, double a1) Sets an affine tranform to the X axis.voidsetXaxisModels(fr.esrf.tangoatk.core.INumberScalar min, fr.esrf.tangoatk.core.INumberScalar max) Sets the min and max for X axis to two scalar attributesvoidSets the x Axis unit.voidspectrumChange(fr.esrf.tangoatk.core.NumberSpectrumEvent numberSpectrumEvent) voidstateChange(fr.esrf.tangoatk.core.AttributeStateEvent evt) Methods inherited from class fr.esrf.tangoatk.widget.util.chart.AdvancedJLChart
actionPerformed, mousePressed, removeMenuItemMethods inherited from class fr.esrf.tangoatk.widget.util.chart.JLChart
addData, addJLChartActionListener, addMenuItem, addSeparator, addUserAction, applyConfiguration, autoScaleOnceX, autoScaleOnceY1, autoScaleOnceY2, buildPanelString, enterZoom, exitZoom, garbageData, getChartBackground, getConfiguration, getDisplayDuration, getHeader, getHeaderColor, getHeaderFont, getHelpString, getLabelFont, getLabelPlacement, getMargin, getMaxDisplayDuration, getNoValueString, getTimePrecision, getUserActionMenuItem, getXAxis, getY1Axis, getY2Axis, isHeaderVisible, isInRange, isLabelVisible, isPaintAxisFirst, isXAxisOnBottom, isZoomed, loadDataFile, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelMoved, paint, printGraph, refreshTableSingle, removeJLChartActionListener, removeUserAction, reset, reset, setBackground, setChartBackground, setDisplayDuration, setFrameParent, setHeader, setHeaderColor, setHeaderFont, setHeaderVisible, setJLChartListener, setLabelFont, setLabelPlacement, setLabelVisible, setMargin, setMaxDisplayDuration, setNoValueString, setPaintAxisFirst, setParentForTableDialog, setParentForTableDialog, setPreferDialogForTable, setTimePrecision, setXAxisOnBottom, showDataOptionDialog, showOptionDialog, showPanel, showPanel, showStatAll, showTableAll, showTableAll, unselectAllMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
model
protected fr.esrf.tangoatk.core.INumberSpectrum model -
dvy
-
pf
-
A0
protected double A0 -
A1
protected double A1 -
xAxisUnit
-
format
-
unitVisible
protected boolean unitVisible -
qualityVisible
protected boolean qualityVisible -
DISPLAY_UNIT_STRING
- See Also:
-
DISPLAY_QUALITY_STRING
- See Also:
-
SET_SPECTRUM_MENU_LABEL
- See Also:
-
-
Constructor Details
-
NumberSpectrumViewer
public NumberSpectrumViewer()Creates new fNumberSpectrumViewer
-
-
Method Details
-
getDataView
- Returns:
- the dataview which contains plotted data
-
getManageXaxis
public boolean getManageXaxis()- Returns:
- if the viewer should manage the X axis according to a min and max value.
-
setManageXaxis
public void setManageXaxis(boolean b) Sets if the viewer should manage the X axis according to a min and max value. This method should be called BEFORE setModel()- Parameters:
b- True to enable automatic axis management
-
getXAxisUnit
- Returns:
- the x Axis unit.
-
setXAxisUnit
Sets the x Axis unit.- Parameters:
u- Axis unit
-
setXAxisAffineTransform
public void setXAxisAffineTransform(double a0, double a1) Sets an affine tranform to the X axis. This allows to transform spectra index displayed on X axis.- Parameters:
a0- a0 coefficienta1- a1 coefficient
-
initForEditing
public void initForEditing()Description copied from interface:JDrawableCall after a component of a JDSwingObject is created, this give a default look and feel for editing.- Specified by:
initForEditingin interfaceJDrawable
-
getComponent
- Specified by:
getComponentin interfaceJDrawable- Returns:
- the JComponent that implements this interface.
-
getDescription
Description copied from interface:JDrawableGet a description of this extensions.- Specified by:
getDescriptionin interfaceJDrawable- Parameters:
name- Extension name- Returns:
- Empty string for no description.
-
getExtensionList
- Specified by:
getExtensionListin interfaceJDrawable- Returns:
- list of extension name for this objects (Empty array for none).
-
setExtendedParam
Description copied from interface:JDrawableSets the specified param.- Specified by:
setExtendedParamin interfaceJDrawable- Parameters:
name- Parameter name (Case unsensitive).value- Parameter value.popupErr- true when the JDrawable should display a popup if the parameter value is incorrect, false otherwise. Note that the JDrawable must not display an error message if the parameter does not exists even if popupAllowed is true.- Returns:
- true if parameters has been succesfully applied, false otherwise.
-
getExtendedParam
Description copied from interface:JDrawableReturns the specified parameter value.- Specified by:
getExtendedParamin interfaceJDrawable- Parameters:
name- Param name (Case unsensitive).- Returns:
- Empty string if not exists, the value otherwise.
-
actionPerformed
Description copied from interface:IJLChartActionListenerCalled when the user select a user action (available from contextual chart menu)- Specified by:
actionPerformedin interfaceIJLChartActionListener- Parameters:
evt- Event object (containing acion name and state)- See Also:
-
getActionState
Description copied from interface:IJLChartActionListenerCalled when the the action name starting with 'chk' (displayed as check box menu item) and each time the chart menu is shown. if several listener handle the same action, the result will be a logical and of all results.- Specified by:
getActionStatein interfaceIJLChartActionListener- Parameters:
evt- Event object (containing acion name)- Returns:
- Action state (true to execute)
- See Also:
-
errorChange
public void errorChange(fr.esrf.tangoatk.core.ErrorEvent errorEvent) - Specified by:
errorChangein interfacefr.esrf.tangoatk.core.IErrorListener
-
stateChange
public void stateChange(fr.esrf.tangoatk.core.AttributeStateEvent evt) - Specified by:
stateChangein interfacefr.esrf.tangoatk.core.IAttributeStateListener
-
spectrumChange
public void spectrumChange(fr.esrf.tangoatk.core.NumberSpectrumEvent numberSpectrumEvent) - Specified by:
spectrumChangein interfacefr.esrf.tangoatk.core.ISpectrumListener
-
clickOnChart
Description copied from interface:IJLChartListenerCalled when the user click on the chart- Specified by:
clickOnChartin interfaceIJLChartListener- Parameters:
e- Event object (containing click inforamtion)- Returns:
- A set of string to display in the value tooltip. Does not display the tooltip if an empty array is returned. Keep default behavior when null is returned
-
setModel
public void setModel(fr.esrf.tangoatk.core.INumberSpectrum v) setModelSet the model.- Parameters:
v- Value to assign to model.
-
clearModel
public void clearModel()clearModelremoves the model. -
setSettings
Apply configuration.- Parameters:
cfg- String containing configuration- Returns:
- error string when failure or an empty string when succesfull
-
getSettings
Return configuration.- Returns:
- current chart configuration as string
-
isUnitVisible
public boolean isUnitVisible()Returns whether unit shoud be visible or not- Returns:
- boolean corresponding to the choice
-
setUnitVisible
public void setUnitVisible(boolean displayUnit) Sets whether unit shoud be visible or not- Parameters:
displayUnit- corresponding to the choice
-
isQualityVisible
public boolean isQualityVisible() -
setQualityVisible
public void setQualityVisible(boolean qualityVisible) -
setSpectrumAttribute
public void setSpectrumAttribute() -
removeDataView
- Overrides:
removeDataViewin classJLChart
-
prepareDataViewMenu
- Overrides:
prepareDataViewMenuin classAdvancedJLChart
-
setXaxisModels
public void setXaxisModels(fr.esrf.tangoatk.core.INumberScalar min, fr.esrf.tangoatk.core.INumberScalar max) Sets the min and max for X axis to two scalar attributes- Parameters:
min- Min value modelmax- Max value model
-
numberScalarChange
public void numberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent evt) - Specified by:
numberScalarChangein interfacefr.esrf.tangoatk.core.INumberScalarListener
-
main
-