com.tensegrity.gui.swing.control.tree
Class TreeOutliner

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTree
                  extended bycom.tensegrity.gui.swing.control.tree.TreeOutliner
All Implemented Interfaces:
javax.accessibility.Accessible, AttributableOnSetListener, BaseCompositeListener, CompositeGroupListener, CompositeLineListener, CompositeListener, CompositeViewListener, DocumentListener, Evaluable, java.util.EventListener, EventListenerTag, EventMediatorListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeSelectionListener, VisualEdgeListener, VisualGraphEventMediatorListener, VisualGraphListener, VisualNodeListener

public class TreeOutliner
extends javax.swing.JTree
implements VisualGraphEventMediatorListener, EventMediatorListener, javax.swing.event.TreeSelectionListener, javax.swing.event.TreeExpansionListener, DocumentListener, Evaluable

The TreeOutliner outlines the content of Documents in a tree representation.

The default implementation outlines the content of GraphDocuments but through the various means detailed below (Inheritance, Strategy Design Pattern, Template Method Design Pattern) it is possible to outline the content of other types of Documents.

It is possible to use this control as is. It is provided with a default tree model where visual nodes are gathered under a Nodes tree node, visual edges under a Edges tree node and isolated visual edges under a Isolated Edges tree node. However it is possible to provide one or several customized tree models. It is also possible to switch between models at runtime. In order to do so one must provide a sub-class of javax.swing.tree.DefaultTreeModel as well as a sub-class of com.tensegrity.gui.swing.control.tree.strategy.AbstractTreeStrategy. This class delegates some method calls to its current strategy. These are:

Default strategy: Since the TreeOutliner might outline different types of Document, a default strategy is required depending on the document type. Use the documentType parameter of the method setDefaultStrategy in order to ensure that the passed default strategy is associated with the correct document type. See AbstractTreeStrategy.DOCUMENT_TYPE_KEY for more information.

Subclassing this class: In order to make this TreeOutliner relatively easy to subclass for custom applications the Template Method design pattern is herein partially implemented. Indeed some final methods defer part of their implementation to some protected non-final method which subclasses can override. These are:

Refer to each of these methods documentation for more information.

Subclasses outlining Documents which are not GraphDocuments should override the method getDefaultStrategy which should then return the default strategy associated to the type of Document they need to outline.

Subclasses can override the factory method getNewTreeCellRenderer() in order to use a different TreeCellRenderer by default. Another solution is to use method setCellRenderer provided by the JTree super-class (javax.swing.JTree#setCellRenderer) but this will not change the default TreeCellRenderer.

Version:
$Id: TreeOutliner.java,v 1.62 2006/03/23 11:17:08 MichaelKegel Exp $
Author:
S�bastien Guyon
See Also:
JTree.setCellRenderer(javax.swing.tree.TreeCellRenderer), TreeStrategy, AbstractTreeStrategy, DefaultVisualGraphTreeModel, DefaultTreeModel, DefaultVisualGraphTreeModel, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JTree
javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector
 
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 java.lang.String OUTLINER_SELECTION_CHANGED
          Constant for the property change event that is fired when the selection in the outliner changes
 
Fields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
 
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
TreeOutliner(AttributeEditor editor, UIManager uiManager)
           Creates a new TreeOutliner instance.
TreeOutliner(AttributeEditor editor, UIManager uiManager, javax.swing.tree.DefaultTreeCellRenderer treeCellRenderer)
           Creates a new TreeOutliner instance.
 
Method Summary
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
 void attributesChanged(AttributableOnSetEvent attributableOnSetEvent)
          Invoked when an attribute in an AttributableOnSet object has changed.
protected  void collectSelectables(javax.swing.tree.TreePath path, java.util.List list)
          Method collectSelectables checks if the lastPathComponent is instance of BaseInteractable interface and adds it to the given list.
 void compositeChanged(ChangedEvent event)
          This method is called whenever a Composite has been changed but for the change is no specialized callback defined.
 void compositeChanged(LineChangedEvent event)
          This method is called whenever a CompositeLine has been changed but for the change is no specialized callback defined.
 void compositeManipulating(LineManipulationEvent event)
           This method is called while a CompositeLine is being manipulated.
 void compositeMoving(LineMoveEvent event)
           This method is called while a CompositeLine is being moved around.
 void compositeMoving(MoveEvent event)
           This method is called while a Composite is being moved around.
 void compositePostManipulating(LineManipulationEvent event)
          This method is called after a CompositeLine has been manipulated.
 void compositePostMoving(LineMoveEvent event)
          This method is called after a CompositeLine has been moved.
 void compositePostMoving(MoveEvent event)
          This method is called after a Composite has been moved.
 void compositePostResizing(ResizeEvent event)
          This method is called after a Composite has been resized.
 void compositePreManipulating(LineManipulationEvent event)
          This method is called before the manipulation of a CompositeLine starts.
 void compositePreMoving(LineMoveEvent event)
          This method is called before a CompositeLine is being moved around.
 void compositePreMoving(MoveEvent event)
          This method is called before a Composite is being moved around.
 void compositePreResizing(ResizeEvent event)
          This method is called before a Composite is about to be resized.
 void compositeResizing(ResizeEvent event)
           This method is called while a Composite is being resized.
protected  void doAddListeners(Document doc)
          Method called by documentSelected(DocumentEvent).
 void documentAdded(DocumentEvent documentEvent)
          Apparently this method does nothing, because the Tree should represent the graph objects which are currently active or selected.
 void documentModelChanged(DocumentEvent documentevent)
          Call the following methods: documentUnselected(documentevent); documentRemoved(documentevent); documentAdded(documentevent); documentSelected(documentevent);
 void documentPreAdd(DocumentEvent documentEvent)
          Do nothing.
 void documentPreRemove(DocumentEvent documentEvent)
          Do nothing.
 void documentRemoved(DocumentEvent documentEvent)
          The Tree removes itself as listener (CompositeView and Document) and clears the map entries.
 void documentSelected(DocumentEvent documentEvent)
          Restores the model from the modelMap and the expanded state from the expandedMap.
 void documentUnselected(DocumentEvent documentEvent)
          The method documentUnselected updates the model- and the expanded map with the model and ExpandedEnumeration of the current deselected graph.
protected  java.util.List doGetSelectionBeforeUpdateModel()
          Method called by updateModel() before it internally sets the TreeModel in order to let subclasses retrieve themselves the selection on their Document.
protected  void doPostValueChanged(java.util.List selection)
          Method called at the end of valueChanged(TreeSelectionEvent e) in order to let subclasses deal themselves with the list of selected "Interactables".
protected  void doRemoveListeners(Document doc)
          Method called by clearModel(Document).
protected  javax.swing.tree.TreePath doRetrieveSelection(java.lang.Object selection)
          Method called by setSelection(Object) and setSelection(Object[]).
protected  void doValueChangedSelectionNull()
          Method called by valueChanged(TreeSelectionEvent e) in order to let subclasses react accordingly when no BaseInteractable is selected on the TreeOutliner.
protected  Document getActiveDocument()
          Retrieves the ActiveDocument property
protected  AttributeEditor getAttributeEditor()
          Returns the AttributeEditor property
protected  java.util.Map getDefaultStrategiesMap()
          Returns the default strategies Map property This Map associates defaultStrategies to Strings representing the type of Document they are associated to.
 AbstractTreeStrategy getDefaultStrategy(Document doc)
          Returns the defaultStrategy associated to the passed document Important When overridding this method it is important to set the default strategy using setDefaultStrategy if the default strategy required did not previously exist and is herein created.
 java.util.Enumeration getDescendantToggledPaths(javax.swing.tree.TreePath parent)
           
protected  VisualGraphView getGraphFromDocument(Document doc)
          Utility method.
protected  Document getLastSelected()
          Returns the last selected Document property
protected  Document getLastUnSelected()
          Returns the last unselected Document property
protected  javax.swing.tree.DefaultTreeCellRenderer getNewTreeCellRenderer()
           Factory method returning the TreeCellRenderer used by the TreeOuliner.
 javax.swing.tree.TreePath getPath(javax.swing.tree.TreeNode node)
          Method getPath returns the TreePath for a given TreeNode.
protected  javax.swing.tree.DefaultMutableTreeNode getRoot()
          Redundant method to spare casting galore to retrieve Rootnode.
 AbstractTreeStrategy getStrategy()
          Returns the currently applied strategy.
protected  AbstractTreeStrategy getStrategyAssociatedToDocument(Document doc, java.lang.String name)
          Method getStrategyAssociatedToGraph returns the AbstractVisualGraphObjectTreeStrategy corresponding to the passed document.
protected  javax.swing.tree.DefaultTreeModel getTreeModel()
          Redundant method, but avoids the cast to DefaultTreeModel within further implementation.
 UIManager getUIManager()
          Returns the UIManager property
 int getUniqueID(VisualGraphObject vgo)
           This method returns a unique ID for a given VisualGraphObject.
 void groupAddedComposite(GroupAddCompositeEvent event)
          This method is called whenever a Composite has been added to a CompositeGroup.
 void groupAddedComposites(GroupAddCompositesEvent event)
          This method is called whenever a List of Composites has been added to a CompositeGroup.
 void groupCompositeOrderChanged(GroupCompositeOrderChangeEvent event)
          This method is called whenever the internal order of BaseComposite objects changes.
 void groupFoldStateChanged(GroupFoldStateChange event)
          This method is called whenever the state of folding of a CompositeGroup has been changed.
 void groupFoldStatePreChange(GroupFoldStateChange event)
          This method is called whenever the state of folding of a CompositeGroup is up to be changed.
 void groupRemovedComposite(GroupRemoveCompositeEvent event)
          This method is called whenever a Composite has been removed from a CompositeGroup.
 void groupRemovedComposites(GroupRemoveCompositesEvent event)
          This method is called whenever a List of Composites has been removed from a CompositeGroup.
 void groupSelectionChanged(GroupSelectionChangeEvent event)
          This method is called whenever the selection within the CompositeGroup has been changed.
 void groupSizeAdjusted(GroupSizeAdjustmentEvent event)
          This method is called whenever the size of a CompositeGroup has been changed by the CompositeGroup itself.
 void installEvList()
          Tells the component to setup its internal state.
protected  boolean isGraphDocument(Document doc)
          Method isGraphDocument returns true if the parameter document instance is of type GraphDocument.
 void isolatedVisualEdgeAdded(VisualEdgeEvent event)
          This method is invoked when an isolated VisualEdge is added.
 void isolatedVisualEdgeAdded(VisualGraphEvent event)
          Forward the call to the current strategy.
 void isolatedVisualEdgeRemoved(VisualEdgeEvent event)
          This method is invoked when an isolated VisualEdge is removed.
 void isolatedVisualEdgeRemoved(VisualGraphEvent event)
          Forward the call to the current strategy.
 boolean isUpdate()
          gives access to the internal "update" flag
 void layout(VisualGraphEvent visualgraphevent)
          Do Nothing
 void mouseClick(BCMouseEvent event)
          This method is called when a mouse button has been pressed and released upon a BaseComposite.
 void mouseDown(BCMouseEvent event)
          This methods is called when a mouse button has been pressed upon a BaseComposite.
 void mouseEnter(BCMouseEvent event)
          This method is called when the mouse enters the BaseComposite.
 void mouseExit(BCMouseEvent event)
          This method is called when the mouse exits the BaseComposite.
 void mouseUp(BCMouseEvent event)
          This methods is called when a mouse button has been pressed upon a BaseComposite and it will be released.
 void postSelect(BCSelectEvent event)
          This method is called whenever a Composite has been selected.
 void preSelect(BCSelectEvent event)
          This method is called before a Composite is being selected.
protected  boolean removeDescendantSelectedPaths(javax.swing.tree.TreePath path, boolean includePath)
          Overriden to allow the subselection to stay active when a node is collapsed
 void restoreSelectionPaths(javax.swing.tree.TreePath[] paths)
          Method restoreSelectionPaths restores the selection on this tree by invoking setSelectionPaths on this tree, while the update flag is turned to true during that call to avoid valueChanged to interact.
 void restoreToggledPaths(java.util.Enumeration enm)
          Method restoreToggledPaths restores the toggled Nodes from the given Enumeration of TreePath instances.
protected  void setActiveDocument(Document activeDocument)
          Sets the ActiveDocument property
protected  void setAttributeEditor(AttributeEditor attributeEditor)
          Sets the AttributeEditor property
 void setDefaultStrategy(AbstractTreeStrategy defaultStrategy, java.lang.String documentType)
           Sets the default strategy.
protected  void setLastSelected(Document lastSelected)
          Sets the last selected Document property
protected  void setLastUnSelected(Document lastUnSelected)
          Sets the last unselected Document property
 void setSelection(java.lang.Object selection)
          Method setSelection sets the selection on the tree.
 void setSelection(java.lang.Object[] selection)
          Method setSelection sets the selection according to all the selectable's within the given Object[].
 void setStrategy(AbstractTreeStrategy strategy)
          Sets the current strategy to be strategy.
protected  void setUIManager(UIManager uiManager)
          Sets the UIManager property
 void setUpdate(boolean update)
           Sets the value of the internal "update" flag
 void sort(boolean ascending)
          Method sort sorts the Tree according to the ascending flag.
 void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
          Ignored.
 void treeExpanded(javax.swing.event.TreeExpansionEvent event)
          Check the list of child nodes if there are any dynamic ones among them, those should load their children now.
 void updateModel()
          This method delegates some of its implementation to doGetSelectionBeforeUpdateModel.
 void updateUI()
           
 void valueChanged(javax.swing.event.TreeSelectionEvent e)
          Sets the selection on the tree according to the getSelectionPaths.
 void viewAddedComposite(ViewAddCompositeEvent event)
          Do nothing.
 void viewAddedComposites(ViewAddCompositesEvent event)
          Do nothing.
 void viewCompositeOrderChanged(ViewCompositeOrderChangeEvent event)
          Called whenever the internal order of BaseComposite objects changes.
 void viewModeChanged(ViewModeChangeEvent event)
          Do nothing.
 void viewParameterChanged(ViewParameterChangeEvent event)
          Do nothing.
 void viewRemovedComposite(ViewRemoveCompositeEvent event)
          Do nothing.
 void viewRemovedComposites(ViewRemoveCompositesEvent event)
          Do nothing.
 void viewScrolled(ViewScrolledEvent event)
          Called if the view position is changed during an action.
 void viewSelectionChanged(ViewSelectionChangeEvent event)
          This method is triggered by the CompositeView to indicate selection changes.
 void visualEdgeAdded(VisualEdgeEvent event)
          This method is invoked when a VisualEdge is added.
 void visualEdgeAdded(VisualGraphEvent event)
          Forward the call to the current strategy.
 void visualEdgeAttachRejected(VisualGraphEvent event)
          Do Nothing
 void visualEdgeRemoved(VisualEdgeEvent event)
          This method is invoked when a VisualEdge is removed.
 void visualEdgeRemoved(VisualGraphEvent event)
          Forward the call to the current strategy.
 void visualEdgeSplit(VisualGraphEvent visualgraphevent)
          Forward the call to the current strategy.
 void visualNodeAdded(VisualGraphEvent event)
          Forward the call to the current strategy.
 void visualNodeAdded(VisualNodeEvent event)
          This method is invoked when a VisualNode is added.
 void visualNodeDeleteEdgeCascade(VisualGraphEvent visualgraphevent)
          Forward the call to the current strategy.
 void visualNodeRemoved(VisualGraphEvent event)
          Forward the call to the current strategy.
 void visualNodeRemoved(VisualNodeEvent event)
          This method is invoked when a VisualNode is removed.
 void visualPortAdded(VisualNodeEvent event)
          This method is invoked on the listener if a VisualPort is added to a VisualNode.
 void visualPortRemoved(VisualNodeEvent event)
          This method is invoked on the listener if a VisualPort is removed from a VisualNode.
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDragEnabled, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange
 
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, 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

OUTLINER_SELECTION_CHANGED

public static final java.lang.String OUTLINER_SELECTION_CHANGED
Constant for the property change event that is fired when the selection in the outliner changes

See Also:
Constant Field Values
Constructor Detail

TreeOutliner

public TreeOutliner(AttributeEditor editor,
                    UIManager uiManager)

Creates a new TreeOutliner instance. By using this constructor, the default strategy is set to be an instance of DefaultVisualGraphTreeStrategy. However the default strategy can later be changed by using the setDefaultStrategy method. The TreeCellRenderer used is the one returned by the factory method getNewTreeCellRenderer.

Parameters:
editor - an AttributeEditor instance.
uiManager - the application UIManager.

TreeOutliner

public TreeOutliner(AttributeEditor editor,
                    UIManager uiManager,
                    javax.swing.tree.DefaultTreeCellRenderer treeCellRenderer)

Creates a new TreeOutliner instance. By using this constructor, the default strategy is set to be an instance of DefaultVisualGraphTreeStrategy. However the default strategy can later be changed by using the setDefaultStrategy method.

Parameters:
editor - an AttributeEditor instance.
uiManager - the application UIManager.
treeCellRenderer - renderer used in order to render the nodes of this tree outliners.
Method Detail

getDefaultStrategiesMap

protected final java.util.Map getDefaultStrategiesMap()

Returns the default strategies Map property This Map associates defaultStrategies to Strings representing the type of Document they are associated to.

Returns:
the default strategies Map property
See Also:
constant

getUIManager

public final UIManager getUIManager()

Returns the UIManager property

Returns:
The UIManager property

setUIManager

protected final void setUIManager(UIManager uiManager)

Sets the UIManager property

Parameters:
uiManager - this is the application's UIManager.

getAttributeEditor

protected final AttributeEditor getAttributeEditor()

Returns the AttributeEditor property

Returns:
Returns the Attribute Table property

setAttributeEditor

protected final void setAttributeEditor(AttributeEditor attributeEditor)

Sets the AttributeEditor property

Parameters:
attributeEditor - this is an AttributeEditor instance.

getLastSelected

protected final Document getLastSelected()

Returns the last selected Document property

Returns:
The last selected Document property

setLastSelected

protected final void setLastSelected(Document lastSelected)

Sets the last selected Document property

Parameters:
lastSelected - this is the last selected Document.

getLastUnSelected

protected final Document getLastUnSelected()

Returns the last unselected Document property

Returns:
The last unselected Document property

setLastUnSelected

protected final void setLastUnSelected(Document lastUnSelected)

Sets the last unselected Document property

Parameters:
lastUnSelected - this is the last unselected Document.

getActiveDocument

protected final Document getActiveDocument()

Retrieves the ActiveDocument property

Returns:
the currently active Document

setActiveDocument

protected final void setActiveDocument(Document activeDocument)

Sets the ActiveDocument property

Parameters:
activeDocument - this represents the active Document.

isUpdate

public final boolean isUpdate()

gives access to the internal "update" flag

Returns:
the internal "update" flag value.

setUpdate

public final void setUpdate(boolean update)

Sets the value of the internal "update" flag

Parameters:
update - boolean indicating whether or not the outliner is being programmatically updated.

getStrategy

public final AbstractTreeStrategy getStrategy()
Returns the currently applied strategy.

Returns:
the currently applied strategy

setStrategy

public final void setStrategy(AbstractTreeStrategy strategy)
Sets the current strategy to be strategy. The tree Model associated with strategy will be applied.

Parameters:
strategy - represents the AbstractTreeStrategy to be applied to the outliner.

setDefaultStrategy

public final void setDefaultStrategy(AbstractTreeStrategy defaultStrategy,
                                     java.lang.String documentType)

Sets the default strategy. The tree Model associated with this default strategy will be the one used whenever a new document is created. Since the TreeOutline might outline differentTypes of document, a default strategy is required depending on the document type. Use the documentType parameter in order to ensure that the passed default strategy is associated with the correct document Type. See AbstractTreeStrategy.DOCUMENT_TYPE_KEY for more information.

Parameters:
defaultStrategy - represents the AbstractTreeStrategy used by default when a new document is created.
documentType - See AbstractTreeStrategy.DOCUMENT_TYPE_KEY

getRoot

protected final javax.swing.tree.DefaultMutableTreeNode getRoot()
Redundant method to spare casting galore to retrieve Rootnode.

Returns:
TreeNode The root node of this tree.

getPath

public final javax.swing.tree.TreePath getPath(javax.swing.tree.TreeNode node)
Method getPath returns the TreePath for a given TreeNode. The path of a node is a list of all nodes from the node to its parent. Therefore this method traverses all those nodes and creates new TreePath instance from it.

Parameters:
node - the node of which you need the TreePath.
Returns:
TreePath the TreePath reflecting the given node.

getNewTreeCellRenderer

protected javax.swing.tree.DefaultTreeCellRenderer getNewTreeCellRenderer()

Factory method returning the TreeCellRenderer used by the TreeOuliner.

Returns:
a new ObjectTreeRenderer (which is a subclass of DefaultTreeCellRenderer)

getDefaultStrategy

public AbstractTreeStrategy getDefaultStrategy(Document doc)

Returns the defaultStrategy associated to the passed document Important When overridding this method it is important to set the default strategy using setDefaultStrategy if the default strategy required did not previously exist and is herein created.

Parameters:
doc - The Document for which we want the defaultStrategy
Returns:
the default AbstractTreeStrategy applied with the passed Document.

getStrategyAssociatedToDocument

protected final AbstractTreeStrategy getStrategyAssociatedToDocument(Document doc,
                                                                     java.lang.String name)
Method getStrategyAssociatedToGraph returns the AbstractVisualGraphObjectTreeStrategy corresponding to the passed document. It first checks if the local Map of documents and strategies contains the passed graph. If yes, this method returned the strategy mapping the document. If not, the default strategy associated to the document is returned. Before exiting it initializes the Model associated to the strategy. This is called by documentAdded(DocumentEvent)

Parameters:
doc - The document you want the strategy of.
name - The document name.
Returns:
A subclass of AbstractTreeStrategy mapping to the passed Document

getGraphFromDocument

protected final VisualGraphView getGraphFromDocument(Document doc)
Utility method. It returns the associated visualgraph instance from the passed document. Returns null if doc is null or not an instance of GraphDocument

Parameters:
doc - the Document of which the VisualGraphView is requested.
Returns:
VisualGraphView the VisualGraphView associated to the passed Document, if any, otherwise null.

getTreeModel

protected javax.swing.tree.DefaultTreeModel getTreeModel()
Redundant method, but avoids the cast to DefaultTreeModel within further implementation.

Returns:
DefaultTreeModel the model associated with the tree outliner, as a DefaultTreeModel instance.

sort

public final void sort(boolean ascending)
Method sort sorts the Tree according to the ascending flag. If this flag is set to true, it sorts ascending, otherwise descending. The current expanded state of all nodes is preserved. Since the sort depends on the Model, the relevant Comparator used to sort is retrieved from the currently applied strategy.

Parameters:
ascending - if true, the Tree is sorted in an ascending manner. If false, in a descending manner.
See Also:
Comparator

isGraphDocument

protected final boolean isGraphDocument(Document doc)
Method isGraphDocument returns true if the parameter document instance is of type GraphDocument.

Parameters:
doc - a Document for which this method checks whether or not it is a GraphDocument.
Returns:
boolean true if doc is a GraphDocument, false otherwise.

updateUI

public final void updateUI()
See Also:
JTree.updateUI()

setSelection

public final void setSelection(java.lang.Object selection)
Method setSelection sets the selection on the tree. The selected object is identified within the tree by its userobject. This method delegates some of its implementation to doRetrieveSelection. Called by ObecjtTreePanel.setSelection(Object selection)

Parameters:
selection - object to be selected.
See Also:
method design pattern, ObjectTreePanel

setSelection

public final void setSelection(java.lang.Object[] selection)
Method setSelection sets the selection according to all the selectable's within the given Object[]. The selection is cleared, if the array is null or empty. This method delegates some of its implementation to doRetrieveSelection. Called by updateModel(), viewSelectionChanged(ViewSelectionChangeEvent event) and visualNodeAdded(VisualGraphEvent) from AbstractVisualGraphTreeStrategy implementors.

Parameters:
selection - objects to be selected.
See Also:
method design pattern

restoreToggledPaths

public final void restoreToggledPaths(java.util.Enumeration enm)
Method restoreToggledPaths restores the toggled Nodes from the given Enumeration of TreePath instances.


restoreSelectionPaths

public final void restoreSelectionPaths(javax.swing.tree.TreePath[] paths)
Method restoreSelectionPaths restores the selection on this tree by invoking setSelectionPaths on this tree, while the update flag is turned to true during that call to avoid valueChanged to interact.

Parameters:
paths - array of TreePath to select.

visualEdgeAdded

public final void visualEdgeAdded(VisualGraphEvent event)
Forward the call to the current strategy.

Specified by:
visualEdgeAdded in interface VisualGraphListener
Parameters:
event - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.visualEdgeAdded(VisualGraphEvent)

visualEdgeRemoved

public final void visualEdgeRemoved(VisualGraphEvent event)
Forward the call to the current strategy.

Specified by:
visualEdgeRemoved in interface VisualGraphListener
Parameters:
event - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.visualEdgeRemoved(VisualGraphEvent)

visualNodeAdded

public final void visualNodeAdded(VisualGraphEvent event)
Forward the call to the current strategy.

Specified by:
visualNodeAdded in interface VisualGraphListener
Parameters:
event - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.visualNodeAdded(VisualGraphEvent)

visualNodeRemoved

public final void visualNodeRemoved(VisualGraphEvent event)
Forward the call to the current strategy.

Specified by:
visualNodeRemoved in interface VisualGraphListener
Parameters:
event - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.visualNodeRemoved(VisualGraphEvent)

isolatedVisualEdgeAdded

public final void isolatedVisualEdgeAdded(VisualGraphEvent event)
Forward the call to the current strategy.

Specified by:
isolatedVisualEdgeAdded in interface VisualGraphListener
Parameters:
event - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.isolatedVisualEdgeAdded(VisualGraphEvent)

isolatedVisualEdgeRemoved

public final void isolatedVisualEdgeRemoved(VisualGraphEvent event)
Forward the call to the current strategy.

Specified by:
isolatedVisualEdgeRemoved in interface VisualGraphListener
Parameters:
event - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.isolatedVisualEdgeRemoved(VisualGraphEvent)

visualEdgeAttachRejected

public final void visualEdgeAttachRejected(VisualGraphEvent event)
Do Nothing

Specified by:
visualEdgeAttachRejected in interface VisualGraphListener
Parameters:
event - the VisualGraphEvent structure that contains the event information.
See Also:
VisualGraphListener.visualEdgeAttachRejected(com.tensegrity.graph.event.VisualGraphEvent)

layout

public final void layout(VisualGraphEvent visualgraphevent)
Do Nothing

Specified by:
layout in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.
See Also:
VisualGraphListener.layout(VisualGraphEvent)

visualEdgeSplit

public final void visualEdgeSplit(VisualGraphEvent visualgraphevent)
Forward the call to the current strategy.

Specified by:
visualEdgeSplit in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.visualEdgeSplit(com.tensegrity.graph.event.VisualGraphEvent)

visualNodeDeleteEdgeCascade

public final void visualNodeDeleteEdgeCascade(VisualGraphEvent visualgraphevent)
Forward the call to the current strategy.

Specified by:
visualNodeDeleteEdgeCascade in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.
See Also:
AbstractVisualGraphTreeStrategy, VisualGraphListener.visualNodeDeleteEdgeCascade(com.tensegrity.graph.event.VisualGraphEvent)

valueChanged

public final void valueChanged(javax.swing.event.TreeSelectionEvent e)
Sets the selection on the tree according to the getSelectionPaths. Returns immediately and does nothing if the update flag is set to true. This method delegates some of its implementation to doValueChangedSelectionNull and doPostValueChanged

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener
Parameters:
e - a TreeSelectionEvent
See Also:
method design pattern, TreeSelectionListener.valueChanged(TreeSelectionEvent)

treeExpanded

public final void treeExpanded(javax.swing.event.TreeExpansionEvent event)
Check the list of child nodes if there are any dynamic ones among them, those should load their children now.

Specified by:
treeExpanded in interface javax.swing.event.TreeExpansionListener
Parameters:
event - a TreeExpansionEvent
See Also:
TreeExpansionListener.treeExpanded(TreeExpansionEvent)

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
Ignored.

Specified by:
treeCollapsed in interface javax.swing.event.TreeExpansionListener
See Also:
TreeExpansionListener.treeCollapsed(TreeExpansionEvent)

viewAddedComposite

public void viewAddedComposite(ViewAddCompositeEvent event)
Do nothing.

Specified by:
viewAddedComposite in interface CompositeViewListener
Parameters:
event - the corresponding event.
See Also:
CompositeViewListener.viewAddedComposite(ViewAddCompositeEvent)

viewAddedComposites

public void viewAddedComposites(ViewAddCompositesEvent event)
Do nothing.

Specified by:
viewAddedComposites in interface CompositeViewListener
Parameters:
event - the corresponding event.
See Also:
CompositeViewListener.viewAddedComposites(ViewAddCompositesEvent)

viewRemovedComposite

public void viewRemovedComposite(ViewRemoveCompositeEvent event)
Do nothing.

Specified by:
viewRemovedComposite in interface CompositeViewListener
Parameters:
event - the corresponding event.
See Also:
CompositeViewListener.viewRemovedComposite(ViewRemoveCompositeEvent)

viewRemovedComposites

public void viewRemovedComposites(ViewRemoveCompositesEvent event)
Do nothing.

Specified by:
viewRemovedComposites in interface CompositeViewListener
Parameters:
event - the corresponding event.
See Also:
CompositeViewListener.viewRemovedComposites(ViewRemoveCompositesEvent)

viewCompositeOrderChanged

public void viewCompositeOrderChanged(ViewCompositeOrderChangeEvent event)
Description copied from interface: CompositeViewListener
Called whenever the internal order of BaseComposite objects changes.

Specified by:
viewCompositeOrderChanged in interface CompositeViewListener
Parameters:
event - the corresponding ViewCompositeOrderChangeEvent event.

viewSelectionChanged

public final void viewSelectionChanged(ViewSelectionChangeEvent event)
This method is triggered by the CompositeView to indicate selection changes. If the Composite list of the event is empty the current treeselection is cleared. Otherwise the current selection is replaced by the list of composites from the event.

Specified by:
viewSelectionChanged in interface CompositeViewListener
Parameters:
event - the corresponding ViewSelectionChangeEvent event.
See Also:
CompositeViewListener.viewSelectionChanged(ViewSelectionChangeEvent)

viewParameterChanged

public void viewParameterChanged(ViewParameterChangeEvent event)
Do nothing.

Specified by:
viewParameterChanged in interface CompositeViewListener
Parameters:
event - the corresponding ViewParameterChangeEvent event.
See Also:
CompositeViewListener.viewParameterChanged(com.tensegrity.composite.event.view.ViewParameterChangeEvent)

viewModeChanged

public void viewModeChanged(ViewModeChangeEvent event)
Do nothing.

Specified by:
viewModeChanged in interface CompositeViewListener
Parameters:
event - the corresponding ViewModeChangeEvent event.
See Also:
CompositeViewListener.viewModeChanged(com.tensegrity.composite.event.view.ViewModeChangeEvent)

documentModelChanged

public void documentModelChanged(DocumentEvent documentevent)
Call the following methods:

Specified by:
documentModelChanged in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.
See Also:
DocumentListener.documentModelChanged(DocumentEvent)

documentAdded

public void documentAdded(DocumentEvent documentEvent)
Apparently this method does nothing, because the Tree should represent the graph objects which are currently active or selected. Therefore all necessary initialization is done in the documentSelected.

Specified by:
documentAdded in interface DocumentListener
Parameters:
documentEvent - the documentevent structure carrying information.
See Also:
DocumentListener.documentAdded(DocumentEvent)

documentPreAdd

public void documentPreAdd(DocumentEvent documentEvent)
                    throws DocumentEventVetoException
Do nothing.

Specified by:
documentPreAdd in interface DocumentListener
Parameters:
documentEvent - the documentevent structure carrying information.
Throws:
DocumentEventVetoException - indicates that the documentevent is not desired.
See Also:
DocumentListener.documentPreAdd(DocumentEvent)

documentPreRemove

public void documentPreRemove(DocumentEvent documentEvent)
                       throws DocumentEventVetoException
Do nothing.

Specified by:
documentPreRemove in interface DocumentListener
Parameters:
documentEvent - the documentevent structure carrying information.
Throws:
DocumentEventVetoException - indicates that the documentevent is not desired.
See Also:
DocumentListener.documentPreRemove(DocumentEvent)

documentRemoved

public void documentRemoved(DocumentEvent documentEvent)
The Tree removes itself as listener (CompositeView and Document) and clears the map entries. The empty model is set to indicate that this tree is empty.

Specified by:
documentRemoved in interface DocumentListener
Parameters:
documentEvent - the documentevent structure carrying information.
See Also:
DocumentListener.documentRemoved(DocumentEvent)

documentSelected

public void documentSelected(DocumentEvent documentEvent)
Restores the model from the modelMap and the expanded state from the expandedMap. Then this tree is added as CompositeViewListener and VisualGraphListener. This method delegates some of its implementation to doAddListeners.

Specified by:
documentSelected in interface DocumentListener
Parameters:
documentEvent - the documentevent structure carrying information.
See Also:
method design pattern, DocumentListener.documentSelected(DocumentEvent)

documentUnselected

public void documentUnselected(DocumentEvent documentEvent)
The method documentUnselected updates the model- and the expanded map with the model and ExpandedEnumeration of the current deselected graph. Also this Tree is removed from the listener lists of the visualgraph.

Specified by:
documentUnselected in interface DocumentListener
Parameters:
documentEvent - the documentevent structure carrying information.
See Also:
DocumentListener.documentUnselected(DocumentEvent)

applyEvList

public final void applyEvList()
Description copied from interface: Evaluable
Tells the component to apply its UIItemEvaluationList.

Specified by:
applyEvList in interface Evaluable
See Also:
Evaluable.applyEvList()

installEvList

public final void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable
See Also:
Evaluable.installEvList()

doValueChangedSelectionNull

protected void doValueChangedSelectionNull()

Method called by valueChanged(TreeSelectionEvent e) in order to let subclasses react accordingly when no BaseInteractable is selected on the TreeOutliner. Does nothing if the activeDocument (see method getActiveDocument()) is not a GraphDocument.

See Also:
BaseInteractable, method design pattern

doPostValueChanged

protected void doPostValueChanged(java.util.List selection)

Method called at the end of valueChanged(TreeSelectionEvent e) in order to let subclasses deal themselves with the list of selected "Interactables". Note that it is not called if no "Interactables" are selected on the Tree. This is internally setting the selection on the VisualGraphView of the ActiveDocument, updating the AttributeEditor and ensuring that the selection is visible.

Parameters:
selection - List of BaseInteractable objects
See Also:
method design pattern, BaseInteractable

doGetSelectionBeforeUpdateModel

protected java.util.List doGetSelectionBeforeUpdateModel()

Method called by updateModel() before it internally sets the TreeModel in order to let subclasses retrieve themselves the selection on their Document. Returns an empty list if the lastSelected document is not a GraphDocument.

Returns:
A list of selected elements on the active document
See Also:
method design pattern

doAddListeners

protected void doAddListeners(Document doc)

Method called by documentSelected(DocumentEvent). Use this method in order to add listeners to the active document when it is selected. Does nothing if the document is not a GraphDocument.

Parameters:
doc - The document we might want to listen to. This is the active document.
See Also:
method design pattern, GraphDocument

doRemoveListeners

protected void doRemoveListeners(Document doc)

Method called by clearModel(Document). Use this method in order to remove listeners of the active document when it is unselected or removed. Does nothing if the document is not a GraphDocument.

Parameters:
doc - The document we might want to listen to. This is the active document.
See Also:
method design pattern, GraphDocument

doRetrieveSelection

protected javax.swing.tree.TreePath doRetrieveSelection(java.lang.Object selection)

Method called by setSelection(Object) and setSelection(Object[]). Use this method in order to retrieve the TreePath of the TreeNode corresponding to the passed "BaseInteractable". Returns null if the parameter is null, if it is not a VisualGraphObject or if findNodeByID provided by the current AbstractTreeStrategy returns null.

Parameters:
selection - An BaseInteractable which was selected.
Returns:
the TreePath of the TreeNode corresponding to the passed parameter, if it exists. Returns null otherwise.
See Also:
method design pattern, AbstractTreeStrategy

collectSelectables

protected void collectSelectables(javax.swing.tree.TreePath path,
                                  java.util.List list)
Method collectSelectables checks if the lastPathComponent is instance of BaseInteractable interface and adds it to the given list. If the object associated to the TreeNode corresponding to the passed path parameter is a VisualGraphObject for which the BaseComposite is an BaseInteractable, the BaseComposite is added the the list list.

Parameters:
path - the path to check for BaseInteractable instances
list - the list to use for storage

updateModel

public final void updateModel()
This method delegates some of its implementation to doGetSelectionBeforeUpdateModel.

See Also:
method design pattern

getDescendantToggledPaths

public java.util.Enumeration getDescendantToggledPaths(javax.swing.tree.TreePath parent)
See Also:
JTree.getDescendantToggledPaths(javax.swing.tree.TreePath)

groupAddedComposite

public void groupAddedComposite(GroupAddCompositeEvent event)
Description copied from interface: CompositeGroupListener
This method is called whenever a Composite has been added to a CompositeGroup. The GroupAddCompositeEvent given by event carries the information a CompositeGroupListener could be interested in.

Specified by:
groupAddedComposite in interface CompositeGroupListener
Parameters:
event - the event that carries the information
See Also:
CompositeGroupListener.groupAddedComposite(com.tensegrity.composite.event.group.GroupAddCompositeEvent)

groupAddedComposites

public void groupAddedComposites(GroupAddCompositesEvent event)
Description copied from interface: CompositeGroupListener
This method is called whenever a List of Composites has been added to a CompositeGroup. The GroupAddCompositesEvent given by event carries the information a CompositeGroupListener could be interested in.

Specified by:
groupAddedComposites in interface CompositeGroupListener
Parameters:
event - the event that carries the information
See Also:
CompositeGroupListener.groupAddedComposites(com.tensegrity.composite.event.group.GroupAddCompositesEvent)

groupFoldStateChanged

public void groupFoldStateChanged(GroupFoldStateChange event)
Description copied from interface: CompositeGroupListener
This method is called whenever the state of folding of a CompositeGroup has been changed. The GroupFoldStateChange event given by event carries the information a CompositeGroupListener could be interested in.

Specified by:
groupFoldStateChanged in interface CompositeGroupListener
Parameters:
event - the event that carries the information.
See Also:
CompositeGroupListener.groupFoldStateChanged(com.tensegrity.composite.event.group.GroupFoldStateChange)

groupFoldStatePreChange

public void groupFoldStatePreChange(GroupFoldStateChange event)
Description copied from interface: CompositeGroupListener
This method is called whenever the state of folding of a CompositeGroup is up to be changed.

Specified by:
groupFoldStatePreChange in interface CompositeGroupListener
Parameters:
event - the event that carries the information.
See Also:
CompositeGroupListener.groupFoldStatePreChange(com.tensegrity.composite.event.group.GroupFoldStateChange)

groupRemovedComposite

public void groupRemovedComposite(GroupRemoveCompositeEvent event)
Description copied from interface: CompositeGroupListener
This method is called whenever a Composite has been removed from a CompositeGroup. The GroupRemoveCompositeEvent given by event carries the information a CompositeGroupListener could be interested in.

Specified by:
groupRemovedComposite in interface CompositeGroupListener
Parameters:
event - the event that carries the information
See Also:
CompositeGroupListener.groupRemovedComposite(com.tensegrity.composite.event.group.GroupRemoveCompositeEvent)

groupRemovedComposites

public void groupRemovedComposites(GroupRemoveCompositesEvent event)
Description copied from interface: CompositeGroupListener
This method is called whenever a List of Composites has been removed from a CompositeGroup. The GroupRemoveCompositesEvent given by event carries the information a CompositeGroupListener could be interested in.

Specified by:
groupRemovedComposites in interface CompositeGroupListener
Parameters:
event - the event that carries the information
See Also:
CompositeGroupListener.groupRemovedComposites(com.tensegrity.composite.event.group.GroupRemoveCompositesEvent)

groupSelectionChanged

public void groupSelectionChanged(GroupSelectionChangeEvent event)
Description copied from interface: CompositeGroupListener
This method is called whenever the selection within the CompositeGroup has been changed. The GroupSelectionChangeEvent given by event carries the information a CompositeGroupListener could be interested in.

Specified by:
groupSelectionChanged in interface CompositeGroupListener
Parameters:
event - the event that carries the information
See Also:
CompositeGroupListener.groupSelectionChanged(com.tensegrity.composite.event.group.GroupSelectionChangeEvent)

groupCompositeOrderChanged

public void groupCompositeOrderChanged(GroupCompositeOrderChangeEvent event)
Description copied from interface: CompositeGroupListener
This method is called whenever the internal order of BaseComposite objects changes.

Specified by:
groupCompositeOrderChanged in interface CompositeGroupListener
Parameters:
event - the corresponding GroupCompositeOrderChangeEvent event.

groupSizeAdjusted

public void groupSizeAdjusted(GroupSizeAdjustmentEvent event)
Description copied from interface: CompositeGroupListener
This method is called whenever the size of a CompositeGroup has been changed by the CompositeGroup itself.
This event is related to the size-adjustment functionality of the CompositeGroup.

Specified by:
groupSizeAdjusted in interface CompositeGroupListener
Parameters:
event - the event that carries the information.
See Also:
CompositeGroupListener.groupSizeAdjusted(com.tensegrity.composite.event.group.GroupSizeAdjustmentEvent)

getUniqueID

public int getUniqueID(VisualGraphObject vgo)

This method returns a unique ID for a given VisualGraphObject.

Parameters:
vgo - VisualGraphObject for which the unique id is requested.
Returns:
a unique ID for vgo.
See Also:


visualNodeAdded

public void visualNodeAdded(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked when a VisualNode is added.

Specified by:
visualNodeAdded in interface VisualNodeListener
Parameters:
event - the event structure carrying additional information.

visualNodeRemoved

public void visualNodeRemoved(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked when a VisualNode is removed.

Specified by:
visualNodeRemoved in interface VisualNodeListener
Parameters:
event - the event structure carrying additional information.

visualPortAdded

public void visualPortAdded(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked on the listener if a VisualPort is added to a VisualNode.

Specified by:
visualPortAdded in interface VisualNodeListener

visualPortRemoved

public void visualPortRemoved(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked on the listener if a VisualPort is removed from a VisualNode.

Specified by:
visualPortRemoved in interface VisualNodeListener
Parameters:
event - the structure that holds details about the event.

visualEdgeAdded

public void visualEdgeAdded(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when a VisualEdge is added.

Specified by:
visualEdgeAdded in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.

visualEdgeRemoved

public void visualEdgeRemoved(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when a VisualEdge is removed.

Specified by:
visualEdgeRemoved in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.

isolatedVisualEdgeAdded

public void isolatedVisualEdgeAdded(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when an isolated VisualEdge is added.

Specified by:
isolatedVisualEdgeAdded in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.

isolatedVisualEdgeRemoved

public void isolatedVisualEdgeRemoved(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when an isolated VisualEdge is removed.

Specified by:
isolatedVisualEdgeRemoved in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.

compositeChanged

public void compositeChanged(LineChangedEvent event)
Description copied from interface: CompositeLineListener
This method is called whenever a CompositeLine has been changed but for the change is no specialized callback defined.

Specified by:
compositeChanged in interface CompositeLineListener
Parameters:
event - the LineChangedEvent
See Also:
LineChangedEvent

compositePreManipulating

public void compositePreManipulating(LineManipulationEvent event)
Description copied from interface: CompositeLineListener
This method is called before the manipulation of a CompositeLine starts.

Specified by:
compositePreManipulating in interface CompositeLineListener
Parameters:
event - the LineManipulationEvent event instance
See Also:
LineManipulationEvent

compositeManipulating

public void compositeManipulating(LineManipulationEvent event)
Description copied from interface: CompositeLineListener

This method is called while a CompositeLine is being manipulated.

Notice that this method is only called while interaction with the CompositeLine is taking place and not when manipulate it by the interface methods.

Specified by:
compositeManipulating in interface CompositeLineListener
Parameters:
event - the LineManipulationEvent event instance
See Also:
LineManipulationEvent

compositePostManipulating

public void compositePostManipulating(LineManipulationEvent event)
Description copied from interface: CompositeLineListener
This method is called after a CompositeLine has been manipulated.

Specified by:
compositePostManipulating in interface CompositeLineListener
Parameters:
event - the LineManipulationEvent event instance
See Also:
LineManipulationEvent

compositePreMoving

public void compositePreMoving(LineMoveEvent event)
Description copied from interface: CompositeLineListener
This method is called before a CompositeLine is being moved around.

Specified by:
compositePreMoving in interface CompositeLineListener
Parameters:
event - the LineMoveEvent event instance
See Also:
LineMoveEvent

compositeMoving

public void compositeMoving(LineMoveEvent event)
Description copied from interface: CompositeLineListener

This method is called while a CompositeLine is being moved around.

Notice that this method is only called while interaction with the CompositeLine is taking place and not when moving it by the interface methods.

Specified by:
compositeMoving in interface CompositeLineListener
Parameters:
event - the LineMoveEvent event instance
See Also:
LineMoveEvent

compositePostMoving

public void compositePostMoving(LineMoveEvent event)
Description copied from interface: CompositeLineListener
This method is called after a CompositeLine has been moved.

Specified by:
compositePostMoving in interface CompositeLineListener
Parameters:
event - the LineMoveEvent event instance
See Also:
LineMoveEvent

preSelect

public void preSelect(BCSelectEvent event)
Description copied from interface: BaseCompositeListener
This method is called before a Composite is being selected.

Specified by:
preSelect in interface BaseCompositeListener
Parameters:
event - the SelectEvent
See Also:
BCSelectEvent

postSelect

public void postSelect(BCSelectEvent event)
Description copied from interface: BaseCompositeListener
This method is called whenever a Composite has been selected.

Specified by:
postSelect in interface BaseCompositeListener
Parameters:
event - the SelectEvent
See Also:
BCSelectEvent

mouseEnter

public void mouseEnter(BCMouseEvent event)
Description copied from interface: BaseCompositeListener
This method is called when the mouse enters the BaseComposite. Enter means that the hotspot of the mouse cursor lies within the bounding box of the BaseComposite

Specified by:
mouseEnter in interface BaseCompositeListener
Parameters:
event - the BCMouseEvent

mouseExit

public void mouseExit(BCMouseEvent event)
Description copied from interface: BaseCompositeListener
This method is called when the mouse exits the BaseComposite. Exit means that the hotspot of the mouse cursor lies no longer within the bounding box of the BaseComposite

Specified by:
mouseExit in interface BaseCompositeListener
Parameters:
event - the BCMouseEvent

mouseDown

public void mouseDown(BCMouseEvent event)
Description copied from interface: BaseCompositeListener
This methods is called when a mouse button has been pressed upon a BaseComposite.

Specified by:
mouseDown in interface BaseCompositeListener
Parameters:
event - the BCMouseEvent

mouseUp

public void mouseUp(BCMouseEvent event)
Description copied from interface: BaseCompositeListener
This methods is called when a mouse button has been pressed upon a BaseComposite and it will be released.

Specified by:
mouseUp in interface BaseCompositeListener
Parameters:
event - the BCMouseEvent

mouseClick

public void mouseClick(BCMouseEvent event)
Description copied from interface: BaseCompositeListener
This method is called when a mouse button has been pressed and released upon a BaseComposite.

Specified by:
mouseClick in interface BaseCompositeListener
Parameters:
event - the BCMouseEvent

compositeChanged

public void compositeChanged(ChangedEvent event)
Description copied from interface: CompositeListener
This method is called whenever a Composite has been changed but for the change is no specialized callback defined.

Specified by:
compositeChanged in interface CompositeListener
Parameters:
event - the ChangedEvent
See Also:
ChangedEvent

compositePreMoving

public void compositePreMoving(MoveEvent event)
Description copied from interface: CompositeListener
This method is called before a Composite is being moved around. Throwing a CompositeEventVetoException prevents movement of the Composite completely.

Specified by:
compositePreMoving in interface CompositeListener
Parameters:
event - the LineMoveEvent
See Also:
MoveEvent

compositeMoving

public void compositeMoving(MoveEvent event)
Description copied from interface: CompositeListener

This method is called while a Composite is being moved around. Throwing a CompositeEventVetoException prevents movement of the Composite to the actual position. For instance this can be used to avoid that the Composite is being moved to a location that is not acceptable.

Notice that this method is only called while interaction with the Composite is taking place and not when moving it by the interface methods.

Specified by:
compositeMoving in interface CompositeListener
Parameters:
event - the MoveEvent
See Also:
MoveEvent

compositePostMoving

public void compositePostMoving(MoveEvent event)
Description copied from interface: CompositeListener
This method is called after a Composite has been moved.

Specified by:
compositePostMoving in interface CompositeListener
Parameters:
event - the MoveEvent
See Also:
MoveEvent

compositePreResizing

public void compositePreResizing(ResizeEvent event)
Description copied from interface: CompositeListener
This method is called before a Composite is about to be resized. Throwing a CompositeEventVetoException prevents resizement of the Composite completely.

Specified by:
compositePreResizing in interface CompositeListener
Parameters:
event - the ResizeEvent
See Also:
ResizeEvent

compositeResizing

public void compositeResizing(ResizeEvent event)
Description copied from interface: CompositeListener

This method is called while a Composite is being resized. Throwing a CompositeEventVetoException prevents resizement of the Composite to the actual size. For instance this can be used to avoid that the Composite is being resized to a size that is not acceptable.

Notice that this method is only called while interaction with the Composite is taking place and not when resize it by the interface methods.

Specified by:
compositeResizing in interface CompositeListener
Parameters:
event - the ResizeEvent
See Also:
ResizeEvent

compositePostResizing

public void compositePostResizing(ResizeEvent event)
Description copied from interface: CompositeListener
This method is called after a Composite has been resized.

Specified by:
compositePostResizing in interface CompositeListener
Parameters:
event - the ResizeEvent
See Also:
ResizeEvent

attributesChanged

public void attributesChanged(AttributableOnSetEvent attributableOnSetEvent)
Description copied from interface: AttributableOnSetListener
Invoked when an attribute in an AttributableOnSet object has changed.

Specified by:
attributesChanged in interface AttributableOnSetListener
Parameters:
attributableOnSetEvent - the event carrying information.

removeDescendantSelectedPaths

protected boolean removeDescendantSelectedPaths(javax.swing.tree.TreePath path,
                                                boolean includePath)
Overriden to allow the subselection to stay active when a node is collapsed


viewScrolled

public void viewScrolled(ViewScrolledEvent event)
Description copied from interface: CompositeViewListener
Called if the view position is changed during an action.

Specified by:
viewScrolled in interface CompositeViewListener
Parameters:
event - the corresponding ViewScrollingEvent event.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.