Arch4J 1.1

org.arch4j.ui.tree
Class TreeBrowser

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.arch4j.ui.tree.TreeBrowser
All Implemented Interfaces:
Accessible, ImageObserver, JApplicationPanel, MenuContainer, Serializable
Direct Known Subclasses:
TestTreeBrowser

public class TreeBrowser
extends JPanel
implements JApplicationPanel

See Also:
Serialized Form

Nested Class Summary
protected  class TreeBrowser.TBTreeWillExpandListener
          declare inner class to catch TreeWillExpand events.
 
Field Summary
protected  JPanel cardPanel
           
protected  CommandManager commandMgr
           
protected  Vector copyBuffer
           
protected  JPanel currentEditor
           
protected  boolean deleting
           
protected  TreeBrowserSelectionListener listener
           
protected  NullPanel nullEditor
           
protected  Performer performer
           
protected  ResourceManager resourceMgr
           
protected  JSplitPane splitPane
           
protected  JTree tree
           
protected  DefaultMutableTreeNode treeStructure
           
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TreeBrowser()
          TreeBrowser constructor comment.
TreeBrowser(AbstractSplashScreen aSplashScreen)
          TreeBrowser constructor comment.
 
Method Summary
 void addListener()
           
protected  void addNullEditor()
           
 void copy()
          This method was created in VisualAge.
 void createCardPanel()
          This method was created by a SmartGuide.
 SortingParentNode createSortingParentNode(Object userObject, String name, String iconAccessor, String action)
           
 SortingParentNode createSortingParentNode(String name, String iconAccessor, String action)
           
 void createSplitPane()
          This method was created by a SmartGuide.
 void createTree()
           
 BrowserTreeNode createTreeNode(Object userObject, String name, String iconAccessor, String action)
           
 BrowserTreeNode createTreeNode(String name, String iconAccessor, String action)
           
 void createTreeStructure()
           
 void cut()
          This method was created in VisualAge.
 void delete()
          This method was created in VisualAge.
 void deleteNode(BrowserTreeNode nodeToRemove)
           
protected  boolean displayConfirm(String aMessage, String aTitle)
          Display an Confirmation dialog to the user
 void displayError(String anError, String aTitle)
          Display an error to the user.
 void displayInformation(String aMessage, String aTitle)
          Display information to the user.
 void displayWarning(String aWarning, String aTitle)
          Display a warning to the user.
 void exitApplication()
          Exit normally from the application.
 CommandManager getCommandManager()
          This method was created by a SmartGuide.
 double getDividerLocation()
          Gets the relative location of the divider bar.
 ImageIcon getIcon()
          This method was created in VisualAge.
 ImageIcon getIconFor(String iconAccessor)
          Get the icon for the name given.
protected  JMenu getMenu(String menu)
          Gets the menu with the given name.
 JMenuBar getMenubar()
          Gets the menubar for the application.
protected  String getNameForBase(String baseName, BrowserTreeNode parent)
          This method was created in VisualAge.
 BrowserTreeNode getNode(String name)
          Look for a node with the specified name.
 JPanel getNullEditor()
           
 JPopupMenu getPopupMenu(String name)
           
 ResourceManager getResourceManager()
          This method was created by a SmartGuide.
 BrowserTreeNode getSelectedNode()
          This method was created by a SmartGuide.
 Vector getSelectedNodes()
          This method was created by a SmartGuide.
 Object getSelectedObject()
          This method was created by a SmartGuide.
 JSplitPane getSplitPane()
          This method was created by a SmartGuide.
 String getTitle()
          This method was created in VisualAge.
 JToolBar getToolbar()
          Gets the toolbar for the application.
 JTree getTree()
           
 DefaultTreeModel getTreeModel()
          This method was created by a SmartGuide.
 BrowserTreeNode getTreeNodeAt(int x, int y)
           
protected  DefaultTreeCellRenderer getTreeNodeRenderer()
          Gets the renderer for the tree nodes.
 DefaultMutableTreeNode getTreeStructure()
           
 void initialize()
           
 void initializeButtonState()
          Initialize the buttons to be enable/disable buttons when the interface comes up.
protected  void initializeCommandManager()
           
protected  void initializeResourceManager()
           
protected  void insertNode(BrowserTreeNode nodeToInsert, BrowserTreeNode parentNode)
           
protected  void insertNode(BrowserTreeNode nodeToInsert, SortingParentNode parentNode)
           
protected  void insertNodeAtSelection(BrowserTreeNode nodeToInsert, boolean selectInsertedNode)
           
 void nextNode()
          Position the selection to the next node in the tree.
protected  void nodeIsCollapsing(BrowserTreeNode aNode)
           
protected  void nodeIsExpanding(BrowserTreeNode aNode)
           
 void paste()
          This method was created in VisualAge.
 void previousNode()
          Position the selection to the previous node in the tree.
 void removeListener()
           
 void requestFocus()
          Overriden to set the focus on the tree.
 void saveChangesOnCurrentPanel()
          Invoked when a node has changed and the panel has changes to be completed.
 void selectionChanging(BrowserTreeNode node)
           
 void selectNode(BrowserTreeNode aNode)
          Select the node in the tree panel.
 void setDefaultCursor()
          Set the wait cursor.
 void setDividerLocation(double aRelativePosition)
          Set the split pane divider location.
 void setResourceManager(ResourceManager aResourceManager)
           
 void setWaitCursor()
          Set the wait cursor.
 void setWindowTitle()
          Find the top level frame and set its title..
protected  void showNullEditor()
           
protected  void showPanel(String aName)
          Display the card panel with the given name.
protected  void showStartupStatus(String aStatus)
          Display the status string in the splash screen.
 void updateTreeStructure()
          This method was created in VisualAge.
protected  void useTreeExpansionListener(boolean abUseIt)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, isValidateRoot, 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, 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, setLayout, 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, setComponentOrientation, 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

commandMgr

protected CommandManager commandMgr

resourceMgr

protected ResourceManager resourceMgr

performer

protected Performer performer

tree

protected JTree tree

treeStructure

protected DefaultMutableTreeNode treeStructure

listener

protected TreeBrowserSelectionListener listener

cardPanel

protected JPanel cardPanel

splitPane

protected JSplitPane splitPane

nullEditor

protected NullPanel nullEditor

currentEditor

protected JPanel currentEditor

deleting

protected boolean deleting

copyBuffer

protected Vector copyBuffer
Constructor Detail

TreeBrowser

public TreeBrowser()
TreeBrowser constructor comment.


TreeBrowser

public TreeBrowser(AbstractSplashScreen aSplashScreen)
TreeBrowser constructor comment.

Method Detail

addListener

public void addListener()

addNullEditor

protected void addNullEditor()

copy

public void copy()
This method was created in VisualAge.


createCardPanel

public void createCardPanel()
This method was created by a SmartGuide.


createSortingParentNode

public SortingParentNode createSortingParentNode(Object userObject,
                                                 String name,
                                                 String iconAccessor,
                                                 String action)

createSortingParentNode

public SortingParentNode createSortingParentNode(String name,
                                                 String iconAccessor,
                                                 String action)

createSplitPane

public void createSplitPane()
This method was created by a SmartGuide.


createTree

public void createTree()

getTreeNodeRenderer

protected DefaultTreeCellRenderer getTreeNodeRenderer()
Gets the renderer for the tree nodes.

Returns:
DefaultTreeCellRenderer The tree node renderer for the tree.

createTreeNode

public BrowserTreeNode createTreeNode(Object userObject,
                                      String name,
                                      String iconAccessor,
                                      String action)

createTreeNode

public BrowserTreeNode createTreeNode(String name,
                                      String iconAccessor,
                                      String action)

createTreeStructure

public void createTreeStructure()

cut

public void cut()
This method was created in VisualAge.


delete

public void delete()
This method was created in VisualAge.


deleteNode

public void deleteNode(BrowserTreeNode nodeToRemove)

displayError

public void displayError(String anError,
                         String aTitle)
Display an error to the user.

Parameters:
anError - The error message.
aTitle - The title for the dialog.

displayConfirm

protected boolean displayConfirm(String aMessage,
                                 String aTitle)
Display an Confirmation dialog to the user

Parameters:
aMessage - The confirmation message.
aTitle - The title for the dialog.
Returns:
OK == true

displayWarning

public void displayWarning(String aWarning,
                           String aTitle)
Display a warning to the user.

Parameters:
aWarning - The warning message.
aTitle - The title for the dialog.

displayInformation

public void displayInformation(String aMessage,
                               String aTitle)
Display information to the user.

Parameters:
aMessage - The informational message.
aTitle - The title for the dialog.

exitApplication

public void exitApplication()
Exit normally from the application.


getCommandManager

public CommandManager getCommandManager()
This method was created by a SmartGuide.

Specified by:
getCommandManager in interface JApplicationPanel

getDividerLocation

public double getDividerLocation()
Gets the relative location of the divider bar.

Returns:
The relative location of the divider bar.

getIcon

public ImageIcon getIcon()
This method was created in VisualAge.

Specified by:
getIcon in interface JApplicationPanel
Returns:
java.lang.String

getIconFor

public ImageIcon getIconFor(String iconAccessor)
Get the icon for the name given.

Parameters:
iconAccessor - The name of the icon to get.

getMenu

protected JMenu getMenu(String menu)
Gets the menu with the given name.


getMenubar

public JMenuBar getMenubar()
Gets the menubar for the application.

Specified by:
getMenubar in interface JApplicationPanel
Returns:
The menubar for the application.

getNameForBase

protected String getNameForBase(String baseName,
                                BrowserTreeNode parent)
This method was created in VisualAge.


getNullEditor

public JPanel getNullEditor()

getPopupMenu

public JPopupMenu getPopupMenu(String name)

getResourceManager

public ResourceManager getResourceManager()
This method was created by a SmartGuide.

Specified by:
getResourceManager in interface JApplicationPanel

getSelectedNode

public BrowserTreeNode getSelectedNode()
This method was created by a SmartGuide.

Returns:
com.sensoriumsoftware.ui.application.BrowserTreeNode

getSelectedNodes

public Vector getSelectedNodes()
This method was created by a SmartGuide.

Returns:
com.sensoriumsoftware.ui.application.BrowserTreeNode

getSelectedObject

public Object getSelectedObject()
This method was created by a SmartGuide.

Returns:
java.lang.Object

getSplitPane

public JSplitPane getSplitPane()
This method was created by a SmartGuide.

Returns:
JSplitPane

getTitle

public String getTitle()
This method was created in VisualAge.

Specified by:
getTitle in interface JApplicationPanel
Returns:
java.lang.String

getToolbar

public JToolBar getToolbar()
Gets the toolbar for the application.

Specified by:
getToolbar in interface JApplicationPanel
Returns:
The toolbar for the application.

getTree

public JTree getTree()

getTreeModel

public DefaultTreeModel getTreeModel()
This method was created by a SmartGuide.

Returns:
com.sun.java.swing.tree.DefaultTreeModel

getTreeNodeAt

public BrowserTreeNode getTreeNodeAt(int x,
                                     int y)

getTreeStructure

public DefaultMutableTreeNode getTreeStructure()

initialize

public void initialize()

initializeButtonState

public void initializeButtonState()
Initialize the buttons to be enable/disable buttons when the interface comes up. Normally used to disable the buttons.

Specified by:
initializeButtonState in interface JApplicationPanel

initializeCommandManager

protected void initializeCommandManager()

initializeResourceManager

protected void initializeResourceManager()

insertNode

protected void insertNode(BrowserTreeNode nodeToInsert,
                          BrowserTreeNode parentNode)

insertNode

protected void insertNode(BrowserTreeNode nodeToInsert,
                          SortingParentNode parentNode)

insertNodeAtSelection

protected void insertNodeAtSelection(BrowserTreeNode nodeToInsert,
                                     boolean selectInsertedNode)

getNode

public BrowserTreeNode getNode(String name)
Look for a node with the specified name.

Parameters:
name - the name of the node to search for
Returns:
the node if found, otherwise null.

previousNode

public void previousNode()
Position the selection to the previous node in the tree. Don't do anything if at the top....


nextNode

public void nextNode()
Position the selection to the next node in the tree. Wrap back to the top parent if at the end.


nodeIsCollapsing

protected void nodeIsCollapsing(BrowserTreeNode aNode)

nodeIsExpanding

protected void nodeIsExpanding(BrowserTreeNode aNode)

paste

public void paste()
This method was created in VisualAge.


removeListener

public void removeListener()

requestFocus

public void requestFocus()
Overriden to set the focus on the tree. This is required when the tree browser is being used as a bean in another interface that needs to programatically move focus to the browser bean.

Overrides:
requestFocus in class JComponent
See Also:
FocusEvent, Component.addFocusListener(java.awt.event.FocusListener), Component.processFocusEvent(java.awt.event.FocusEvent), Component.isFocusTraversable()

saveChangesOnCurrentPanel

public void saveChangesOnCurrentPanel()
Invoked when a node has changed and the panel has changes to be completed.


selectionChanging

public void selectionChanging(BrowserTreeNode node)

selectNode

public void selectNode(BrowserTreeNode aNode)
Select the node in the tree panel.

Parameters:
aNode - The node to select.

setDefaultCursor

public void setDefaultCursor()
Set the wait cursor.


setDividerLocation

public void setDividerLocation(double aRelativePosition)
Set the split pane divider location.

Parameters:
aRelativePosition - The position for the split pane.

setResourceManager

public void setResourceManager(ResourceManager aResourceManager)

setWaitCursor

public void setWaitCursor()
Set the wait cursor.


setWindowTitle

public void setWindowTitle()
Find the top level frame and set its title..


showNullEditor

protected void showNullEditor()

showPanel

protected void showPanel(String aName)
Display the card panel with the given name.

Parameters:
aName - The name of the panel to show.

showStartupStatus

protected void showStartupStatus(String aStatus)
Display the status string in the splash screen.


updateTreeStructure

public void updateTreeStructure()
This method was created in VisualAge.


useTreeExpansionListener

protected void useTreeExpansionListener(boolean abUseIt)

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.