org.argouml.model.uml
Class ActivityGraphsHelperImpl

java.lang.Object
  extended byorg.argouml.model.uml.ActivityGraphsHelperImpl
All Implemented Interfaces:
org.argouml.model.ActivityGraphsHelper

class ActivityGraphsHelperImpl
extends Object
implements org.argouml.model.ActivityGraphsHelper

Helper class for UML BehavioralElements::ActivityGraphs Package. Current implementation is a placeholder.

Since:
ARGO0.11.2

Field Summary
private  NSUMLModelImplementation nsmodel
          The model implementation.
 
Constructor Summary
(package private) ActivityGraphsHelperImpl(NSUMLModelImplementation implementation)
          Don't allow instantiation.
 
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.
 boolean isAddingActivityGraphAllowed(Object context)
          Returns true if an activitygraph may be added to the given context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nsmodel

private NSUMLModelImplementation nsmodel
The model implementation.

Constructor Detail

ActivityGraphsHelperImpl

ActivityGraphsHelperImpl(NSUMLModelImplementation implementation)
Don't allow instantiation.

Parameters:
implementation - To get other helpers and factories.
Method Detail

findClassifierByName

public Object findClassifierByName(Object ofs,
                                   String s)
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 org.argouml.model.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 Object findStateByName(Object c,
                              String s)
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 org.argouml.model.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(Object context)
Returns true if an activitygraph may be added to the given context. To decouple ArgoUML as much as possible from the NSUML model, 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 org.argouml.model.ActivityGraphsHelper
Parameters:
context - the given context
Returns:
boolean true if an activitygraph may be added

addInState

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


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook