Class ModelGlue
- java.lang.Object
-
- de.aristaflow.adept2.ui.processvisualisation.model.ModelGlue
-
- All Implemented Interfaces:
GraphFigureProvider
public class ModelGlue extends Object implements GraphFigureProvider
Helper methods for managing the model and transforming it into chunks manageable by EditParts.
-
-
Field Summary
Fields Modifier and Type Field Description protected de.aristaflow.adept2.ui.processvisualisation.widgets.adept.ProcessConnectionRouter
connectionRouter
a connection router for adept connection figuresprotected de.aristaflow.adept2.ui.processvisualisation.widgets.GraphFigureFormatter
formatter
a figure formatter for adept figuresprotected static Logger
logger
The logger used to log error messages.
-
Constructor Summary
Constructors Constructor Description ModelGlue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adaptDataEdgeFigure(de.aristaflow.adept2.ui.processvisualisation.widgets.ProcessConnectionInterface pci, ActivityConstants.AccessType type, boolean optional, boolean decision)
Adapts the designated process connection (representing a data edge) according to the designated type and optional flag.de.aristaflow.adept2.ui.processvisualisation.widgets.ProcessConnectionInterface
createFigureForEdge(ProcessConstants.EdgeType type)
Create an appropriate ProcessConnectionorg.eclipse.draw2d.IFigure
getBranchFigure()
Creates an IFigure from the widgets package for a branch edit partorg.eclipse.draw2d.ConnectionRouter
getConnectionRouter(UISettings uiSettings)
Creates and returns a connection router which is used to route the connection between graph elementsde.aristaflow.adept2.ui.processvisualisation.widgets.ProcessConnectionInterface
getDataEdgeFigure(ActivityConstants.AccessType type, boolean optional, boolean decision)
Create a ProcessConnection for a data edge.de.aristaflow.adept2.ui.processvisualisation.widgets.DataElementAnchor
getDataElementAnchor(org.eclipse.draw2d.IFigure figure)
Creates an Anchor for a data element figurede.aristaflow.adept2.ui.processvisualisation.widgets.DataFigureInterface
getDataElementFigure(de.aristaflow.adept2.ui.processvisualisation.parts.DataElementEditPart editPart)
Create an IFigure from the widgets package for a data elementde.aristaflow.adept2.ui.processvisualisation.widgets.GraphFigureFormatter
getGraphFigureFormatter()
Creates and returns a formatter for the process graph figuresde.aristaflow.adept2.ui.processvisualisation.widgets.NodeAnchor
getNodeAnchor(ProcessConstants.NodeType type, org.eclipse.draw2d.IFigure figure)
Create an Anchor for this node and figurede.aristaflow.adept2.ui.processvisualisation.widgets.adept.NodeFigure
getNodeFigure(ProcessConstants.NodeType type)
Create an IFigure from the widgets package for a NodeList<Integer>
sortNodes(int[] nodes, Template t)
Sort a list of Nodes by their branch ID and return the sorted Collection as a new List.
-
-
-
Field Detail
-
logger
protected static final Logger logger
The logger used to log error messages.
-
formatter
protected de.aristaflow.adept2.ui.processvisualisation.widgets.GraphFigureFormatter formatter
a figure formatter for adept figures
-
connectionRouter
protected de.aristaflow.adept2.ui.processvisualisation.widgets.adept.ProcessConnectionRouter connectionRouter
a connection router for adept connection figures
-
-
Method Detail
-
getGraphFigureFormatter
public de.aristaflow.adept2.ui.processvisualisation.widgets.GraphFigureFormatter getGraphFigureFormatter()
Description copied from interface:GraphFigureProvider
Creates and returns a formatter for the process graph figures- Specified by:
getGraphFigureFormatter
in interfaceGraphFigureProvider
- Returns:
- a graph formatter
-
getNodeAnchor
public de.aristaflow.adept2.ui.processvisualisation.widgets.NodeAnchor getNodeAnchor(ProcessConstants.NodeType type, org.eclipse.draw2d.IFigure figure)
Create an Anchor for this node and figure- Specified by:
getNodeAnchor
in interfaceGraphFigureProvider
- Parameters:
type
- the NodeType of the represented nodefigure
- the Figure- Returns:
- an appropriate ConnectionAnchor
-
getDataElementAnchor
public de.aristaflow.adept2.ui.processvisualisation.widgets.DataElementAnchor getDataElementAnchor(org.eclipse.draw2d.IFigure figure)
Description copied from interface:GraphFigureProvider
Creates an Anchor for a data element figure- Specified by:
getDataElementAnchor
in interfaceGraphFigureProvider
- Parameters:
figure
- the figure where the anchor should be created for- Returns:
- an appropriate DataElementAnchor
-
getConnectionRouter
public org.eclipse.draw2d.ConnectionRouter getConnectionRouter(UISettings uiSettings)
Description copied from interface:GraphFigureProvider
Creates and returns a connection router which is used to route the connection between graph elements- Specified by:
getConnectionRouter
in interfaceGraphFigureProvider
- Parameters:
uiSettings
- the uiSettings which can be used to get default values for the routing- Returns:
- an appropriate ConnectionRouuter
-
getNodeFigure
public de.aristaflow.adept2.ui.processvisualisation.widgets.adept.NodeFigure getNodeFigure(ProcessConstants.NodeType type)
Create an IFigure from the widgets package for a Node- Specified by:
getNodeFigure
in interfaceGraphFigureProvider
- Parameters:
type
- the type of the Node- Returns:
- the widget for the node
-
getBranchFigure
public org.eclipse.draw2d.IFigure getBranchFigure()
Description copied from interface:GraphFigureProvider
Creates an IFigure from the widgets package for a branch edit part- Specified by:
getBranchFigure
in interfaceGraphFigureProvider
- Returns:
- the widget for the branch
-
getDataElementFigure
public de.aristaflow.adept2.ui.processvisualisation.widgets.DataFigureInterface getDataElementFigure(de.aristaflow.adept2.ui.processvisualisation.parts.DataElementEditPart editPart)
Description copied from interface:GraphFigureProvider
Create an IFigure from the widgets package for a data element- Specified by:
getDataElementFigure
in interfaceGraphFigureProvider
- Parameters:
editPart
- the editPart the widget is created for- Returns:
- the widget for the data element
-
createFigureForEdge
public de.aristaflow.adept2.ui.processvisualisation.widgets.ProcessConnectionInterface createFigureForEdge(ProcessConstants.EdgeType type)
Create an appropriate ProcessConnection- Specified by:
createFigureForEdge
in interfaceGraphFigureProvider
- Parameters:
type
- the type of the edge- Returns:
- a ProcessConnection that is correct for the edges type
-
getDataEdgeFigure
public de.aristaflow.adept2.ui.processvisualisation.widgets.ProcessConnectionInterface getDataEdgeFigure(ActivityConstants.AccessType type, boolean optional, boolean decision)
Description copied from interface:GraphFigureProvider
Create a ProcessConnection for a data edge.- Specified by:
getDataEdgeFigure
in interfaceGraphFigureProvider
- Parameters:
type
- The access type of the data edge.optional
- Whether the data edge is optional.decision
- Whether the data edge is a decision data edge.- Returns:
- a ProcessConnection for a data edge
-
adaptDataEdgeFigure
public void adaptDataEdgeFigure(de.aristaflow.adept2.ui.processvisualisation.widgets.ProcessConnectionInterface pci, ActivityConstants.AccessType type, boolean optional, boolean decision)
Description copied from interface:GraphFigureProvider
Adapts the designated process connection (representing a data edge) according to the designated type and optional flag.- Specified by:
adaptDataEdgeFigure
in interfaceGraphFigureProvider
- Parameters:
pci
- The ProcessConnection for a data edge.type
- The access type of the data edge.optional
- Whether the data edge is optional.decision
- Whether the data edge is a decision data edge.
-
sortNodes
public List<Integer> sortNodes(int[] nodes, Template t)
Sort a list of Nodes by their branch ID and return the sorted Collection as a new List. The passed List is not modified- Specified by:
sortNodes
in interfaceGraphFigureProvider
- Parameters:
nodes
- the list of node IDst
- the Template containing the nodes- Returns:
- a sorted copy of the List
-
-