org.argouml.ui
Class NavigatorPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.argouml.ui.NavigatorPane
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, ru.novosoft.uml.MElementListener, java.awt.MenuContainer, java.beans.PropertyChangeListener, QuadrantPanel, java.io.Serializable

public class NavigatorPane
extends javax.swing.JPanel
implements java.awt.event.ItemListener, java.beans.PropertyChangeListener, QuadrantPanel, ru.novosoft.uml.MElementListener

The upper-left pane of the main Argo/UML window, shows a tree view of the UML model.

The model can be viewed from different tree "Perspectives".

The public interface of this class provides the following:

  1. selection via getSelectedObject(), getTree().getSelectionPaths()
  2. model changed notification via forceUpdate()
  3. History via various *nav*() methods
  4. statistics gathering - not really used
  5. a collection of perspectives

Perspectives are now built here. $Id: NavigatorPane.java,v 1.48 2003/07/18 17:06:00 d00mst Exp $

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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
static int _clicksInNavPane
          for collecting user statistics
protected  javax.swing.JComboBox _combo
          selects the perspective
protected  NavPerspective _curPerspective
          the current perspective
static int _navPerspectivesChanged
          for collecting user statistics
protected  java.util.Vector _perspectives
          vector of TreeModels, that are the perspectives
protected  java.lang.Object _root
          tree root object
protected  Toolbar _toolbar
          toolbar for history navigation and perspectives config dialog
protected  DisplayTextTree _tree
          the java.swing.JTree component
protected  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)
          Constructs a new navigator panel.
 
Method Summary
 void addPerspective(NavPerspective np)
           
 java.util.Vector buildPerspectives()
          the perspectives to be chosen in the combobox are built here.
 void forceUpdate()
          Notification from Argo that the model has changed and the Tree view needs updating.
 void forceUpdate(java.lang.Object changed)
          Countpart to forceUpdate() that only updates viewable rows, instead of rebuilding the whole tree; a vast improvement in performance.
 NavPerspective getCurPerspective()
          needs documenting
 java.awt.Dimension getMinimumSize()
          needs documenting
 java.util.Vector getPerspectives()
          needs documenting
 int getQuadrant()
          QuadrantPanel implementation
 java.lang.Object getRoot()
          needs documenting
 java.lang.Object getSelectedObject()
          selection accessor - to be moved into some selection manager when used by ActionAddPackage and ActionSetSourcePath
 java.lang.Object[] getSelectedObjects()
          Gets all selected objects (for multiselect)
 DisplayTextTree getTree()
          used as a selection accessor - to be removed.
 void itemStateChanged(java.awt.event.ItemEvent e)
          called when the user selects a perspective from the perspective combo.
 void listRoleItemSet(ru.novosoft.uml.MElementEvent e)
          If a element changes, this will be catched by this method and reflected in the tree.
 void navDown()
          history method - to be moved into some HistoryManager that is linked to the not-yet-done SelectionManager ??
 void navUp()
          history method - to be moved into some HistoryManager that is linked to the not-yet-done SelectionManager ??
 void propertyChange(java.beans.PropertyChangeEvent pce)
          Listen for configuration changes that could require repaint of the navigator pane, calls forceUpdate(), Listens for changes of the project fired by projectmanager.
 void propertySet(ru.novosoft.uml.MElementEvent e)
          If a element changes, this will be catched by this method and reflected in the tree.
 void recovered(ru.novosoft.uml.MElementEvent e)
          If a element changes, this will be catched by this method and reflected in the tree.
 void removed(ru.novosoft.uml.MElementEvent e)
          If a element changes, this will be catched by this method and reflected in the tree.
 void removePerspective(NavPerspective np)
          method for navconfig dialog to remove a perspective.
 void roleAdded(ru.novosoft.uml.MElementEvent e)
          If a element changes, this will be catched by this method and reflected in the tree.
 void roleRemoved(ru.novosoft.uml.MElementEvent e)
          If a element changes, this will be catched by this method and reflected in the tree.
 void setCurPerspective(NavPerspective per)
          needs documenting
 void setRoot(java.lang.Object r)
          needs documenting
 void setSelection(java.lang.Object level1, java.lang.Object level2)
          selection mutator - to be moved into some selection manager.
protected  void updateTree()
          helper method to: - itemStateChanged(), - setPerspectives(Vector pers)
 
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, 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, 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

cat

protected transient org.apache.log4j.Category cat

MAX_HISTORY

public static final int MAX_HISTORY
See Also:
Constant Field Values

_clicksInNavPane

public static int _clicksInNavPane
for collecting user statistics


_navPerspectivesChanged

public static int _navPerspectivesChanged
for collecting user statistics


_tree

protected DisplayTextTree _tree
the java.swing.JTree component


_toolbar

protected Toolbar _toolbar
toolbar for history navigation and perspectives config dialog


_combo

protected javax.swing.JComboBox _combo
selects the perspective


_curPerspective

protected NavPerspective _curPerspective
the current perspective


_perspectives

protected java.util.Vector _perspectives
vector of TreeModels, that are the perspectives


_root

protected java.lang.Object _root
tree root object

Constructor Detail

NavigatorPane

public NavigatorPane(boolean doSplash)
Constructs a new navigator panel.

This panel consists of a Combobox to select a navigation perspective, a JTree to display the UML model, some history (back and forward arrows) buttons that are currently disabled, and a configuration dialog to tailor the perspectives (but this is not saved).

Method Detail

setRoot

public void setRoot(java.lang.Object r)
needs documenting


getRoot

public java.lang.Object getRoot()
needs documenting


getPerspectives

public java.util.Vector getPerspectives()
needs documenting


getCurPerspective

public NavPerspective getCurPerspective()
needs documenting


setCurPerspective

public void setCurPerspective(NavPerspective per)
needs documenting


getSelectedObject

public java.lang.Object getSelectedObject()
selection accessor - to be moved into some selection manager when used by ActionAddPackage and ActionSetSourcePath

then change to private for use by the NavigatorKeyListener, below.


getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Gets all selected objects (for multiselect)

Returns:
all selected objects (for multiselect)

forceUpdate

public void forceUpdate()
Notification from Argo that the model has changed and the Tree view needs updating. TODO: More specific information needs to be provided, it is expesive to update the whole tree.

See Also:
ActionRemoveFromModel, ActionAddDiagram, PropPanelGeneralization, UMLReflectionListModel

forceUpdate

public void forceUpdate(java.lang.Object changed)
Countpart to forceUpdate() that only updates viewable rows, instead of rebuilding the whole tree; a vast improvement in performance.

See Also:
UmlModelListener

setSelection

public void setSelection(java.lang.Object level1,
                         java.lang.Object level2)
selection mutator - to be moved into some selection manager. 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.

called from main()


getMinimumSize

public java.awt.Dimension getMinimumSize()
needs documenting


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

navDown

public void navDown()
history method - to be moved into some HistoryManager that is linked to the not-yet-done SelectionManager ??


navUp

public void navUp()
history method - to be moved into some HistoryManager that is linked to the not-yet-done SelectionManager ??


updateTree

protected void updateTree()
helper method to: - itemStateChanged(), - setPerspectives(Vector pers)


getQuadrant

public int getQuadrant()
QuadrantPanel implementation

Specified by:
getQuadrant in interface QuadrantPanel

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pce)
Listen for configuration changes that could require repaint of the navigator pane, calls forceUpdate(), 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()
used as a selection accessor - to be removed. Returns the DisplayTextTree.

Returns:
DisplayTextTree

buildPerspectives

public java.util.Vector buildPerspectives()
the perspectives to be chosen in the combobox are built here.


removePerspective

public void removePerspective(NavPerspective np)
method for navconfig dialog to remove a perspective.


addPerspective

public void addPerspective(NavPerspective np)

listRoleItemSet

public void listRoleItemSet(ru.novosoft.uml.MElementEvent e)
If a element changes, this will be catched by this method and reflected in the tree.

Specified by:
listRoleItemSet in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.listRoleItemSet(ru.novosoft.uml.MElementEvent)

propertySet

public void propertySet(ru.novosoft.uml.MElementEvent e)
If a element changes, this will be catched by this method and reflected in the tree.

Specified by:
propertySet in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.propertySet(ru.novosoft.uml.MElementEvent)

recovered

public void recovered(ru.novosoft.uml.MElementEvent e)
If a element changes, this will be catched by this method and reflected in the tree.

Specified by:
recovered in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.recovered(ru.novosoft.uml.MElementEvent)

removed

public void removed(ru.novosoft.uml.MElementEvent e)
If a element changes, this will be catched by this method and reflected in the tree.

Specified by:
removed in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.removed(ru.novosoft.uml.MElementEvent)

roleAdded

public void roleAdded(ru.novosoft.uml.MElementEvent e)
If a element changes, this will be catched by this method and reflected in the tree.

Specified by:
roleAdded in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.roleAdded(ru.novosoft.uml.MElementEvent)

roleRemoved

public void roleRemoved(ru.novosoft.uml.MElementEvent e)
If a element changes, this will be catched by this method and reflected in the tree.

Specified by:
roleRemoved in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.roleRemoved(ru.novosoft.uml.MElementEvent)


ArgoUML © 1996-2003 (20040125)ArgoUML Project HomeArgoUML Cookbook