Package fr.esrf.tangoatk.widget.util
Class J3DTrend
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.J3DTrend
- All Implemented Interfaces:
KeyListener,MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Serializable,EventListener
A class to handle a 3D spectrum image viewer using colormap
This class should be used with NumberSpectrumTrend3DViewer
- 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 Insetsprotected BufferedImageprotected booleanprotected booleanprotected JLAxisprotected intprotected intprotected intprotected JLAxisprotected intprotected intprotected intFields 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 TypeMethodDescriptionvoidRemove the cursorvoidvoidcursorMove(boolean fireUpdate) getImage()Returns a handle to the image displayedgetXAxis()intgetYAxis()intbooleanvoidvoidvoidprotected voidvoidvoidvoidvoidvoidvoidvoidvoidprotected voidvoidsetCursor(int x, int y) Sets the cursor positionvoidsetCursorEnabled(boolean enable) Enable cross cursor on mouse clickvoidsetImage(BufferedImage img, int maxX, int maxY) Sets the imagevoidSets the margin of the JImagevoidSets the parent of this componentvoidshiftCursorX(int delta) Shift the cursor by the specified deltavoidupdateXRange(boolean b) Tell the viewer to update or not xAxis range.voidupdateYRange(boolean b) Tell the viewer to update or not yAxis range.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, getNextFocusableComponent, getPopupLocation, 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, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
theImage
-
margin
-
xOrg
protected int xOrg -
yOrg
protected int yOrg -
xAxis
-
xAxisHeight
protected int xAxisHeight -
xAxisUpMargin
protected int xAxisUpMargin -
yAxis
-
yAxisWidth
protected int yAxisWidth -
yAxisRightMargin
protected int yAxisRightMargin -
updateXRange
protected boolean updateXRange -
updateYRange
protected boolean updateYRange
-
-
Constructor Details
-
J3DTrend
public J3DTrend()Construction
-
-
Method Details
-
getYAxis
- Returns:
- handle to the y axis
-
getXAxis
- Returns:
- handle to the x axis
-
setMargin
Sets the margin of the JImage- Parameters:
i- Image margin
-
setCursorEnabled
public void setCursorEnabled(boolean enable) Enable cross cursor on mouse click- Parameters:
enable- Enable cursor
-
updateXRange
public void updateXRange(boolean b) Tell the viewer to update or not xAxis range.- Parameters:
b- True to enable updating range
-
updateYRange
public void updateYRange(boolean b) Tell the viewer to update or not yAxis range.- Parameters:
b- True to enable updating range
-
setParent
Sets the parent of this component- Parameters:
p- NumberSpectrumTrend3DViewer parent
-
measureAxis
protected void measureAxis() -
getMinimumSize
- Overrides:
getMinimumSizein classJComponent
-
getPreferredSize
- Overrides:
getPreferredSizein classJComponent
-
setImage
Sets the image- Parameters:
img- imagemaxX- Maximum XmaxY- Maximum Y
-
getImage
Returns a handle to the image displayed- Returns:
- Image handle
-
shiftCursorX
public void shiftCursorX(int delta) Shift the cursor by the specified delta- Parameters:
delta- Shift
-
getXCursor
public int getXCursor()- Returns:
- X coordinate of the cursor
-
getYCursor
public int getYCursor()- Returns:
- Y coordinate of the cursor
-
setCursor
public void setCursor(int x, int y) Sets the cursor position- Parameters:
x- X coordinate of the cursory- Y coordinate of the cursor
-
isCursorInside
public boolean isCursorInside()- Returns:
- true if the cursor is inside the image.
-
clearCursor
public void clearCursor()Remove the cursor -
paintAxis
-
paint
- Overrides:
paintin classJComponent
-
cursorMove
public void cursorMove() -
cursorMove
public void cursorMove(boolean fireUpdate) -
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-