Package org.eclipse.draw2d
Class AbstractRouter
java.lang.Object
org.eclipse.draw2d.AbstractRouter
- All Implemented Interfaces:
ConnectionRouter
- Direct Known Subclasses:
AutomaticRouter
,BendpointConnectionRouter
,ConnectionRouter.NullConnectionRouter
,ManhattanConnectionRouter
,ShortestPathConnectionRouter
Base class for implementing a connection router. This class provides stubs
for constraint usage, and some utility methods.
-
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 TypeMethodDescriptiongetConstraint
(Connection connection) Returns the constraint for the given Connection.protected Point
getEndPoint
(Connection connection) A convenience method for obtaining a connection's endpoint.protected Point
getStartPoint
(Connection conn) A convenience method for obtaining a connection's start point.void
invalidate
(Connection connection) Causes the router to discard any cached information about the given Connection.void
remove
(Connection connection) Removes the given Connection from this routers list of Connections it is responsible for.void
setConstraint
(Connection connection, Object constraint) Sets the constraint for the given Connection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.draw2d.ConnectionRouter
route
-
Constructor Details
-
AbstractRouter
public AbstractRouter()
-
-
Method Details
-
getConstraint
Returns the constraint for the given Connection.- Specified by:
getConstraint
in interfaceConnectionRouter
- Parameters:
connection
- The connection- Returns:
- The constraint
- Since:
- 2.0
-
getEndPoint
A convenience method for obtaining a connection's endpoint. The connection's endpoint is a point in absolute coordinates obtained by using its source and targetConnectionAnchor
. The returned Point is a static singleton that is reused to reduce garbage collection. The caller may modify this point in any way. However, the point will be reused and its values overwritten during the next call to this method.- Parameters:
connection
- The connection- Returns:
- The endpoint
- Since:
- 2.0
-
getStartPoint
A convenience method for obtaining a connection's start point. The connection's startpoint is a point in absolute coordinates obtained by using its source and targetConnectionAnchor
. The returned Point is a static singleton that is reused to reduce garbage collection. The caller may modify this point in any way. However, the point will be reused and its values overwritten during the next call to this method.- Parameters:
conn
- The connection- Returns:
- The start point
- Since:
- 2.0
-
invalidate
Causes the router to discard any cached information about the given Connection.- Specified by:
invalidate
in interfaceConnectionRouter
- Parameters:
connection
- The connection to invalidate- Since:
- 2.0
-
remove
Removes the given Connection from this routers list of Connections it is responsible for.- Specified by:
remove
in interfaceConnectionRouter
- Parameters:
connection
- The connection to remove- Since:
- 2.0
-
setConstraint
Sets the constraint for the given Connection.- Specified by:
setConstraint
in interfaceConnectionRouter
- Parameters:
connection
- The connectionconstraint
- The constraint- Since:
- 2.0
-