public final class PeServiceImpl extends java.lang.Object implements IPeService
| Constructor and Description |
|---|
PeServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
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[] xy,
Diagram diagram)
Creates a curved connection (Bezier curve) inside the given diagram.
|
Diagram |
createDiagram(java.lang.String diagramTypeId,
java.lang.String diagramName)
Creates a 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.
|
void |
deletePictogramElement(PictogramElement pe)
Deletes the given pictogram element (and with it all aggregated
elements!).
|
void |
deletePictogramElementIgnoringCrossReferences(java.lang.Iterable<PictogramElement> pes)
Deletes the given pictogram elements (and with it all aggregated
elements!).
|
void |
deletePictogramElementIgnoringCrossReferences(PictogramElement pe)
Deletes the given pictogram element (and with it all aggregated
elements!).
|
PictogramElement |
getActiveContainerPe(GraphicsAlgorithm ga)
Gets the active container pe.
|
PictogramElement |
getActiveContainerPe(PictogramElement pictogramElement)
Gets the active container pe.
|
java.util.List<Connection> |
getAllConnections(Anchor anchor)
Returns all connections of an anchor.
|
java.util.List<Connection> |
getAllConnections(AnchorContainer anchorContainer)
Returns all connections of an anchor container.
|
java.util.Collection<PictogramElement> |
getAllContainedPictogramElements(PictogramElement pe)
Gets the all contained pictogram elements.
|
java.util.Collection<Shape> |
getAllContainedShapes(ContainerShape cs)
Returns all the contained container shapes.
|
Anchor |
getChopboxAnchor(AnchorContainer anchorContainer)
Gets the chopbox anchor.
|
ILocation |
getConnectionMidpoint(Connection c,
double d)
Gets the connection midpoint.
|
Diagram |
getDiagramForAnchor(Anchor anchor)
Returns the diagram for the given anchor.
|
Diagram |
getDiagramForPictogramElement(PictogramElement pe)
Returns the diagram for the given pictogram element.
|
Diagram |
getDiagramForShape(Shape shape)
Returns the diagram for the given shape.
|
org.eclipse.emf.ecore.EObject[] |
getElementsNotInDiagram(org.eclipse.emf.ecore.EObject[] elements,
Diagram diagram)
From the given elements, returns all elements that are not linked by a
PictogramLink in the given Diagram.
|
IRectangle |
getGaBoundsForAnchor(Anchor anchor)
Returns the bounds of the graphics algorithm, which is referenced by the
anchor.
|
java.util.List<Connection> |
getIncomingConnections(AnchorContainer anchorContainer)
Returns the incoming connections of an anchor container.
|
java.lang.Object[] |
getLinkedPictogramElements(org.eclipse.emf.ecore.EObject[] elements,
Diagram diagram)
Return all the pictogram elements of the given Diagram which have at
least one link to one of the given elements.
|
ILocationInfo |
getLocationInfo(Shape shape,
int x,
int y)
Returns the location info for a specific position inside a shape.
|
ILocation |
getLocationRelativeToDiagram(Anchor anchor)
Returns the location of the anchor relative to the diagram.
|
ILocation |
getLocationRelativeToDiagram(Shape shape)
Returns the location of the shape relative to the diagram.
|
java.util.List<Connection> |
getOutgoingConnections(AnchorContainer anchorContainer)
Returns the outgoing connections of an anchor container.
|
java.util.Collection<PictogramElement> |
getPictogramElementChildren(PictogramElement pe)
Returns a pictogram element's children.
|
PictogramElement |
getPictogramElementParent(PictogramElement pe)
Gets the pictogram element parent.
|
Property |
getProperty(PropertyContainer propertyContainer,
java.lang.String key)
Returns the property of a given property container for a specific key.
|
java.lang.String |
getPropertyValue(PropertyContainer propertyContainer,
java.lang.String key)
Returns the first element of the property values of a given property
container for a specific key.
|
void |
moveBendpoints(IExecutionInfo executionInfo)
Move bendpoints.
|
boolean |
removeProperty(PropertyContainer propertyContainer,
java.lang.String key)
Removes the property of a given property container for a specific key.
|
void |
sendToBack(Shape shape)
Reorders parent's children to make the given shape the backmost one.
|
void |
sendToFront(Shape shape)
Reorders parent's children to make the given shape the frontmost one.
|
void |
setPropertyValue(PropertyContainer propertyContainer,
java.lang.String key,
java.lang.String value)
Sets/modifies the property's value of a given property container for a
specific key.
|
public BoxRelativeAnchor createBoxRelativeAnchor(AnchorContainer anchorContainer)
IPeCreateServicecreateBoxRelativeAnchor in interface IPeCreateServiceanchorContainer - the anchors parentpublic ChopboxAnchor createChopboxAnchor(AnchorContainer anchorContainer)
IPeCreateServicecreateChopboxAnchor in interface IPeCreateServiceanchorContainer - the anchors parentpublic ConnectionDecorator createConnectionDecorator(Connection connection, boolean active, double location, boolean isRelative)
IPeCreateServicecreateConnectionDecorator in interface IPeCreateServiceconnection - the connectionactive - TRUE, if decorator is active, FALSE otherwiselocation - location of the decorator (must be between 0 and 1)isRelative - true if the decorator should be positioned relative to the
connection's midpointpublic ContainerShape createContainerShape(ContainerShape parentContainerShape, boolean active)
IPeCreateServicecreateContainerShape in interface IPeCreateServiceparentContainerShape - the parent container shapeactive - 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 relative to its next
active parent which can be used for layouting its
PictogramElement children, while an inactive one uses
the coordinate system of its next direct 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.
public Diagram createDiagram(java.lang.String diagramTypeId, java.lang.String diagramName)
IPeCreateServicecreateDiagram in interface IPeCreateServicediagramTypeId - the type id of the diagramdiagramName - the name of the diagramIPeCreateService.createDiagram(String diagramTypeId, String diagramName, boolean
snap)public Diagram createDiagram(java.lang.String diagramTypeId, java.lang.String diagramName, boolean snap)
IPeCreateServicecreateDiagram in interface IPeCreateServicediagramTypeId - the type id of the diagramdiagramName - the name of the diagramsnap - TRUE enables snap to gridIPeCreateService.createDiagram(String diagramTypeId, String diagramName, int
gridUnit, boolean snap)public Diagram createDiagram(java.lang.String diagramTypeId, java.lang.String diagramName, int gridUnit, boolean snap)
IPeCreateServicecreateDiagram in interface IPeCreateServicediagramTypeId - the type id of the diagramdiagramName - the name of the diagramgridUnit - grid size (in both directions) in pixel; if 0 then no grid
will be drawnsnap - TRUE enables snap to gridpublic Diagram createDiagram(java.lang.String diagramTypeId, java.lang.String diagramName, int horizontalGridUnit, int verticalGridUnit, boolean snap)
IPeCreateServicecreateDiagram in interface IPeCreateServicediagramTypeId - the type id of the diagramdiagramName - the name of the diagramhorizontalGridUnit - horizontal grid size in pixel; if 0 then no grid will be drawnverticalGridUnit - vertical grid size in pixel; if 0 then no grid will be drawnsnap - TRUE enables snap to gridpublic FixPointAnchor createFixPointAnchor(AnchorContainer anchorContainer)
IPeCreateServicecreateFixPointAnchor in interface IPeCreateServiceanchorContainer - the anchors parentpublic FreeFormConnection createFreeFormConnection(Diagram diagram)
IPeCreateServicecreateFreeFormConnection in interface IPeCreateServicediagram - the diagrampublic ManhattanConnection createManhattanConnection(Diagram diagram)
IPeCreateServicecreateManhattanConnection in interface IPeCreateServicediagram - the diagrampublic CompositeConnection createCompositeConnection(Diagram diagram)
IPeCreateServiceCompositeConnections
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.createCompositeConnection in interface IPeCreateServicediagram - the diagrampublic CurvedConnection createCurvedConnection(double[] xy, Diagram diagram)
IPeCreateServicecreateCurvedConnection in interface IPeCreateServicexy - an array of double value pairs defining the control points
(two values - x and y - define the point) of the Bezier curvediagram - the diagrampublic Shape createShape(ContainerShape parentContainerShape, boolean active)
IPeCreateServicecreateShape in interface IPeCreateServiceparentContainerShape - the parent container shapeactive - 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.
public void deletePictogramElement(PictogramElement pe)
IPeServiceIPeService.deletePictogramElementIgnoringCrossReferences(Iterable) and
IPeService.deletePictogramElementIgnoringCrossReferences(PictogramElement)
instead.deletePictogramElement in interface IPeServicepe - The pictogram element to deletepublic void deletePictogramElementIgnoringCrossReferences(PictogramElement pe)
IPeServiceIPeService.deletePictogramElement(PictogramElement). In case you need to
follow cross references as well and update them you will need to use
IPeService.deletePictogramElement(PictogramElement) instead.deletePictogramElementIgnoringCrossReferences in interface IPeServicepe - The pictogram element to deletepublic void deletePictogramElementIgnoringCrossReferences(java.lang.Iterable<PictogramElement> pes)
IPeServiceIPeService.deletePictogramElement(PictogramElement). In case you need to
follow cross references as well and update them you will need to use
IPeService.deletePictogramElement(PictogramElement) instead.deletePictogramElementIgnoringCrossReferences in interface IPeServicepes - The pictogram elements to deletepublic PictogramElement getActiveContainerPe(GraphicsAlgorithm ga)
IPeServicegetActiveContainerPe in interface IPeServicega - the gapublic PictogramElement getActiveContainerPe(PictogramElement pictogramElement)
IPeServicegetActiveContainerPe in interface IPeServicepictogramElement - the pictogram elementpublic java.util.List<Connection> getAllConnections(Anchor anchor)
IPeServicegetAllConnections in interface IPeServiceanchor - the anchorpublic java.util.List<Connection> getAllConnections(AnchorContainer anchorContainer)
IPeServicegetAllConnections in interface IPeServiceanchorContainer - the anchor containerpublic java.util.Collection<PictogramElement> getAllContainedPictogramElements(PictogramElement pe)
IPeServicegetAllContainedPictogramElements in interface IPeServicepe - the pepublic java.util.Collection<Shape> getAllContainedShapes(ContainerShape cs)
IPeServicegetAllContainedShapes in interface IPeServicecs - the container shapepublic Anchor getChopboxAnchor(AnchorContainer anchorContainer)
IPeServicegetChopboxAnchor in interface IPeServiceanchorContainer - the anchor containerpublic ILocation getConnectionMidpoint(Connection c, double d)
IPeLayoutServicegetConnectionMidpoint in interface IPeLayoutServicec - the connectiond - a relative location on the connection (must be between 0 and
1)public Diagram getDiagramForAnchor(Anchor anchor)
IPeServicegetDiagramForAnchor in interface IPeServiceanchor - the anchorpublic Diagram getDiagramForPictogramElement(PictogramElement pe)
IPeServicegetDiagramForPictogramElement in interface IPeServicepe - the pepublic Diagram getDiagramForShape(Shape shape)
IPeServicegetDiagramForShape in interface IPeServiceshape - the shapepublic org.eclipse.emf.ecore.EObject[] getElementsNotInDiagram(org.eclipse.emf.ecore.EObject[] elements,
Diagram diagram)
IPeServicegetElementsNotInDiagram in interface IPeServiceelements - the elementsdiagram - the diagpublic IRectangle getGaBoundsForAnchor(Anchor anchor)
IPeLayoutServicegetGaBoundsForAnchor in interface IPeLayoutServiceanchor - the anchorpublic java.util.List<Connection> getIncomingConnections(AnchorContainer anchorContainer)
IPeServicegetIncomingConnections in interface IPeServiceanchorContainer - the anchor containerpublic java.lang.Object[] getLinkedPictogramElements(org.eclipse.emf.ecore.EObject[] elements,
Diagram diagram)
IPeServicegetLinkedPictogramElements in interface IPeServiceelements - the elementsdiagram - the diagpublic ILocationInfo getLocationInfo(Shape shape, int x, int y)
IPeLayoutServicegetLocationInfo in interface IPeLayoutServiceshape - the shapex - x coordinatey - y coordinateILocationInfopublic ILocation getLocationRelativeToDiagram(Anchor anchor)
IPeLayoutServicegetLocationRelativeToDiagram in interface IPeLayoutServiceanchor - the given anchorpublic ILocation getLocationRelativeToDiagram(Shape shape)
IPeLayoutServicegetLocationRelativeToDiagram in interface IPeLayoutServiceshape - the given shapepublic java.util.List<Connection> getOutgoingConnections(AnchorContainer anchorContainer)
IPeServicegetOutgoingConnections in interface IPeServiceanchorContainer - the anchor containerpublic java.util.Collection<PictogramElement> getPictogramElementChildren(PictogramElement pe)
IPeServicegetPictogramElementChildren in interface IPeServicepe - the given pictogram elementpublic PictogramElement getPictogramElementParent(PictogramElement pe)
IPeServicegetPictogramElementParent in interface IPeServicepe - the pepublic Property getProperty(PropertyContainer propertyContainer, java.lang.String key)
IPeServicegetProperty in interface IPeServicepropertyContainer - The property container (e.g. PictogramElement or
GraphicsAlgorithm)key - The property keypublic java.lang.String getPropertyValue(PropertyContainer propertyContainer, java.lang.String key)
IPeServicegetPropertyValue in interface IPeServicepropertyContainer - The property container (e.g. PictogramElement or
GraphicsAlgorithm)key - The property keypublic void moveBendpoints(IExecutionInfo executionInfo)
IPeServicemoveBendpoints in interface IPeServiceexecutionInfo - the execution infopublic boolean removeProperty(PropertyContainer propertyContainer, java.lang.String key)
IPeServiceremoveProperty in interface IPeServicepropertyContainer - The property container (e.g. PictogramElement or
GraphicsAlgorithm)key - The property keypublic void sendToBack(Shape shape)
IPeServicesendToBack in interface IPeServiceshape - shape to make the backmost onepublic void sendToFront(Shape shape)
IPeServicesendToFront in interface IPeServiceshape - shape to make the frontmost onepublic void setPropertyValue(PropertyContainer propertyContainer, java.lang.String key, java.lang.String value)
IPeServicesetPropertyValue in interface IPeServicepropertyContainer - The property container (e.g. PictogramElement or
GraphicsAlgorithm)key - The property keyvalue - The new property value