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)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `java.awt.Component.BaselineResizeBehavior`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String[]` | `COLOR_MAP_NAMES` Names of the color tables in the context menu.
    `int` | `m_panelMode` Flag if running as self-contained panel or as overlay of another container panel.
    `static int` | `MODE_OVERLAY`
    `static int` | `MODE_PANEL`

    - ### Fields inherited from class java.awt.Component

      `BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

    - ### Fields inherited from interface java.awt.image.ImageObserver

      `ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

  - ### 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
    --- | ---
    `void` | `actionPerformed(java.awt.event.ActionEvent e)` Invoked when an action occurs.
    `void` | `enableContextMenu(boolean bEnable)` Enable popup menu when right click into the canvas.
    `int` | `getPanelMode()` Get flag if running as self-contained panel or as overlay of another container panel.
    `java.awt.Dimension` | `getPreferredSize()` Gets the preferred size of this component.
    `void` | `mouseClicked(java.awt.event.MouseEvent mouseEvent)` Invoked when the mouse button has been clicked (pressed and released) on a component.
    `void` | `mouseDragged(java.awt.event.MouseEvent mouseEvent)` Invoked when a mouse button is pressed on a component and then dragged.
    `void` | `mouseEntered(java.awt.event.MouseEvent mouseEvent)` Invoked when the mouse enters a component.
    `void` | `mouseExited(java.awt.event.MouseEvent mouseEvent)` Invoked when the mouse exits a component.
    `void` | `mouseMoved(java.awt.event.MouseEvent mouseEvent)` Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
    `void` | `mousePressed(java.awt.event.MouseEvent mouseEvent)` Invoked when a mouse button has been pressed on a component.
    `void` | `mouseReleased(java.awt.event.MouseEvent mouseEvent)` Invoked when a mouse button has been released on a component.
    `void` | `paint(java.awt.Graphics g)` Paints this canvas.
    `void` | `paintOverlay(java.awt.Graphics g, int xInset, int yInset, int width, int height)` Draw overlay in JavaView display.
    `void` | `setDisplayComponent(java.awt.Component panel)` Set panel of of this container which provides graphics context.
    `void` | `setPanelMode(int panelMode)` Set flag if running as self-contained panel or as overlay of another container panel.
    `void` | `setParent(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`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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.

  - ### Constructor Detail

    - #### PuColorBarCanvas

          public PuColorBarCanvas()

      Construct a new PuColorBarCanvas.

  - ### 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 `Canvas` should 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:
        `paint` in class `java.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:
        `mouseClicked` in interface `java.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:
        `mousePressed` in interface `java.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_DRAGGED` events 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_DRAGGED` events may not be delivered during a native Drag-and-Drop operation.

      Specified by:
        `mouseDragged` in interface `java.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:
        `mouseMoved` in interface `java.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:
        `mouseReleased` in interface `java.awt.event.MouseListener`

    - #### mouseEntered

          public void mouseEntered(java.awt.event.MouseEvent mouseEvent)

      Invoked when the mouse enters a component.
      Specified by:
        `mouseEntered` in interface `java.awt.event.MouseListener`

    - #### mouseExited

          public void mouseExited(java.awt.event.MouseEvent mouseEvent)

      Invoked when the mouse exits a component.
      Specified by:
        `mouseExited` in interface `java.awt.event.MouseListener`

    - #### actionPerformed

          public void actionPerformed(java.awt.event.ActionEvent e)

      Invoked when an action occurs.
      Specified by:
        `actionPerformed` in interface `java.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:
        `setPanelMode` in interface `PvDisplayOverlayIf`

    - #### getPreferredSize

          public java.awt.Dimension getPreferredSize()

      Gets the preferred size of this component.
      Specified by:
        `getPreferredSize` in interface `PvDisplayOverlayIf`
      Overrides:
        `getPreferredSize` in class `java.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:
        `setDisplayComponent` in interface `PvDisplayOverlayIf`

    - #### paintOverlay

          public void paintOverlay(java.awt.Graphics g,
                                   int xInset,
                                   int yInset,
                                   int width,
                                   int height)

      Draw overlay in JavaView display.
      Specified by:
        `paintOverlay` in interface `PvDisplayOverlayIf`

"

The software JavaView? is copyright protected. All Rights Reserved.
"