org.argouml.model
Interface UmlFactory


public interface UmlFactory

The interface for the UmlFactory.


Method Summary
 Object buildConnection(Object connectionType, 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.
 void delete(Object elem)
          Delete a model element.
 boolean isConnectionType(Object connectionType)
          Checks if some type of UML model element is valid to connect other UML model elements.
 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)
          Check whether a model element has been deleted.
 

Method Detail

buildConnection

public Object buildConnection(Object connectionType,
                              Object fromElement,
                              Object fromStyle,
                              Object toElement,
                              Object toStyle,
                              Object unidirectional,
                              Object namespace)
                       throws IllegalModelElementConnectionException
Creates a UML model element of the given type and uses this to connect two other existing UML model elements. This only works for UML elements. If a diagram contains elements of another type then it is the responsibility of the diagram manage those items and not call this method.

Parameters:
connectionType - the UML object type of the connection
fromElement - the UML object for the "from" element
fromStyle - the aggregationkind for the connection in case of an association
toElement - the UML object for the "to" element
toStyle - the aggregationkind for the connection in case of an association
unidirectional - for association and associationrole
namespace - the namespace to use if it can't be determined
Returns:
the newly build connection (UML object)
Throws:
IllegalModelElementConnectionException - if the connection is not a valid thing to do

buildNode

public Object buildNode(Object elementType)
Creates a UML model element of the given type. This only works for UML elements. If a diagram contains elements of another type then it is the responsibility of the diagram manage those items and not call this method. It also only works for UML model elements that are represented in diagrams by a node.

Parameters:
elementType - the type of model element to build
Returns:
the model element

isConnectionType

public boolean isConnectionType(Object connectionType)
Checks if some type of UML model element is valid to connect other UML model elements.

Parameters:
connectionType - the UML object type of the connection
Returns:
true if valid

isConnectionValid

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

This only works for UML elements. If a diagram contains elements of another type then it is the responsibility of the diagram to filter those out before calling this method.

Parameters:
connectionType - the UML object type of the connection
fromElement - the UML object type of the "from"
toElement - the UML object type of the "to"
Returns:
true if valid

delete

public void delete(Object elem)
Delete a model element. This will do a a 'cascading deletes' which recursively deletes any model elements which would no longer be valid after this element is deleted. For example, a binary association which has one end deleted will also be deleted because it no longer meets the minimum multiplicity constraint.

Callers who are interested in receiving notification of all elements which were deleted should register an event listener to receive delete events.

Parameters:
elem - The element to be deleted

isRemoved

public boolean isRemoved(Object o)
Check whether a model element has been deleted.

Note that without external synchronization that there's no guarantee that the element won't be deleted by another after this method returns, but before the caller can do anything with it.

Parameters:
o - the object to be checked
Returns:
true if removed


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook