Class AttributeMultiChart
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.chart.JLChart
fr.esrf.tangoatk.widget.attribute.AttributeMultiChart
- All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener,fr.esrf.tangoatk.core.IErrorListener,fr.esrf.tangoatk.core.INumberScalarListener,ActionListener,MouseListener,MouseMotionListener,MouseWheelListener,ImageObserver,MenuContainer,Serializable,EventListener
public class AttributeMultiChart
extends JLChart
implements fr.esrf.tangoatk.core.INumberScalarListener
- Author:
- SOLEIL
- 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 JLDataViewprotected booleanprotected doubleprotected JMenuItemprotected intprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuprotected JMenuItemstatic final intint value representing the kind of chart "BarChart"protected JMenuItemprotected JMenuItemprotected JMenuItemprotected Colorprotected booleanprotected intprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuItemstatic final intint value representing the fact that you want to see the attribute's alias in tooltip/X Axisstatic final intint value representing the fact that you want to see the name of the device to which the attribute belongs in tooltip/X Axisstatic final intint value representing the fact that you want to see the attribute's complete name in tooltip (default option)/X Axisstatic final intint value representing the fact that you want to see the index of the attribute in X Axis (default option)static final intint value representing the fact that you want to see the attribute's label in tooltip/X Axisstatic final intint value representing the fact that you want to see the attribute's name without its device name in tooltip/X Axisprotected intstatic final intint value representing the kind of chart "DotChart"protected JMenuprotected JMenuItemprotected JMenuItemprotected JLDataViewprotected doubleprotected JMenuItemprotected Stringprotected booleanprotected booleanprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected Stringprotected JMenuItemstatic final intint value representing the kind of chart "LineChart"protected JMenuprotected JLDataViewprotected JMenuItemprotected intprotected fr.esrf.tangoatk.core.AttributeListprotected JMenuprotected JMenuItemprotected intprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuItemprotected JMenuprotected JMenuItemprotected JMenuItemprotected Stringprotected JMenuItemprotected JMenuItemprotected Stringprotected JMenuFields 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_DATALOAD, 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
ConstructorsConstructorDescriptionDefault ConstructorAttributeMultiChart(int chartStyle) ConstructorAttributeMultiChart(int chartStyle, int displayMode) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected StringapplySettings(CfFileReader cffilereader) String[]voidClears the chartvoiderrorChange(fr.esrf.tangoatk.core.ErrorEvent arg0) doubleintReturns an int representing what kind of information about your attribute you can see in X axis.intintReturns an int representing what kind of information about your attribute you can see in tooltip.doubleintReturns the marker style style for line chart and dot chartintgetUnit()protected voidprotected voidbooleanbooleanbooleanbooleanprotected voidLoads configuration from a filestatic voidprotected voidvoidnumberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent numberScalarEvent) protected voidprepareName(JLDataView view, fr.esrf.tangoatk.core.INumberScalar scalar) protected voidvoidSaves the configuration of the chart in a filevoidsetAlarmEnable(boolean alarmEnable) voidsetAlarmLevel(double alarm_level) protected voidsetAttributeListAsString(String attributeListAsString) voidsetAxisDisplayMode(int axisDisplayMode) Set what kind of information about your attribute you can see in X axis.voidsetChartColor(Color chartColor) voidsetChartHeader(String header) voidsetChartOnXAxis(boolean chartOnXAxis) voidsetChartStyle(int style) Allows you to choose which kind of chart you want to usevoidsetDisplayMode(int displayMode) Set what kind of information about your attribute you can see in tooltip.voidsetFaultLevel(double fault_level) voidsetHighAlarm(boolean highAlarm) voidsetHighFault(boolean highFault) voidsetMarkerStyle(int style) Sets the marker style for line chart and dot chartvoidsetModel(fr.esrf.tangoatk.core.AttributeList attl) Sets the attributes this chart will display.voidsetRefreshingPeriod(int refreshingPeriod) sets the refreshing period of the associatedAttributeListvoidvoidsetWidth(int bar_width) Sets the width of the bars of the bar chartvoidsetXaxisName(String xaxis_name) protected voidvoidstateChange(fr.esrf.tangoatk.core.AttributeStateEvent arg0) protected voidMethods inherited from class fr.esrf.tangoatk.widget.util.chart.JLChart
addData, addJLChartActionListener, addMenuItem, addSeparator, addUserAction, applyConfiguration, autoScaleOnceX, autoScaleOnceY1, autoScaleOnceY2, 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, mousePressed, mouseReleased, mouseWheelMoved, paint, printGraph, refreshTableSingle, removeDataView, removeJLChartActionListener, removeMenuItem, 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, 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
-
header
-
xaxisName
-
unit
-
alarmLevel
protected double alarmLevel -
faultLevel
protected double faultLevel -
alarm
-
fault
-
lineView
-
lastConfig
-
refreshingPeriod
protected int refreshingPeriod -
dataViewHash
-
model
protected fr.esrf.tangoatk.core.AttributeList model -
chartStyle
protected int chartStyle -
markerStyle
protected int markerStyle -
chartColor
-
alarmEnable
protected boolean alarmEnable -
chartOnXAxis
protected boolean chartOnXAxis -
highAlarm
protected boolean highAlarm -
highFault
protected boolean highFault -
multiChartMenu
-
barChartItem
-
dotChartMenu
-
dotItem
-
boxItem
-
triangleItem
-
diamondItem
-
starItem
-
vertLineItem
-
horizLineItem
-
crossItem
-
circleItem
-
squareItem
-
lineChartMenu
-
dotItem2
-
boxItem2
-
triangleItem2
-
diamondItem2
-
starItem2
-
vertLineItem2
-
horizLineItem2
-
crossItem2
-
circleItem2
-
squareItem2
-
tooltipMenu
-
fullNameItem
-
noDeviceNameItem
-
labelItem
-
aliasItem
-
deviceNameItem
-
axisInfoMenu
-
axisInfoFullNameItem
-
axisInfoNoDeviceNameItem
-
axisInfoLabelItem
-
axisInfoAliasItem
-
axisInfoDeviceNameItem
-
axisInfoIndexItem
-
YScale
-
logarithmic
-
linear
-
displayMode
protected int displayMode -
axisDisplayMode
protected int axisDisplayMode -
barChart
public static final int barChartint value representing the kind of chart "BarChart"- See Also:
-
dotChart
public static final int dotChartint value representing the kind of chart "DotChart"- See Also:
-
lineChart
public static final int lineChartint value representing the kind of chart "LineChart"- See Also:
-
DISPLAY_FULL_NAME
public static final int DISPLAY_FULL_NAMEint value representing the fact that you want to see the attribute's complete name in tooltip (default option)/X Axis- See Also:
-
DISPLAY_NAME_NO_DEVICE
public static final int DISPLAY_NAME_NO_DEVICEint value representing the fact that you want to see the attribute's name without its device name in tooltip/X Axis- See Also:
-
DISPLAY_LABEL
public static final int DISPLAY_LABELint value representing the fact that you want to see the attribute's label in tooltip/X Axis- See Also:
-
DISPLAY_ALIAS
public static final int DISPLAY_ALIASint value representing the fact that you want to see the attribute's alias in tooltip/X Axis- See Also:
-
DISPLAY_DEVICE_NAME
public static final int DISPLAY_DEVICE_NAMEint value representing the fact that you want to see the name of the device to which the attribute belongs in tooltip/X Axis- See Also:
-
DISPLAY_INDEX
public static final int DISPLAY_INDEXint value representing the fact that you want to see the index of the attribute in X Axis (default option)- See Also:
-
-
Constructor Details
-
AttributeMultiChart
public AttributeMultiChart()Default Constructor -
AttributeMultiChart
public AttributeMultiChart(int chartStyle) Constructor -
AttributeMultiChart
public AttributeMultiChart(int chartStyle, int displayMode) Constructor- Parameters:
chartStyle- the kind of chart chosendisplayMode- the kind of information you want to display in tooltip- See Also:
-
-
Method Details
-
getMarkerStyle
public int getMarkerStyle()Returns the marker style style for line chart and dot chart- Returns:
- int representing the marker style
-
setMarkerStyle
public void setMarkerStyle(int style) Sets the marker style for line chart and dot chart -
initComponents
protected void initComponents() -
buildPanelString
- Overrides:
buildPanelStringin classJLChart
-
initLevels
protected void initLevels() -
isChartOnXAxis
public boolean isChartOnXAxis() -
setChartOnXAxis
public void setChartOnXAxis(boolean chartOnXAxis) -
setModel
public void setModel(fr.esrf.tangoatk.core.AttributeList attl) Sets the attributes this chart will display. It calls to clearmodel() first- Parameters:
attl- the list of Attribute as anAttributeList
-
clearModel
public void clearModel()Clears the chart -
setWidth
public void setWidth(int bar_width) Sets the width of the bars of the bar chart- Parameters:
bar_width- the width
-
isHighAlarm
public boolean isHighAlarm() -
setHighAlarm
public void setHighAlarm(boolean highAlarm) -
isHighFault
public boolean isHighFault() -
setHighFault
public void setHighFault(boolean highFault) -
numberScalarChange
public void numberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent numberScalarEvent) - Specified by:
numberScalarChangein interfacefr.esrf.tangoatk.core.INumberScalarListener
-
getChartStyle
public int getChartStyle() -
setChartStyle
public void setChartStyle(int style) Allows you to choose which kind of chart you want to use -
stateChange
public void stateChange(fr.esrf.tangoatk.core.AttributeStateEvent arg0) - Specified by:
stateChangein interfacefr.esrf.tangoatk.core.IAttributeStateListener
-
errorChange
public void errorChange(fr.esrf.tangoatk.core.ErrorEvent arg0) - Specified by:
errorChangein interfacefr.esrf.tangoatk.core.IErrorListener
-
getAlarmLevel
public double getAlarmLevel()- Returns:
- Returns the alarm_level.
-
setAlarmLevel
public void setAlarmLevel(double alarm_level) - Parameters:
alarm_level- The alarm_level to set. Set Double.MAX_VALUE to remove it.
-
getFaultLevel
public double getFaultLevel()- Returns:
- Returns the fault_level.
-
setFaultLevel
public void setFaultLevel(double fault_level) - Parameters:
fault_level- The fault_level to set. Set Double.MAX_VALUE to remove it.
-
getChartHeader
- Returns:
- Returns the header.
-
setChartHeader
- Parameters:
header- The header to set.
-
getUnit
- Returns:
- Returns the unit.
-
setUnit
- Parameters:
unit- The unit to set.
-
getXaxisName
- Returns:
- Returns the xaxis_name.
-
setXaxisName
- Parameters:
xaxis_name- The xaxis_name to set.
-
getSettings
- Returns:
- The String that will be written in a configuration file
-
saveSetting
Saves the configuration of the chart in a file- Parameters:
s- the file path
-
loadSetting
Loads configuration from a file- Parameters:
s- the file path- Returns:
- a String that is empty if the loading is all right, or contains an error message otherwise
-
getRefreshingPeriod
public int getRefreshingPeriod()- Returns:
- the refreshing period of the associated
AttributeList
-
setRefreshingPeriod
public void setRefreshingPeriod(int refreshingPeriod) sets the refreshing period of the associatedAttributeList- Parameters:
refreshingPeriod- the refreshing period
-
applySettings
-
setAttributeListAsString
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJLChart- Parameters:
evt- Action Event- See Also:
-
showTableAll
protected void showTableAll()- Overrides:
showTableAllin classJLChart
-
loadPerformed
protected void loadPerformed() -
savePerformed
protected void savePerformed() -
getDisplayMode
public int getDisplayMode()Returns an int representing what kind of information about your attribute you can see in tooltip.- Returns:
- An int representing what kind of information about your attribute you can see in tooltip.
- See Also:
-
setDisplayMode
public void setDisplayMode(int displayMode) Set what kind of information about your attribute you can see in tooltip.- Parameters:
displayMode- an int representing the kind of information about your attribute you can see in tooltip.- See Also:
-
getAxisDisplayMode
public int getAxisDisplayMode()Returns an int representing what kind of information about your attribute you can see in X axis.- Returns:
- An int representing what kind of information about your attribute you can see in X axis.
- See Also:
-
setAxisDisplayMode
public void setAxisDisplayMode(int axisDisplayMode) Set what kind of information about your attribute you can see in X axis.- Parameters:
axisDisplayMode- an int representing the kind of information about your attribute you can see in X axis.- See Also:
-
updateToolTips
protected void updateToolTips() -
prepareName
-
manageLabels
protected void manageLabels() -
getChartColor
- Returns:
- Returns the chartColor.
-
setChartColor
- Parameters:
chartColor- The chartColor to set.
-
isAlarmEnable
public boolean isAlarmEnable()- Returns:
- Returns the alarmEnable.
-
setAlarmEnable
public void setAlarmEnable(boolean alarmEnable) - Parameters:
alarmEnable- The alarmEnable to set.
-
main
-