Interface IPeService

All Superinterfaces:
IPeCreateService, IPeLayoutService
All Known Implementing Classes:
PeServiceImpl

public interface IPeService extends IPeCreateService, IPeLayoutService
The interface IPeService provides convenient services for the creation and layout of pictogram elements.
  • Method Details

    • deletePictogramElement

      void deletePictogramElement(PictogramElement pe)
      Deletes the given pictogram element (and with it all aggregated elements!). This method will also follow all cross references which might for large models cause performance issues. In case you suffer from that you might check to use deletePictogramElementIgnoringCrossReferences(Iterable) and deletePictogramElementIgnoringCrossReferences(PictogramElement) instead.
      Parameters:
      pe - The pictogram element to delete
    • deletePictogramElementIgnoringCrossReferences

      void deletePictogramElementIgnoringCrossReferences(PictogramElement pe)
      Deletes the given pictogram element (and with it all aggregated elements!). This method will not follow cross references which might for large models have performance advantages over using deletePictogramElement(PictogramElement). In case you need to follow cross references as well and update them you will need to use deletePictogramElement(PictogramElement) instead.
      Parameters:
      pe - The pictogram element to delete
      Since:
      0.13
    • deletePictogramElementIgnoringCrossReferences

      void deletePictogramElementIgnoringCrossReferences(Iterable<PictogramElement> pes)
      Deletes the given pictogram elements (and with it all aggregated elements!). This method will not follow cross references which might for large models have performance advantages over using deletePictogramElement(PictogramElement). In case you need to follow cross references as well and update them you will need to use deletePictogramElement(PictogramElement) instead.
      Parameters:
      pes - The pictogram elements to delete
      Since:
      0.13
    • getActiveContainerPe

      PictogramElement getActiveContainerPe(GraphicsAlgorithm ga)
      Gets the active container pe.
      Parameters:
      ga - the ga
      Returns:
      the active container pe
    • getActiveContainerPe

      PictogramElement getActiveContainerPe(PictogramElement pictogramElement)
      Gets the active container pe.
      Parameters:
      pictogramElement - the pictogram element
      Returns:
      the active container pe
    • getAllConnections

      List<Connection> getAllConnections(Anchor anchor)
      Returns all connections of an anchor.
      Parameters:
      anchor - the anchor
      Returns:
      list of connections
    • getAllConnections

      List<Connection> getAllConnections(AnchorContainer anchorContainer)
      Returns all connections of an anchor container.
      Parameters:
      anchorContainer - the anchor container
      Returns:
      list of connections
    • getAllContainedPictogramElements

      Collection<PictogramElement> getAllContainedPictogramElements(PictogramElement pe)
      Gets the all contained pictogram elements.
      Parameters:
      pe - the pe
      Returns:
      the all contained pictogram elements
    • getAllContainedShapes

      Collection<Shape> getAllContainedShapes(ContainerShape cs)
      Returns all the contained container shapes. Dives through the whole shapes tree.
      Parameters:
      cs - the container shape
      Returns:
      all the contained container shapes
    • getChopboxAnchor

      Anchor getChopboxAnchor(AnchorContainer anchorContainer)
      Gets the chopbox anchor.
      Parameters:
      anchorContainer - the anchor container
      Returns:
      The chopbox anchor of the anchor container if one exist, otherwise null
    • getDiagramForAnchor

      Diagram getDiagramForAnchor(Anchor anchor)
      Returns the diagram for the given anchor.
      Parameters:
      anchor - the anchor
      Returns:
      the diagram
    • getDiagramForPictogramElement

      Diagram getDiagramForPictogramElement(PictogramElement pe)
      Returns the diagram for the given pictogram element.
      Parameters:
      pe - the pe
      Returns:
      the diagram
    • getDiagramForShape

      Diagram getDiagramForShape(Shape shape)
      Returns the diagram for the given shape.
      Parameters:
      shape - the shape
      Returns:
      the diagram
    • getElementsNotInDiagram

      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.
      Parameters:
      elements - the elements
      diagram - the diag
      Returns:
      the elements not in diagram
    • getIncomingConnections

      List<Connection> getIncomingConnections(AnchorContainer anchorContainer)
      Returns the incoming connections of an anchor container.
      Parameters:
      anchorContainer - the anchor container
      Returns:
      list of incoming connections
    • getLinkedPictogramElements

      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.
      Parameters:
      elements - the elements
      diagram - the diag
      Returns:
      the linked pictogram elements
    • getOutgoingConnections

      List<Connection> getOutgoingConnections(AnchorContainer anchorContainer)
      Returns the outgoing connections of an anchor container.
      Parameters:
      anchorContainer - the anchor container
      Returns:
      list of outgoing connections
    • getPictogramElementChildren

      Collection<PictogramElement> getPictogramElementChildren(PictogramElement pe)
      Returns a pictogram element's children.
      Some Examples: returns all connections of a diagram, all shapes of a container shape, all decorators of a connection, all anchors of an anchor container
      Parameters:
      pe - the given pictogram element
      Returns:
      all the pictogram element's children
    • getPictogramElementParent

      PictogramElement getPictogramElementParent(PictogramElement pe)
      Gets the pictogram element parent.
      Parameters:
      pe - the pe
      Returns:
      the pictogram element parent
    • getProperty

      Property getProperty(PropertyContainer propertyContainer, String key)
      Returns the property of a given property container for a specific key.
      Parameters:
      propertyContainer - The property container (e.g. PictogramElement or GraphicsAlgorithm)
      key - The property key
      Returns:
      The property for the key
    • getPropertyValue

      String getPropertyValue(PropertyContainer propertyContainer, String key)
      Returns the first element of the property values of a given property container for a specific key.
      Parameters:
      propertyContainer - The property container (e.g. PictogramElement or GraphicsAlgorithm)
      key - The property key
      Returns:
      The fist value of the property values for the key
    • moveBendpoints

      void moveBendpoints(IExecutionInfo executionInfo)
      Move bendpoints.
      Parameters:
      executionInfo - the execution info
    • removeProperty

      boolean removeProperty(PropertyContainer propertyContainer, String key)
      Removes the property of a given property container for a specific key.
      Parameters:
      propertyContainer - The property container (e.g. PictogramElement or GraphicsAlgorithm)
      key - The property key
      Returns:
      True, if the property existed
    • sendToBack

      void sendToBack(Shape shape)
      Reorders parent's children to make the given shape the backmost one. This is a convenient service to modify the z order. The z order of shapes in their containers can also be modified by changing the order of the children in the corresponding container shape directly. The last element in the list will be painted on top.
      Parameters:
      shape - shape to make the backmost one
    • sendToFront

      void sendToFront(Shape shape)
      Reorders parent's children to make the given shape the frontmost one. This is a convenient service to modify the z order. The z order of shapes in their containers can also be modified by changing the order of the children in the corresponding container shape directly. The last element in the list will be painted on top.
      Parameters:
      shape - shape to make the frontmost one
    • setPropertyValue

      void setPropertyValue(PropertyContainer propertyContainer, String key, String value)
      Sets/modifies the property's value of a given property container for a specific key.
      The property object will be created if it does not exist.
      Parameters:
      propertyContainer - The property container (e.g. PictogramElement or GraphicsAlgorithm)
      key - The property key
      value - The new property value