public class Trend extends javax.swing.JPanel implements IControlee, java.awt.event.ActionListener, IJLChartActionListener, IRefresherListener, IListStateListener, IJLChartListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JMenuItem |
addXMenuItem |
protected javax.swing.JMenuItem |
addY1MenuItem |
protected javax.swing.JMenuItem |
addY2MenuItem |
protected AttributePolledList |
attList |
protected javax.swing.JMenuItem |
attOptionMenuItem |
protected java.util.Map |
buttonMap |
protected javax.swing.JButton |
cfgButton |
protected javax.swing.JMenuItem |
cfgMenuI |
static java.lang.String |
config
Corresponds to the button "Add new attribute"
|
protected javax.swing.JLabel |
dateLabel |
protected static java.awt.Color[] |
defaultColor |
static int |
DEVICE_LABEL_ALWAYS
Device name are always displayed whithin chart label
|
static int |
DEVICE_LABEL_AUTO
Device name are displayed whithin chart label when needed
|
static int |
DEVICE_LABEL_NEVER
Device name are never displayed whithin chart label
|
protected ErrorHistory |
errWin |
protected javax.swing.JPanel |
innerPanel |
static java.lang.String |
load
Corresponds to the button "Load configuration"
|
protected javax.swing.JButton |
loadButton |
protected javax.swing.JMenuItem |
loadMenuI |
protected javax.swing.JTree |
mainTree |
protected javax.swing.tree.DefaultTreeModel |
mainTreeModel |
protected int |
minRefreshInterval |
protected int |
minRefreshTrendInterval |
protected javax.swing.JCheckBoxMenuItem |
offLineButton |
protected boolean |
offLineMode |
static java.lang.String |
option
Corresponds to the button "Global settings"
|
protected javax.swing.JButton |
optionButton |
protected javax.swing.JMenuItem |
optionMenuI |
protected javax.swing.JMenuItem |
optionMenuItem |
protected javax.swing.JToolBar |
panelToolBar |
protected javax.swing.JToolBar |
panelToolBarTrend |
protected javax.swing.JFrame |
parent |
protected javax.swing.JButton |
refreshButton |
protected javax.swing.JMenuItem |
refreshMenuI |
protected javax.swing.JMenuItem |
removeMenuItem |
static java.lang.String |
reset
Corresponds to the button "Reset trend"
|
protected javax.swing.JButton |
resetButton |
protected javax.swing.JMenuItem |
resetMenuI |
protected fr.esrf.tangoatk.widget.attribute.TrendSelectionNode |
rootNode |
static java.lang.String |
save
Corresponds to the button "Save configuration"
|
protected javax.swing.JButton |
saveButton |
protected javax.swing.JMenuItem |
saveMenuI |
static int |
SEL_NONE
Not selected
|
static int |
SEL_X
Selected on X
|
static int |
SEL_Y1
Selected on Y1
|
static int |
SEL_Y2
Selected on Y2
|
protected javax.swing.JMenuItem |
showDiagMenuI |
protected javax.swing.JMenuItem |
showErrorMenuI |
protected javax.swing.JCheckBoxMenuItem |
showMaxAlarmMenuItem |
protected javax.swing.JCheckBoxMenuItem |
showMinAlarmMenuItem |
protected javax.swing.JMenuItem |
showtoolMenuI |
protected javax.swing.ImageIcon |
startIcon |
static java.lang.String |
startStop
Corresponds to the button "start/stop monitoring"
|
protected javax.swing.JButton |
startStopButton |
protected javax.swing.JMenuItem |
startStopMenuI |
protected javax.swing.ImageIcon |
stopIcon |
protected JLChart |
theGraph |
protected javax.swing.JToolBar |
theToolBar |
static java.lang.String |
time
Corresponds to the button "Set rfresh interval"
|
protected javax.swing.JButton |
timeButton |
protected javax.swing.JButton |
timeButtonTrend |
protected javax.swing.JMenuItem |
timeMenuI |
protected javax.swing.JMenuItem |
timeMenuTrendI |
protected javax.swing.JPopupMenu |
toolMenu |
protected javax.swing.JPopupMenu |
treeMenu |
protected javax.swing.JScrollPane |
treeView |
static java.lang.String |
zoom
Corresponds to the button "Zoom"
|
protected javax.swing.JButton |
zoomButton |
protected javax.swing.JMenuItem |
zoomMenuI |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Trend()
Default constructor.
|
Trend(javax.swing.JFrame parent)
Trend constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt) |
void |
actionPerformed(JLChartActionEvent evt)
Called when the user select a user action (available from
contextual chart menu)
|
void |
addAttribute(INumberScalar scalar) |
void |
addAttribute(java.lang.String name)
addAttribute will add the INumberScalar to the
Trend. |
void |
addToAxis(INumberScalar attribute,
int axisSelection,
boolean addToModel)
Adds an attribute to an axis of this trend (or removes the attribute from
axis).
|
void |
addToAxis(java.lang.String attributeName,
int axisSelection,
boolean addToModel)
Adds an attribute to an axis of this trend (or removes the attribute from
axis).
|
void |
clearModel()
Free any allocated resource and stop refreshing.
|
java.lang.String[] |
clickOnChart(JLChartEvent e)
Called when the user click on the chart
|
void |
disableButton(java.lang.String buttonName)
Disables the button corresponding to the string
|
void |
enableButton(java.lang.String buttonName)
Enables the button corresponding to the string
|
boolean |
getActionState(JLChartActionEvent evt)
Called when the the action name starting with 'chk'
(displayed as check box menu item) and each time the chart menu
is shown.
|
int |
getAxisForAttribute(java.lang.String attributeName)
Returns the axis associated with an attribute
|
JLChart |
getChart()
Returns a handle to the chart
|
JLDataView |
getDataViewForAttribute(java.lang.String attributeName)
Returns the dataview associated with an attribute (null if no dataview is associated with the attribute)
|
double |
getMaxDisplayDuration() |
protected int |
getMinRefreshInterval() |
protected int |
getMinRefreshTrendInterval() |
AttributePolledList |
getModel() |
int |
getRefreshIntervalTrend() |
double |
getSamplingRate()
Deprecated.
no longer used (has no FX)
|
java.lang.String |
getSettings()
returns the configuration as string.
|
int |
getTimePrecision() |
java.lang.String |
getTitle()
Returns the frame_title field read in the config file.
|
int |
getXAxisLength()
Deprecated.
no longer used (has no FX)
|
boolean |
isButtonBarVisible()
Returns true only if toolbar is visible
|
boolean |
isDateVisible()
Returns true only if datelabel is visible
|
boolean |
isLegendVisible()
Deprecated.
use getChart()
|
boolean |
isListVisible()
Deprecated.
no longer used (has no FX)
|
boolean |
isLogarithmicScale()
Deprecated.
use getChart()
|
boolean |
isManageIntervalTrend() |
boolean |
isSelectionTreeVisible()
Returns true only if the selection tree is visible
|
int |
isShowingDeviceNames()
Determines whether or not device names (within chart labels) are visible.
|
boolean |
isShowingNames()
Deprecated.
no longer used (has no FX)
|
java.lang.String |
loadSetting(java.lang.String filename)
Load graph settings.
|
static void |
main(java.lang.String[] args) |
void |
ok()
ok will 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 a
getRootPane().getParent().setVisible(false); |
void |
refreshStep()
Called by an entityList refresher afer models update.
|
void |
refreshTrend() |
void |
removeAttribute(INumberScalar scalar) |
void |
resetTrend() |
void |
saveSetting(java.lang.String filename)
Save settings.
|
void |
setButtonBarVisible(boolean b)
Displays or hides the toolbar
|
void |
setDateVisible(boolean b)
Displays or hides the date label
|
void |
setLegendVisible(boolean b)
Deprecated.
use getChart()
|
void |
setListVisible(boolean b)
Deprecated.
no longer used (has no FX)
|
void |
setLogarithmicScale(boolean logarithmic)
Deprecated.
use getChart()
|
void |
setManageIntervalTrend() |
void |
setMaxDisplayDuration(double maxDisplay) |
protected void |
setMinRefreshInterval(int minRefreshInterval) |
protected void |
setMinRefreshTrendInterval(int minRefreshTrendInterval) |
void |
setModel(AttributePolledList list)
This
setModel which takes an AttributePolledList as a
parameter, will just add the attributes in the list to the list
viewer in the Trend. |
void |
setModel(INumberScalar scalar)
Deprecated.
use addAttribute instead.
|
void |
setOffLineMode(boolean mode)
Sets or unset the offline mode (data are updated but not painted)
|
void |
setRefreshIntervalTrend(int refreshIntervalTrend) |
void |
setSamplingRate(double rate)
Deprecated.
no longer used (has no FX)
|
void |
setSelectionTreeVisible(boolean b)
Displays or hides the selection tree
|
java.lang.String |
setSetting(java.lang.String txt)
Apply a configuration.
|
void |
setShowingDeviceNames(int mode)
Determines whether or not device names (within chart labels) are visible.
|
void |
setShowingNames(boolean b)
Deprecated.
no longer used (has no FX)
|
void |
setTimePrecision(int timePrecision) |
void |
setXAxisLength(int length)
Deprecated.
no longer used (has no FX)
|
void |
stateChange(int state)
Called by an entityList after a call to EntityList.startRefresher or EntityList.stopRefresher.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, 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, update
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, validateTree
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int SEL_NONE
public static final int SEL_X
public static final int SEL_Y1
public static final int SEL_Y2
public static final int DEVICE_LABEL_AUTO
public static final int DEVICE_LABEL_NEVER
public static final int DEVICE_LABEL_ALWAYS
protected static java.awt.Color[] defaultColor
protected javax.swing.JFrame parent
protected javax.swing.JToolBar theToolBar
protected javax.swing.JPopupMenu toolMenu
protected javax.swing.JButton optionButton
protected javax.swing.JMenuItem optionMenuI
protected javax.swing.JButton startStopButton
protected javax.swing.ImageIcon startIcon
protected javax.swing.ImageIcon stopIcon
protected javax.swing.JMenuItem startStopMenuI
protected javax.swing.JButton loadButton
protected javax.swing.JMenuItem loadMenuI
protected javax.swing.JButton saveButton
protected javax.swing.JMenuItem saveMenuI
protected javax.swing.JButton zoomButton
protected javax.swing.JMenuItem zoomMenuI
protected javax.swing.JButton timeButton
protected javax.swing.JMenuItem timeMenuI
protected javax.swing.JButton cfgButton
protected javax.swing.JMenuItem cfgMenuI
protected javax.swing.JButton resetButton
protected javax.swing.JMenuItem resetMenuI
protected javax.swing.JCheckBoxMenuItem offLineButton
protected javax.swing.JMenuItem showErrorMenuI
protected javax.swing.JMenuItem showDiagMenuI
protected javax.swing.JMenuItem showtoolMenuI
protected javax.swing.JPanel innerPanel
protected javax.swing.JLabel dateLabel
protected javax.swing.JScrollPane treeView
protected javax.swing.JTree mainTree
protected javax.swing.tree.DefaultTreeModel mainTreeModel
protected fr.esrf.tangoatk.widget.attribute.TrendSelectionNode rootNode
protected javax.swing.JPopupMenu treeMenu
protected javax.swing.JMenuItem addXMenuItem
protected javax.swing.JMenuItem addY1MenuItem
protected javax.swing.JMenuItem addY2MenuItem
protected javax.swing.JCheckBoxMenuItem showMinAlarmMenuItem
protected javax.swing.JCheckBoxMenuItem showMaxAlarmMenuItem
protected javax.swing.JMenuItem removeMenuItem
protected javax.swing.JMenuItem optionMenuItem
protected javax.swing.JMenuItem attOptionMenuItem
protected JLChart theGraph
protected AttributePolledList attList
protected java.util.Map buttonMap
public static final java.lang.String startStop
public static final java.lang.String save
public static final java.lang.String load
public static final java.lang.String zoom
public static final java.lang.String time
public static final java.lang.String option
public static final java.lang.String config
public static final java.lang.String reset
protected int minRefreshInterval
protected javax.swing.JToolBar panelToolBarTrend
protected javax.swing.JToolBar panelToolBar
protected javax.swing.JButton timeButtonTrend
protected javax.swing.JButton refreshButton
protected javax.swing.JMenuItem timeMenuTrendI
protected javax.swing.JMenuItem refreshMenuI
protected int minRefreshTrendInterval
protected boolean offLineMode
protected ErrorHistory errWin
public Trend(javax.swing.JFrame parent)
parent
- Parent framepublic Trend()
public java.lang.String[] clickOnChart(JLChartEvent e)
IJLChartListener
clickOnChart
in interface IJLChartListener
e
- Event object (containing click inforamtion)public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
public void actionPerformed(JLChartActionEvent evt)
IJLChartActionListener
actionPerformed
in interface IJLChartActionListener
evt
- Event object (containing acion name and state)JLChart.addUserAction(java.lang.String)
public boolean getActionState(JLChartActionEvent evt)
IJLChartActionListener
getActionState
in interface IJLChartActionListener
evt
- Event object (containing acion name)JLChart.addUserAction(java.lang.String)
public int getTimePrecision()
public void setTimePrecision(int timePrecision)
public void refreshStep()
IRefresherListener
refreshStep
in interface IRefresherListener
public void stateChange(int state)
IListStateListener
stateChange
in interface IListStateListener
public void setOffLineMode(boolean mode)
mode
- Offline modepublic void clearModel()
public void setModel(AttributePolledList list)
setModel
which takes an AttributePolledList as a
parameter, will just add the attributes in the list to the list
viewer in the Trend. It will not add any of the attributes to the
Trendlist
- a AttributePolledList
valuepublic void addAttribute(java.lang.String name)
addAttribute
will add the INumberScalar to the
Trend. Additional calls to addAttribute will add more INumberScalars
to the trend.name
- Attribute namepublic void addAttribute(INumberScalar scalar)
public void removeAttribute(INumberScalar scalar)
public void setModel(INumberScalar scalar)
setModel
scalar
- a fr.esrf.tangoatk.core.INumberScalar
valuepublic AttributePolledList getModel()
public java.lang.String getSettings()
setSetting(java.lang.String)
public java.lang.String setSetting(java.lang.String txt)
txt
- Configuration text.getSettings()
public void saveSetting(java.lang.String filename)
filename
- file to be saved.public java.lang.String loadSetting(java.lang.String filename)
filename
- file to be readpublic java.lang.String getTitle()
public void setLegendVisible(boolean b)
public boolean isLegendVisible()
public void setSamplingRate(double rate)
public double getSamplingRate()
public void setXAxisLength(int length)
public int getXAxisLength()
public void setLogarithmicScale(boolean logarithmic)
public boolean isLogarithmicScale()
public void setListVisible(boolean b)
public boolean isListVisible()
public void setShowingNames(boolean b)
public boolean isShowingNames()
public void setShowingDeviceNames(int mode)
mode
- Device name display modeDEVICE_LABEL_AUTO
,
DEVICE_LABEL_NEVER
,
DEVICE_LABEL_ALWAYS
,
isShowingDeviceNames()
public int isShowingDeviceNames()
setShowingDeviceNames(int)
public void setButtonBarVisible(boolean b)
b
- Visible flagpublic boolean isButtonBarVisible()
public void setDateVisible(boolean b)
b
- Visible flagpublic boolean isDateVisible()
public void setSelectionTreeVisible(boolean b)
b
- Visible flagpublic boolean isSelectionTreeVisible()
public JLChart getChart()
public void ok()
IControlee
ok
will 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 a
getRootPane().getParent().setVisible(false);
ok
in interface IControlee
ButtonBar
public void disableButton(java.lang.String buttonName)
public void enableButton(java.lang.String buttonName)
public void addToAxis(java.lang.String attributeName, int axisSelection, boolean addToModel)
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. If true
and the attribute is not
in model, the attribute is added in the trend model.SEL_X
,
SEL_Y1
,
SEL_Y2
,
SEL_NONE
public void addToAxis(INumberScalar attribute, int axisSelection, boolean addToModel)
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 wheather the attribute has to be added in
model or not. If true
and the attribute is not
in model, the attribute is added in the trend model.SEL_X
,
SEL_Y1
,
SEL_Y2
,
SEL_NONE
public int getAxisForAttribute(java.lang.String attributeName)
public JLDataView getDataViewForAttribute(java.lang.String attributeName)
attributeName
- The name of the attributepublic void setMaxDisplayDuration(double maxDisplay)
public double getMaxDisplayDuration()
protected int getMinRefreshInterval()
protected void setMinRefreshInterval(int minRefreshInterval)
public void resetTrend()
protected int getMinRefreshTrendInterval()
protected void setMinRefreshTrendInterval(int minRefreshTrendInterval)
public int getRefreshIntervalTrend()
public void setRefreshIntervalTrend(int refreshIntervalTrend)
public boolean isManageIntervalTrend()
public void setManageIntervalTrend()
public void refreshTrend()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception