|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.router.polyline.AbstractSegmentInfo
public abstract class AbstractSegmentInfo
Stores location information for orthogonal edge segments.
Most notably, AbstractSegmentInfo stores direction, segment points and intervals describing possible location and extension of a segment.
| Field Summary | |
|---|---|
static byte |
ALIGNMENT_ANY
Specifies that the segment can be placed somewhere in its location range. |
static byte |
ALIGNMENT_MAX
Specifies that the segment prefers to be placed close to the upper bound of its location range. |
static byte |
ALIGNMENT_MIN
Specifies that the segment prefers to be placed close to the lower bound of its location range. |
| Constructor Summary | |
|---|---|
protected |
AbstractSegmentInfo(Edge edge,
int segmentIndex,
Direction direction,
Interval locationRange,
Interval minExtension,
Interval maxExtension)
Creates a new instance for the segment |
protected |
AbstractSegmentInfo(Edge edge,
int segmentNo,
LineSegment segment)
Creates a new instance using a line segment to describe the edge segment. |
| Method Summary | |
|---|---|
Direction |
getDirection()
Returns the direction the segment of this info points to. |
Edge |
getEdge()
Returns the edge this segment info belongs to. |
double |
getLocation()
Returns the fixed location inside the location range that has been set before. |
Interval |
getLocationRange()
Returns the range, the location of the segment shall be placed in. |
Interval |
getMaxExtension()
Returns the maximum extension this segment will stretch. |
Interval |
getMinExtension()
The minimal known extension of the segment, that is the minimal interval this segment will cover in any case. |
byte |
getPreferredAlignment()
Returns whether this segment prefers to be placed close to the lower bound, upper bound or somewhere of its location range. |
SegmentGroup |
getSegmentGroup()
Returns the segment group this segment info belongs to or null if this segment info doesn't belong
to any group. |
int |
getSegmentIndex()
Returns the index of this info's segment. |
boolean |
isFixed()
Determines whether or not this segment info is fixed, that means a fixed location has been determined inside its location range. |
boolean |
isVertical()
Determines whether or not the associated segment is vertical. |
void |
setLocation(double location)
Sets a fixed location for this segment info. |
void |
setPreferredAlignment(byte alignment)
Sets whether this segment prefers to be placed close to the lower bound, upper bound or somewhere of its location range. |
void |
setSegmentGroup(SegmentGroup segmentGroup)
Sets the segment group this segment info belongs to and adjusts the location range
to use the common interval of the group. |
String |
toString()
|
| 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
getPreferredAlignment(),
setPreferredAlignment(byte),
Constant Field Valuespublic static final byte ALIGNMENT_MAX
getPreferredAlignment(),
setPreferredAlignment(byte),
Constant Field Valuespublic static final byte ALIGNMENT_ANY
getPreferredAlignment(),
setPreferredAlignment(byte),
Constant Field Values| Constructor Detail |
|---|
protected AbstractSegmentInfo(Edge edge,
int segmentIndex,
Direction direction,
Interval locationRange,
Interval minExtension,
Interval maxExtension)
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.
protected AbstractSegmentInfo(Edge edge,
int segmentNo,
LineSegment segment)
This constructor is meant to be used for fixed orthogonal edge segments.
edge - The edge this segment info belongs to.segmentNo - The number of the segment this info belongs to.segment - A line segment describing the edge segment.| Method Detail |
|---|
public String toString()
toString in class Objectpublic Interval getMinExtension()
For horizontal intervals, this is the minimal horizontal extension; for vertical intervals, this is the minimal vertical extension.
null if no minimal extension can be determined.public 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 segment this is the range containing the horizontal location.
public byte getPreferredAlignment()
lower bound, upper bound or somewhere of its location range.
ALIGNMENT_MIN,
ALIGNMENT_MAX,
ALIGNMENT_ANYpublic void setPreferredAlignment(byte alignment)
lower bound, upper bound or somewhere of its location range.
alignment - The preferred alignment of the segment inside the location range.ALIGNMENT_MIN,
ALIGNMENT_MAX,
ALIGNMENT_ANYpublic void setLocation(double location)
RuntimeException - If the segment info already has a fixed location.
IllegalArgumentException - If the given location isn't inside the location range.location - The fixed location this segment info shall use.isFixed(),
getLocationRange()public double getLocation()
location range that has been set before.
For horizontal segments, this is the vertical location; for vertical segments, this is the horizontal location.
0 if no fixed location has
been set, yet.public boolean isFixed()
location range.
true, if this segment info has a fixed location assigned to it; false otherwise.public boolean isVertical()
true, if the segment of this segment info is vertical, false, if it is horizontal.public Direction getDirection()
public Edge getEdge()
public int getSegmentIndex()
public void setSegmentGroup(SegmentGroup segmentGroup)
location range
to use the common interval of the group.
segmentGroup - The segment group this segment info shall belong to.SegmentGroup.getCommonLocationRange()public SegmentGroup getSegmentGroup()
null if this segment info doesn't belong
to any group.
null.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||