Search this API

y.layout.router.polyline
Class PathSearchContext

java.lang.Object
  extended by y.layout.router.polyline.PathSearchContext

public class PathSearchContext
extends Object

Provides context information that is useful for the path search algorithm.

Most notably, the context provides access to the edge that is currently being routed (see getCurrentEdge()).


Constructor Summary
protected PathSearchContext(PathSearch pathSearch, PathSearchConfiguration configuration)
          Creates a new instance.
 
Method Summary
 void addSourceCell(PartitionCell cell)
          Adds an additional source cell of the getCurrentEdge() if it is not already contained in the list of source cells.
 void addTargetCell(PartitionCell cell)
          Adds an additional target cell of the getCurrentEdge() if it is not already contained in the list of target cells.
 PartitionCell getCombinedSourceCell()
          Returns an artificial partition cell with the size of the bounding box of all source cells of the getCurrentEdge().
 PartitionCell getCombinedTargetCell()
          Returns an artificial partition cell with the size of the bounding box of all target cells of the getCurrentEdge().
 PathSearchConfiguration getConfiguration()
          Returns the configuration used for the path search.
 Edge getCurrentEdge()
          Returns the edge that is routed.
 EdgeLayoutDescriptor getCurrentEdgeLayoutDescriptor()
          Returns the edge layout descriptor for the getCurrentEdge() containing edge specific settings for the path search.
 EdgeCursor getEdges()
          The edges that are routed.
 PathSearch getPathSearch()
          Returns the path search that uses this context.
 PathSearchResult getPathSearchResult()
          Returns the results of the path search.
 PartitionCell getSourceCell(int index)
          Returns the source cell with the given index in the list of all cells that are covered by the source node of the getCurrentEdge().
 PartitionCell getTargetCell(int index)
          Returns the target cell with the given index in the list of all cells that are covered by the target node of the getCurrentEdge().
 boolean isSourceCell(PartitionCell cell)
          Determines if the given cell is a source cell of the getCurrentEdge().
 boolean isTargetCell(PartitionCell cell)
          Determines if the given cell is a target cell of the getCurrentEdge().
protected  void setCurrentEdge(Edge currentEdge)
          Specifies the edge that is routed.
protected  void setEdges(EdgeList edges)
          Sets the list of edges that shall be routed.
 int sourceCellCount()
          Returns the number of all cells that are covered by the source node of the getCurrentEdge().
 int targetCellCount()
          Returns the number of all cells that are covered by the target node of the getCurrentEdge().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathSearchContext

protected PathSearchContext(PathSearch pathSearch,
                            PathSearchConfiguration configuration)
Creates a new instance.

Parameters:
pathSearch - The path search that uses this context.
configuration - The configuration used for the path search.
Method Detail

getPathSearch

public PathSearch getPathSearch()
Returns the path search that uses this context.

Returns:
The path search that uses this context.

getConfiguration

public PathSearchConfiguration getConfiguration()
Returns the configuration used for the path search.

Returns:
The configuration used for the path search.

getEdges

public EdgeCursor getEdges()
The edges that are routed.

Returns:
An EdgeCursor to iterate over the edges a path that shall be calculated for.

setEdges

protected void setEdges(EdgeList edges)
Sets the list of edges that shall be routed.

Parameters:
edges - The list of edges that shall be routed.

getCurrentEdge

public Edge getCurrentEdge()
Returns the edge that is routed.

This edge is one of those in getEdges().

Returns:
The edge that is currently routed.

setCurrentEdge

protected void setCurrentEdge(Edge currentEdge)
Specifies the edge that is routed.

Parameters:
currentEdge - The edge that shall be routed.

getCurrentEdgeLayoutDescriptor

public EdgeLayoutDescriptor getCurrentEdgeLayoutDescriptor()
Returns the edge layout descriptor for the getCurrentEdge() containing edge specific settings for the path search.

Returns:
The edge layout descriptor for the current edge.

sourceCellCount

public int sourceCellCount()
Returns the number of all cells that are covered by the source node of the getCurrentEdge().

Returns:
the number of all cells that are covered by the source node of the getCurrentEdge()

addSourceCell

public void addSourceCell(PartitionCell cell)
Adds an additional source cell of the getCurrentEdge() if it is not already contained in the list of source cells.

Parameters:
cell - The new source cell to add.
See Also:
sourceCellCount(), getSourceCell(int)

getSourceCell

public PartitionCell getSourceCell(int index)
Returns the source cell with the given index in the list of all cells that are covered by the source node of the getCurrentEdge().

Returns:
the source cell with the given index in the list of all cells that are covered by the source node of the getCurrentEdge().

isSourceCell

public boolean isSourceCell(PartitionCell cell)
Determines if the given cell is a source cell of the getCurrentEdge().

Parameters:
cell - The cell to be tested.
Returns:
true if the given cell is in the list of source cells, false otherwise.
See Also:
sourceCellCount(), getSourceCell(int)

getCombinedSourceCell

public PartitionCell getCombinedSourceCell()
Returns an artificial partition cell with the size of the bounding box of all source cells of the getCurrentEdge().

Returns:
an artificial partition cell with the size of the bounding box of all source cells of the getCurrentEdge()

targetCellCount

public int targetCellCount()
Returns the number of all cells that are covered by the target node of the getCurrentEdge().

Returns:
the number of all cells that are covered by the target node of the getCurrentEdge()

addTargetCell

public void addTargetCell(PartitionCell cell)
Adds an additional target cell of the getCurrentEdge() if it is not already contained in the list of target cells.

Parameters:
cell - the new target cell to add
See Also:
targetCellCount(), getTargetCell(int)

getTargetCell

public PartitionCell getTargetCell(int index)
Returns the target cell with the given index in the list of all cells that are covered by the target node of the getCurrentEdge().

Returns:
the target cell with the given index in the list of all cells that are covered by the target node of the getCurrentEdge().

isTargetCell

public boolean isTargetCell(PartitionCell cell)
Determines if the given cell is a target cell of the getCurrentEdge().

Parameters:
cell - The cell to be tested.
Returns:
true if the given cell is in the list of target cells, false otherwise.
See Also:
targetCellCount(), getTargetCell(int)

getCombinedTargetCell

public PartitionCell getCombinedTargetCell()
Returns an artificial partition cell with the size of the bounding box of all target cells of the getCurrentEdge().

Returns:
an artificial partition cell with the size of the bounding box of all target cells of the getCurrentEdge()

getPathSearchResult

public PathSearchResult getPathSearchResult()
Returns the results of the path search.

Returns:
The results of the path search.

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.