|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.AbstractRouter | +--org.eclipse.draw2d.AutomaticRouter
The AutomaticRouter provides the facility to prevent Connections
from overlapping. Subclasses implement the abstract method
handleCollision(PointList, int)
to determine how to handle Connection
collisions.
Also provides access to its 'next' router so that manual routing in subclasses is possible.
Nested Class Summary |
Nested classes inherited from class org.eclipse.draw2d.ConnectionRouter |
ConnectionRouter.NullConnectionRouter |
Field Summary |
Fields inherited from interface org.eclipse.draw2d.ConnectionRouter |
NULL |
Constructor Summary | |
AutomaticRouter()
|
Method Summary | |
Object |
getConstraint(Connection connection)
Returns the constraint for the given Connection. |
protected abstract void |
handleCollision(PointList list,
int index)
Handles collisions between 2 or more Connections. |
void |
invalidate(Connection conn)
Causes the router to discard any cached information about the given Connection. |
protected ConnectionRouter |
next()
Returns the next router in the chain. |
void |
remove(Connection conn)
Removes the given Connection from this routers list of Connections it is responsible for. |
void |
route(Connection conn)
Routes the given connection. |
void |
setConstraint(Connection connection,
Object constraint)
An AutomaticRouter needs no constraints for the connections it routes. |
protected void |
setEndPoints(Connection conn)
Sets the start and end points for the given connection. |
void |
setNextRouter(ConnectionRouter router)
Sets the next router. |
Methods inherited from class org.eclipse.draw2d.AbstractRouter |
getEndPoint, getStartPoint |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AutomaticRouter()
Method Detail |
public Object getConstraint(Connection connection)
AbstractRouter
getConstraint
in interface ConnectionRouter
getConstraint
in class AbstractRouter
connection
- The connection
ConnectionRouter.getConstraint(Connection)
protected abstract void handleCollision(PointList list, int index)
list
- The PointList of a connection that collides with another connectionindex
- The index of the current connection in the list of colliding connectionspublic void invalidate(Connection conn)
AbstractRouter
invalidate
in interface ConnectionRouter
invalidate
in class AbstractRouter
conn
- The connection to invalidateConnectionRouter.invalidate(Connection)
protected ConnectionRouter next()
public void remove(Connection conn)
AbstractRouter
remove
in interface ConnectionRouter
remove
in class AbstractRouter
conn
- The connection to removeConnectionRouter.remove(Connection)
public void route(Connection conn)
handleCollision(PointList, int)
.
conn
- The connection to routepublic void setConstraint(Connection connection, Object constraint)
setConstraint(Connection, Object)
on the
next()
router.
setConstraint
in interface ConnectionRouter
setConstraint
in class AbstractRouter
connection
- The connectionconstraint
- The constraintConnectionRouter.setConstraint(Connection, Object)
protected void setEndPoints(Connection conn)
conn
- The connectionpublic void setNextRouter(ConnectionRouter router)
router
- The ConnectionRouter
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |