org.argouml.model.uml
Class UseCasesFactoryImpl

java.lang.Object
  extended byorg.argouml.model.uml.AbstractUmlModelFactory
      extended byorg.argouml.model.uml.UseCasesFactoryImpl
All Implemented Interfaces:
org.argouml.model.UseCasesFactory

public class UseCasesFactoryImpl
extends AbstractUmlModelFactory
implements org.argouml.model.UseCasesFactory

Factory to create UML classes for the UML BehaviorialElements::UseCases package. TODO: Change visibility to package after reflection problem solved.

Since:
ARGO0.11.2

Field Summary
private  NSUMLModelImplementation nsmodel
          The model implementation.
 
Constructor Summary
(package private) UseCasesFactoryImpl(NSUMLModelImplementation implementation)
          Don't allow instantiation.
 
Method Summary
private  ru.novosoft.uml.behavior.use_cases.MActor buildActor(ru.novosoft.uml.foundation.core.MNamespace ns, Object model)
          Builds an actor in the given namespace.
 Object buildActor(Object actor, Object model)
          Builds an actor in the same namespace of the given actor.
 Object buildExtend(Object abase, Object anextension)
          Build an extend relationship.
 Object buildExtend(Object abase, Object anextension, Object apoint)
          Build an extend relationship.
 Object buildExtensionPoint(Object modelElement)
          Builds an extension point for a use case.
 Object buildInclude(Object abase, Object anaddition)
          Build an include relationship.
 Object createActor()
          Create an empty but initialized instance of a Actor.
 Object createExtend()
          Create an empty but initialized instance of a Extend.
 Object createExtensionPoint()
          Create an empty but initialized instance of a ExtensionPoint.
 Object createInclude()
          Create an empty but initialized instance of a Include.
 Object createUseCase()
          Create an empty but initialized instance of a UseCase.
 Object createUseCaseInstance()
          Create an empty but initialized instance of a UseCaseInstance.
(package private)  void deleteActor(Object elem)
           
(package private)  void deleteExtend(Object elem)
           
(package private)  void deleteExtensionPoint(Object elem)
           
(package private)  void deleteInclude(Object elem)
           
(package private)  void deleteUseCase(Object elem)
           
(package private)  void deleteUseCaseInstance(Object elem)
           
 
Methods inherited from class org.argouml.model.uml.AbstractUmlModelFactory
addListenersToModelElement, initialize
 
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

UseCasesFactoryImpl

UseCasesFactoryImpl(NSUMLModelImplementation implementation)
Don't allow instantiation.

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

createExtend

public Object createExtend()
Create an empty but initialized instance of a Extend.

Specified by:
createExtend in interface org.argouml.model.UseCasesFactory
Returns:
an initialized Extend instance.

createExtensionPoint

public Object createExtensionPoint()
Create an empty but initialized instance of a ExtensionPoint.

Specified by:
createExtensionPoint in interface org.argouml.model.UseCasesFactory
Returns:
an initialized ExtensionPoint instance.

createActor

public Object createActor()
Create an empty but initialized instance of a Actor.

Specified by:
createActor in interface org.argouml.model.UseCasesFactory
Returns:
an initialized Actor instance.

createInclude

public Object createInclude()
Create an empty but initialized instance of a Include.

Specified by:
createInclude in interface org.argouml.model.UseCasesFactory
Returns:
an initialized Include instance.

createUseCase

public Object createUseCase()
Create an empty but initialized instance of a UseCase.

Specified by:
createUseCase in interface org.argouml.model.UseCasesFactory
Returns:
an initialized UseCase instance.

createUseCaseInstance

public Object createUseCaseInstance()
Create an empty but initialized instance of a UseCaseInstance.

Specified by:
createUseCaseInstance in interface org.argouml.model.UseCasesFactory
Returns:
an initialized UseCaseInstance instance.

buildExtend

public Object buildExtend(Object abase,
                          Object anextension)
Build an extend relationship.

Set the namespace to the base (preferred) or else extension's namespace. We don't do any checking on base and extension. They should be different, but that is someone else's problem.

Specified by:
buildExtend in interface org.argouml.model.UseCasesFactory
Parameters:
abase - The base use case for the relationship
anextension - The extension use case for the relationship
Returns:
The new extend relationship or null if it can't be created.

buildExtend

public Object buildExtend(Object abase,
                          Object anextension,
                          Object apoint)
Build an extend relationship.

Specified by:
buildExtend in interface org.argouml.model.UseCasesFactory
Parameters:
abase - The base use case for the relationship
anextension - The extension use case for the relationship
apoint - The insertion point for the extension
Returns:
The new extend relationship or null if it can't be created.

buildExtensionPoint

public Object buildExtensionPoint(Object modelElement)
Builds an extension point for a use case.

Specified by:
buildExtensionPoint in interface org.argouml.model.UseCasesFactory
Parameters:
modelElement - The owning use case for the extension point.
Returns:
The new extension point.
Throws:
IllegalArgumentException - if modelElement isn't a use-case.

buildInclude

public Object buildInclude(Object abase,
                           Object anaddition)
Build an include relationship.

Set the namespace to the base (preferred) or else extension's namespace. We don't do any checking on base and extension. They should be different, but that is someone else's problem.

Note. There is a bug in NSUML that gets the base and addition associations back to front. We reverse the use of their accessors in the code to correct this.

Specified by:
buildInclude in interface org.argouml.model.UseCasesFactory
Parameters:
abase - The base use case for the relationship
anaddition - The extension use case for the relationship
Returns:
The new include relationship or null if it can't be created.

buildActor

private ru.novosoft.uml.behavior.use_cases.MActor buildActor(ru.novosoft.uml.foundation.core.MNamespace ns,
                                                             Object model)
Builds an actor in the given namespace.

Parameters:
ns - the given namespace
model - TODO: What is this? Why is this argument needed?
Returns:
The newly build Actor.

buildActor

public Object buildActor(Object actor,
                         Object model)
Builds an actor in the same namespace of the given actor. If object is no actor nothing is built. Did not give MActor as an argument but object to seperate argouml better from NSUML.

Specified by:
buildActor in interface org.argouml.model.UseCasesFactory
Parameters:
model - The current model.
actor - the given Actor
Returns:
The newly build Actor
See Also:
UseCasesFactory.buildActor(java.lang.Object, java.lang.Object)

deleteActor

void deleteActor(Object elem)
Parameters:
elem - the UML element to be deleted

deleteExtend

void deleteExtend(Object elem)
Parameters:
elem - the UML element to be deleted

deleteExtensionPoint

void deleteExtensionPoint(Object elem)
Parameters:
elem - the UML element to be deleted

deleteInclude

void deleteInclude(Object elem)
Parameters:
elem - the UML element to be deleted

deleteUseCase

void deleteUseCase(Object elem)
Parameters:
elem - the UML element to be deleted

deleteUseCaseInstance

void deleteUseCaseInstance(Object elem)
Parameters:
elem - the UML element to be deleted


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