|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.incremental.SwimLaneDescriptor
public class SwimLaneDescriptor
This class is used by HierarchicLayouter
during the various
phases to associate swim lanes with each node.
Each node should be associated with a SwimLaneDescriptor instance;
nodes in the same lane may share one instance.
The results of the calculation of the geometry of the swim lanes will be placed
into the instances of this class after the layout.
It can be bound to the layout algorithm using the
HierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY
DataProvider
key.
This class is designed as a class to allow for future additions of new getter
methods.
HierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY
Constructor Summary | |
---|---|
SwimLaneDescriptor(Comparable clientObject)
Creates a new swim lane descriptor with an associated client object. |
|
SwimLaneDescriptor(Object clientObject,
Comparator cmp)
Creates a new swim lane descriptor using the given client object and comparator. |
Method Summary | |
---|---|
int |
compareTo(Object o)
Implements the Comparable interface using the getComparator() and
getClientObject() fields. |
Object |
getClientObject()
Returns the client object. |
Comparator |
getComparator()
Returns the comparator that is used for sorting the lanes. |
int |
getComputedLaneIndex()
Returns the computed zero-based index of the lane after the layout has been calculated. |
double |
getComputedLanePosition()
Returns the computed position (smaller coordinate) of the lane after the layout has been calculated. |
double |
getComputedLaneWidth()
Returns the computed width of the lane after the layout has been calculated. |
double |
getLaneTightness()
Returns the tightness factor of the lane. |
double |
getLeftLaneInset()
Returns the left lane insets where no element will lie in the resulting drawing. |
double |
getMinimumLaneWidth()
Returns the minimum lane width. |
double |
getRightLaneInset()
Returns the right lane insets where no element will lie in the resulting drawing. |
boolean |
isIndexFixed()
Returns whether the index of this swim lane is fixed or whether the algorithm should try to find the best possible position. |
void |
setClientObject(Object o)
Sets the client object. |
void |
setComparator(Comparator c)
Sets the comparator that is used for sorting the lanes. |
void |
setIndexFixed(boolean fixIndex)
Specifies whether a swim lane's index is fixed (based on the result of the comparison with the other swim lanes) or whether the index should be chosen automatically in order to minimize edge lengths. |
void |
setLaneTightness(double tightness)
Sets the tightness factor of the lane. |
void |
setLeftLaneInset(double inset)
Sets the left lane insets where no element will lie in the resulting drawing. |
void |
setMinimumLaneWidth(double laneWidth)
Sets the minimum width of the lane. |
void |
setRightLaneInset(double inset)
Sets the right lane insets where no element will lie in the resulting drawing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwimLaneDescriptor(Comparable clientObject)
NullPointerException
- if the specified client object is
null
.clientObject
- an object provided by the client that will be used
for determining the order of the lanes.public SwimLaneDescriptor(Object clientObject, Comparator cmp)
NullPointerException
- if the specified client object is
null
or the specified comparator is null
but the
specified client object is not a Comparable
instance.clientObject
- a client object used for sorting the lanescmp
- a Comparator used for comparing the client objects.Method Detail |
---|
public boolean isIndexFixed()
true
true
iff the swim lane's index should not be determined automatically.setIndexFixed(boolean)
public void setIndexFixed(boolean fixIndex)
For all swim lanes where this property is set to true
, the relative ordering given by the client objects
is preserved. The remaining swim lanes may be resorted so that the overall edge lengths are minimized.
By default, this feature is enabled.
fixIndex
- true
iff the swim lane index should not be determined automatically.isIndexFixed()
public void setClientObject(Object o)
IllegalArgumentException
- if there is currently no comparator set and
the specified object is not a Comparable
instance.o
- the new objectgetComparator()
,
setComparator(java.util.Comparator)
public Object getClientObject()
public void setLaneTightness(double tightness)
0.0d
will disable compression of the lane.
A value of 1.0d
will try to force the lane to be of
its minimum width
.
IllegalArgumentException
- if tightness is out of the valid rangetightness
- the tightness of the lane [0.0d .. 1.0d]public double getLaneTightness()
0.0d
.
setLaneTightness(double)
public void setComparator(Comparator c)
NullPointerException
- if the specified comparator is
null
.c
- the comparator.public Comparator getComparator()
public double getMinimumLaneWidth()
0.0d
.
public void setMinimumLaneWidth(double laneWidth)
IllegalArgumentException
- if the specified value is less than
0
.laneWidth
- the new width.public double getLeftLaneInset()
0.0d
.
public double getRightLaneInset()
0.0d
.
public void setLeftLaneInset(double inset)
IllegalArgumentException
- if the specified value is less than
0
.inset
- the new insetspublic void setRightLaneInset(double inset)
IllegalArgumentException
- if the specified value is less than
0
.inset
- the new insets.public double getComputedLanePosition()
public double getComputedLaneWidth()
public int getComputedLaneIndex()
-1
if no index has been computed for this lane.public int compareTo(Object o)
getComparator()
and
getClientObject()
fields.
compareTo
in interface Comparable
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |