jv.viewer
Class PvScenegraph
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Panel
-
- jv.viewer.PvScenegraph
-
- All Implemented Interfaces:
- java.awt.event.AdjustmentListener, 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 PvScenegraph extends java.awt.Panel implements PvDisplayOverlayIf, java.awt.event.AdjustmentListener
Gui canvas showing a tree-based explorer view. Used in PvDisplay as scene graph and in tree view.This class is in beta.
- Since:
- JavaView v4.81.003, formerly in alpha mode.
- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 09.02.14, 2.00 revised (kp) First running beta within JavaView display.
14.12.13, 1.00 created (kp) Extending earlier work on jvTree.
-
-
Field Summary
Fields Modifier and Type Field and Description static intBGCOLORIndices of specific colors in color array m_color.static intHBGCOLORstatic intHTXTBGCOLORstatic intHTXTCOLORstatic intMODE_OVERLAYstatic intMODE_PANELstatic intOUTLINEstatic intTXTCOLOR
-
Constructor Summary
Constructors Constructor and Description PvScenegraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadjustmentValueChanged(java.awt.event.AdjustmentEvent event)intgetIconInd()Get index of icon resp. field with currently picked node.java.lang.StringgetNodeID()Get ID of current picked node.intgetNodeInd()Get index of current picked node.java.lang.StringgetNodeStatus()Get status of directory nodes (open/close).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.voidinit()voidmouseClicked(java.awt.event.MouseEvent mouseEvent)voidmouseDragged(java.awt.event.MouseEvent mouseEvent)voidmouseEntered(java.awt.event.MouseEvent mouseEvent)voidmouseExited(java.awt.event.MouseEvent mouseEvent)voidmouseMoved(java.awt.event.MouseEvent mouseEvent)voidmousePressed(java.awt.event.MouseEvent mouseEvent)voidmouseReleased(java.awt.event.MouseEvent mouseEvent)voidpaint(java.awt.Graphics g)voidpaintOverlay(java.awt.Graphics g, int xInset, int yInset, int width, int height)Draw scenegraph as overlay in JavaView display.voidselectColors(int bgColor, int txtColor, int hbgColor, int htxtColor)Select color of special items using index in color array.voidselectFonts(int titleFont, int nodeFont)Select color of special items using index in color array.voidsetColors(java.awt.Color[] color)Set colors, index identified using COLOR_xyz .voidsetDisplayComponent(java.awt.Component panel)Set panel of of this container which provides graphics context.voidsetFonts(java.awt.Font[] font)Set fonts, index identified using FONT_xyz .voidsetNodeIcons(java.awt.Image[] nodeImg, int numIcons)Set icons of tree nodes and other gui elements.voidsetNodeParms(int iVersion, java.lang.String[] parmArray, int numParms)Set list of tree nodes and node parameters, each node is given as string.voidsetPanelMode(int panelMode)Set flag if running as self-contained panel or as overlay of another container panel.voidsetParent()voidsetTitle(java.lang.String title)Set title string.voidupdate(java.awt.Graphics g)-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
BGCOLOR
public static int BGCOLOR
Indices of specific colors in color array m_color.
-
TXTCOLOR
public static int TXTCOLOR
-
HBGCOLOR
public static int HBGCOLOR
-
HTXTCOLOR
public static int HTXTCOLOR
-
HTXTBGCOLOR
public static int HTXTBGCOLOR
-
OUTLINE
public static int OUTLINE
-
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
-
-
Method Detail
-
init
public void init()
-
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.Container- Returns:
- a dimension object indicating this component's preferred size
-
setParent
public void setParent()
-
getNodeInd
public int getNodeInd()
Get index of current picked node.
-
getIconInd
public int getIconInd()
Get index of icon resp. field with currently picked node.
-
getNodeID
public java.lang.String getNodeID()
Get ID of current picked node.
-
getNodeStatus
public java.lang.String getNodeStatus()
Get status of directory nodes (open/close).
-
setTitle
public void setTitle(java.lang.String title)
Set title string.
-
setColors
public void setColors(java.awt.Color[] color)
Set colors, index identified using COLOR_xyz .- Parameters:
color- array of colors for gui elements
-
selectColors
public void selectColors(int bgColor, int txtColor, int hbgColor, int htxtColor)Select color of special items using index in color array.- Parameters:
bgColor- index of background color of canvashbgColor- index of highlighted background color of canvastxtColor- index of text color of canvashtxtColor- index of highlighted text color of canvas
-
setFonts
public void setFonts(java.awt.Font[] font)
Set fonts, index identified using FONT_xyz .- Parameters:
font- array of fonts for gui text
-
selectFonts
public void selectFonts(int titleFont, int nodeFont)Select color of special items using index in color array.- Parameters:
titleFont- font for titlenodeFont- font for node labels
-
setNodeIcons
public void setNodeIcons(java.awt.Image[] nodeImg, int numIcons)Set icons of tree nodes and other gui elements.- Parameters:
nodeImg- icons of nodes and gui elements
-
setNodeParms
public void setNodeParms(int iVersion, java.lang.String[] parmArray, int numParms)Set list of tree nodes and node parameters, each node is given as string.- Parameters:
iVersion- version number of formatting of node stringsparmArray- array of nodes, each node given as formatted stringnumParms- number of nodes in array
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
update
public void update(java.awt.Graphics g)
- Overrides:
updatein classjava.awt.Container
-
paint
public void paint(java.awt.Graphics g)
- Overrides:
paintin classjava.awt.Container
-
paintOverlay
public void paintOverlay(java.awt.Graphics g, int xInset, int yInset, int width, int height)Draw scenegraph as overlay in JavaView display.- Specified by:
paintOverlayin interfacePvDisplayOverlayIf
-
adjustmentValueChanged
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
- Specified by:
adjustmentValueChangedin interfacejava.awt.event.AdjustmentListener
-
setDisplayComponent
public void setDisplayComponent(java.awt.Component panel)
Set panel of of this container which provides graphics context.- Specified by:
setDisplayComponentin interfacePvDisplayOverlayIf
-
-
"