Search this API

y.layout.router.polyline
Class EdgeInfo

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

public class EdgeInfo
extends Object

Encapsulates the information required to route an edge with a path routing algorithm.

See Also:
ChannelBasedPathRouting

Constructor Summary
EdgeInfo(Path path, PathSearchConfiguration configuration)
          Creates a new instance.
 
Method Summary
 LineSegment[] calculateLineSegments()
          Returns an array of LineSegments created from the calculated path points.
 YList calculatePathPoints()
          Returns a list of YPoints containing the source port, bend and target port locations.
 Edge getEdge()
          Returns the edge whose route is described by this info.
 EdgeCellInfo getEdgeCellInfo(CellEntrance entrance)
          Returns the EdgeCellInfo of the given CellEntrance in the path.
 List getEdgeCellInfos()
          Returns a list of EdgeCellInfos describing how the edge traverses each PartitionCell on its path.
 SegmentInfo getNextSegment(SegmentInfo segment)
          Returns the segment info of the segment following the segment of the given segment info.
 SegmentInfo getPreviousSegment(SegmentInfo segment)
          Returns the segment info of the segment preceding the segment of the given segment info.
 SegmentInfo getSegmentInfo(int segmentIndex)
          Returns the segment info the the segment with the given index.
 YPoint getStrongSourcePort()
          Returns the location of the strong source port the edge uses.
 YPoint getStrongTargetPort()
          Returns the location of the strong target port the edge uses.
 boolean isFixed()
          Determines whether the path of this edge is fixed or shall be routed by the path search algorithm.
 int segmentCount()
          Returns the number of segments of the edge.
 void setStrongSourcePort(YPoint portLocation)
          Sets the location of the strong source port the edge uses and updates the first SegmentInfo to use this fixed port location.
 void setStrongTargetPort(YPoint portLocation)
          Sets the location of the strong target port the edge uses and updates the last SegmentInfo to use this fixed port location.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EdgeInfo

public EdgeInfo(Path path,
                PathSearchConfiguration configuration)
Creates a new instance.

Parameters:
path - The path that shall be used to route the edge.
configuration - The configuration of the path search algorithm.
Method Detail

isFixed

public boolean isFixed()
Determines whether the path of this edge is fixed or shall be routed by the path search algorithm.

Returns:
true if the path of this edge is fixed or shall be routed by the path search algorithm, false otherwise.

getEdge

public Edge getEdge()
Returns the edge whose route is described by this info.

Returns:
The edge whose route is described by this info.

getEdgeCellInfos

public List getEdgeCellInfos()
Returns a list of EdgeCellInfos describing how the edge traverses each PartitionCell on its path.

Returns:
A list of EdgeCellInfos describing how the edge traverses each PartitionCell on its path.

getEdgeCellInfo

public EdgeCellInfo getEdgeCellInfo(CellEntrance entrance)
Returns the EdgeCellInfo of the given CellEntrance in the path.

Parameters:
entrance - The entrance to get the edge cell info for.
Returns:
The EdgeCellInfo of the given CellEntrance in the path.

getSegmentInfo

public SegmentInfo getSegmentInfo(int segmentIndex)
Returns the segment info the the segment with the given index.

Parameters:
segmentIndex - The index of the edge segment to return the segment info for.
Returns:
The segment info the the segment with the given index.

getPreviousSegment

public SegmentInfo getPreviousSegment(SegmentInfo segment)
Returns the segment info of the segment preceding the segment of the given segment info.

Parameters:
segment - The segmentInfo for which the previous segment info shall be returned.
Returns:
The segment info of the segment preceding the segment of the given segment info.

getNextSegment

public SegmentInfo getNextSegment(SegmentInfo segment)
Returns the segment info of the segment following the segment of the given segment info.

Parameters:
segment - The segmentInfo for which the following segment info shall be returned.
Returns:
The segment info of the segment following the segment of the given segment info.

segmentCount

public int segmentCount()
Returns the number of segments of the edge.

Returns:
The number of segments of the edge.

toString

public String toString()
Overrides:
toString in class Object

getStrongSourcePort

public YPoint getStrongSourcePort()
Returns the location of the strong source port the edge uses.

Returns:
The location of the strong source port, the edge uses, or null if no strong source port has been set.
See Also:
setStrongSourcePort(y.geom.YPoint)

setStrongSourcePort

public void setStrongSourcePort(YPoint portLocation)
Sets the location of the strong source port the edge uses and updates the first SegmentInfo to use this fixed port location.

Throws:
IllegalArgumentException - If the first segment is already fixed and the given port location contradicts the segments fixed location.
Parameters:
portLocation - The strong source port location.
See Also:
getStrongSourcePort(), AbstractSegmentInfo.setLocation(double), SegmentInfo.setAtStrongPortConstraint(boolean)

getStrongTargetPort

public YPoint getStrongTargetPort()
Returns the location of the strong target port the edge uses.

Returns:
The location of the strong target port the edge uses, or null if no strong target port has been set.
See Also:
setStrongTargetPort(y.geom.YPoint)

setStrongTargetPort

public void setStrongTargetPort(YPoint portLocation)
Sets the location of the strong target port the edge uses and updates the last SegmentInfo to use this fixed port location.

Throws:
IllegalArgumentException - If the last segment is already fixed and the given port location contradicts the segments fixed location.
Parameters:
portLocation - The strong target port location.
See Also:
getStrongTargetPort(), AbstractSegmentInfo.setLocation(double), SegmentInfo.setAtStrongPortConstraint(boolean)

calculateLineSegments

public LineSegment[] calculateLineSegments()
Returns an array of LineSegments created from the calculated path points.

Returns:
An array of LineSegments created from the calculated path points.

calculatePathPoints

public YList calculatePathPoints()
Returns a list of YPoints containing the source port, bend and target port locations.

Returns:
A list of YPoints containing the source port, bend and target port locations.

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