|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.router.polyline.AbstractSegmentInfo
public abstract class AbstractSegmentInfo
This class stores location information for orthogonal item segments.
Most notably, AbstractSegmentInfo
stores the direction
to which the segment points and the
interval
describing possible locations and extensions of a segment.
Field Summary | |
---|---|
static byte |
ALIGNMENT_ANY
A constant specifying that the segment can be placed anywhere within its location range. |
static byte |
ALIGNMENT_MAX
A constant specifying that the segment prefers to be placed close to the upper bound of its location range. |
static byte |
ALIGNMENT_MIN
A constant specifying that the segment prefers to be placed close to the lower bound of its location range. |
Constructor Summary | |
---|---|
protected |
AbstractSegmentInfo(java.lang.Object item,
int segmentIndex,
Direction direction,
Interval locationRange,
Interval minExtension,
Interval maxExtension)
Creates a new instance of AbstractSegmentInfo . |
protected |
AbstractSegmentInfo(java.lang.Object item,
int segmentIndex,
LineSegment segment)
Creates a new instance of AbstractSegmentInfo using a line segment to describe the edge segment. |
Method Summary | |
---|---|
Direction |
getDirection()
Returns the Direction to which the segment of this info points. |
double |
getLocation()
Returns the fixed location within the location range
for this segment info. |
Interval |
getLocationRange()
Returns the range, i.e., the interval within which the segment should be placed. |
Interval |
getMaxExtension()
Returns the maximum extension that this segment can span. |
Interval |
getMinExtension()
Returns the minimum known extension of the segment, i.e., the minimum interval that this segment will cover in any case. |
byte |
getPreferredAlignment()
Returns the preferred placement of this segment within its location range. |
SegmentGroup |
getSegmentGroup()
Returns the segment group to which this segment info belongs. |
int |
getSegmentIndex()
Returns the index of the segment of this info. |
boolean |
isFixed()
Determines whether or not this segment info is fixed, i.e., a fixed location has been
determined within its location range . |
boolean |
isVertical()
Determines whether or not the associated segment is vertical. |
void |
setLocation(double location)
Specifies the fixed location within the location range
for this segment info. |
void |
setPreferredAlignment(byte alignment)
Specifies the preferred placement of this segment within its location range. |
void |
setSegmentGroup(SegmentGroup segmentGroup)
Specifies the segment group to which this segment info belongs. |
java.lang.String |
toString()
Returns a string representation of this AbstractSegmentInfo object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte ALIGNMENT_MIN
public static final byte ALIGNMENT_MAX
public static final byte ALIGNMENT_ANY
Constructor Detail |
---|
protected AbstractSegmentInfo(java.lang.Object item, int segmentIndex, Direction direction, Interval locationRange, Interval minExtension, Interval maxExtension)
AbstractSegmentInfo
.
item
- the item to which the segment of this info belongssegmentIndex
- the index of the segment to which this info belongsdirection
- the direction to which the segment of this info pointslocationRange
- the range within which the common location of this segment has to lieminExtension
- the minimum interval in extension direction this segment is known to intersectmaxExtension
- the maximum interval in extension direction this segment will spanprotected AbstractSegmentInfo(java.lang.Object item, int segmentIndex, LineSegment segment)
AbstractSegmentInfo
using a line segment to describe the edge segment.
This constructor is meant to be used for fixed orthogonal edge segments.
item
- the item to which this segment info belongssegmentIndex
- the index of the segment to which this info belongssegment
- a line segment describing the item segmentMethod Detail |
---|
public java.lang.String toString()
AbstractSegmentInfo
object.
toString
in class java.lang.Object
AbstractSegmentInfo
objectpublic Interval getMinExtension()
For horizontal intervals, this is the minimum horizontal extension; for vertical intervals, this is the minimum vertical extension.
null
if no minimum extension can be determinedpublic Interval getMaxExtension()
For horizontal intervals, this is the maximum horizontal extension; for vertical intervals, this is the maximum vertical extension.
public Interval getLocationRange()
For horizontal segments, this is the range containing the vertical location; for vertical segments, this is the range containing the horizontal location.
public byte getPreferredAlignment()
setPreferredAlignment(byte)
public void setPreferredAlignment(byte alignment)
ALIGNMENT_ANY
. The segment can be placed anywhere within its location range.alignment
- one of the predefined alignments
java.lang.IllegalArgumentException
- if an unknown alignment is givenpublic void setLocation(double location)
fixed
location within the location range
for this segment info.
For horizontal segments, this is the vertical location; for vertical segments, this is the horizontal location.
location
- the fixed location that this segment info shall use
java.lang.IllegalStateException
- if the segment info already has a fixed location
java.lang.IllegalArgumentException
- if the given location does not lie within the location rangeisFixed()
,
getLocationRange()
Location 0 when location range is [3,47] | Location 5 when location range is [3,47] | Location 40 when location range is [3,47] |
public double getLocation()
fixed
location within the location range
for this segment info.
For horizontal segments, this is the vertical location; for vertical segments, this is the horizontal location.
0
if no fixed location has been setsetLocation(double)
,
isFixed()
,
getLocationRange()
public boolean isFixed()
fixed location
has been
determined within its location range
.
true
if this segment info has a fixed location assigned to it, false
otherwisepublic boolean isVertical()
true
if the segment of this segment info is vertical, false
if it is horizontalpublic Direction getDirection()
Direction
to which the segment of this info points.
public int getSegmentIndex()
public void setSegmentGroup(SegmentGroup segmentGroup)
When defining the segment group, the location range
will be adjusted to
use the common interval of the segment group.
segmentGroup
- the segment group to which this segment info should belongSegmentGroup.getCommonLocationRange()
public SegmentGroup getSegmentGroup()
When defining the segment group, the location range
will be adjusted to
use the common interval of the segment group.
null
if no segment group is assignedsetSegmentGroup(SegmentGroup)
,
SegmentGroup.getCommonLocationRange()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |