com.mindfusion.diagramming
Class Factory

java.lang.Object
  extended by com.mindfusion.diagramming.Factory

public class Factory
extends java.lang.Object

Provides shortcut methods for creating and adding instances of the standard item types. Call the class methods through the Factory property of the Diagram class.


Constructor Summary
Factory(Diagram diagram)
          Initializes a new instance of the Factory class over the specified Diagram.
 
Method Summary
 ContainerNode createContainerNode(double x, double y, double width, double height)
          Creates a new ContainerNode instance at the specified location with the specified size and adds it to the Nodes collection of the underlying diagram.
 ContainerNode createContainerNode(double x, double y, double width, double height, boolean foldable)
          Creates a new ContainerNode instance at the specified location with the specified size, optionally foldable, and adds it to the Nodes collection of the underlying diagram.
 ContainerNode createContainerNode(java.awt.geom.Point2D location, java.awt.geom.Dimension2D size)
          Creates a new ContainerNode instance at the specified location with the specified size and adds it to the Nodes collection of the underlying diagram.
 ContainerNode createContainerNode(java.awt.geom.Point2D location, java.awt.geom.Dimension2D size, boolean foldable)
          Creates a new ContainerNode instance at the specified location with the specified size, optionally foldable, and adds it to the Nodes collection of the underlying diagram.
 ContainerNode createContainerNode(java.awt.geom.Rectangle2D bounds)
          Creates a new ContainerNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram.
 ContainerNode createContainerNode(java.awt.geom.Rectangle2D bounds, boolean foldable)
          Creates a new ContainerNode instance with the specified dimensions, optionally foldable, and adds it to the Nodes collection of the underlying diagram.
 DiagramLink createDiagramLink(DiagramNode origin, DiagramNode destination)
          Creates a new DiagramLink instance between the specified nodes and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(DiagramNode origin, java.awt.geom.Point2D destination)
          Creates a new DiagramLink instance between the specified node and the specified point, and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(DiagramNode origin, TableNode destination, int destRow)
          Creates a new DiagramLink instance between the specified nodes and the specified table, and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(java.awt.geom.Point2D origin, DiagramNode destination)
          Creates a new DiagramLink instance between the specified point and the specified node, and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(java.awt.geom.Point2D origin, java.awt.geom.Point2D destination)
          Creates a new DiagramLink instance between the specified points and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(ShapeNode origin, int originAnchor, ShapeNode destination, int destAnchor)
          Creates a new DiagramLink instance between the specified nodes and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(TableNode origin, int originRow, DiagramNode destination)
          Creates a new DiagramLink instance between the specified table and the specified node, and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(TableNode origin, int originRow, TableNode destination, int destRow)
          Creates a new DiagramLink instance between the specified tables and adds it to the Links collection of the underlying diagram.
 DiagramLink createDiagramLink(TableNode origin, TableNode destination)
          Creates a new DiagramLink instance between the specified tables and adds it to the Links collection of the underlying diagram.
 Group createGroup(DiagramItem mainItem)
          Creates a new hierarchical Group with the specified main item.
 ShapeNode createShapeNode(double x, double y, double width, double height)
          Creates a new ShapeNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram.
 ShapeNode createShapeNode(double x, double y, double width, double height, Shape shape)
          Creates a new ShapeNode instance at the specified position with the specified size and shape, and adds it to the Nodes collection of the underlying diagram.
 ShapeNode createShapeNode(java.awt.geom.Point2D location, java.awt.geom.Dimension2D size)
          Creates a new ShapeNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram.
 ShapeNode createShapeNode(java.awt.geom.Point2D location, java.awt.geom.Dimension2D size, Shape shape)
          Creates a new ShapeNode instance at the specified position with the specified size and shape, and adds it to the Nodes collection of the underlying diagram.
 ShapeNode createShapeNode(java.awt.geom.Rectangle2D bounds)
          Creates a new ShapeNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram.
 ShapeNode createShapeNode(java.awt.geom.Rectangle2D bounds, Shape shape)
          Creates a new ShapeNode instance with the specified dimensions and shape, and adds it to the Nodes collection of the underlying diagram.
 TableNode createTableNode(double x, double y, double width, double height)
          Creates a new TableNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram.
 TableNode createTableNode(double x, double y, double width, double height, int columns, int rows)
          Creates a new TableNode instance at the specified position with the specified size and the specified number of columns and rows, and adds it to the Nodes collection of the underlying diagram.
 TableNode createTableNode(java.awt.geom.Point2D location, java.awt.geom.Dimension2D size)
          Creates a new TableNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram.
 TableNode createTableNode(java.awt.geom.Point2D location, java.awt.geom.Dimension2D size, int columns, int rows)
          Creates a new TableNode instance at the specified position with the specified size and with the specified number of columns and rows, and adds it to the Nodes collection of the underlying diagram.
 TableNode createTableNode(java.awt.geom.Rectangle2D bounds)
          Creates a new TableNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram.
 TableNode createTableNode(java.awt.geom.Rectangle2D bounds, int columns, int rows)
          Creates a new TableNode instance with the specified dimensions and with the specified number of columns and rows, and adds it to the Nodes collection of the underlying diagram.
 TreeViewNode createTreeViewNode(double x, double y, double width, double height)
          Creates a new TreeViewNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram.
 TreeViewNode createTreeViewNode(java.awt.geom.Point2D location, java.awt.geom.Dimension2D size)
          Creates a new TreeViewNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram.
 TreeViewNode createTreeViewNode(java.awt.geom.Rectangle2D bounds)
          Creates a new TreeViewNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Factory

public Factory(Diagram diagram)
Initializes a new instance of the Factory class over the specified Diagram.

Parameters:
diagram - The Diagram object for which to create the new factory.
Method Detail

createShapeNode

public ShapeNode createShapeNode(double x,
                                 double y,
                                 double width,
                                 double height)
Creates a new ShapeNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a shape node at the position specified by x and y. The size of the node is set by width and height.

Parameters:
x - The x-coordinate of the upper-left corner of the new node.
y - The y-coordinate of the upper-left corner of the new node.
width - The width of the new node.
height - The height of the new node.
Returns:
The newly created ShapeNode instance.

createShapeNode

public ShapeNode createShapeNode(java.awt.geom.Point2D location,
                                 java.awt.geom.Dimension2D size)
Creates a new ShapeNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a shape node at the position specified by location. The size of the node is set by size.

Parameters:
location - The position of the new node.
size - The size of the new node.
Returns:
The newly created ShapeNode instance.

createShapeNode

public ShapeNode createShapeNode(java.awt.geom.Rectangle2D bounds)
Creates a new ShapeNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram. The method creates a shape node with dimensions specified by bounds.

Parameters:
bounds - The bounding rectangle of the new node.
Returns:
The newly created ShapeNode instance.

createShapeNode

public ShapeNode createShapeNode(double x,
                                 double y,
                                 double width,
                                 double height,
                                 Shape shape)
Creates a new ShapeNode instance at the specified position with the specified size and shape, and adds it to the Nodes collection of the underlying diagram. The method creates a shape node at the position specified by x and y. The size of the node is set by width and height. The shape of the new node is specified by shape.

Parameters:
x - The x-coordinate of the upper-left corner of the new node.
y - The y-coordinate of the upper-left corner of the new node.
width - The width of the new node.
height - The height of the new node.
shape - The shape of the new node.
Returns:
The newly created ShapeNode instance.

createShapeNode

public ShapeNode createShapeNode(java.awt.geom.Point2D location,
                                 java.awt.geom.Dimension2D size,
                                 Shape shape)
Creates a new ShapeNode instance at the specified position with the specified size and shape, and adds it to the Nodes collection of the underlying diagram. The method creates a shape node at the position specified by location. The size of the node is set by size. The shape of the new node is specified by shape.

Parameters:
location - The position of the new node.
size - The size of the new node.
shape - The shape of the new node.
Returns:
The newly created ShapeNode instance.

createShapeNode

public ShapeNode createShapeNode(java.awt.geom.Rectangle2D bounds,
                                 Shape shape)
Creates a new ShapeNode instance with the specified dimensions and shape, and adds it to the Nodes collection of the underlying diagram.

Parameters:
bounds - The bounding rectangle of the new node.
shape - The shape of the new node.
Returns:
The newly created ShapeNode instance.

createTableNode

public TableNode createTableNode(double x,
                                 double y,
                                 double width,
                                 double height)
Creates a new TableNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a table node at the position specified by x and y. The size of the node is set by width and height.

Parameters:
x - The x-coordinate of the upper-left corner of the new table.
y - The y-coordinate of the upper-left corner of the new table.
width - The width of the new table.
height - The height of the new table.
Returns:
The newly created TableNode instance.

createTableNode

public TableNode createTableNode(java.awt.geom.Point2D location,
                                 java.awt.geom.Dimension2D size)
Creates a new TableNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a table node at the position specified by location. The size of the node is set by size.

Parameters:
location - The position of the new table.
size - The size of the new table.
Returns:
The newly created TableNode instance.

createTableNode

public TableNode createTableNode(java.awt.geom.Rectangle2D bounds)
Creates a new TableNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram. The method creates a table node with dimensions specified by bounds.

Parameters:
bounds - The bounding rectangle of the new table.
Returns:
The newly created TableNode instance.

createTableNode

public TableNode createTableNode(double x,
                                 double y,
                                 double width,
                                 double height,
                                 int columns,
                                 int rows)
Creates a new TableNode instance at the specified position with the specified size and the specified number of columns and rows, and adds it to the Nodes collection of the underlying diagram. The method creates a table node at the position specified by x and y. The size of the node is set by width and height. The initial number of columns and rows in the table is specified by columns and rows respectively.

Parameters:
x - The x-coordinate of the upper-left corner of the new table.
y - The y-coordinate of the upper-left corner of the new table.
width - The width of the new table.
height - The height of the new table.
columns - The initial number of columns in the table.
rows - The initial number of rows in the table.
Returns:
The newly created TableNode instance.

createTableNode

public TableNode createTableNode(java.awt.geom.Point2D location,
                                 java.awt.geom.Dimension2D size,
                                 int columns,
                                 int rows)
Creates a new TableNode instance at the specified position with the specified size and with the specified number of columns and rows, and adds it to the Nodes collection of the underlying diagram.

Parameters:
location - The position of the new table.
size - The size of the new table.
columns - The initial number of columns in the table.
rows - The initial number of rows in the table.

createTableNode

public TableNode createTableNode(java.awt.geom.Rectangle2D bounds,
                                 int columns,
                                 int rows)
Creates a new TableNode instance with the specified dimensions and with the specified number of columns and rows, and adds it to the Nodes collection of the underlying diagram. The method creates a table node with dimensions specified by bounds. The initial number of columns and rows in the table is specified by columns and rows respectively.

Parameters:
bounds - The bounding rectangle of the new table.
columns - The initial number of columns in the table.
rows - The initial number of rows in the table.
Returns:
The newly created TableNode instance.

createContainerNode

public ContainerNode createContainerNode(double x,
                                         double y,
                                         double width,
                                         double height)
Creates a new ContainerNode instance at the specified location with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a container node at the position specified by x and y. The size of the container is set by width and height.

Parameters:
x - The x-coordinate of the upper-left corner of the new node.
y - The y-coordinate of the upper-left corner of the new node.
width - The width of the new node.
height - The height of the new node.
Returns:
The newly created ContainerNode instance.

createContainerNode

public ContainerNode createContainerNode(java.awt.geom.Point2D location,
                                         java.awt.geom.Dimension2D size)
Creates a new ContainerNode instance at the specified location with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a container node at the position specified by location. The size of the container is set by size.

Parameters:
location - The location of the ContainerNode object.
size - The size of the ContainerNode object.
Returns:
The newly created ContainerNode instance.

createContainerNode

public ContainerNode createContainerNode(java.awt.geom.Rectangle2D bounds)
Creates a new ContainerNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram. The method creates a container node with the position and size specified by bounds.

Parameters:
bounds - The initial bounding rectangle of the new node.
Returns:
The newly created ContainerNode instance.

createContainerNode

public ContainerNode createContainerNode(double x,
                                         double y,
                                         double width,
                                         double height,
                                         boolean foldable)
Creates a new ContainerNode instance at the specified location with the specified size, optionally foldable, and adds it to the Nodes collection of the underlying diagram. The method creates a container node at the position specified by x and y. The size of the container is set by width and height. The parameter foldable specifies whether the container node is initially foldable.

Parameters:
x - The x-coordinate of the upper-left corner of the new node.
y - The y-coordinate of the upper-left corner of the new node.
width - The width of the new node.
height - The height of the new node.
foldable - true if the container can be folded; otherwise, false.
Returns:
The newly created ContainerNode instance.

createContainerNode

public ContainerNode createContainerNode(java.awt.geom.Point2D location,
                                         java.awt.geom.Dimension2D size,
                                         boolean foldable)
Creates a new ContainerNode instance at the specified location with the specified size, optionally foldable, and adds it to the Nodes collection of the underlying diagram.

Parameters:
location - The location of the ContainerNode object.
size - The newly created ContainerNode instance.
foldable - true if the container can be folded; otherwise, false.
Returns:
The newly created ContainerNode instance.

createContainerNode

public ContainerNode createContainerNode(java.awt.geom.Rectangle2D bounds,
                                         boolean foldable)
Creates a new ContainerNode instance with the specified dimensions, optionally foldable, and adds it to the Nodes collection of the underlying diagram. The method creates a container node with the position and size specified by bounds. The parameter foldable specifies whether the container node is initially foldable.

Parameters:
bounds - The initial bounding rectangle of the new node.
foldable - true if the container can be folded; otherwise, false.
Returns:
The newly created ContainerNode instance.

createDiagramLink

public DiagramLink createDiagramLink(DiagramNode origin,
                                     DiagramNode destination)
Creates a new DiagramLink instance between the specified nodes and adds it to the Links collection of the underlying diagram. The method creates a link connecting the nodes specified by origin and destination.

Parameters:
origin - The origin node.
destination - The destination node.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(ShapeNode origin,
                                     int originAnchor,
                                     ShapeNode destination,
                                     int destAnchor)
Creates a new DiagramLink instance between the specified nodes and adds it to the Links collection of the underlying diagram. The method creates a link connecting the shape nodes specified by origin and destination.

Parameters:
origin - The origin node.
originAnchor - The index of an anchor point within the origin node's AnchorPattern.
destination - The destination node.
destAnchor - The index of an anchor point within the destination node's AnchorPattern.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(TableNode origin,
                                     TableNode destination)
Creates a new DiagramLink instance between the specified tables and adds it to the Links collection of the underlying diagram. The method creates a link connecting the tables specified by origin and destination.

Parameters:
origin - The origin node.
destination - The destination node.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(TableNode origin,
                                     int originRow,
                                     TableNode destination,
                                     int destRow)
Creates a new DiagramLink instance between the specified tables and adds it to the Links collection of the underlying diagram. The method creates a link connecting the tables specified by origin and destination.

Parameters:
origin - The origin node.
originRow - The zero-based index of the origin table row of the new link.
destination - The destination node.
destRow - The zero-based index of the destination table row of the new link.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(DiagramNode origin,
                                     TableNode destination,
                                     int destRow)
Creates a new DiagramLink instance between the specified nodes and the specified table, and adds it to the Links collection of the underlying diagram. The method creates a link connecting the node specified by origin and the table specified by destination.

Parameters:
origin - The origin node.
destination - The destination node.
destRow - The zero-based index of the destination table row of the new link.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(TableNode origin,
                                     int originRow,
                                     DiagramNode destination)
Creates a new DiagramLink instance between the specified table and the specified node, and adds it to the Links collection of the underlying diagram. The method creates a link connecting the table specified by origin and the node specified by destination.

Parameters:
origin - The origin node.
originRow - The zero-based index of the destination table row of the new link.
destination - The destination node.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(DiagramNode origin,
                                     java.awt.geom.Point2D destination)
Creates a new DiagramLink instance between the specified node and the specified point, and adds it to the Links collection of the underlying diagram. The method creates a link connecting the node specified by origin and the point specified by destination.

Parameters:
origin - The origin node.
destination - The destination point.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(java.awt.geom.Point2D origin,
                                     DiagramNode destination)
Creates a new DiagramLink instance between the specified point and the specified node, and adds it to the Links collection of the underlying diagram. The method creates a link connecting the point specified by origin and the node specified by destination.

Parameters:
origin - The origin point.
destination - The destination node.
Returns:
The newly created DiagramLink instance.

createDiagramLink

public DiagramLink createDiagramLink(java.awt.geom.Point2D origin,
                                     java.awt.geom.Point2D destination)
Creates a new DiagramLink instance between the specified points and adds it to the Links collection of the underlying diagram. The method creates a link connecting the points specified by origin and destination.

Parameters:
origin - The origin point.
destination - The destination point.
Returns:
The newly created DiagramLink instance.

createGroup

public Group createGroup(DiagramItem mainItem)
Creates a new hierarchical Group with the specified main item. Use this method to create an hierarchical group of items. Attach subordinated items via the various Group members.

Parameters:
mainItem - The DiagramItem around which the group would be built.
Returns:
The newly crated Group instance if successfully created; otherwise null.

createTreeViewNode

public TreeViewNode createTreeViewNode(double x,
                                       double y,
                                       double width,
                                       double height)
Creates a new TreeViewNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a treeview node at the position specified by x and y. The size of the node is set by width and height.

Parameters:
x - The x-coordinate of the upper-left corner of the new node.
y - The y-coordinate of the upper-left corner of the new node.
width - The width of the new node.
height - The height of the new node.
Returns:
The newly created TreeViewNode instance.

createTreeViewNode

public TreeViewNode createTreeViewNode(java.awt.geom.Point2D location,
                                       java.awt.geom.Dimension2D size)
Creates a new TreeViewNode instance at the specified position with the specified size and adds it to the Nodes collection of the underlying diagram. The method creates a treeview node at the position specified by location. The size of the node is set by size.

Parameters:
location - The position of the new node.
size - The size of the new node.
Returns:
The newly created TreeViewNode instance.

createTreeViewNode

public TreeViewNode createTreeViewNode(java.awt.geom.Rectangle2D bounds)
Creates a new TreeViewNode instance with the specified dimensions and adds it to the Nodes collection of the underlying diagram. The method creates a treeview node with dimensions specified by bounds.

Parameters:
bounds - The bounding rectangle of the new node.
Returns:
The newly created TreeViewNode instance.