org.argouml.uml.diagram
Class DiagramFactory

java.lang.Object
  extended by org.argouml.uml.diagram.DiagramFactory

public final class DiagramFactory
extends java.lang.Object

Provide a factory method to create different UML diagrams.


Nested Class Summary
static class DiagramFactory.DiagramType
          Enumeration containing all the different types of UML diagrams.
 
Method Summary
 ArgoDiagram create(DiagramFactory.DiagramType type, java.lang.Object owner, DiagramSettings settings)
          Factory method to create a new instance of an ArgoDiagram.
 ArgoDiagram createDefaultDiagram(java.lang.Object namespace)
          Factory method to create a new default instance of an ArgoDiagram.
 ArgoDiagram createDiagram(DiagramFactory.DiagramType type, java.lang.Object namespace, java.lang.Object machine)
          Deprecated. for 0.27.3 by tfmorris. Use create(DiagramType, Object, DiagramSettings). The 'owner' argument should be the 'machine' for a state diagram or activity diagram (which can figure out the correct namespace from that) and the 'namespace' for all others.
static DiagramFactory getInstance()
           
 void registerDiagramFactory(DiagramFactory.DiagramType type, DiagramFactoryInterface2 factory)
          Register a specific factory class to create diagram instances for a specific diagram type
 ArgoDiagram removeDiagram(ArgoDiagram diagram)
          Factory method to remove a diagram.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DiagramFactory getInstance()
Returns:
the singleton

createDefaultDiagram

public ArgoDiagram createDefaultDiagram(java.lang.Object namespace)
Factory method to create a new default instance of an ArgoDiagram.

Parameters:
namespace - The namespace that (in)directly owns the elements on the diagram
Returns:
the newly instantiated class diagram

createDiagram

@Deprecated
public ArgoDiagram createDiagram(DiagramFactory.DiagramType type,
                                            java.lang.Object namespace,
                                            java.lang.Object machine)
Deprecated. for 0.27.3 by tfmorris. Use create(DiagramType, Object, DiagramSettings). The 'owner' argument should be the 'machine' for a state diagram or activity diagram (which can figure out the correct namespace from that) and the 'namespace' for all others.

Factory method to create a new instance of an ArgoDiagram.

Parameters:
type - The class of rendering diagram to create
namespace - The namespace that (in)directly owns the elements on the diagram
machine - The StateMachine for the diagram (only: statemachine - activitygraph)
Returns:
the newly instantiated class diagram

create

public ArgoDiagram create(DiagramFactory.DiagramType type,
                          java.lang.Object owner,
                          DiagramSettings settings)
Factory method to create a new instance of an ArgoDiagram.

Parameters:
type - The class of rendering diagram to create
owner - the owning UML element. For most diagrams this is a namespace, but for the state diagram it is the state machine and for the activity diagram it is the context.
settings - default rendering settings for the diagram
Returns:
the newly instantiated class diagram

removeDiagram

public ArgoDiagram removeDiagram(ArgoDiagram diagram)
Factory method to remove a diagram.

Parameters:
diagram - the diagram
Returns:
the diagram that was removed

registerDiagramFactory

public void registerDiagramFactory(DiagramFactory.DiagramType type,
                                   DiagramFactoryInterface2 factory)
Register a specific factory class to create diagram instances for a specific diagram type

Parameters:
type - the diagram type
factory - the factory instance


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook