|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.model.uml.AbstractUmlModelFactory
org.argouml.model.uml.UmlFactoryImpl
Root factory for UML model element instance creation.
Nested Class Summary | |
(package private) class |
UmlFactoryImpl.ObjectCreateInfo
|
Field Summary | |
private NSUMLModelImplementation |
nsmodel
The model implementation. |
private static Object[][] |
VALID_CONNECTIONS
An array of valid connections, the combination of connecting class and node classes must exist as a row in this list to be considered valid. |
private Map |
validConnectionMap
A map of valid connections keyed by the connection type. |
Constructor Summary | |
(package private) |
UmlFactoryImpl(NSUMLModelImplementation implementation)
Don't allow external instantiation. |
Method Summary | |
Object |
buildConnection(Object elementType,
Object fromElement,
Object fromStyle,
Object toElement,
Object toStyle,
Object unidirectional,
Object namespace)
Creates a UML model element of the given type and uses this to connect two other existing UML model elements. |
Object |
buildNode(Object elementType)
Creates a UML model element of the given type. |
private void |
buildValidConnectionMap()
|
Object |
createActionExpression()
Create an empty but initialized instance of a UML ActionExpression. |
void |
delete(Object elem)
Deletes a modelelement. |
private void |
deleteAction(Object elem)
Factored this method out of delete to simplify the design of the delete operation. |
private void |
deleteFeature(ru.novosoft.uml.foundation.core.MFeature elem)
Factored this method out of delete to simplify the design of the delete operation. |
private void |
deleteInstance(ru.novosoft.uml.behavior.common_behavior.MInstance elem)
Factored this method out of delete to simplify the design of the delete operation. |
private void |
deleteNamespace(ru.novosoft.uml.foundation.core.MNamespace elem)
Factored this method out of delete to simplify the design of the delete operation. |
private void |
deleteRelationship(ru.novosoft.uml.foundation.core.MRelationship elem)
Factored this method out of delete to simplify the design of the delete operation. |
private void |
deleteStateVertex(ru.novosoft.uml.behavior.state_machines.MStateVertex elem)
Factored this method out of delete to simplify the design of the delete operation. |
private ActivityGraphsFactoryImpl |
getActivityGraphs()
Returns the package factory for the UML package BehavioralElements::ActivityGraphs. |
CollaborationsFactoryImpl |
getCollaborations()
Returns the package factory for the UML package BehavioralElements::Collaborations. |
CommonBehaviorFactoryImpl |
getCommonBehavior()
Returns the package factory for the UML package BehavioralElements::CommonBehavior. |
CoreFactoryImpl |
getCore()
Returns the package factory for the UML package Foundation::Core. |
private ExtensionMechanismsFactoryImpl |
getExtensionMechanisms()
Returns the package factory for the UML package Foundation::ExtensionMechanisms. |
ModelManagementFactoryImpl |
getModelManagement()
Returns the package factory for the UML package ModelManagement. |
StateMachinesFactoryImpl |
getStateMachines()
Returns the package factory for the UML package BehavioralElements::StateMachines. |
UseCasesFactoryImpl |
getUseCases()
Returns the package factory for the UML package BehavioralElements::UseCases. |
boolean |
isConnectionValid(Object connectionType,
Object fromElement,
Object toElement)
Checks if some type of UML model element is valid to connect two other existing UML model elements. |
boolean |
isRemoved(Object o)
The Project may check if a certain MBase has been removed. |
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 |
Methods inherited from interface org.argouml.model.UmlFactory |
addListenersToModelElement |
Field Detail |
private NSUMLModelImplementation nsmodel
private Map validConnectionMap
private static final Object[][] VALID_CONNECTIONS
Constructor Detail |
UmlFactoryImpl(NSUMLModelImplementation implementation)
implementation
- To get other helpers and factories.Method Detail |
private void buildValidConnectionMap()
public Object buildConnection(Object elementType, Object fromElement, Object fromStyle, Object toElement, Object toStyle, Object unidirectional, Object namespace) throws org.argouml.model.IllegalModelElementConnectionException
buildConnection
in interface org.argouml.model.UmlFactory
elementType
- the UML object type of the connectionfromElement
- the UML object for the "from" elementfromStyle
- the aggregationkind for the connection
in case of an associationtoElement
- the UML object for the "to" elementtoStyle
- the aggregationkind for the connection
in case of an associationunidirectional
- for association and associationrolenamespace
- the namespace to use if it can't be determined
org.argouml.model.IllegalModelElementConnectionException
- if the connection is not
a valid thing to dopublic Object buildNode(Object elementType)
The parameter "elementType" stands for the type of model element to build.
buildNode
in interface org.argouml.model.UmlFactory
UmlFactory.buildNode(java.lang.Object)
public boolean isConnectionValid(Object connectionType, Object fromElement, Object toElement)
isConnectionValid
in interface org.argouml.model.UmlFactory
connectionType
- the UML object type of the connectionfromElement
- the UML object type of the "from"toElement
- the UML object type of the "to"
private ExtensionMechanismsFactoryImpl getExtensionMechanisms()
public CoreFactoryImpl getCore()
public CommonBehaviorFactoryImpl getCommonBehavior()
public UseCasesFactoryImpl getUseCases()
public StateMachinesFactoryImpl getStateMachines()
public CollaborationsFactoryImpl getCollaborations()
private ActivityGraphsFactoryImpl getActivityGraphs()
public ModelManagementFactoryImpl getModelManagement()
public void delete(Object elem)
The actual deletion is delegated to delete methods in the rest of the factories. For example: a method deleteClass exists on CoreHelper. Delete methods as deleteClass should only do those extra actions that are necessary for the deletion of the modelelement itself. I.e. deleteClass should only take care of things specific to MClass.
The delete methods in the UML Factories should not be called directly throughout the code! Calls should allways refer to this method and never call the deleteXXX method on XXXFactory directly. The reason that it is possible to call the deleteXXX methods directly is a pure implementation detail.
The implementation of this method uses a quite complicate if then else tree. This is done to provide optimal performance and full compliance to the UML 1.3 nsmodel. The last remark refers to the fact that the UML 1.3 model knows multiple inheritance in several places. This has to be taken into account.
Extensions and its children are not taken into account here. They do not require extra cleanup actions. Not in the form of a call to the remove method as is normal for all children of MBase and not in the form of other behaviour we want to implement via this operation.
delete
in interface org.argouml.model.UmlFactory
elem
- The element to be deletedpublic boolean isRemoved(Object o)
isRemoved
in interface org.argouml.model.UmlFactory
o
- the object to be checked
private void deleteFeature(ru.novosoft.uml.foundation.core.MFeature elem)
elem
- private void deleteNamespace(ru.novosoft.uml.foundation.core.MNamespace elem)
elem
- private void deleteRelationship(ru.novosoft.uml.foundation.core.MRelationship elem)
elem
- private void deleteAction(Object elem)
elem
- private void deleteInstance(ru.novosoft.uml.behavior.common_behavior.MInstance elem)
elem
- private void deleteStateVertex(ru.novosoft.uml.behavior.state_machines.MStateVertex elem)
elem
- public Object createActionExpression()
createActionExpression
in interface org.argouml.model.UmlFactory
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |