byucc.jhdl.apps.Viewers.NewTreeBrowser
Class TreeBrowserPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JScrollPane
                  extended bybyucc.jhdl.apps.Viewers.Event.JHDLWidgetScrollPane
                      extended bybyucc.jhdl.apps.Viewers.NewTreeBrowser.TreeBrowserPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, CLICommand, java.util.EventListener, java.awt.image.ImageObserver, JHDLMouseEventGenerator, JHDLWidgetEventListener, java.awt.MenuContainer, javax.swing.ScrollPaneConstants, java.io.Serializable

public class TreeBrowserPanel
extends JHDLWidgetScrollPane
implements java.awt.event.ActionListener, CLICommand

Displays and allows for selection of components of a Cell. Any JHDLMouseEventListener can be registered with this panel to receive updates on when selections occur. Selections may be of any Cell or sub-Cell of the given root Cell; also, only one cell may be selected at a time. If the user clicks on the same cell multiple times in a row, the same cell remains selected, and the clicking event is dispatched to all listeners. Clicking can be double clicking or a single clicking; both will also select the node.

Author:
Tyler Anderson
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JScrollPane
javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JPanel _contentPane
          The actual content panel for this JScrollPane
static java.lang.String ALPHA_ASCENDING
           
static java.lang.String ALPHA_DESCENDING
           
protected  CLInterpreter cli
           
static int DEFAULT_HEIGHT
           
static int DEFAULT_WIDTH
           
static java.lang.String FULL_NAME
           
static java.lang.String HIGHLIGHT
           
protected  javax.swing.JMenuItem highLightLeaf
           
protected  JHDLHostWidgetInterface hwi
           
static java.lang.String LEAF_NAME
           
static java.lang.String LEAFS
           
protected  java.awt.event.MouseAdapter ma
          the listener
static java.lang.String MENU_HIGHLIGHT_LEAFS
           
static java.lang.String MENU_SORT_ASCENDING
           
static java.lang.String MENU_SORT_DESCENDING
           
static java.lang.String MENU_VIEW_FULL_NAME
           
static java.lang.String MENU_VIEW_LEAF_NAME
           
protected  TreeBrowserModel model
           
protected  TreeBrowserCellRenderer renderer
           
static java.lang.String SORT
           
protected  javax.swing.JMenuItem sortAlphaAscending
           
protected  javax.swing.JMenuItem sortAlphaDescending
           
protected  javax.swing.JTree tree
           
static java.lang.String VIEW
           
protected  javax.swing.JMenuItem viewFullName
           
protected  javax.swing.JMenuItem viewLeafName
           
 
Fields inherited from class javax.swing.JScrollPane
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface byucc.jhdl.util.cli.CLICommand
OVERLOAD
 
Fields inherited from interface javax.swing.ScrollPaneConstants
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TreeBrowserPanel(Cell rNode)
          Deprecated.  
TreeBrowserPanel(Node rNode, JHDLHostWidgetInterface hwi)
          Constructs a new TreeBrowserPanel--New constructor, so that this panel can pass the JHDLHostWidgetInterface to its parent to get the call chain ready to be initialized.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 java.lang.Object execute(CLInterpreter parent, java.lang.String[] args)
           
 java.lang.String getHelpText(java.lang.String cmdName)
           
 java.lang.String getHelpType(java.lang.String cmdName)
           
 Cell getSelectedCell()
           
 java.lang.String getUsageText(java.lang.String cmdName)
           
 void init()
           
 void JHDLWidgetEventPerformed(JHDLWidgetEvent we)
          Method called by {@link byucc.jhdl.apps.Viewers.Event.JHDLWidgetEventGenerator objects that this object is listening to.
 
Methods inherited from class byucc.jhdl.apps.Viewers.Event.JHDLWidgetScrollPane
addJHDLMouseEventListener, fireJHDLMouseEvent, fireJHDLMouseEvent, removeJHDLMouseEventListener, setupJHDLEvents
 
Methods inherited from class javax.swing.JScrollPane
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
See Also:
Constant Field Values

SORT

public static final java.lang.String SORT
See Also:
Constant Field Values

VIEW

public static final java.lang.String VIEW
See Also:
Constant Field Values

HIGHLIGHT

public static final java.lang.String HIGHLIGHT
See Also:
Constant Field Values

MENU_VIEW_FULL_NAME

public static final java.lang.String MENU_VIEW_FULL_NAME
See Also:
Constant Field Values

MENU_VIEW_LEAF_NAME

public static final java.lang.String MENU_VIEW_LEAF_NAME
See Also:
Constant Field Values

MENU_SORT_ASCENDING

public static final java.lang.String MENU_SORT_ASCENDING
See Also:
Constant Field Values

MENU_SORT_DESCENDING

public static final java.lang.String MENU_SORT_DESCENDING
See Also:
Constant Field Values

MENU_HIGHLIGHT_LEAFS

public static final java.lang.String MENU_HIGHLIGHT_LEAFS
See Also:
Constant Field Values

ALPHA_DESCENDING

public static final java.lang.String ALPHA_DESCENDING
See Also:
Constant Field Values

ALPHA_ASCENDING

public static final java.lang.String ALPHA_ASCENDING
See Also:
Constant Field Values

LEAF_NAME

public static final java.lang.String LEAF_NAME
See Also:
Constant Field Values

FULL_NAME

public static final java.lang.String FULL_NAME
See Also:
Constant Field Values

LEAFS

public static final java.lang.String LEAFS
See Also:
Constant Field Values

_contentPane

protected javax.swing.JPanel _contentPane
The actual content panel for this JScrollPane


ma

protected java.awt.event.MouseAdapter ma
the listener


tree

protected javax.swing.JTree tree

renderer

protected TreeBrowserCellRenderer renderer

model

protected TreeBrowserModel model

highLightLeaf

protected javax.swing.JMenuItem highLightLeaf

sortAlphaAscending

protected javax.swing.JMenuItem sortAlphaAscending

sortAlphaDescending

protected javax.swing.JMenuItem sortAlphaDescending

viewFullName

protected javax.swing.JMenuItem viewFullName

viewLeafName

protected javax.swing.JMenuItem viewLeafName

cli

protected CLInterpreter cli

hwi

protected JHDLHostWidgetInterface hwi
Constructor Detail

TreeBrowserPanel

public TreeBrowserPanel(Node rNode,
                        JHDLHostWidgetInterface hwi)
Constructs a new TreeBrowserPanel--New constructor, so that this panel can pass the JHDLHostWidgetInterface to its parent to get the call chain ready to be initialized.

Parameters:
rNode - The cell that this Panel will be initialized from.
hwi - The JHDLHostWidgetInterface this panel will send to its parent.

TreeBrowserPanel

public TreeBrowserPanel(Cell rNode)
Deprecated.  

Method Detail

init

public void init()

getSelectedCell

public Cell getSelectedCell()

JHDLWidgetEventPerformed

public void JHDLWidgetEventPerformed(JHDLWidgetEvent we)
Method called by {@link byucc.jhdl.apps.Viewers.Event.JHDLWidgetEventGenerator objects that this object is listening to. This method interprets the event and updates the display accordingly.

Specified by:
JHDLWidgetEventPerformed in interface JHDLWidgetEventListener
Parameters:
we - The passed in JHDLWidgetEvent object.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

execute

public java.lang.Object execute(CLInterpreter parent,
                                java.lang.String[] args)
                         throws CLIException
Specified by:
execute in interface CLICommand
Throws:
CLIException

getHelpText

public java.lang.String getHelpText(java.lang.String cmdName)
Specified by:
getHelpText in interface CLICommand

getHelpType

public java.lang.String getHelpType(java.lang.String cmdName)
Specified by:
getHelpType in interface CLICommand

getUsageText

public java.lang.String getUsageText(java.lang.String cmdName)
Specified by:
getUsageText in interface CLICommand


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.