public class OrthogonalRouter extends AbstractRouter
IConnectionRouter
that interprets the Connection
control
points as way points and adjusts the way points (if necessary) so that the
Connection
is routed orthogonally.AbstractRouter.ControlPointManipulator, AbstractRouter.VolatileStaticAnchor
Constructor and Description |
---|
OrthogonalRouter() |
Modifier and Type | Method and Description |
---|---|
protected Point |
getAnchoredReferencePoint(java.util.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(java.util.List<Point> points,
int index,
DynamicAnchor anchor,
AnchorKey key)
Update's the reference point of the anchor with the given index.
|
createControlPointManipulator, getAnchorageGeometry, getConnection, insertRouterAnchors, removeVolatileAnchors, route, updateComputationParameters, wasInserted
protected Point getAnchoredReferencePoint(java.util.List<Point> points, int index)
getAnchoredReferencePoint
in class AbstractRouter
points
- The Connection
that is currently routed.index
- The index specifying the anchor for which to provide a
reference point.protected Vector route(AbstractRouter.ControlPointManipulator cpm, Vector inDirection, Vector outDirection)
AbstractRouter
Vector
that
points to the next point.route
in class AbstractRouter
cpm
- The AbstractRouter.ControlPointManipulator
that can be used to insert
points.inDirection
- The Vector
from the previous point to the current
point.outDirection
- The Vector
from the current point to the next point.Vector
from the current point to the next
point.protected Vector routeNonOrthogonalSegment(Connection connection, AbstractRouter.ControlPointManipulator controlPointManipulator, Vector inDirection, Vector outDirection, int i, Point currentPoint)
connection
- The Connection
that is manipulated.controlPointManipulator
- The helper that is used for inserting route points.inDirection
- The previous direction, or null
(for the end
point).outDirection
- The current direction, or null
(for the start
point).i
- The index of the current point.currentPoint
- The current Point
.protected Vector routeOrthogonalSegment(Connection connection, AbstractRouter.ControlPointManipulator controlPointManipulator, Vector currentDirection, int i, Point currentPoint)
connection
- The Connection
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 current Point
.protected void updateComputationParameters(java.util.List<Point> points, int index, DynamicAnchor anchor, AnchorKey key)
AbstractRouter
updateComputationParameters
in class AbstractRouter
points
- The Connection
'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
- The DynamicAnchor
for which to update the computation
parameters.key
- The AnchorKey
, corresponding to the index, for which
to update the computation parameters.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.