Draw2D v2.0

org.eclipse.draw2d
Class AutomaticRouter

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractRouter
        |
        +--org.eclipse.draw2d.AutomaticRouter
All Implemented Interfaces:
ConnectionRouter
Direct Known Subclasses:
FanRouter

public abstract class AutomaticRouter
extends AbstractRouter

The AutomaticRouter provides the facility to prevent Connections from overlapping. Subclasses implement the abstract method handleCollision(PointList list, int index) to determine how to handle Connection collisions. Also provides access to its 'next' router so that manual routing in subclasses is possible.


Inner classes inherited from class org.eclipse.draw2d.ConnectionRouter
ConnectionRouter.NullConnectionRouter
 
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)
           
 void invalidate(Connection conn)
          Causes the router to discard any cached information about the given Connection.
protected  ConnectionRouter next()
          Returns the next router.
 void remove(Connection conn)
          Removes the given Connection from this routers list of Connections it is responsible for.
 void route(Connection conn)
          Routes the Connection.
 void setConstraint(Connection connection, Object constraint)
          Sets the constraint for the given Connection.
protected  void setEndPoints(Connection conn)
           
 void setNextRouter(ConnectionRouter router)
          Sets the next router to the passed value.
 
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

AutomaticRouter

public AutomaticRouter()
Method Detail

getConstraint

public Object getConstraint(Connection connection)
Description copied from class: AbstractRouter
Returns the constraint for the given Connection.
Overrides:
getConstraint in class AbstractRouter

handleCollision

protected abstract void handleCollision(PointList list,
                                        int index)

invalidate

public void invalidate(Connection conn)
Description copied from class: AbstractRouter
Causes the router to discard any cached information about the given Connection.
Overrides:
invalidate in class AbstractRouter

next

protected ConnectionRouter next()
Returns the next router.
Since:
2.0

remove

public void remove(Connection conn)
Description copied from class: AbstractRouter
Removes the given Connection from this routers list of Connections it is responsible for.
Overrides:
remove in class AbstractRouter

route

public void route(Connection conn)
Description copied from interface: ConnectionRouter
Routes the Connection.

setConstraint

public void setConstraint(Connection connection,
                          Object constraint)
Description copied from class: AbstractRouter
Sets the constraint for the given Connection.
Overrides:
setConstraint in class AbstractRouter

setEndPoints

protected void setEndPoints(Connection conn)

setNextRouter

public void setNextRouter(ConnectionRouter router)
Sets the next router to the passed value.
Since:
2.0

Draw2D v2.0