org.argouml.model.uml
Class UmlFactory

java.lang.Object
  |
  +--org.argouml.model.uml.AbstractUmlModelFactory
        |
        +--org.argouml.model.uml.UmlFactory

public class UmlFactory
extends AbstractUmlModelFactory

Root factory for UML model element instance creation.

Since:
ARGO0.11.2

Method Summary
 java.lang.Object buildConnection(java.lang.Object connectionType, java.lang.Object fromElement, java.lang.Object toElement)
          Create a new connection model element (a relationship or link) between any existing node model elements.
 java.lang.Object buildConnection(java.lang.Object connectionType, java.lang.Object fromElement, java.lang.Object fromStyle, java.lang.Object toElement, java.lang.Object toStyle, java.lang.Object unidirectional)
           
 void delete(java.lang.Object elem)
          Deletes a modelelement.
 void doCopyBase(MBase source, MBase target)
          Used by the copy functions.
 ActivityGraphsFactory getActivityGraphs()
          Returns the package factory for the UML package BehavioralElements::ActivityGraphs.
 CollaborationsFactory getCollaborations()
          Returns the package factory for the UML package BehavioralElements::Collaborations.
 CommonBehaviorFactory getCommonBehavior()
          Returns the package factory for the UML package BehavioralElements::CommonBehavior.
 CoreFactory getCore()
          Returns the package factory for the UML package Foundation::Core.
 DataTypesFactory getDataTypes()
          Returns the package factory for the UML package Foundation::DataTypes.
 ExtensionMechanismsFactory getExtensionMechanisms()
          Returns the package factory for the UML package Foundation::ExtensionMechanisms.
static UmlFactory getFactory()
          Singleton instance access method.
 ModelManagementFactory getModelManagement()
          Returns the package factory for the UML package ModelManagement.
 StateMachinesFactory getStateMachines()
          Returns the package factory for the UML package BehavioralElements::StateMachines.
 UseCasesFactory getUseCases()
          Returns the package factory for the UML package BehavioralElements::UseCases.
 boolean isConnectionValid(java.lang.Object connectionType, java.lang.Object fromElement, java.lang.Object toElement)
           
 
Methods inherited from class org.argouml.model.uml.AbstractUmlModelFactory
addListenersToModelElement, initialize, isGuiEnabled, setGuiEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFactory

public static UmlFactory getFactory()
Singleton instance access method.


buildConnection

public java.lang.Object buildConnection(java.lang.Object connectionType,
                                        java.lang.Object fromElement,
                                        java.lang.Object toElement)
                                 throws IllegalModelElementConnectionException
Create a new connection model element (a relationship or link) between any existing node model elements.

IllegalModelElementConnectionException

buildConnection

public java.lang.Object buildConnection(java.lang.Object connectionType,
                                        java.lang.Object fromElement,
                                        java.lang.Object fromStyle,
                                        java.lang.Object toElement,
                                        java.lang.Object toStyle,
                                        java.lang.Object unidirectional)
                                 throws IllegalModelElementConnectionException
IllegalModelElementConnectionException

isConnectionValid

public boolean isConnectionValid(java.lang.Object connectionType,
                                 java.lang.Object fromElement,
                                 java.lang.Object toElement)

getExtensionMechanisms

public ExtensionMechanismsFactory getExtensionMechanisms()
Returns the package factory for the UML package Foundation::ExtensionMechanisms.

Returns:
the ExtensionMechanisms factory instance.

getDataTypes

public DataTypesFactory getDataTypes()
Returns the package factory for the UML package Foundation::DataTypes.

Returns:
the DataTypes factory instance.

getCore

public CoreFactory getCore()
Returns the package factory for the UML package Foundation::Core.

Returns:
the Core factory instance.

getCommonBehavior

public CommonBehaviorFactory getCommonBehavior()
Returns the package factory for the UML package BehavioralElements::CommonBehavior.

Returns:
the CommonBehavior factory instance.

getUseCases

public UseCasesFactory getUseCases()
Returns the package factory for the UML package BehavioralElements::UseCases.

Returns:
the UseCases factory instance.

getStateMachines

public StateMachinesFactory getStateMachines()
Returns the package factory for the UML package BehavioralElements::StateMachines.

Returns:
the StateMachines factory instance.

getCollaborations

public CollaborationsFactory getCollaborations()
Returns the package factory for the UML package BehavioralElements::Collaborations.

Returns:
the Collaborations factory instance.

getActivityGraphs

public ActivityGraphsFactory getActivityGraphs()
Returns the package factory for the UML package BehavioralElements::ActivityGraphs.

Returns:
the ActivityGraphs factory instance.

getModelManagement

public ModelManagementFactory getModelManagement()
Returns the package factory for the UML package ModelManagement.

Returns:
the ModelManagement factory instance.

delete

public void delete(java.lang.Object elem)
Deletes a modelelement. It calls the remove method of the modelelement but also does 'cascading deletes' that are not provided for in the remove method of the modelelement itself. For example: this delete method also removes the binary associations that a class has if the class is deleted. In this way, it is not longer possible that illegal states exist in the model.

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 model. 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.

Parameters:
elem - The element to be deleted

doCopyBase

public void doCopyBase(MBase source,
                       MBase target)
Used by the copy functions. Do not call this function directly. Extensions? I don't think we use them anywhere.



ArgoUML © 1996-2003 (20040229)ArgoUML Project HomeArgoUML Cookbook