Package org.eclipse.draw2d
Class ShortestPathConnectionRouter
java.lang.Object
org.eclipse.draw2d.AbstractRouter
org.eclipse.draw2d.ShortestPathConnectionRouter
- All Implemented Interfaces:
- ConnectionRouter
Routes multiple connections around the children of a given container figure.
- Since:
- 3.1
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.eclipse.draw2d.ConnectionRouterConnectionRouter.NullConnectionRouter
- 
Field SummaryFields inherited from interface org.eclipse.draw2d.ConnectionRouterNULL
- 
Constructor SummaryConstructorsConstructorDescriptionShortestPathConnectionRouter(IFigure container) Creates a new shortest path router with the given container.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsConnection(Connection conn) Returns true if the given connection is routed by this router, false otherwisegetConstraint(Connection connection) Gets the constraint for the givenConnection.intReturns the default spacing maintained on either side of a connection.booleanvoidinvalidate(Connection connection) Causes the router to discard any cached information about the given Connection.booleanisDirty()Returns the value indicating if the router is dirty, i.e. if there are any outstanding connections that need to be routedvoidremove(Connection connection) Removes the given Connection from this routers list of Connections it is responsible for.voidroute(Connection conn) Routes the Connection.voidsetConstraint(Connection connection, Object constraint) Sets the constraint for the given Connection.voidsetIgnoreInvalidate(boolean b) Sets the value indicating if connection invalidation should be ignored.voidsetSpacing(int spacing) Sets the default space that should be maintained on either side of a connection.booleanReturns the value indicating if connection invalidation should be ignored.Methods inherited from class org.eclipse.draw2d.AbstractRoutergetEndPoint, getStartPoint
- 
Constructor Details- 
ShortestPathConnectionRouterCreates 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 Details- 
getConstraintGets the constraint for the givenConnection. The constraint is the paths list of bend points for this connection.- Specified by:
- getConstraintin interface- ConnectionRouter
- Overrides:
- getConstraintin class- AbstractRouter
- Parameters:
- connection- The connection whose constraint we are retrieving
- Returns:
- The constraint
- Since:
- 3.15
 
- 
getSpacingpublic int getSpacing()Returns the default spacing maintained on either side of a connection. The default value is 4.- Returns:
- the connection spacing
- Since:
- 3.2
 
- 
invalidateDescription copied from class:AbstractRouterCauses the router to discard any cached information about the given Connection.- Specified by:
- invalidatein interface- ConnectionRouter
- Overrides:
- invalidatein class- AbstractRouter
- Parameters:
- connection- The connection to invalidate
- See Also:
 
- 
removeDescription copied from class:AbstractRouterRemoves the given Connection from this routers list of Connections it is responsible for.- Specified by:
- removein interface- ConnectionRouter
- Overrides:
- removein class- AbstractRouter
- Parameters:
- connection- The connection to remove
- See Also:
 
- 
routeDescription copied from interface:ConnectionRouterRoutes the Connection.- Parameters:
- conn- The Connection to route
- See Also:
 
- 
getPathsAfterRouting- Returns:
- All connection paths after routing dirty paths. Some of the paths that were not dirty may change as well, as a consequence of new routings.
- Since:
- 3.5
 
- 
setConstraintDescription copied from class:AbstractRouterSets the constraint for the given Connection.- Specified by:
- setConstraintin interface- ConnectionRouter
- Overrides:
- setConstraintin class- AbstractRouter
- Parameters:
- connection- The connection
- constraint- The constraint
- See Also:
 
- 
setSpacingpublic void setSpacing(int spacing) Sets the default space that should be maintained on either side of a connection. This causes the connections to be separated from each other and from the obstacles. The default value is 4.- Parameters:
- spacing- the connection spacing
- Since:
- 3.2
 
- 
hasMoreConnectionspublic boolean hasMoreConnections()- Returns:
- true if there are connections routed by this router, false otherwise
- Since:
- 3.5
 
- 
getContainer- Returns:
- the container which contains connections routed by this router
- Since:
- 3.5
 
- 
setIgnoreInvalidatepublic void setIgnoreInvalidate(boolean b) Sets the value indicating if connection invalidation should be ignored.- Parameters:
- b- true if invalidation should be skipped, false otherwise
- Since:
- 3.5
 
- 
shouldIgnoreInvalidatepublic boolean shouldIgnoreInvalidate()Returns the value indicating if connection invalidation should be ignored.- Returns:
- true if invalidation should be skipped, false otherwise
- Since:
- 3.5
 
- 
isDirtypublic boolean isDirty()Returns the value indicating if the router is dirty, i.e. if there are any outstanding connections that need to be routed- Returns:
- true if there are connections to be routed, false otherwise
- Since:
- 3.5
 
- 
containsConnectionReturns true if the given connection is routed by this router, false otherwise- Parameters:
- conn- Connection whose router is questioned
- Returns:
- true if this is the router used for conn
- Since:
- 3.5
 
 
-