org.argouml.model.uml
Class UmlHelperImpl

java.lang.Object
  extended byorg.argouml.model.uml.UmlHelperImpl
All Implemented Interfaces:
org.argouml.model.UmlHelper

class UmlHelperImpl
extends Object
implements org.argouml.model.UmlHelper

Helper class for UML metamodel.

Since:
ARGO0.11.2

Field Summary
private static Logger LOG
          Logger.
private  NSUMLModelImplementation nsmodel
          The model implementation.
 
Constructor Summary
(package private) UmlHelperImpl(NSUMLModelImplementation implementation)
          Don't allow instantiation.
 
Method Summary
protected  void addListenersToMBase(Object mbase)
          Internal recursive worker to add UmlModelListener.
 void addListenersToModel(Object model)
          Ensures that all of the elements in a model are registered to the UmlModelListener.
 void deleteCollection(Collection col)
          Utility method to quickly delete a collection of modelelements.
 org.argouml.model.ActivityGraphsHelper getActivityGraphs()
          Returns the package helper for the UML package BehavioralElements::ActivityGraphs.
 org.argouml.model.CollaborationsHelper getCollaborations()
          Returns the package helper for the UML package BehavioralElements::Collaborations.
 org.argouml.model.CommonBehaviorHelper getCommonBehavior()
          Returns the package helper for the UML package BehavioralElements::CommonBehavior.
 org.argouml.model.CoreHelper getCore()
          Returns the package helper for the UML package Foundation::Core.
 org.argouml.model.DataTypesHelper getDataTypes()
          Returns the package helper for the UML package Foundation::DataTypes.
 Object getDestination(Object relationShip)
          Returns the destination of some relationship.
 org.argouml.model.ExtensionMechanismsHelper getExtensionMechanisms()
          Returns the package helper for the UML package Foundation::ExtensionMechanisms.
 Object getHelper(Object base)
          Returns the correct helper on basis of the package of base.
 org.argouml.model.ModelManagementHelper getModelManagement()
          Returns the package helper for the UML package ModelManagement.
 Object getOwner(Object handle)
          Returns the owner of some modelelement object.
 Object getSource(Object relationShip)
          Returns the source of some relationship.
 org.argouml.model.StateMachinesHelper getStateMachines()
          Returns the package helper for the UML package BehavioralElements::StateMachines.
 org.argouml.model.UseCasesHelper getUseCases()
          Returns the package helper for the UML package BehavioralElements::UseCases.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Logger.


nsmodel

private NSUMLModelImplementation nsmodel
The model implementation.

Constructor Detail

UmlHelperImpl

UmlHelperImpl(NSUMLModelImplementation implementation)
Don't allow instantiation.

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

addListenersToModel

public void addListenersToModel(Object model)
Ensures that all of the elements in a model are registered to the UmlModelListener. This is useful when the MModel is not created by the UmlFactory.

Specified by:
addListenersToModel in interface org.argouml.model.UmlHelper
Parameters:
model - the UML model

addListenersToMBase

protected void addListenersToMBase(Object mbase)
Internal recursive worker to add UmlModelListener.

Parameters:
mbase - the element to add listeners to

getExtensionMechanisms

public org.argouml.model.ExtensionMechanismsHelper getExtensionMechanisms()
Returns the package helper for the UML package Foundation::ExtensionMechanisms.

Specified by:
getExtensionMechanisms in interface org.argouml.model.UmlHelper
Returns:
the ExtensionMechanisms helper instance.

getDataTypes

public org.argouml.model.DataTypesHelper getDataTypes()
Returns the package helper for the UML package Foundation::DataTypes.

Specified by:
getDataTypes in interface org.argouml.model.UmlHelper
Returns:
the DataTypes helper instance.

getCore

public org.argouml.model.CoreHelper getCore()
Returns the package helper for the UML package Foundation::Core.

Specified by:
getCore in interface org.argouml.model.UmlHelper
Returns:
the Core helper instance.

getCommonBehavior

public org.argouml.model.CommonBehaviorHelper getCommonBehavior()
Returns the package helper for the UML package BehavioralElements::CommonBehavior.

Specified by:
getCommonBehavior in interface org.argouml.model.UmlHelper
Returns:
the CommonBehavior helper instance.

getUseCases

public org.argouml.model.UseCasesHelper getUseCases()
Returns the package helper for the UML package BehavioralElements::UseCases.

Specified by:
getUseCases in interface org.argouml.model.UmlHelper
Returns:
the UseCases helper instance.

getStateMachines

public org.argouml.model.StateMachinesHelper getStateMachines()
Returns the package helper for the UML package BehavioralElements::StateMachines.

Specified by:
getStateMachines in interface org.argouml.model.UmlHelper
Returns:
the StateMachines helper instance.

getCollaborations

public org.argouml.model.CollaborationsHelper getCollaborations()
Returns the package helper for the UML package BehavioralElements::Collaborations.

Specified by:
getCollaborations in interface org.argouml.model.UmlHelper
Returns:
the Collaborations helper instance.

getActivityGraphs

public org.argouml.model.ActivityGraphsHelper getActivityGraphs()
Returns the package helper for the UML package BehavioralElements::ActivityGraphs.

Specified by:
getActivityGraphs in interface org.argouml.model.UmlHelper
Returns:
the ActivityGraphs helper instance.

getModelManagement

public org.argouml.model.ModelManagementHelper getModelManagement()
Returns the package helper for the UML package ModelManagement.

Specified by:
getModelManagement in interface org.argouml.model.UmlHelper
Returns:
the ModelManagement helper instance.

getHelper

public Object getHelper(Object base)
Returns the correct helper on basis of the package of base.

Specified by:
getHelper in interface org.argouml.model.UmlHelper
Parameters:
base - the modelelement
Returns:
Object the helper

getOwner

public Object getOwner(Object handle)
Returns the owner of some modelelement object. In most cases this will be the owning namespace but in some cases it will be null (the root model) or for instance the owning class with an attribute.

Specified by:
getOwner in interface org.argouml.model.UmlHelper
Parameters:
handle - the modelelement
Returns:
Object the owner

deleteCollection

public void deleteCollection(Collection col)
Utility method to quickly delete a collection of modelelements. This method should only be called from within the model component. The only reason it is public is that the other helpers/factories are in other packages and therefore cannot see this method if it is not public.

Specified by:
deleteCollection in interface org.argouml.model.UmlHelper
Parameters:
col - a collection of modelelements

getSource

public Object getSource(Object relationShip)
Returns the source of some relationship. This is the element in binary relations from which a relation 'departs'.

Specified by:
getSource in interface org.argouml.model.UmlHelper
Parameters:
relationShip - the relationship to be tested
Returns:
the source of the relationship

getDestination

public Object getDestination(Object relationShip)
Returns the destination of some relationship. This is the element in binary relations at which a relation 'arrives'.

Specified by:
getDestination in interface org.argouml.model.UmlHelper
Parameters:
relationShip - the relationship to be tested
Returns:
the destination of the relationship


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