org.argouml.ui
Class AbstractGoRule

java.lang.Object
  |
  +--org.argouml.ui.AbstractGoRule
All Implemented Interfaces:
javax.swing.tree.TreeModel
Direct Known Subclasses:
GoAssocRoleMessages, GoBehavioralFeatureToStateDiagram, GoBehavioralFeatureToStateMachine, GoClassifierToBeh, GoClassifierToCollaboration, GoClassifierToStateMachine, GoClassifierToStructuralFeature, GoClassToAssociatedClass, GoClassToNavigableClass, GoClassToSummary, GoCollaborationDiagram, GoCollaborationInteraction, GoCompositeStateToSubvertex, GoDiagramToEdge, GoDiagramToNode, GoElementToMachine, GoFilteredChildren, GoGenElementToDerived, GoInteractionMessage, GoInteractionMessages, GoLinkStimuli, GoMachineDiagram, GoMachineToState, GoMachineToTrans, GoMessageAction, GoModelElementToComment, GoModelToBaseElements, GoModelToClass, GoModelToCollaboration, GoModelToElements, GoNamespaceToDiagram, GoOperationToCollaboration, GoOperationToCollaborationDiagram, GoProjectToCollaboration, GoProjectToDiagram, GoProjectToModel, GoProjectToStateMachine, GoSignalToReception, GoStateMachineToTransition, GoStateToDoActivity, GoStateToDownstream, GoStateToEntry, GoStateToExit, GoStateToIncomingTrans, GoStateToInternalTrans, GoStateToOutgoingTrans, GoStimulusToAction, GoSummaryToAssociation, GoSummaryToAttribute, GoSummaryToIncomingDependency, GoSummaryToInheritance, GoSummaryToOperation, GoSummaryToOutgoingDependency, GoTransitionToSource, GoTransitionToTarget, GoUseCaseToExtensionPoint

public abstract class AbstractGoRule
extends java.lang.Object
implements javax.swing.tree.TreeModel

Abstract class to be used as a convenience class for implementing 'go rules'. Go rules are rules to which the navperspectives comply if they are registred with the navperspectives. This usually happens in the static block of NavPerspective. If some modelelement is not showing up in a navperspective, in most cases this means that there is no go rule defined or an incorrect one. Via the abstract method getChildren the children of some tree element in a perspective are returned. Only the returned children are shown for some tree element.


Constructor Summary
AbstractGoRule()
           
 
Method Summary
 void addTreeModelListener(javax.swing.event.TreeModelListener treeModelListener)
           
 java.lang.Object getChild(java.lang.Object parent, int index)
           
 int getChildCount(java.lang.Object parent)
           
abstract  java.util.Collection getChildren(java.lang.Object parent)
          this is the method that should be overridden by GoRules
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
           
 java.lang.Object getRoot()
           
abstract  java.lang.String getRuleName()
          return the name of the rule as it is displayed in the nav perspective edit pane.
 boolean isLeaf(java.lang.Object node)
           
 void removeTreeModelListener(javax.swing.event.TreeModelListener treeModelListener)
           
 java.lang.String toString()
          wrapper around getRuleName()
 void valueForPathChanged(javax.swing.tree.TreePath treePath, java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractGoRule

public AbstractGoRule()
Method Detail

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Specified by:
getChild in interface javax.swing.tree.TreeModel
See Also:
TreeModel.getChild(Object, int)

getChildCount

public int getChildCount(java.lang.Object parent)
Specified by:
getChildCount in interface javax.swing.tree.TreeModel
See Also:
TreeModel.getChildCount(Object)

isLeaf

public final boolean isLeaf(java.lang.Object node)
Specified by:
isLeaf in interface javax.swing.tree.TreeModel
See Also:
TreeModel.isLeaf(Object)

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object child)
Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel
See Also:
TreeModel.getIndexOfChild(Object, Object)

getChildren

public abstract java.util.Collection getChildren(java.lang.Object parent)
this is the method that should be overridden by GoRules


getRuleName

public abstract java.lang.String getRuleName()
return the name of the rule as it is displayed in the nav perspective edit pane. Returns for example "State->Substates".

See Also:
toString()

toString

public java.lang.String toString()
wrapper around getRuleName()

Overrides:
toString in class java.lang.Object

addTreeModelListener

public void addTreeModelListener(javax.swing.event.TreeModelListener treeModelListener)
Specified by:
addTreeModelListener in interface javax.swing.tree.TreeModel

getRoot

public java.lang.Object getRoot()
Specified by:
getRoot in interface javax.swing.tree.TreeModel

removeTreeModelListener

public void removeTreeModelListener(javax.swing.event.TreeModelListener treeModelListener)
Specified by:
removeTreeModelListener in interface javax.swing.tree.TreeModel

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath treePath,
                                java.lang.Object obj)
Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel


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