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

A SegmentInfo holds information about the possible location of an orthogonal edge segment. Most notably, it stores the direction of the segment and the interval that restricts the location of the segment.

 

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, java.util.List cellSegmentInfos)
          Creates a new instance of SegmentInfo with the given information.
SegmentInfo(Edge edge, int segmentIndex, LineSegment segment)
          Creates a new instance of SegmentInfo using a LineSegment 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.
 Edge getEdge()
          Returns the edge to which the segment of this info belongs.
 boolean isAtStrongPortConstraint()
          Returns whether or not this edge segment has the restriction of a strong PortConstraint.
 void setAtStrongPortConstraint(boolean atStrongPortConstraint)
          Specifies whether or not this edge segment has the restriction of a strong PortConstraint.
 void setSegmentGroup(SegmentGroup segmentGroup)
          Specifies the segment group for this segment info and its associated CellSegmentInfos.
 
Methods inherited from class y.layout.router.polyline.AbstractSegmentInfo
getDirection, 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,
                   java.util.List cellSegmentInfos)
Creates a new instance of SegmentInfo with the given information.

Parameters:
edge - the edge to which the segment of this info belongs
segmentIndex - the index of the segment to which this info belongs
direction - the direction to which the segment of this info points
locationRange - the range within which the common location of this segment has to lie
minExtension - the minimum interval in extension direction this segment is known to intersect
maxExtension - the maximum interval in extension direction this segment will span
cellSegmentInfos - the list of CellSegmentInfo objects upon which this segment info is built

SegmentInfo

public SegmentInfo(Edge edge,
                   int segmentIndex,
                   LineSegment segment)
Creates a new instance of SegmentInfo using a LineSegment 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 to which the segment of this info belongs
segmentIndex - the index of the segment to which this info belongs
segment - a line segment describing the edge segment
Method Detail

getEdge

public Edge getEdge()
Returns the edge to which the segment of this info belongs.

Returns:
the edge to which the segment of this info belongs

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 - the index of the CellSegmentInfo to return
Returns:
the CellSegmentInfo at the given index of this segment info

setSegmentGroup

public void setSegmentGroup(SegmentGroup segmentGroup)
Specifies the segment group for this segment info and its associated CellSegmentInfos. The location ranges are adjusted to use the SegmentGroup.getCommonLocationRange().

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

isAtStrongPortConstraint

public boolean isAtStrongPortConstraint()
Returns whether or not this edge segment has the restriction of a strong PortConstraint.

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

setAtStrongPortConstraint

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

Parameters:
atStrongPortConstraint - true if this edge segment has the restriction of a strong PortConstraint, false otherwise

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