org.argouml.model
Class AbstractActivityGraphsHelperDecorator

java.lang.Object
  extended byorg.argouml.model.AbstractActivityGraphsHelperDecorator
All Implemented Interfaces:
ActivityGraphsHelper
Direct Known Subclasses:
UndoActivityGraphsHelperDecorator

public abstract class AbstractActivityGraphsHelperDecorator
extends Object
implements ActivityGraphsHelper

The abstract Decorator for the ActivityGraphsHelper.


Method Summary
 void addInState(Object classifierInState, Object state)
           
 Object findClassifierByName(Object ofs, String s)
          Finds the Classifier to which a given ObjectFlowState refers by its given name.
 Object findStateByName(Object c, String s)
          Find a state of a Classifier by its name.
protected  ActivityGraphsHelper getComponent()
          The component we are decorating.
 boolean isAddingActivityGraphAllowed(Object context)
          Returns true if an activitygraph may be added to the given context.
 void setInStates(Object classifierInState, Collection newStates)
          Replace the complete collection of states by the given new one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getComponent

protected ActivityGraphsHelper getComponent()
The component we are decorating.

Returns:
Returns the component.

findClassifierByName

public Object findClassifierByName(Object ofs,
                                   String s)
Description copied from interface: ActivityGraphsHelper
Finds the Classifier to which a given ObjectFlowState refers by its given name. This function may be used for when the user types the name of a classifier in the diagram, in an ObjectFlowState.

Specified by:
findClassifierByName in interface ActivityGraphsHelper
Parameters:
ofs - the given ObjectFlowState
s - the given String that represents the name of the "type" Classifier
Returns:
the found classifier or null
See Also:
ActivityGraphsHelper.findClassifierByName(java.lang.Object, java.lang.String)

findStateByName

public Object findStateByName(Object c,
                              String s)
Description copied from interface: ActivityGraphsHelper
Find a state of a Classifier by its name. This routine is used to make the connection between a ClassifierInState and its State.

Specified by:
findStateByName in interface ActivityGraphsHelper
Parameters:
c - the Classifier. If this is not a Classifier, then IllegalArgumentException is thrown.
s - the string that represents the name of the state we are looking for. If "" or null, then null is returned straight away.
Returns:
the State (as Object) or null, if not found.
See Also:
ActivityGraphsHelper.findStateByName(java.lang.Object, java.lang.String)

isAddingActivityGraphAllowed

public boolean isAddingActivityGraphAllowed(Object context)
Description copied from interface: ActivityGraphsHelper
Returns true if an activitygraph may be added to the given context. To decouple ArgoUML as much as possible from the model implementation, the parameter of the method is of type Object.

An ActivityGraph specifies the dynamics of

  1. a Package, or
  2. a Classifier (including UseCase), or
  3. a BehavioralFeature.

Specified by:
isAddingActivityGraphAllowed in interface ActivityGraphsHelper
Parameters:
context - the given context
Returns:
boolean true if an activitygraph may be added
See Also:
ActivityGraphsHelper.isAddingActivityGraphAllowed(java.lang.Object)

addInState

public void addInState(Object classifierInState,
                       Object state)
Specified by:
addInState in interface ActivityGraphsHelper
Parameters:
classifierInState - the classifierInState
state - the state that will be linked
See Also:
ActivityGraphsHelper.addInState(java.lang.Object, java.lang.Object)

setInStates

public void setInStates(Object classifierInState,
                        Collection newStates)
Description copied from interface: ActivityGraphsHelper
Replace the complete collection of states by the given new one. This function only modifies the model for added or removed states.

Specified by:
setInStates in interface ActivityGraphsHelper
Parameters:
classifierInState - the ClassifierInState to be altered
newStates - the collection of states
See Also:
ActivityGraphsHelper.setInStates(java.lang.Object, java.util.Collection)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook