Class Services


  • public class Services
    extends Object
    See http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.sirius.doc%2Fdoc%2Findex.html&cp=24 for documentation on how to write service methods.
    • Constructor Detail

      • Services

        public Services()
        Constructor for the services called by the Sirius framework. The framework might instantiate this class several times for the same diagram or for other diagrams. Therefore, holding state is not possible.
    • Method Detail

      • loadDefaultResources

        public boolean loadDefaultResources​(EObject self,
                                            org.eclipse.sirius.diagram.DDiagramElement diagramElement)
        Loads the default resources into the diagram's resource set.
        Parameters:
        self - not used
        diagramElement - Any diagram element.
        Returns:
        Always false.
      • canReconnectSource

        public boolean canReconnectSource​(CharacterizedDataFlow self)
        Indicates if the source of the given data flow can be reconnected. Reconnecting the edge is possible if the source can be changed in the current diagram, i.e. does not belong to an upper level diagram.
        Parameters:
        self - The data flow to be changed.
        Returns:
        True if the source can be changed, false otherwise.
      • canReconnectTarget

        public boolean canReconnectTarget​(CharacterizedDataFlow self)
        Indicates if the target of the given data flow can be reconnected. Reconnecting the edge is possible if the target can be changed in the current diagram, i.e. does not belong to an upper level diagram.
        Parameters:
        self - The data flow to be changed.
        Returns:
        True if the target can be changed, false otherwise.
      • isValidEdge

        public boolean isValidEdge​(CharacterizedDataFlow self,
                                   org.eclipse.sirius.diagram.DNode sourceView,
                                   org.eclipse.sirius.diagram.DNode targetView)
        Indicates if the source and target of an edge match their semantic content. It is crucial to check the views of the pins to derive the real source and target nodes from reused behaviors as well as from owned behaviors. The parent views of the pin views are the views of the corresponding nodes that have to be checked as well.
        Parameters:
        self - The data flow.
        sourceView - The source pin view.
        targetView - The target pin view.
        Returns:
        True if the pins and nodes match the source and target of the data flow, false otherwise.
      • getInputPinCandidates

        public Collection<Pin> getInputPinCandidates​(CharacterizedNode node,
                                                     org.eclipse.sirius.diagram.DDiagram diagram)
        Determines Pin elements for inputs that are available for the given node in the given diagram. This method is meant to be used by read only nodes in refined diagrams.
        Parameters:
        node - The node to determine the pins for.
        diagram - The current diagram view.
        Returns:
        The set of available pins.
        See Also:
        getPinCandidates(DDiagram, CharacterizedNode, Function)
      • getOutputPinCandidates

        public Collection<Pin> getOutputPinCandidates​(CharacterizedNode node,
                                                      org.eclipse.sirius.diagram.DDiagram diagram)
        Determines Pin elements for outputs that are available for the given node in the given diagram. This method is meant to be used by read only nodes in refined diagrams.
        Parameters:
        node - The node to determine the pins for.
        diagram - The current diagram view.
        Returns:
        The set of available pins.
        See Also:
        getPinCandidates(DDiagram, CharacterizedNode, Function)
      • getPinCandidates

        protected Collection<Pin> getPinCandidates​(org.eclipse.sirius.diagram.DDiagram diagram,
                                                   CharacterizedNode node,
                                                   Function<BehaviorDefinition,​Collection<Pin>> pinGet)
        Determines Pin elements that are available for the given node in the given diagram. This method is meant to be used by read only nodes in refined diagrams. The method assumes that every passed node is a read only node. The pins shown for a read only node must only be pins that are used by the refined process in the upper level diagram.
        Parameters:
        diagram - The current diagram view.
        node - The node to determine the pins for.
        pinGet - A function mapping a given behavior to pins (used to select input or output pins).
        Returns:
        The set of available pins.
      • navigateDown

        public EObject navigateDown​(EObject self,
                                    EObject element)
        navigate to refining diagram
        Parameters:
        self -
        element - refined Process
        Returns:
        refining diagram
      • listDataTypes

        public List<EObject> listDataTypes​(EObject self)
        Parameters:
        self -
        Returns:
        list of data types for data flows
      • isRefined

        public boolean isRefined​(EObject self)
        Parameters:
        self - characterized process
        Returns:
      • isNotRefined

        public boolean isNotRefined​(EObject self,
                                    EObject element)
      • needsRefDialog

        public boolean needsRefDialog​(EObject self,
                                      EObject sourceNode,
                                      EObject targetNode)
      • refineCDF

        public void refineCDF​(EObject self,
                              CharacterizedDataFlow df,
                              org.palladiosimulator.dataflow.diagram.DataFlowDiagram.DataFlowDiagram dfd)
      • refineProcess

        public void refineProcess​(EObject newDFD,
                                  EObject p,
                                  org.palladiosimulator.dataflow.diagram.DataFlowDiagram.DataFlowDiagram oldDFD,
                                  org.palladiosimulator.dataflow.diagram.DataFlowDiagram.DataFlowDiagramRefinement ref)
      • loadResources

        public void loadResources​(EObject self)
      • isValidData

        public boolean isValidData​(EObject self)
      • isValidData

        public boolean isValidData​(EObject self,
                                   EObject entry)
      • getAllRefinements

        public List<org.palladiosimulator.dataflow.diagram.DataFlowDiagram.EdgeRefinement> getAllRefinements​(EObject source,
                                                                                                             EObject target)
      • canCreateDF

        public boolean canCreateDF​(EObject self)
      • stopDFCreation

        public void stopDFCreation​(EObject self)
      • setRef

        public void setRef​(EObject self,
                           org.palladiosimulator.dataflow.diagram.DataFlowDiagram.EdgeRefinement er)
      • canConnect

        public boolean canConnect​(EObject self,
                                  org.palladiosimulator.dataflow.diagram.DataFlowDiagram.Node sourceNode,
                                  Pin sourcePin,
                                  org.palladiosimulator.dataflow.diagram.DataFlowDiagram.Node targetNode,
                                  Pin targetPin)
        Parameters:
        self - source pin
        source - source pin
        target - target pin
        Returns:
      • inputOutputIsConsistent

        public boolean inputOutputIsConsistent​(EObject self)
      • deleteNode

        public void deleteNode​(EObject self)
      • deleteEdge

        public void deleteEdge​(EObject self)
      • getErrorMessage

        public String getErrorMessage​(EObject self)