Class BooleanTrend
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
fr.esrf.tangoatk.widget.attribute.BooleanTrend
- All Implemented Interfaces:
fr.esrf.tangoatk.core.IRefresherListener,IJLChartActionListener,IControlee,ActionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class BooleanTrend
extends JPanel
implements IControlee, ActionListener, IJLChartActionListener, fr.esrf.tangoatk.core.IRefresherListener
A class to monitor multiple boolean scalar attributes.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested 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 JMenuItemprotected JMenuItemprotected fr.esrf.tangoatk.core.AttributePolledListprotected JMenuItemprotected static final fr.esrf.tangoatk.core.IEntityFilterprotected Mapprotected static final GregorianCalendarprotected JButtonprotected JMenuItemprotected fr.esrf.tangoatk.widget.attribute.BooleanConfigPanelstatic final StringCorresponds to the button "Add new attribute"protected JLabelprotected static final double[]static final intDevice name are always displayed whithin chart labelstatic final intDevice name are displayed whithin chart label when neededstatic final intDevice name are never displayed whithin chart labelprotected static Pointprotected static Pointprotected static final SimpleDateFormatprotected Stringprotected JPanelprotected intprotected static final double[]protected static final String[]protected fr.esrf.tangoatk.widget.attribute.BooleanTrendSelectionNodeprotected Stringprotected fr.esrf.tangoatk.core.AttributePolledListstatic final StringCorresponds to the button "Load configuration"protected JButtonprotected JMenuItemprotected JTreeprotected DefaultTreeModelstatic final StringCorresponds to the button "Global settings"protected JButtonprotected JMenuItemprotected JMenuItemprotected JFrameprotected SimplePropertyFrameprotected JMenuItemstatic final StringCorresponds to the button "Reset trend"protected JButtonprotected JMenuItemprotected fr.esrf.tangoatk.widget.attribute.BooleanTrendSelectionNodestatic final StringCorresponds to the button "Save configuration"protected JButtonprotected JMenuItemstatic final intNot selectedstatic final intSelected on Y1static final intSelected on Y2protected JMenuItemprotected booleanstatic final StringCorresponds to the button "start monitoring"protected JButtonprotected JMenuItemstatic final StringCorresponds to the button "stop monitoring"protected JButtonprotected JMenuItemprotected fr.esrf.tangoatk.widget.attribute.BooleanChartprotected JToolBarstatic final StringCorresponds to the button "Set rfresh interval"protected JButtonprotected JMenuItemprotected intprotected JPopupMenuprotected JPopupMenuprotected JScrollPanestatic final StringCorresponds to the button "Zoom"protected JButtonprotected JMenuItemFields 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)voidvoidaddAttribute(fr.esrf.tangoatk.core.IBooleanScalar scalar) voidaddAttribute(String name) addAttributewill add the IBooleanScalar to the BooleanTrend.voidaddToAxis(fr.esrf.tangoatk.core.IBooleanScalar attribute, int axisSelection, boolean addToModel) Adds an attribute to an axis of this trend (or removes the attribute from axis).voidAdds an attribute to an axis of this trend (or removes the attribute from axis).voidFree any allocated resource and stop refreshing.voiddisableButton(String buttonName) Disables the button corresponding to the stringvoidenableButton(String buttonName) Enables the button corresponding to the stringbooleanCalled when the the action name starting with 'chk' (displayed as check box menu item) and each time the chart menu is shown.intgetAxisForAttribute(String attributeName) Returns the axis associated with an attributegetChart()Returns a handle to the chartgetDataViewForAttribute(String attributeName) Returns the dataview associated with an attribute (null if no dataview is associated with the attribute)doublefr.esrf.tangoatk.core.AttributePolledListgetModel()doubleDeprecated.no longer used (has no FX)returns the configuration as string.intgetTitle()intDeprecated.no longer used (has no FX)booleanReturns true only if toolbar is visiblebooleanReturns true only if datelabel is visiblebooleanDeprecated.use getChart()booleanDeprecated.no longer used (has no FX)booleanDeprecated.use getChart()booleanintDetermines whether or not device names (within chart labels) are visible.booleanDeprecated.no longer used (has no FX)loadSetting(String filename) Load graph settings.static voidvoidok()okwill be called when the component is visible and the user presses the OK button on the ButtonBar Expected behaviour is to set all the values on the model the widget is representing followed by agetRootPane().getParent().setVisible(false);voidvoidremoveAttribute(fr.esrf.tangoatk.core.IBooleanScalar scalar) voidvoidsaveSetting(String filename) Save settings.voidsetButtonBarVisible(boolean b) Displays or hides the toolbarvoidsetDateVisible(boolean b) Displays or hides the date labelvoidsetLegendVisible(boolean b) Deprecated.use getChart()voidsetListVisible(boolean b) Deprecated.no longer used (has no FX)voidsetLogarithmicScale(boolean logarithmic) Deprecated.use getChart()voidsetMaxDisplayDuration(double maxDisplay) voidsetModel(fr.esrf.tangoatk.core.AttributePolledList list) ThissetModelwhich takes an AttributePolledList as a parameter, will just add the boolean scalar attributes in the list to the list viewer in the BooleanTrend.voidsetSamplingRate(double rate) Deprecated.no longer used (has no FX)voidsetSelectionTreeVisible(boolean b) Displays or hides the selection treesetSetting(String txt) Apply a configuration.voidsetShowingDeviceNames(int mode) Determines whether or not device names (within chart labels) are visible.voidsetShowingNames(boolean b) Deprecated.no longer used (has no FX)voidsetTimePrecision(int timePrecision) voidsetXAxisLength(int length) Deprecated.no longer used (has no FX)Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods 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, 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
-
SEL_NONE
public static final int SEL_NONENot selected- See Also:
-
SEL_Y1
public static final int SEL_Y1Selected on Y1- See Also:
-
SEL_Y2
public static final int SEL_Y2Selected on Y2- See Also:
-
DEVICE_LABEL_AUTO
public static final int DEVICE_LABEL_AUTODevice name are displayed whithin chart label when needed- See Also:
-
DEVICE_LABEL_NEVER
public static final int DEVICE_LABEL_NEVERDevice name are never displayed whithin chart label- See Also:
-
DEVICE_LABEL_ALWAYS
public static final int DEVICE_LABEL_ALWAYSDevice name are always displayed whithin chart label- See Also:
-
parent
-
theToolBar
-
toolMenu
-
optionButton
-
optionMenuI
-
stopButton
-
stopMenuI
-
startButton
-
startMenuI
-
loadButton
-
loadMenuI
-
saveButton
-
saveMenuI
-
zoomButton
-
zoomMenuI
-
timeButton
-
timeMenuI
-
cfgButton
-
cfgMenuI
-
resetButton
-
resetMenuI
-
showtoolMenuI
-
innerPanel
-
dateLabel
-
treeView
-
mainTree
-
mainTreeModel
-
rootNode
protected fr.esrf.tangoatk.widget.attribute.BooleanTrendSelectionNode rootNode -
treeMenu
-
addY1MenuItem
-
addY2MenuItem
-
removeMenuItem
-
optionMenuItem
-
attOptionMenuItem
-
theGraph
protected fr.esrf.tangoatk.widget.attribute.BooleanChart theGraph -
graphTitle
-
cfgPanel
protected fr.esrf.tangoatk.widget.attribute.BooleanConfigPanel cfgPanel -
framePos
-
frameDimension
-
attList
protected fr.esrf.tangoatk.core.AttributePolledList attList -
lastAdded
protected fr.esrf.tangoatk.widget.attribute.BooleanTrendSelectionNode lastAdded -
lastCreatedList
protected fr.esrf.tangoatk.core.AttributePolledList lastCreatedList -
propFrame
-
lastConfig
-
singleDevice
protected boolean singleDevice -
isShowingDeviceName
protected int isShowingDeviceName -
calendar
-
genFormat
-
buttonMap
-
start
Corresponds to the button "start monitoring"- See Also:
-
stop
Corresponds to the button "stop monitoring"- See Also:
-
save
Corresponds to the button "Save configuration"- See Also:
-
load
Corresponds to the button "Load configuration"- See Also:
-
zoom
Corresponds to the button "Zoom"- See Also:
-
time
Corresponds to the button "Set rfresh interval"- See Also:
-
option
Corresponds to the button "Global settings"- See Also:
-
config
Corresponds to the button "Add new attribute"- See Also:
-
reset
Corresponds to the button "Reset trend"- See Also:
-
timePrecision
protected int timePrecision -
labels
-
labelPositions
protected static final double[] labelPositions -
defaultMinMax
protected static final double[] defaultMinMax -
booleanFilter
protected static final fr.esrf.tangoatk.core.IEntityFilter booleanFilter
-
-
Constructor Details
-
BooleanTrend
Trend constructor.- Parameters:
parent- Parent frame
-
BooleanTrend
public BooleanTrend()Default constructor.
-
-
Method Details
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
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:
-
getTimePrecision
public int getTimePrecision() -
setTimePrecision
public void setTimePrecision(int timePrecision) -
refreshStep
public void refreshStep()- Specified by:
refreshStepin interfacefr.esrf.tangoatk.core.IRefresherListener
-
clearModel
public void clearModel()Free any allocated resource and stop refreshing. The internal attribute list is released. -
setModel
public void setModel(fr.esrf.tangoatk.core.AttributePolledList list) ThissetModelwhich takes an AttributePolledList as a parameter, will just add the boolean scalar attributes in the list to the list viewer in the BooleanTrend. It will not add any of the attributes to the BooleanTrend. The list used by the BooleanTrend will be a copy of the given list. If you don't use the list anymore (the on given in parameter), remember to clean it, because this is not the list the BooleanTrand uses (it uses a copy of it)- Parameters:
list- anAttributePolledListvalue
-
addAttribute
addAttributewill add the IBooleanScalar to the BooleanTrend. Additional calls to addAttribute will add more IBooleanScalars to the BooleanTrend.- Parameters:
name- Attribute name
-
addAttribute
public void addAttribute(fr.esrf.tangoatk.core.IBooleanScalar scalar) -
removeAttribute
public void removeAttribute(fr.esrf.tangoatk.core.IBooleanScalar scalar) -
getModel
public fr.esrf.tangoatk.core.AttributePolledList getModel() -
getSettings
returns the configuration as string.- Returns:
- Configuration string
- See Also:
-
setSetting
Apply a configuration.- Parameters:
txt- Configuration text.- Returns:
- An error string or An empty string when succes
- See Also:
-
saveSetting
Save settings.- Parameters:
filename- file to be saved.
-
loadSetting
Load graph settings.- Parameters:
filename- file to be read- Returns:
- An error string or An empty string when succes
-
getTitle
- Returns:
- the frame_title field read in the config file.
-
getPreferredSize
- Overrides:
getPreferredSizein classJComponent
-
setLegendVisible
public void setLegendVisible(boolean b) Deprecated.use getChart()- Parameters:
b- Not used
-
isLegendVisible
public boolean isLegendVisible()Deprecated.use getChart()- Returns:
- false
-
setSamplingRate
public void setSamplingRate(double rate) Deprecated.no longer used (has no FX)- Parameters:
rate- Not used
-
getSamplingRate
public double getSamplingRate()Deprecated.no longer used (has no FX)- Returns:
- 0
-
setXAxisLength
public void setXAxisLength(int length) Deprecated.no longer used (has no FX)- Parameters:
length- Not used
-
getXAxisLength
public int getXAxisLength()Deprecated.no longer used (has no FX)- Returns:
- 0
-
setLogarithmicScale
public void setLogarithmicScale(boolean logarithmic) Deprecated.use getChart()- Parameters:
logarithmic- Not used
-
isLogarithmicScale
public boolean isLogarithmicScale()Deprecated.use getChart()- Returns:
- false
-
setListVisible
public void setListVisible(boolean b) Deprecated.no longer used (has no FX)- Parameters:
b- Not used
-
isListVisible
public boolean isListVisible()Deprecated.no longer used (has no FX)- Returns:
- false
-
setShowingNames
public void setShowingNames(boolean b) Deprecated.no longer used (has no FX)- Parameters:
b- Not used
-
isShowingNames
public boolean isShowingNames()Deprecated.no longer used (has no FX)- Returns:
- false
-
setShowingDeviceNames
public void setShowingDeviceNames(int mode) Determines whether or not device names (within chart labels) are visible.- Parameters:
mode- Device name display mode- See Also:
-
isShowingDeviceNames
public int isShowingDeviceNames()Determines whether or not device names (within chart labels) are visible.- Returns:
- Showing device name flag
- See Also:
-
setButtonBarVisible
public void setButtonBarVisible(boolean b) Displays or hides the toolbar- Parameters:
b- Visible flag
-
isButtonBarVisible
public boolean isButtonBarVisible()Returns true only if toolbar is visible- Returns:
- Visible flag
-
setDateVisible
public void setDateVisible(boolean b) Displays or hides the date label- Parameters:
b- Visible flag
-
isDateVisible
public boolean isDateVisible()Returns true only if datelabel is visible- Returns:
- Visible flag
-
setSelectionTreeVisible
public void setSelectionTreeVisible(boolean b) Displays or hides the selection tree- Parameters:
b- Visible flag
-
isSelectionTreeVisible
public boolean isSelectionTreeVisible()- Returns:
- true only if the selection tree is visible
-
getChart
Returns a handle to the chart- Returns:
- Chart handle
-
ok
public void ok()Description copied from interface:IControleeokwill be called when the component is visible and the user presses the OK button on the ButtonBar Expected behaviour is to set all the values on the model the widget is representing followed by agetRootPane().getParent().setVisible(false);- Specified by:
okin interfaceIControlee- See Also:
-
disableButton
Disables the button corresponding to the string- Parameters:
buttonName- Button name
-
enableButton
Enables the button corresponding to the string- Parameters:
buttonName- Button name
-
addToAxis
Adds an attribute to an axis of this trend (or removes the attribute from axis).- Parameters:
attributeName- The name of the attributeaxisSelection- The axis. Can be SEL_X (x axis), SEL_Y1 (y1 axis), SEL_Y2 (y2 axis) or SEL_NONE (removes attribute from axis)addToModel- A boolean to say wheather the attribute has to be added in model or not. Iftrueand the attribute is not in model, the attribute is added in the trend model.- See Also:
-
addToAxis
public void addToAxis(fr.esrf.tangoatk.core.IBooleanScalar attribute, int axisSelection, boolean addToModel) Adds an attribute to an axis of this trend (or removes the attribute from axis).- Parameters:
attribute- The attributeaxisSelection- The axis. Can be SEL_X (x axis), SEL_Y1 (y1 axis), SEL_Y2 (y2 axis) or SEL_NONE (removes attribute from axis)addToModel- A boolean to say whether the attribute has to be added in model or not. Iftrueand the attribute is not in model, the attribute is added in the trend model.- See Also:
-
getAxisForAttribute
Returns the axis associated with an attribute- Parameters:
attributeName- The name of the attribute- Returns:
- The axis associated with the attribute
- See Also:
-
getDataViewForAttribute
Returns the dataview associated with an attribute (null if no dataview is associated with the attribute)- Parameters:
attributeName- The name of the attribute- Returns:
- The dataview associated with the attribute (null if no dataview is associated with the attribute)
-
setMaxDisplayDuration
public void setMaxDisplayDuration(double maxDisplay) -
getMaxDisplayDuration
public double getMaxDisplayDuration() -
resetTrend
public void resetTrend() -
main
- Throws:
Exception
-