org.argouml.model
Class AbstractActivityGraphsHelperDecorator

java.lang.Object
  extended by org.argouml.model.AbstractActivityGraphsHelperDecorator
All Implemented Interfaces:
ActivityGraphsHelper

public abstract class AbstractActivityGraphsHelperDecorator
extends java.lang.Object
implements ActivityGraphsHelper

The abstract Decorator for the ActivityGraphsHelper.


Constructor Summary
protected AbstractActivityGraphsHelperDecorator(ActivityGraphsHelper component)
           
 
Method Summary
 void addContent(java.lang.Object partition, java.lang.Object modelElement)
          Add a model element to a partition
 void addInState(java.lang.Object classifierInState, java.lang.Object state)
           
 void addParameter(java.lang.Object objectFlowState, java.lang.Object parameter)
          Add a Parameter to an ObjectFlowState.
 java.lang.Object findClassifierByName(java.lang.Object ofs, java.lang.String s)
          Finds the Classifier to which a given ObjectFlowState refers by its given name.
 java.lang.Object findStateByName(java.lang.Object c, java.lang.String s)
          Find a state of a Classifier by its name.
protected  ActivityGraphsHelper getComponent()
          The component we are decorating.
 boolean isAddingActivityGraphAllowed(java.lang.Object context)
          Returns true if an activitygraph may be added to the given context.
 void removeContent(java.lang.Object partition, java.lang.Object modelElement)
          Remove a model element from a partition
 void removeParameter(java.lang.Object objectFlowState, java.lang.Object parameter)
          Remove Parameter from an ObjectFlowState.
 void setContents(java.lang.Object partition, java.util.Collection newContents)
          Replace the complete collection of the partition contents by the given new one.
 void setInStates(java.lang.Object classifierInState, java.util.Collection newStates)
          Replace the complete collection of states by the given new one.
 void setParameters(java.lang.Object objectFlowState, java.util.Collection parameters)
           
 void setSynch(java.lang.Object objectFlowState, boolean isSynch)
          Set the isSynch attribute of an ObjectFlowState.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractActivityGraphsHelperDecorator

protected AbstractActivityGraphsHelperDecorator(ActivityGraphsHelper component)
Parameters:
component - The component to decorate.
Method Detail

getComponent

protected ActivityGraphsHelper getComponent()
The component we are decorating.

Returns:
Returns the component.

findClassifierByName

public java.lang.Object findClassifierByName(java.lang.Object ofs,
                                             java.lang.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

findStateByName

public java.lang.Object findStateByName(java.lang.Object c,
                                        java.lang.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.

isAddingActivityGraphAllowed

public boolean isAddingActivityGraphAllowed(java.lang.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

addInState

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

setInStates

public void setInStates(java.lang.Object classifierInState,
                        java.util.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

setContents

public void setContents(java.lang.Object partition,
                        java.util.Collection newContents)
Description copied from interface: ActivityGraphsHelper
Replace the complete collection of the partition contents by the given new one. This function only modifies the model for added or removed modelelements.

Specified by:
setContents in interface ActivityGraphsHelper
Parameters:
partition - the partition to be altered
newContents - the new contents of the partition (modelelements)

addContent

public void addContent(java.lang.Object partition,
                       java.lang.Object modelElement)
Description copied from interface: ActivityGraphsHelper
Add a model element to a partition

Specified by:
addContent in interface ActivityGraphsHelper
Parameters:
partition - the partition to contain the model element
modelElement - the model element to place in the partition

removeContent

public void removeContent(java.lang.Object partition,
                          java.lang.Object modelElement)
Description copied from interface: ActivityGraphsHelper
Remove a model element from a partition

Specified by:
removeContent in interface ActivityGraphsHelper
Parameters:
partition - the partition currently containing the model element
modelElement - the model element to be removed from the partition

setSynch

public void setSynch(java.lang.Object objectFlowState,
                     boolean isSynch)
Description copied from interface: ActivityGraphsHelper
Set the isSynch attribute of an ObjectFlowState.

Specified by:
setSynch in interface ActivityGraphsHelper
Parameters:
objectFlowState - the element for which to set the attribute
isSynch - true if this ObjectFlowState is a synch state.

addParameter

public void addParameter(java.lang.Object objectFlowState,
                         java.lang.Object parameter)
Description copied from interface: ActivityGraphsHelper
Add a Parameter to an ObjectFlowState.

Specified by:
addParameter in interface ActivityGraphsHelper
Parameters:
objectFlowState - the ObjectFlowState
parameter - the Parameter

removeParameter

public void removeParameter(java.lang.Object objectFlowState,
                            java.lang.Object parameter)
Description copied from interface: ActivityGraphsHelper
Remove Parameter from an ObjectFlowState.

Specified by:
removeParameter in interface ActivityGraphsHelper
Parameters:
objectFlowState - the ObjectFlowState
parameter - the Parameter to remove

setParameters

public void setParameters(java.lang.Object objectFlowState,
                          java.util.Collection parameters)
Specified by:
setParameters in interface ActivityGraphsHelper
Parameters:
objectFlowState - the ObjectFlowState.
parameters - the collection of Parameters. Pass Collections.EMPTY_SET if there are no Parameters.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook