Package org.eclipse.gef.fx.nodes
Class OrthogonalRouter
java.lang.Object
org.eclipse.gef.fx.nodes.AbstractRouter
org.eclipse.gef.fx.nodes.OrthogonalRouter
- All Implemented Interfaces:
IConnectionRouter
An
IConnectionRouter
that interprets the Connection
control
points as way points and adjusts the way points (if necessary) so that the
Connection
is routed orthogonally.-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.gef.fx.nodes.AbstractRouter
AbstractRouter.ControlPointManipulator, AbstractRouter.VolatileStaticAnchor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Point
getAnchoredReferencePoint
(List<Point> points, int index) Returns the reference point for the anchor at the given index.protected Vector
route
(AbstractRouter.ControlPointManipulator cpm, Vector inDirection, Vector outDirection) Inserts router anchors where necessary.protected Vector
routeNonOrthogonalSegment
(Connection connection, AbstractRouter.ControlPointManipulator controlPointManipulator, Vector inDirection, Vector outDirection, int i, Point currentPoint) This method is called for a non-orthogonal direction from the last point on the connection to the current point on the connection.protected Vector
routeOrthogonalSegment
(Connection connection, AbstractRouter.ControlPointManipulator controlPointManipulator, Vector currentDirection, int i, Point currentPoint) This method is called for an orthogonal direction from the last point on the connection to the current point on the connection.protected void
updateComputationParameters
(List<Point> points, int index, DynamicAnchor anchor, AnchorKey key) Update's the reference point of the anchor with the given index.Methods inherited from class org.eclipse.gef.fx.nodes.AbstractRouter
createControlPointManipulator, getAnchorageGeometry, getConnection, insertRouterAnchors, removeVolatileAnchors, route, updateComputationParameters, wasInserted
-
Constructor Details
-
OrthogonalRouter
public OrthogonalRouter()
-
-
Method Details
-
getAnchoredReferencePoint
Returns the reference point for the anchor at the given index.- Specified by:
getAnchoredReferencePoint
in classAbstractRouter
- Parameters:
points
- TheConnection
that is currently routed.index
- The index specifying the anchor for which to provide a reference point.- Returns:
- The reference point for the anchor at the given index in the local coordinate system of the anchored, which is the connection's curve.
-
route
protected Vector route(AbstractRouter.ControlPointManipulator cpm, Vector inDirection, Vector outDirection) Description copied from class:AbstractRouter
Inserts router anchors where necessary. Returns theVector
that points to the next point.- Overrides:
route
in classAbstractRouter
- Parameters:
cpm
- TheAbstractRouter.ControlPointManipulator
that can be used to insert points.inDirection
- TheVector
from the previous point to the current point.outDirection
- TheVector
from the current point to the next point.- Returns:
- The adjusted
Vector
from the current point to the next point.
-
routeNonOrthogonalSegment
protected Vector routeNonOrthogonalSegment(Connection connection, AbstractRouter.ControlPointManipulator controlPointManipulator, Vector inDirection, Vector outDirection, int i, Point currentPoint) This method is called for a non-orthogonal direction from the last point on the connection to the current point on the connection.- Parameters:
connection
- TheConnection
that is manipulated.controlPointManipulator
- The helper that is used for inserting route points.inDirection
- The previous direction, ornull
(for the end point).outDirection
- The current direction, ornull
(for the start point).i
- The index of the current point.currentPoint
- The currentPoint
.- Returns:
- The manipulated current direction.
-
routeOrthogonalSegment
protected Vector routeOrthogonalSegment(Connection connection, AbstractRouter.ControlPointManipulator controlPointManipulator, Vector currentDirection, int i, Point currentPoint) This method is called for an orthogonal direction from the last point on the connection to the current point on the connection.- Parameters:
connection
- TheConnection
that is manipulated.controlPointManipulator
- The helper that is used to insert route points.currentDirection
- The current direction.i
- The index of the current point.currentPoint
- The currentPoint
.- Returns:
- The manipulated current direction.
-
updateComputationParameters
protected void updateComputationParameters(List<Point> points, int index, DynamicAnchor anchor, AnchorKey key) Description copied from class:AbstractRouter
Update's the reference point of the anchor with the given index.- Overrides:
updateComputationParameters
in classAbstractRouter
- Parameters:
points
- TheConnection
's points (snapshot taken before parameters are updated, i.e. independent from the parameter changes).index
- The index of the connection anchor (and anchor key) for which the computation parameters are updated.anchor
- TheDynamicAnchor
for which to update the computation parameters.key
- TheAnchorKey
, corresponding to the index, for which to update the computation parameters.
-