fdda.graphics
Class ComponentFactory

java.lang.Object
  |
  +--fdda.graphics.ComponentFactory
Direct Known Subclasses:
Java2dFactory

public abstract class ComponentFactory
extends Object

Interface of the factory that produces graphical components. For different types of graphics, different factories may be used.

Author:
Jörg Rüdenauer

Constructor Summary
ComponentFactory()
           
 
Method Summary
abstract  Container createContainer()
          Creates a new container.
abstract  GraphicalSystem createGraphicalSystem()
          Creates a new graphical system.
abstract  Line createLine(Node startNode, Node endNode, boolean selected, boolean directed)
          Creates a new line
abstract  Message createMessage(Line line, boolean forward)
          Creates a new message.
abstract  Node createNode(double x, double y, boolean selected)
          Creates a new node.
abstract  Selection getComponentSelection()
          Creates a new selection.
static ComponentFactory getInstance()
          Returns the concrete component factory.
static void setFactory(ComponentFactory aFactory)
          Sets the factory that shall be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentFactory

public ComponentFactory()
Method Detail

setFactory

public static final void setFactory(ComponentFactory aFactory)
Sets the factory that shall be used.

Parameters:
aFactory - the factory

getInstance

public static final ComponentFactory getInstance()
Returns the concrete component factory.

Returns:
the factory

createNode

public abstract Node createNode(double x,
                                double y,
                                boolean selected)
Creates a new node.

Parameters:
x - the x coordinate of the center point of the node
y - the y coordinate of the center point of the node
selected - whether the node shall be selected
Returns:
the newly created Node

createLine

public abstract Line createLine(Node startNode,
                                Node endNode,
                                boolean selected,
                                boolean directed)
Creates a new line

Parameters:
startNode - the start node for the line
endNode - the end node for the line
selected - whether the line shall be selected
directed - whether the line shall be directed
Returns:
the newly created Line

createContainer

public abstract Container createContainer()
Creates a new container.

Returns:
the newly created Container

createMessage

public abstract Message createMessage(Line line,
                                      boolean forward)
Creates a new message.

Parameters:
line - the line which transports the message
forward - whether the message runs in the designated direction of the line
Returns:
the newly created message

getComponentSelection

public abstract Selection getComponentSelection()
Creates a new selection. Note that this needs not be used often.

Returns:
the newly created Selection

createGraphicalSystem

public abstract GraphicalSystem createGraphicalSystem()
Creates a new graphical system.

Returns:
the newly created GraphicalSystem


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.