public class OrthogonalRouter extends java.lang.Object implements IConnectionRouter
IConnectionRouter
that interprets the Connection
control
points as way points and adjusts the way points (if necessary) so that the
Connection
is routed orthogonally.Constructor and Description |
---|
OrthogonalRouter() |
Modifier and Type | Method and Description |
---|---|
protected IGeometry |
getAnchorageGeometry(Connection connection,
int index)
Retrieves the geometry of the anchorage at the given index, in case the
respective anchor is connected.
|
boolean |
isImplicitAnchor(IAnchor anchor)
Returns
true if the given IAnchor was added by this
IConnectionRouter during IConnectionRouter.route(Connection) . |
void |
route(Connection connection)
Adjusts the
connection's points (if necessary), which
includes computing reference points for DynamicAnchor s (if any). |
protected Vector |
routeNonOrthogonalSegment(Connection connection,
org.eclipse.gef4.fx.nodes.OrthogonalRouter.ControlPointManipulator controlPointManipulator,
Vector previousDirection,
Vector currentDirection,
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,
org.eclipse.gef4.fx.nodes.OrthogonalRouter.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 IGeometry getAnchorageGeometry(Connection connection, int index)
connection
- The connection which is connected.index
- The index of the anchor whose anchorage geometry is to be
retrieved.null
if the anchor is
not connected.public boolean isImplicitAnchor(IAnchor anchor)
IConnectionRouter
true
if the given IAnchor
was added by this
IConnectionRouter
during IConnectionRouter.route(Connection)
. Otherwise
returns false
.isImplicitAnchor
in interface IConnectionRouter
anchor
- The IAnchor
that is tested for implicitness.true
if the given IAnchor
is implicit,
otherwise false
.public void route(Connection connection)
IConnectionRouter
connection's
points (if necessary), which
includes computing reference points for DynamicAnchor
s (if any).route
in interface IConnectionRouter
connection
- The Connection
to route.protected Vector routeNonOrthogonalSegment(Connection connection, org.eclipse.gef4.fx.nodes.OrthogonalRouter.ControlPointManipulator controlPointManipulator, Vector previousDirection, Vector currentDirection, int i, Point currentPoint)
connection
- The Connection
that is manipulated.controlPointManipulator
- The helper that is used for inserting route points.previousDirection
- The previous direction, or null
.currentDirection
- The current direction.i
- The index of the current point.currentPoint
- The current Point
.protected Vector routeOrthogonalSegment(Connection connection, org.eclipse.gef4.fx.nodes.OrthogonalRouter.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
.Copyright (c) 2014 itemis AG and others. All rights reserved.