Search this API

y.layout.router.polyline
Class SegmentInfo

java.lang.Object
  extended by y.layout.router.polyline.AbstractSegmentInfo
      extended by y.layout.router.polyline.SegmentInfo

public class SegmentInfo
extends AbstractSegmentInfo

Stores information about the possible location of an orthogonal edge segment. Most notable, SegmentInfo holds the segment's direction and the interval that restricts the segment's location.


Field Summary
 
Fields inherited from class y.layout.router.polyline.AbstractSegmentInfo
ALIGNMENT_ANY, ALIGNMENT_MAX, ALIGNMENT_MIN
 
Constructor Summary
SegmentInfo(Edge edge, int segmentIndex, Direction direction, Interval locationRange, Interval minExtension, Interval maxExtension, List cellSegmentInfos)
          Creates a new instance for the segment.
SegmentInfo(Edge edge, int segmentIndex, LineSegment segment)
          Creates a new instance using a line segment to describe the edge segment.
 
Method Summary
 int cellSegmentInfoCount()
          Returns the number of CellSegmentInfo of this segment info.
 CellSegmentInfo getCellSegmentInfo(int index)
          Returns the CellSegmentInfo at the given index of this segment info.
 boolean isAtStrongPortConstraint()
          Determines whether or not this edge segment has the restriction of a strong port constraint.
 void setAtStrongPortConstraint(boolean atStrongPortConstraint)
          Sets whether or not this edge segment has the restriction of a strong port constraint.
 void setSegmentGroup(SegmentGroup segmentGroup)
          Sets the segment group for this segment info and its cell segment infos and adjusts their AbstractSegmentInfo.getLocationRange()s to use the SegmentGroup.getCommonLocationRange().
 
Methods inherited from class y.layout.router.polyline.AbstractSegmentInfo
getDirection, getEdge, getLocation, getLocationRange, getMaxExtension, getMinExtension, getPreferredAlignment, getSegmentGroup, getSegmentIndex, isFixed, isVertical, setLocation, setPreferredAlignment, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SegmentInfo

public SegmentInfo(Edge edge,
                   int segmentIndex,
                   Direction direction,
                   Interval locationRange,
                   Interval minExtension,
                   Interval maxExtension,
                   List cellSegmentInfos)
Creates a new instance for the segment.

Parameters:
edge - The edge the segment of this info belongs to.
segmentIndex - The index of the segment this info belongs to.
direction - The direction the segment points to.
locationRange - The range the common location of this segment has to be inside.
minExtension - The minimal interval in extension direction this segment is known to intersect.
maxExtension - The maximum interval in extension direction this segment will span.
cellSegmentInfos - A list of cell segment infos this segment info is build upon.

SegmentInfo

public SegmentInfo(Edge edge,
                   int segmentIndex,
                   LineSegment segment)
Creates a new instance using a line segment to describe the edge segment.

This constructor is meant to be used for fixed orthogonal edge segments already knowing their extension and location.

Parameters:
edge - The edge this segment info belongs to.
segmentIndex - The index of the segment this info belongs to.
segment - A line segment describing the edge segment.
Method Detail

cellSegmentInfoCount

public int cellSegmentInfoCount()
Returns the number of CellSegmentInfo of this segment info.

Returns:
the number of CellSegmentInfo of this segment info

getCellSegmentInfo

public CellSegmentInfo getCellSegmentInfo(int index)
Returns the CellSegmentInfo at the given index of this segment info.

Parameters:
index - index of the CellSegmentInfo to return
Returns:
the CellSegmentInfo at the given index of this segment info

setSegmentGroup

public void setSegmentGroup(SegmentGroup segmentGroup)
Sets the segment group for this segment info and its cell segment infos and adjusts their AbstractSegmentInfo.getLocationRange()s to use the SegmentGroup.getCommonLocationRange().

Overrides:
setSegmentGroup in class AbstractSegmentInfo
Parameters:
segmentGroup - The segment group this segment info shall belong to.
See Also:
SegmentGroup

isAtStrongPortConstraint

public boolean isAtStrongPortConstraint()
Determines whether or not this edge segment has the restriction of a strong port constraint.

Returns:
true if this edge segment has the restriction of a strong port constraint, false otherwise.

setAtStrongPortConstraint

public void setAtStrongPortConstraint(boolean atStrongPortConstraint)
Sets whether or not this edge segment has the restriction of a strong port constraint.

Parameters:
atStrongPortConstraint - If this edge segment has the restriction of a strong port constraint.

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