org.eclipse.graphiti.services
Interface IPeCreateService

All Known Subinterfaces:
ICreateService, IPeService

public interface IPeCreateService

The interface IPeCreateService provides services for the creation of all available pictogram elements. E.g. Shapes, Connections, Anchors, ...


Method Summary
 BoxRelativeAnchor createBoxRelativeAnchor(AnchorContainer anchorContainer)
          Creates a box relative anchor inside the given anchor container.
 ChopboxAnchor createChopboxAnchor(AnchorContainer anchorContainer)
          Creates a chop box anchor inside the given anchor container.
 CompositeConnection createCompositeConnection(Diagram diagram)
          Creates a composite connection (a connection that is made of several other connections) inside the given diagram.
 ConnectionDecorator createConnectionDecorator(Connection connection, boolean active, double location, boolean isRelative)
          Creates a connection decorator and adds it to the given connection.
 ContainerShape createContainerShape(ContainerShape parentContainerShape, boolean active)
          Creates a container shape inside the given parent container shape.
 CurvedConnection createCurvedConnection(double[] controllPoints, Diagram diagram)
          Creates a curved connection (Bezier curve) inside the given diagram.
 Diagram createDiagram(java.lang.String diagramTypeId, java.lang.String diagramName, boolean snap)
          Creates a diagram.
 Diagram createDiagram(java.lang.String diagramTypeId, java.lang.String diagramName, int gridUnit, boolean snap)
          Creates a diagram.
 Diagram createDiagram(java.lang.String diagramTypeId, java.lang.String diagramName, int horizontalGridUnit, int verticalGridUnit, boolean snap)
          Creates a diagram.
 FixPointAnchor createFixPointAnchor(AnchorContainer anchorContainer)
          Creates a fix point anchor inside the given anchor container.
 FreeFormConnection createFreeFormConnection(Diagram diagram)
          Creates a free form connection inside the given diagram.
 ManhattanConnection createManhattanConnection(Diagram diagram)
          Creates a manhattan connection inside the given diagram.
 Shape createShape(ContainerShape parentContainerShape, boolean active)
          Creates a shape inside the given parent container shape.
 

Method Detail

createBoxRelativeAnchor

BoxRelativeAnchor createBoxRelativeAnchor(AnchorContainer anchorContainer)
Creates a box relative anchor inside the given anchor container.

Parameters:
anchorContainer - the anchors parent
Returns:
the new box relative anchor

createChopboxAnchor

ChopboxAnchor createChopboxAnchor(AnchorContainer anchorContainer)
Creates a chop box anchor inside the given anchor container.

Parameters:
anchorContainer - the anchors parent
Returns:
the new chop box anchor

createConnectionDecorator

ConnectionDecorator createConnectionDecorator(Connection connection,
                                              boolean active,
                                              double location,
                                              boolean isRelative)
Creates a connection decorator and adds it to the given connection.

Parameters:
connection - the connection
active - TRUE, if decorator is active, FALSE otherwise
location - location of the decorator (must be between 0 and 1)
isRelative - true if the decorator should be positioned relative to the connection's midpoint
Returns:
the new connection decorator

createContainerShape

ContainerShape createContainerShape(ContainerShape parentContainerShape,
                                    boolean active)
Creates a container shape inside the given parent container shape.

Parameters:
parentContainerShape - the parent container shape
active - true, if the created shape should be active, false otherwise. An active shape can be selected in the diagram editor and it is also relevant for layouting: an active shape opens a coordinate system which can be used for layouting its PictogramElement children, while an inactive one does not provide one but uses the coordinate system of its next active parent for layouting its children.

By default all shapes should be active, inactive shapes should be used for grouping purposes or for linking a group of graphical objects to the domain world only.

For those familiar with GEF: only for active shapes a GEF EditPart will be created by the Graphiti framework, not for inactive ones.

Returns:
the new container shape

createDiagram

Diagram createDiagram(java.lang.String diagramTypeId,
                      java.lang.String diagramName,
                      boolean snap)
Creates a diagram.

Parameters:
diagramTypeId - the type id of the diagram
diagramName - the name of the diagram
snap - TRUE enables snap to grid
Returns:
the new diagram
See Also:
createDiagram(String diagramTypeId, String diagramName, int gridUnit, boolean snap)

createDiagram

Diagram createDiagram(java.lang.String diagramTypeId,
                      java.lang.String diagramName,
                      int gridUnit,
                      boolean snap)
Creates a diagram.

Parameters:
diagramTypeId - the type id of the diagram
diagramName - the name of the diagram
gridUnit - grid size (in both directions) in pixel; if 0 then no grid will be drawn
snap - TRUE enables snap to grid
Returns:
the new diagram

createDiagram

Diagram createDiagram(java.lang.String diagramTypeId,
                      java.lang.String diagramName,
                      int horizontalGridUnit,
                      int verticalGridUnit,
                      boolean snap)
Creates a diagram.

Parameters:
diagramTypeId - the type id of the diagram
diagramName - the name of the diagram
horizontalGridUnit - horizontal grid size in pixel; if 0 then no grid will be drawn
verticalGridUnit - vertical grid size in pixel; if 0 then no grid will be drawn
snap - TRUE enables snap to grid
Returns:
the new diagram
Since:
0.8

createFixPointAnchor

FixPointAnchor createFixPointAnchor(AnchorContainer anchorContainer)
Creates a fix point anchor inside the given anchor container.

Parameters:
anchorContainer - the anchors parent
Returns:
the new fix point anchor

createFreeFormConnection

FreeFormConnection createFreeFormConnection(Diagram diagram)
Creates a free form connection inside the given diagram.

Parameters:
diagram - the diagram
Returns:
the new free form connection

createManhattanConnection

ManhattanConnection createManhattanConnection(Diagram diagram)
Creates a manhattan connection inside the given diagram.

Parameters:
diagram - the diagram
Returns:
the new free form connection
Since:
0.8

createCurvedConnection

CurvedConnection createCurvedConnection(double[] controllPoints,
                                        Diagram diagram)
Creates a curved connection (Bezier curve) inside the given diagram.

Parameters:
controllPoints - an array of double value pairs defining the control points (two values - x and y - define the point) of the Bezier curve
diagram - the diagram
Returns:
the new curved connection
Since:
0.9

createCompositeConnection

CompositeConnection createCompositeConnection(Diagram diagram)
Creates a composite connection (a connection that is made of several other connections) inside the given diagram. CompositeConnections can be used to combine any number of CurvedConnections into one semantical connection using its CompositeConnection.getChildren() relation. Note that the composite connection itself needs to have an associated GraphicsAlgorithm (usually a Polyline) for its visualization, although it might be invisible and only the child connections have a visible polyline as their visualization.
Note that this is an experimental API and might change without further notice.

Parameters:
diagram - the diagram
Returns:
the new composite connection
Since:
0.9

createShape

Shape createShape(ContainerShape parentContainerShape,
                  boolean active)
Creates a shape inside the given parent container shape.

Parameters:
parentContainerShape - the parent container shape
active - true, if the created shape should be active, false otherwise. An active shape can be selected in the diagram editor and it is also relevant for layouting: an active shape opens a coordinate system which can be used for layouting its PictogramElement children, while an inactive one does not provide one but uses the coordinate system of its next active parent for layouting its children.

By default all shapes should be active, inactive shapes should be used for grouping purposes or for linking a group of graphical objects to the domain world only.

For those familiar with GEF: only for active shapes a GEF EditPart will be created by the Graphiti framework, not for inactive ones.

Returns:
the new shape


Copyright (c) SAP AG 2005, 2012.