Eclipse Draw2d
3.1

org.eclipse.draw2d
Class ShortestPathConnectionRouter

java.lang.Object
  extended byorg.eclipse.draw2d.AbstractRouter
      extended byorg.eclipse.draw2d.ShortestPathConnectionRouter
All Implemented Interfaces:
ConnectionRouter

public final class ShortestPathConnectionRouter
extends AbstractRouter

Routes multiple connections around the children of a given container figure.

Since:
3.1

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
ShortestPathConnectionRouter(IFigure container)
          Creates a new shortest path router with the given container.
 
Method Summary
 Object getConstraint(Connection connection)
          Gets the constraint for the given Connection.
 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 route(Connection conn)
          Routes the Connection.
 void setConstraint(Connection connection, Object constraint)
          Sets the constraint for the given Connection.
 
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

ShortestPathConnectionRouter

public ShortestPathConnectionRouter(IFigure container)
Creates a new shortest path router with the given container. The container contains all the figure's which will be treated as obstacles for the connections to avoid. Any time a child of the container moves, one or more connections will be revalidated to process the new obstacle locations. The connections being routed must not be contained within the container.

Parameters:
container - the container
Method Detail

getConstraint

public Object getConstraint(Connection connection)
Gets the constraint for the given Connection. The constraint is the paths list of bend points for this connection.

Specified by:
getConstraint in interface ConnectionRouter
Overrides:
getConstraint in class AbstractRouter
Parameters:
connection - The connection whose constraint we are retrieving
Returns:
The constraint

invalidate

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

Specified by:
invalidate in interface ConnectionRouter
Overrides:
invalidate in class AbstractRouter
Parameters:
connection - The connection to invalidate
See Also:
ConnectionRouter.invalidate(org.eclipse.draw2d.Connection)

remove

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

Specified by:
remove in interface ConnectionRouter
Overrides:
remove in class AbstractRouter
Parameters:
connection - The connection to remove
See Also:
ConnectionRouter.remove(org.eclipse.draw2d.Connection)

route

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

Parameters:
conn - The Connection to route
See Also:
ConnectionRouter.route(Connection)

setConstraint

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

Specified by:
setConstraint in interface ConnectionRouter
Overrides:
setConstraint in class AbstractRouter
Parameters:
connection - The connection
constraint - The constraint
See Also:
ConnectionRouter.setConstraint(org.eclipse.draw2d.Connection, java.lang.Object)

Eclipse Draw2d
3.1

Copyright (c) IBM Corp. and others 2000, 2005. All Rights Reserved.