org.argouml.ui
Class NavigatorPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.argouml.ui.NavigatorPane
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.beans.PropertyChangeListener, QuadrantPanel, java.io.Serializable, javax.swing.event.TreeSelectionListener

public class NavigatorPane
extends javax.swing.JPanel
implements java.awt.event.ItemListener, javax.swing.event.TreeSelectionListener, java.beans.PropertyChangeListener, QuadrantPanel

The upper-left pane of the main Argo/UML window. This shows the contents of the current project in one of several ways that are determined by NavPerspectives. This does not allow drag and drop as yet. This is considered a must have for as yet undetermined future. other feature enhancements include showing the presence of note connected to individual UML artifacts and to diagrams themselves.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int _clicksInNavPane
           
protected  javax.swing.JComboBox _combo
           
protected  NavPerspective _curPerspective
           
protected  int _historyIndex
           
protected  java.util.Vector _navHistory
           
static int _navPerspectivesChanged
           
protected  java.util.Vector _perspectives
           
protected  java.lang.Object _root
           
protected  Toolbar _toolbar
           
protected  DisplayTextTree _tree
           
protected static org.apache.log4j.Category cat
           
static int MAX_HISTORY
           
 
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 org.argouml.application.api.QuadrantPanel
Q_BOTTOM, Q_BOTTOM_LEFT, Q_BOTTOM_RIGHT, Q_LEFT, Q_RIGHT, Q_TOP, Q_TOP_LEFT, Q_TOP_RIGHT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NavigatorPane(boolean doSplash)
           
 
Method Summary
 void addToHistory(java.lang.Object sel)
           
 boolean canNavBack()
           
 boolean canNavForw()
           
 void clearHistory()
           
 void forceUpdate()
           
 NavPerspective getCurPerspective()
           
 java.awt.Dimension getMinimumSize()
           
 javax.swing.tree.TreePath getParentPath()
           
 java.util.Vector getPerspectives()
           
 int getQuadrant()
           
 java.lang.Object getRoot()
           
 java.lang.Object getSelectedObject()
           
 DisplayTextTree getTree()
          Returns the DisplayTextTree.
 void itemStateChanged(java.awt.event.ItemEvent e)
          called when the user selects a perspective from the perspective combo.
protected  java.lang.String menuLocalize(java.lang.String key)
          Locale a popup menu item in the navigator pane.
protected  void mouseClick(int row, javax.swing.tree.TreePath path)
           
 void myDoubleClick(int row, javax.swing.tree.TreePath path)
          called when the user clicks twice on an item in the tree.
 void mySingleClick(int row, javax.swing.tree.TreePath path)
          called when the user clicks once on an item in the tree.
 void navBack()
           
 void navDown()
           
 void navForw()
           
 void navUp()
           
 void propertyChange(java.beans.PropertyChangeEvent pce)
          Listen for configuration changes that could require repaint of the navigator pane.
 void setCurPerspective(NavPerspective per)
           
 void setPerspectives(java.util.Vector pers)
           
 void setRoot(java.lang.Object r)
           
 void setSelection(java.lang.Object level1, java.lang.Object level2)
          This is pretty limited, it is really only useful for selecting the default diagram when the user does New.
protected  void updateTree()
           
 void valueChanged(javax.swing.event.TreeSelectionEvent e)
          called when the user selects an item in the tree, by clicking or otherwise.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, 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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cat

protected static org.apache.log4j.Category cat

MAX_HISTORY

public static int MAX_HISTORY

_perspectives

protected java.util.Vector _perspectives

_toolbar

protected Toolbar _toolbar

_combo

protected javax.swing.JComboBox _combo

_root

protected java.lang.Object _root

_navHistory

protected java.util.Vector _navHistory

_historyIndex

protected int _historyIndex

_curPerspective

protected NavPerspective _curPerspective

_tree

protected DisplayTextTree _tree

_clicksInNavPane

public static int _clicksInNavPane

_navPerspectivesChanged

public static int _navPerspectivesChanged
Constructor Detail

NavigatorPane

public NavigatorPane(boolean doSplash)
Method Detail

setRoot

public void setRoot(java.lang.Object r)

getRoot

public java.lang.Object getRoot()

getPerspectives

public java.util.Vector getPerspectives()

setPerspectives

public void setPerspectives(java.util.Vector pers)

getCurPerspective

public NavPerspective getCurPerspective()

setCurPerspective

public void setCurPerspective(NavPerspective per)

getSelectedObject

public java.lang.Object getSelectedObject()

forceUpdate

public void forceUpdate()

setSelection

public void setSelection(java.lang.Object level1,
                         java.lang.Object level2)
This is pretty limited, it is really only useful for selecting the default diagram when the user does New. A general function to select a given object would have to find the shortest path to it.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
called when the user selects a perspective from the perspective combo.
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent e)
called when the user selects an item in the tree, by clicking or otherwise.
Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener

mySingleClick

public void mySingleClick(int row,
                          javax.swing.tree.TreePath path)
called when the user clicks once on an item in the tree.

mouseClick

protected void mouseClick(int row,
                          javax.swing.tree.TreePath path)

myDoubleClick

public void myDoubleClick(int row,
                          javax.swing.tree.TreePath path)
called when the user clicks twice on an item in the tree.

navDown

public void navDown()

navUp

public void navUp()

clearHistory

public void clearHistory()

addToHistory

public void addToHistory(java.lang.Object sel)

canNavBack

public boolean canNavBack()

navBack

public void navBack()

canNavForw

public boolean canNavForw()

navForw

public void navForw()

updateTree

protected void updateTree()

menuLocalize

protected final java.lang.String menuLocalize(java.lang.String key)
Locale a popup menu item in the navigator pane.
Parameters:
key - The key for the string to localize.
Returns:
The localized string.

getQuadrant

public int getQuadrant()
Specified by:
getQuadrant in interface QuadrantPanel

getParentPath

public javax.swing.tree.TreePath getParentPath()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pce)
Listen for configuration changes that could require repaint of the navigator pane. Listens for changes of the project fired by projectmanager.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Since:
ARGO0.11.2

getTree

public DisplayTextTree getTree()
Returns the DisplayTextTree.
Returns:
DisplayTextTree


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook