Package org.eclipse.draw2d
Class ManhattanConnectionRouter
java.lang.Object
org.eclipse.draw2d.AbstractRouter
org.eclipse.draw2d.ManhattanConnectionRouter
- All Implemented Interfaces:
ConnectionRouter
Provides a
Connection
with an orthogonal route between the
Connection's source and target anchors.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.draw2d.ConnectionRouter
ConnectionRouter.NullConnectionRouter
-
Field Summary
Fields inherited from interface org.eclipse.draw2d.ConnectionRouter
NULL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Ray
getDirection
(Rectangle r, Point p) Returns the direction the point p is in relation to the given rectangle.protected Ray
getEndDirection
(Connection conn) protected int
getRowNear
(Connection connection, int r, int n, int x) protected Ray
getStartDirection
(Connection conn) void
invalidate
(Connection connection) Causes the router to discard any cached information about the given Connection.protected void
processPositions
(Ray start, Ray end, List<Integer> positions, boolean horizontal, Connection conn) void
remove
(Connection connection) Removes the given Connection from this routers list of Connections it is responsible for.protected void
removeReservedLines
(Connection connection) protected void
reserveColumn
(Connection connection, Integer column) protected void
reserveRow
(Connection connection, Integer row) void
route
(Connection conn) Routes the Connection.Methods inherited from class org.eclipse.draw2d.AbstractRouter
getConstraint, getEndPoint, getStartPoint, setConstraint
-
Constructor Details
-
ManhattanConnectionRouter
public ManhattanConnectionRouter()
-
-
Method Details
-
invalidate
Description copied from class:AbstractRouter
Causes the router to discard any cached information about the given Connection.- Specified by:
invalidate
in interfaceConnectionRouter
- Overrides:
invalidate
in classAbstractRouter
- Parameters:
connection
- The connection to invalidate- See Also:
-
getDirection
Returns the direction the point p is in relation to the given rectangle. Possible values are LEFT (-1,0), RIGHT (1,0), UP (0,-1) and DOWN (0,1).- Parameters:
r
- the rectanglep
- the point- Returns:
- the direction from r to p
-
getEndDirection
-
getRowNear
-
getStartDirection
-
processPositions
protected void processPositions(Ray start, Ray end, List<Integer> positions, boolean horizontal, Connection conn) -
remove
Description copied from class:AbstractRouter
Removes the given Connection from this routers list of Connections it is responsible for.- Specified by:
remove
in interfaceConnectionRouter
- Overrides:
remove
in classAbstractRouter
- Parameters:
connection
- The connection to remove- See Also:
-
removeReservedLines
-
reserveColumn
-
reserveRow
-
route
Description copied from interface:ConnectionRouter
Routes the Connection.- Parameters:
conn
- The Connection to route- See Also:
-