jvx.gui
Class PuColorBarCanvas
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Canvas
-
- jvx.gui.PuColorBarCanvas
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, PvDisplayOverlayIf
public class PuColorBarCanvas extends java.awt.Canvas implements PvDisplayOverlayIf, java.awt.event.ActionListener
Inner class representing the gui element of a color bar.- See Also:
- Serialized Form
- Author:
- Matthias Nieser, Konrad Polthier
- Version:
- 10.03.2015, 2.00 revised (kp) Created as full class, major rewrite for integration in display.
11.11.2006, 1.00 created (mn)
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String[]COLOR_MAP_NAMESNames of the color tables in the context menu.intm_panelModeFlag if running as self-contained panel or as overlay of another container panel.static intMODE_OVERLAYstatic intMODE_PANEL
-
Constructor Summary
Constructors Constructor and Description PuColorBarCanvas()Construct a new PuColorBarCanvas.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidactionPerformed(java.awt.event.ActionEvent e)Invoked when an action occurs.voidenableContextMenu(boolean bEnable)Enable popup menu when right click into the canvas.intgetPanelMode()Get flag if running as self-contained panel or as overlay of another container panel.java.awt.DimensiongetPreferredSize()Gets the preferred size of this component.voidmouseClicked(java.awt.event.MouseEvent mouseEvent)Invoked when the mouse button has been clicked (pressed and released) on a component.voidmouseDragged(java.awt.event.MouseEvent mouseEvent)Invoked when a mouse button is pressed on a component and then dragged.voidmouseEntered(java.awt.event.MouseEvent mouseEvent)Invoked when the mouse enters a component.voidmouseExited(java.awt.event.MouseEvent mouseEvent)Invoked when the mouse exits a component.voidmouseMoved(java.awt.event.MouseEvent mouseEvent)Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.voidmousePressed(java.awt.event.MouseEvent mouseEvent)Invoked when a mouse button has been pressed on a component.voidmouseReleased(java.awt.event.MouseEvent mouseEvent)Invoked when a mouse button has been released on a component.voidpaint(java.awt.Graphics g)Paints this canvas.voidpaintOverlay(java.awt.Graphics g, int xInset, int yInset, int width, int height)Draw overlay in JavaView display.voidsetDisplayComponent(java.awt.Component panel)Set panel of of this container which provides graphics context.voidsetPanelMode(int panelMode)Set flag if running as self-contained panel or as overlay of another container panel.voidsetParent(PsUpdateIf parent)Set parent of this panel which receives update events.-
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
-
-
-
Field Detail
-
COLOR_MAP_NAMES
public static final java.lang.String[] COLOR_MAP_NAMES
Names of the color tables in the context menu.
-
MODE_PANEL
public static final int MODE_PANEL
- See Also:
- Constant Field Values
-
MODE_OVERLAY
public static final int MODE_OVERLAY
- See Also:
- Constant Field Values
-
m_panelMode
public int m_panelMode
Flag if running as self-contained panel or as overlay of another container panel. Default is panel mode like, for example, in tree_view.
-
-
Method Detail
-
setParent
public void setParent(PsUpdateIf parent)
Set parent of this panel which receives update events.- Parameters:
parent- parent of this panel
-
enableContextMenu
public void enableContextMenu(boolean bEnable)
Enable popup menu when right click into the canvas.
-
paint
public void paint(java.awt.Graphics g)
Paints this canvas.Most applications that subclass
Canvasshould override this method in order to perform some useful operation (typically, custom painting of the canvas). The default operation is simply to clear the canvas. Applications that override this method need not call super.paint(g).- Overrides:
paintin classjava.awt.Canvas- Parameters:
g- the specified Graphics context- Version:
- 11.11.2006, 1.00 revised (mn) Moved to subclass PuColorBarCanvas.
26.09.2006, 1.00 created (mn)
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
Invoked when the mouse button has been clicked (pressed and released) on a component.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
Invoked when a mouse button has been pressed on a component.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
Invoked when a mouse button is pressed on a component and then dragged.MOUSE_DRAGGEDevents will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).Due to platform-dependent Drag-and-Drop implementations,
MOUSE_DRAGGEDevents may not be delivered during a native Drag-and-Drop operation.- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent mouseEvent)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
Invoked when a mouse button has been released on a component.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
Invoked when the mouse enters a component.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent mouseEvent)
Invoked when the mouse exits a component.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
getPanelMode
public int getPanelMode()
Get flag if running as self-contained panel or as overlay of another container panel.
-
setPanelMode
public void setPanelMode(int panelMode)
Set flag if running as self-contained panel or as overlay of another container panel. Default is panel mode like, for example, in tree_view.- Specified by:
setPanelModein interfacePvDisplayOverlayIf
-
getPreferredSize
public java.awt.Dimension getPreferredSize()
Gets the preferred size of this component.- Specified by:
getPreferredSizein interfacePvDisplayOverlayIf- Overrides:
getPreferredSizein classjava.awt.Component- Returns:
- a dimension object indicating this component's preferred size
-
setDisplayComponent
public void setDisplayComponent(java.awt.Component panel)
Set panel of of this container which provides graphics context.- Specified by:
setDisplayComponentin interfacePvDisplayOverlayIf
-
paintOverlay
public void paintOverlay(java.awt.Graphics g, int xInset, int yInset, int width, int height)Draw overlay in JavaView display.- Specified by:
paintOverlayin interfacePvDisplayOverlayIf
-
-
"