Class Services
- java.lang.Object
-
- org.palladiosimulator.dataflow.diagram.characterized.editor.sirius.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 Summary
Constructors Constructor Description Services()
Constructor for the services called by the Sirius framework.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCDF(EObject self, EObject sourcePin, EObject targetPin, EObject sourceNode, EObject targetNode)
void
addNewRefinedDF(EObject self, EObject sourcePin, EObject targetPin, EObject sourceNode, EObject targetNode)
void
addRefiningDF(EObject self, EObject sourcePin, EObject targetPin, EObject source, EObject target)
boolean
canConnect(EObject self, org.palladiosimulator.dataflow.diagram.DataFlowDiagram.Node sourceNode, Pin sourcePin, org.palladiosimulator.dataflow.diagram.DataFlowDiagram.Node targetNode, Pin targetPin)
boolean
canCreateDF(EObject self)
boolean
canReconnectSource(CharacterizedDataFlow self)
Indicates if the source of the given data flow can be reconnected.boolean
canReconnectTarget(CharacterizedDataFlow self)
Indicates if the target of the given data flow can be reconnected.void
deleteEdge(EObject self)
void
deleteNode(EObject self)
List<org.palladiosimulator.dataflow.diagram.DataFlowDiagram.EdgeRefinement>
getAllRefinements(EObject source, EObject target)
String
getErrorMessage(EObject self)
Collection<Pin>
getInputPinCandidates(CharacterizedNode node, org.eclipse.sirius.diagram.DDiagram diagram)
DeterminesPin
elements for inputs that are available for the given node in the given diagram.Collection<Pin>
getOutputPinCandidates(CharacterizedNode node, org.eclipse.sirius.diagram.DDiagram diagram)
DeterminesPin
elements for outputs that are available for the given node in the given diagram.protected Collection<Pin>
getPinCandidates(org.eclipse.sirius.diagram.DDiagram diagram, CharacterizedNode node, Function<BehaviorDefinition,Collection<Pin>> pinGet)
DeterminesPin
elements that are available for the given node in the given diagram.CharacterizedNode
getTarget(EObject self, EObject targetPin)
boolean
inputOutputIsConsistent(EObject self)
boolean
isNotRefined(EObject self, EObject element)
boolean
isRefined(EObject self)
boolean
isValidData(EObject self)
boolean
isValidData(EObject self, EObject entry)
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.List<EObject>
listDataTypes(EObject self)
boolean
loadDefaultResources(EObject self, org.eclipse.sirius.diagram.DDiagramElement diagramElement)
Loads the default resources into the diagram's resource set.void
loadResources(EObject self)
EObject
navigateDown(EObject self, EObject element)
navigate to refining diagramboolean
needsRef(EObject self, EObject source, EObject target)
boolean
needsRefDialog(EObject self, EObject sourceNode, EObject targetNode)
void
refineCDF(EObject self, CharacterizedDataFlow df, org.palladiosimulator.dataflow.diagram.DataFlowDiagram.DataFlowDiagram dfd)
void
refineProcess(EObject newDFD, EObject p, org.palladiosimulator.dataflow.diagram.DataFlowDiagram.DataFlowDiagram oldDFD, org.palladiosimulator.dataflow.diagram.DataFlowDiagram.DataFlowDiagramRefinement ref)
void
setRef(EObject self, org.palladiosimulator.dataflow.diagram.DataFlowDiagram.EdgeRefinement er)
void
stopDFCreation(EObject self)
-
-
-
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 useddiagramElement
- 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)
DeterminesPin
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)
DeterminesPin
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)
DeterminesPin
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:
-
addNewRefinedDF
public void addNewRefinedDF(EObject self, EObject sourcePin, EObject targetPin, 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)
-
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)
-
addRefiningDF
public void addRefiningDF(EObject self, EObject sourcePin, EObject targetPin, EObject source, EObject target)
-
addCDF
public void addCDF(EObject self, EObject sourcePin, EObject targetPin, EObject sourceNode, EObject targetNode)
-
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 pinsource
- source pintarget
- target pin- Returns:
-
inputOutputIsConsistent
public boolean inputOutputIsConsistent(EObject self)
-
deleteNode
public void deleteNode(EObject self)
-
deleteEdge
public void deleteEdge(EObject self)
-
getTarget
public CharacterizedNode getTarget(EObject self, EObject targetPin)
-
-