public final class ShortestPathConnectionRouter extends AbstractRouter
ConnectionRouter.NullConnectionRouter
NULL
Constructor and Description |
---|
ShortestPathConnectionRouter(IFigure container)
Creates a new shortest path router with the given container.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsConnection(Connection conn)
Returns true if the given connection is routed by this router, false
otherwise
|
java.lang.Object |
getConstraint(Connection connection)
Gets the constraint for the given
Connection . |
IFigure |
getContainer() |
java.util.List |
getPathsAfterRouting() |
int |
getSpacing()
Returns the default spacing maintained on either side of a connection.
|
boolean |
hasMoreConnections() |
void |
invalidate(Connection connection)
Causes the router to discard any cached information about the given
Connection.
|
boolean |
isDirty()
Returns the value indicating if the router is dirty, i.e. if there are
any outstanding connections that need to be routed
|
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,
java.lang.Object constraint)
Sets the constraint for the given Connection.
|
void |
setIgnoreInvalidate(boolean b)
Sets the value indicating if connection invalidation should be ignored.
|
void |
setSpacing(int spacing)
Sets the default space that should be maintained on either side of a
connection.
|
boolean |
shouldIgnoreInvalidate()
Returns the value indicating if connection invalidation should be
ignored.
|
getEndPoint, getStartPoint
public ShortestPathConnectionRouter(IFigure container)
container
- the containerpublic java.lang.Object getConstraint(Connection connection)
Connection
. The constraint is
the paths list of bend points for this connection.getConstraint
in interface ConnectionRouter
getConstraint
in class AbstractRouter
connection
- The connection whose constraint we are retrievingpublic int getSpacing()
public void invalidate(Connection connection)
AbstractRouter
invalidate
in interface ConnectionRouter
invalidate
in class AbstractRouter
connection
- The connection to invalidateConnectionRouter.invalidate(Connection)
public void remove(Connection connection)
AbstractRouter
remove
in interface ConnectionRouter
remove
in class AbstractRouter
connection
- The connection to removeConnectionRouter.remove(Connection)
public void route(Connection conn)
ConnectionRouter
conn
- The Connection to routeConnectionRouter.route(Connection)
public java.util.List getPathsAfterRouting()
public void setConstraint(Connection connection, java.lang.Object constraint)
AbstractRouter
setConstraint
in interface ConnectionRouter
setConstraint
in class AbstractRouter
connection
- The connectionconstraint
- The constraintConnectionRouter.setConstraint(Connection, Object)
public void setSpacing(int spacing)
spacing
- the connection spacingpublic boolean hasMoreConnections()
public IFigure getContainer()
public void setIgnoreInvalidate(boolean b)
b
- true if invalidation should be skipped, false otherwisepublic boolean shouldIgnoreInvalidate()
public boolean isDirty()
public boolean containsConnection(Connection conn)
conn
- Connection whose router is questionedCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.