Class NumberSpectrumTrend3DViewer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.attribute.NumberSpectrumTrend3DViewer
- All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener,fr.esrf.tangoatk.core.IErrorListener,fr.esrf.tangoatk.core.ISpectrumListener,IJLChartListener,J3DTrendListener,ActionListener,AdjustmentListener,MouseListener,ImageObserver,MenuContainer,Serializable,EventListener
public class NumberSpectrumTrend3DViewer
extends JComponent
implements fr.esrf.tangoatk.core.ISpectrumListener, ActionListener, MouseListener, J3DTrendListener, IJLChartListener, AdjustmentListener
A class to monitor a spectrum as a function of time using colormap for intensity.
- 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 JMenuItemprotected JFrameprotected JLDataViewprotected JLChartprotected JMenuprotected fr.esrf.tangoatk.core.INumberSpectrumprotected JPopupMenuprotected SimplePropertyFrameprotected JMenuItemprotected JFrameprotected JMenuItemprotected JMenuItemprotected LineProfilerViewerprotected JMenustatic final fr.esrf.tangoatk.widget.attribute.ZoomInfo[]Possible zoom values.Fields inherited from class javax.swing.JComponent
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 TypeMethodDescriptionvoidvoidAdd the given change listenervoidAdd the given cursor listenervoidAdd the given NumberSpectrumTrend3DViewerListenervoidvoidClear the viewervoidremoves the model.voidClear the values in the status label, only name is printed until the next click.String[]clickOnChart(JLChartEvent evt) Called when the user click on the chartvoidcommit()Rebuild image when some settings has been changed.voiderrorChange(fr.esrf.tangoatk.core.ErrorEvent evt) intReturns the horizontal axis length in pixel.intdoublegetTimeAt(int x) Returns the timestamp of the values at the coordinates x.getTrend()Returns 3D trend componentsdoublegetValueAt(int x, int y) Return the value at (x,y) position.intgetXAxis()intgetYAxis()intdoubledoubleReturns the minimum of the of the z axis (color)booleanbooleanbooleanbooleanReturns true is the image viewer menu is displayed when clicking on the right mouse button.booleanstatic voidprotected StringmakeTabbedString(boolean transpose) voidvoidvoidvoidvoidvoidreadPollingHistory(boolean readPolling) Reads the polling history when setting the modelvoidRemove the given change listenervoidRemove the given cursor listenervoidvoidScrolls the image to the leftvoidScrolls the image to the rightvoidsetCursorEnabled(boolean enable) Enable cross cursor on mouse clickvoidsetCursorPos(int x, int y) Sets the cursor position (data coordinates)voidsetData(double[] dates, double[][] data) voidsetData(long[] dates, double[][] data) Fill the viewer with arbitrary datavoidvoidSets the colormap.voidsetGradientVisible(boolean b) Displays or hides the gradient (right panel).voidsetHistoryLength(int length) Sets the horizontal axis length in pixel.voidsetHorinzontalScrollPos(int pos) Sets the horizontal scroll positionvoidsetHorizontalZoom(int zoom) Sets the horizontal zoom factor See ZoomInfo for accepted zoom.voidsetLogScale(boolean logScale) Set the viewer in linear or log scale for the colormapvoidsetModel(fr.esrf.tangoatk.core.INumberSpectrum v) Sets the model of this viewervoidSets the main name which is displayed in the status line.voidsetNaNColor(Color nanColor) Sets the color for the NaN valuesvoidsetShowDerivative(boolean show) Set the viewer in linear or log scale for the colormapvoidsetShowingMenu(boolean b) True to enable menu displayed when clicking on right mouse button.voidSets the trend backgroudn colorvoidSets the name which is displayed in the status line for the unit.voidsetValueName(String vName) Sets the name wich is displayed in the status line for the value.voidsetVerticalZoom(int zoom) Sets the vertical zoom factor See ZoomInfo for accepted zoom.voidsetVertitalScrollPos(int pos) Sets the vertical scroll positionvoidsetYIndexName(String[] idxName) Sets the names of Y indexvoidSets the name which is displayed in the status line for the y value.voidsetYTransfom(double gain, double offset) Sets the Y axis coordinates transformationvoidSets the unit of the y axisvoidsetZAutoScale(boolean autoScale) Sets the viewer in autoscale mode for the colormap when true, use min and max otherwisevoidsetZMaximum(double max) Sets the maximum of the z axis (color)voidsetZMinimum(double min) Sets the minimum of the z axis (color)voidvoidspectrumChange(fr.esrf.tangoatk.core.NumberSpectrumEvent evt) voidstateChange(fr.esrf.tangoatk.core.AttributeStateEvent evt) voidupdateCursor(int xCursor, int yCursor, boolean fireCursorChange) Update cursor information.Methods 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, paint, 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, 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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
zoomInfos
public static final fr.esrf.tangoatk.widget.attribute.ZoomInfo[] zoomInfosPossible zoom values. -
model
protected fr.esrf.tangoatk.core.INumberSpectrum model -
popupMenu
-
saveFileMenuItem
-
settingsMenuItem
-
hProfileMenuItem
-
vProfileMenuItem
-
hZoomMenu
-
vZoomMenu
-
settingsFrame
-
propDialog
-
vProfiler
-
hProfiler
-
hProfilerGraph
-
hProfilerData
-
-
Constructor Details
-
NumberSpectrumTrend3DViewer
public NumberSpectrumTrend3DViewer()Construct a number specturm 3D viewer
-
-
Method Details
-
adjustmentValueChanged
- Specified by:
adjustmentValueChangedin interfaceAdjustmentListener
-
setHistoryLength
public void setHistoryLength(int length) Sets the horizontal axis length in pixel.- Parameters:
length- Horizontal axis length
-
getTrend
Returns 3D trend components- Returns:
- 3D trend viewer
-
getHistoryLength
public int getHistoryLength()Returns the horizontal axis length in pixel.- Returns:
- Horizontal axis length
-
clearData
public void clearData()Clear the viewer -
setData
public void setData(long[] dates, double[][] data) Fill the viewer with arbitrary data- Parameters:
dates- Time stampsdata- Data
-
setData
public void setData(double[] dates, double[][] data) -
setZMinimum
public void setZMinimum(double min) Sets the minimum of the z axis (color)- Parameters:
min- Minimum value
-
getZMinimum
public double getZMinimum()Returns the minimum of the of the z axis (color)- Returns:
- minimum value
-
setZMaximum
public void setZMaximum(double max) Sets the maximum of the z axis (color)- Parameters:
max- Maximum value
-
getZMaximum
public double getZMaximum()- Returns:
- maximum value of the z axis (color)
-
isZAutoScale
public boolean isZAutoScale()- Returns:
- true if the viewer is in autoscale mode for the colormap, false otherwise
-
setZAutoScale
public void setZAutoScale(boolean autoScale) Sets the viewer in autoscale mode for the colormap when true, use min and max otherwise- Parameters:
autoScale- AutoScale flag
-
isLogScale
public boolean isLogScale()- Returns:
- true if the viewer is in log scale for the colormap, false otherwise
-
setLogScale
public void setLogScale(boolean logScale) Set the viewer in linear or log scale for the colormap- Parameters:
logScale- LogScale flag
-
isShowDerivative
public boolean isShowDerivative()- Returns:
- true if the viewer display derivative data, false otherwise
-
setShowDerivative
public void setShowDerivative(boolean show) Set the viewer in linear or log scale for the colormap- Parameters:
show- Display derivative data
-
setGradient
Sets the colormap.- Parameters:
g- Gradient colormap
-
getGradient
- Returns:
- the gradient used by the viewer.
-
setGradientVisible
public void setGradientVisible(boolean b) Displays or hides the gradient (right panel).- Parameters:
b- True if status line is displayed
-
isGradientVisible
public boolean isGradientVisible()- Returns:
- true when the gradient is visible.
-
setNaNColor
Sets the color for the NaN values- Parameters:
nanColor- NaN color
-
getXAxis
- Returns:
- a handle to the horizontal axis
-
getYAxis
- Returns:
- a handle to the vertical axis
-
setHorizontalZoom
public void setHorizontalZoom(int zoom) Sets the horizontal zoom factor See ZoomInfo for accepted zoom.- Parameters:
zoom- zoom factor
-
getHorizontalZoom
public int getHorizontalZoom()- Returns:
- the horizontal zoom factor.
-
setVerticalZoom
public void setVerticalZoom(int zoom) Sets the vertical zoom factor See ZoomInfo for accepted zoom.- Parameters:
zoom- zoom factor
-
getVerticalZoom
public int getVerticalZoom()- Returns:
- the vertical zoom factor
-
setFormat
-
getFormat
-
setModel
public void setModel(fr.esrf.tangoatk.core.INumberSpectrum v) Sets the model of this viewer- Parameters:
v- NumberSpectrum model
-
clearModel
public void clearModel()removes the model. -
getTimeAt
public double getTimeAt(int x) Returns the timestamp of the values at the coordinates x. Returns 0 if no data is present at this place. x is in image coordinates.- Parameters:
x- X coordinates (in image coordinates)- Returns:
- Tiemstamp at x
-
addNumberSpectrumTrend3DViewerListener
Add the given NumberSpectrumTrend3DViewerListener- Parameters:
l- NumberSpectrumTrend3DViewerListener
-
addCursorListener
Add the given cursor listener- Parameters:
l- I3DTrendCursorListener
-
removeCursorListener
Remove the given cursor listener- Parameters:
l- I3DTrendCursorListener
-
addChangeListener
Add the given change listener- Parameters:
l- I3DTrendChangeListener
-
removeChangeListener
Remove the given change listener- Parameters:
l- I3DTrendChangeListener
-
setCursorPos
public void setCursorPos(int x, int y) Sets the cursor position (data coordinates)- Parameters:
x- X cursor coordinatesy- Y cursor coordinates
-
getXCursor
public int getXCursor()- Returns:
- horizontal position of the cursor (data coordinates), -1 is returned if there is no cursor.
-
getYCursor
public int getYCursor()- Returns:
- vertical position of the cursor (data coordinates) -1 is returned if there is no cursor.
-
getValueAt
public double getValueAt(int x, int y) Return the value at (x,y) position. NaN is returned if no data.- Parameters:
x- X coordinates (in image coordinates)y- Y coordinates (in image coordinates)- Returns:
- The value at x,y
-
setCursorEnabled
public void setCursorEnabled(boolean enable) Enable cross cursor on mouse click- Parameters:
enable- Enable cursor
-
clearStatusLabel
public void clearStatusLabel()Clear the values in the status label, only name is printed until the next click. -
updateCursor
public void updateCursor(int xCursor, int yCursor, boolean fireCursorChange) Update cursor information. This function is trigerred when the user click on the image.- Specified by:
updateCursorin interfaceJ3DTrendListener- Parameters:
xCursor- x coordinates (referenced by the image)yCursor- y coordinates (referenced by the image)fireCursorChange- Fire cursorChange event
-
setShowingMenu
public void setShowingMenu(boolean b) True to enable menu displayed when clicking on right mouse button.- Parameters:
b- True to enable the menu
-
isShowingMenu
public boolean isShowingMenu()Returns true is the image viewer menu is displayed when clicking on the right mouse button.- Returns:
- True is menu is enabled
-
readPollingHistory
public void readPollingHistory(boolean readPolling) Reads the polling history when setting the model- Parameters:
readPolling- true to enable history reading, false otherwise
-
setValueName
Sets the name wich is displayed in the status line for the value.- Parameters:
vName- value name
-
setYName
Sets the name which is displayed in the status line for the y value.- Parameters:
yName- y axis name
-
setYIndexName
Sets the names of Y index- Parameters:
idxName- Array of string containing vertical index name
-
setYUnit
Sets the unit of the y axis- Parameters:
unit- Y axis unit
-
setYTransfom
public void setYTransfom(double gain, double offset) Sets the Y axis coordinates transformation- Parameters:
gain- Y gainoffset- Y offset
-
setUnit
Sets the name which is displayed in the status line for the unit.- Parameters:
unit- Unit
-
setName
Sets the main name which is displayed in the status line. -
commit
public void commit()Rebuild image when some settings has been changed. -
scrollToRight
public void scrollToRight()Scrolls the image to the right -
scrollToLeft
public void scrollToLeft()Scrolls the image to the left -
setHorinzontalScrollPos
public void setHorinzontalScrollPos(int pos) Sets the horizontal scroll position- Parameters:
pos- Scrollbar position
-
setVertitalScrollPos
public void setVertitalScrollPos(int pos) Sets the vertical scroll position- Parameters:
pos- Scrollbar position
-
setTrendBackground
Sets the trend backgroudn color- Parameters:
bg- Background color
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
clickOnChart
Description copied from interface:IJLChartListenerCalled when the user click on the chart- Specified by:
clickOnChartin interfaceIJLChartListener- Parameters:
evt- 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
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
spectrumChange
public void spectrumChange(fr.esrf.tangoatk.core.NumberSpectrumEvent evt) - Specified by:
spectrumChangein interfacefr.esrf.tangoatk.core.ISpectrumListener
-
stateChange
public void stateChange(fr.esrf.tangoatk.core.AttributeStateEvent evt) - Specified by:
stateChangein interfacefr.esrf.tangoatk.core.IAttributeStateListener
-
errorChange
public void errorChange(fr.esrf.tangoatk.core.ErrorEvent evt) - Specified by:
errorChangein interfacefr.esrf.tangoatk.core.IErrorListener
-
showSettings
public void showSettings() -
saveDataFile
public void saveDataFile() -
makeTabbedString
-
main
-