Search this API

y.layout.router.polyline
Class EdgeInfo

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

public class EdgeInfo
extends java.lang.Object

This class encapsulates the information required to route an edge with a path routing algorithm.

See Also:
ChannelBasedPathRouting
 

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

Constructor Detail

EdgeInfo

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

Parameters:
edge - the edge to create the info for
path - the path that will be used for routing the edge
configuration - the configuration of the path search algorithm
Method Detail

isFixed

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

Returns:
true if the path of this edge is fixed, false if it should be routed by the path search algorithm

getEdge

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

Returns:
the edge whose route is described by this EdgeInfo instance

getEdgeCellInfos

public java.util.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 partition cell on its path

getEdgeCellInfo

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

Parameters:
entrance - the entrance for which the EdgeCellInfo will be returned
Returns:
the EdgeCellInfo of the given CellEntrance in the path

getSegmentInfo

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

Parameters:
segmentIndex - the index of the edge segment for which the segment info will be returned
Returns:
the SegmentInfo of the edge segment with the given index

getPreviousSegment

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

Parameters:
segment - the segment info for which the previous segment info will 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 SegmentInfo of the segment following the segment of the given SegmentInfo.

Parameters:
segment - the segment info for which the next segment info will 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 java.lang.String toString()
Returns a string representation of this EdgeInfo object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this EdgeInfo object

getStrongSourcePort

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

Defining a new strong source port also updates the first SegmentInfo to use this fixed port location.

Returns:
the strong source port location or null if no strong source port has been set
See Also:
setStrongSourcePort(YPoint), AbstractSegmentInfo.setLocation(double), SegmentInfo.setAtStrongPortConstraint(boolean)

setStrongSourcePort

public void setStrongSourcePort(YPoint portLocation)
Specifies the location of the strong source port that the edge uses.

Defining a new strong source port also updates the first SegmentInfo to use this fixed port location.

Default Value:
The default value is null. No strong source port location for the edge is specified.
Parameters:
portLocation - the strong source port location
Throws:
java.lang.IllegalArgumentException - if the first segment is already fixed and the given port location contradicts the segment's fixed location
See Also:
AbstractSegmentInfo.setLocation(double), SegmentInfo.setAtStrongPortConstraint(boolean)

getStrongTargetPort

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

Defining a new strong target port also updates the last SegmentInfo to use this fixed port location.

Returns:
the strong target port location or null if no strong target port has been set
See Also:
setStrongTargetPort(YPoint), AbstractSegmentInfo.setLocation(double), SegmentInfo.setAtStrongPortConstraint(boolean)

setStrongTargetPort

public void setStrongTargetPort(YPoint portLocation)
Specifies the location of the strong target port that the edge uses.

Defining a new strong target port also updates the last SegmentInfo to use this fixed port location.

Default Value:
The default value is null. No strong target port location for the edge is specified.
Parameters:
portLocation - the strong target port location
Throws:
java.lang.IllegalArgumentException - if the last segment is already fixed and the given port location contradicts the segment's fixed location
See Also:
AbstractSegmentInfo.setLocation(double), SegmentInfo.setAtStrongPortConstraint(boolean)

calculateLineSegments

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

Returns:
an array of LineSegments created by the calculated path points

calculatePathPoints

public YList calculatePathPoints()
Calculates 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-2022,
yWorks GmbH.
All rights reserved.