Class AdaptagramsRouting
java.lang.Object
org.vanted.plugins.layout.adaptagrams.edgerouting.AdaptagramsRouting
public class AdaptagramsRouting extends Object
- Author:
- Tobias Czauderna
-
Constructor Summary
Constructors Constructor Description AdaptagramsRouting()
-
Method Summary
Modifier and Type Method Description static void
addBendPointForNodePosition(ArrayList<Vector2d> edgeBends, int compareIndex, int addIndex, Vector2d nodePos)
Adds an edge bend point for the node position.static org.adaptagrams.ConnRef
defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int routingType)
Defines a ConnRef for an edge.static org.adaptagrams.ConnRef
defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType)
Defines a ConnRef for an edge.static org.adaptagrams.ConnRef
defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)
Defines a ConnRef for an edge.static org.adaptagrams.ConnRef
defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)
Defines a ConnRef for an edge.static org.adaptagrams.ShapeRef
defineShapeRef(org.adaptagrams.Router router, View view, Node node)
Defines a ShapeRef for a node.static void
fixSourceBendPoints(ArrayList<Vector2d> edgeBends, View view, Node node)
Fixes the edge bend points at the source node.static void
fixTargetBendPoints(ArrayList<Vector2d> edgeBends, View view, Node node)
Fixes the edge bend points at the target node.static ArrayList<Vector2d>
getEdgeBends(org.adaptagrams.ConnRef connRef)
Returns the edge bend points for a connector.static ArrayList<Vector2d>
getEdgeBends(org.adaptagrams.ConnRef connRef, double radius)
Returns the edge bend points for a connector.
-
Constructor Details
-
AdaptagramsRouting
public AdaptagramsRouting()
-
-
Method Details
-
defineShapeRef
public static org.adaptagrams.ShapeRef defineShapeRef(org.adaptagrams.Router router, View view, Node node)Defines a ShapeRef for a node.- Parameters:
router
- the routerview
- the current viewnode
- the node- Returns:
- Adaptagrams shape (
ShapeRef
)
-
defineConnRef
public static org.adaptagrams.ConnRef defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int routingType)Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.- Parameters:
router
- the routerview
- the current viewedge
- the edgeroutingType
- routing type (ConnType.ConnType_PolyLine
orConnType.ConnType_Orthogonal
)- Returns:
- Adaptagrams connector (
ConnRef
)
-
defineConnRef
public static org.adaptagrams.ConnRef defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.- Parameters:
router
- the routerview
- the current viewedge
- the edgeroutingType
- routing type (ConnType.ConnType_PolyLine
orConnType.ConnType_Orthogonal
)avoidCheckpoints
- Adaptagrams checkpoints (AvoidCheckpoints
), list of checkpoints the connector (the edge) has to pass- Returns:
- Adaptagrams connector (
ConnRef
)
-
defineConnRef
public static org.adaptagrams.ConnRef defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.- Parameters:
router
- the routerview
- the current viewedge
- the edgesrcConnDirFlag
- edge direction at source node (ConnDirFlag.ConnDirAll
,ConnDirFlag.ConnDirUp
,ConnDirFlag.ConnDirRight
,ConnDirFlag.ConnDirDown
,ConnDirFlag.ConnDirLeft
orConnDirFlag.ConnDirNone
)tgtConnDirFlag
- edge direction at target node (ConnDirFlag.ConnDirAll
,ConnDirFlag.ConnDirUp
,ConnDirFlag.ConnDirRight
,ConnDirFlag.ConnDirDown
,ConnDirFlag.ConnDirLeft
orConnDirFlag.ConnDirNone
)routingType
- routing type (ConnType.ConnType_PolyLine
orConnType.ConnType_Orthogonal
)avoidCheckpoints
- Adaptagrams checkpoints (AvoidCheckpoints
), list of checkpoints the connector (the edge) has to pass- Returns:
- Adaptagrams connector (
ConnRef
)
-
defineConnRef
public static org.adaptagrams.ConnRef defineConnRef(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType)Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.- Parameters:
router
- the routerview
- the current viewedge
- the edgesrcConnDirFlag
- edge direction at source node (ConnDirFlag.ConnDirAll
,ConnDirFlag.ConnDirUp
,ConnDirFlag.ConnDirRight
,ConnDirFlag.ConnDirDown
,ConnDirFlag.ConnDirLeft
orConnDirFlag.ConnDirNone
)tgtConnDirFlag
- edge direction at target node (ConnDirFlag.ConnDirAll
,ConnDirFlag.ConnDirUp
,ConnDirFlag.ConnDirRight
,ConnDirFlag.ConnDirDown
,ConnDirFlag.ConnDirLeft
orConnDirFlag.ConnDirNone
)routingType
- routing type (ConnType.ConnType_PolyLine
orConnType.ConnType_Orthogonal
- Returns:
- Adaptagrams connector (
ConnRef
)
-
getEdgeBends
Returns the edge bend points for a connector.- Parameters:
connRef
- Adaptagrams connector (ConnRef
)- Returns:
ArrayList
of bend points
-
getEdgeBends
Returns the edge bend points for a connector.- Parameters:
connRef
- Adaptagrams connector (ConnRef
)radius
- bend radius- Returns:
ArrayList
of bend points
-
addBendPointForNodePosition
public static void addBendPointForNodePosition(ArrayList<Vector2d> edgeBends, int compareIndex, int addIndex, Vector2d nodePos)Adds an edge bend point for the node position.- Parameters:
edgeBends
-ArrayList
of bend pointscompareIndex
- compare the node position with bend point at this indexaddIndex
- add a bend point for the node position at this indexnodePos
- node position
-
fixSourceBendPoints
Fixes the edge bend points at the source node. Only edge bend points outside the node are kept.- Parameters:
edgeBends
-ArrayList
of bend pointsview
- the current viewnode
- the node
-
fixTargetBendPoints
Fixes the edge bend points at the target node. Only edge bend points outside the node are kept.- Parameters:
edgeBends
-ArrayList
of bend pointsview
- the current viewnode
- the node
-