|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.incremental.SwimLaneDescriptor
public class SwimLaneDescriptor
This class is used by HierarchicLayouter during the various phases and models a swimlane structure.
For layout orientation LayoutOrientation.TOP_TO_BOTTOM, swimlanes partition the drawing area
into vertical stripes. Each node is placed within a user-specified lane.
Swimlanes are, for example, often used in flow diagrams to separate logical units.
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 swimlanes' geometry will be stored by the instances after the layout.
A SwimLaneDescriptor instance can be bound to the layout algorithm using a DataProvider registered
with the graph using key HierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY that returns a SwimLaneDescriptor
instance for each node of the graph.
PartitionGrid offers a newer implementation which supports both
horizontal and vertical swimlanes.HierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY![]() |
![]() |
| Constructor Summary | |
|---|---|
SwimLaneDescriptor(java.lang.Comparable clientObject)
Creates a new SwimLaneDescriptor instance with a given Comparable object. |
|
SwimLaneDescriptor(java.lang.Object clientObject,
java.util.Comparator comparator)
Creates a new SwimLaneDescriptor instance with a given client Object and a given Comparator. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o)
Implements the Comparable interface using the getComparator() and
getClientObject() fields. |
java.lang.Object |
getClientObject()
Returns the client object. |
java.util.Comparator |
getComparator()
Returns the Comparator instance used for sorting the lanes. |
int |
getComputedLaneIndex()
Returns the computed zero-based index of the swimlane after the layout has been calculated. |
double |
getComputedLanePosition()
Returns the computed position (smaller coordinate) of the swimlane after the layout has been calculated. |
double |
getComputedLaneWidth()
Returns the computed width of the swimlane after the layout has been calculated. |
double |
getLaneTightness()
Returns the tightness factor of the lane. |
double |
getLeftLaneInset()
Returns the left insets of the swimlane in which no element will lie in the resulting layout. |
double |
getMinimumLaneWidth()
Returns the minimum width of the swimlane. |
double |
getRightLaneInset()
Returns the right insets of the swimlane in which no element will lie in the resulting layout. |
boolean |
isIndexFixed()
Returns whether or not an index of a swimlane is fixed (based on the result of the comparison with the other swimlanes) or whether the index should be chosen automatically in order to minimize edge lengths. |
void |
setClientObject(java.lang.Object o)
Specifies the client object. |
void |
setComparator(java.util.Comparator comparator)
Specifies the Comparator instance used for sorting the lanes. |
void |
setIndexFixed(boolean fixIndex)
Specifies whether or not an index of a swimlane is fixed (based on the result of the comparison with the other swimlanes) or whether the index should be chosen automatically in order to minimize edge lengths. |
void |
setLaneTightness(double tightness)
Specifies the tightness factor of the lane. |
void |
setLeftLaneInset(double inset)
Specifies the left insets of the swimlane in which no element will lie in the resulting layout. |
void |
setMinimumLaneWidth(double laneWidth)
Specifies the minimum width of the swimlane. |
void |
setRightLaneInset(double inset)
Specifies the right insets of the swimlane in which no element will lie in the resulting layout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwimLaneDescriptor(java.lang.Comparable clientObject)
SwimLaneDescriptor instance with a given Comparable object.
clientObject - a Comparable used for determining the order of the lanes
java.lang.IllegalArgumentException - if the specified client object is null.
public SwimLaneDescriptor(java.lang.Object clientObject,
java.util.Comparator comparator)
SwimLaneDescriptor instance with a given client Object and a given Comparator.
The given client Object should be an instance of Comparable if the given Comparator
is null.
clientObject - a client Object used for sorting the lanescomparator - a Comparator used for comparing the client objects
java.lang.IllegalArgumentException - if the specified client Object is null or the specified Comparator
is null but the specified client Object is not an instance of Comparable.| Method Detail |
|---|
public boolean isIndexFixed()
For all swimlanes where this property is set to true, the relative ordering given by the client
objects is preserved. The remaining swimlanes may be sorted again so that the overall edge lengths are minimized.
true if the swimlane index are determined automatically, false otherwisesetIndexFixed(boolean)public void setIndexFixed(boolean fixIndex)
For all swimlanes where this property is set to true, the relative ordering given by the client
objects is preserved. The remaining swimlanes may be sorted again so that the overall edge lengths are minimized.
fixIndex - true if the swimlane index should not be determined automatically, false
otherwisepublic void setClientObject(java.lang.Object o)
object.
The given client Object should be an instance of Comparable.
o - the given client Object
java.lang.IllegalArgumentException - if there is currently no comparator and
the specified object is not a Comparable instance or if the given client object is nullgetComparator(),
setComparator(java.util.Comparator)public java.lang.Object getClientObject()
object.
The given client Object is an instance of Comparable.
ObjectsetClientObject(Object),
getComparator(),
setComparator(java.util.Comparator)public void setLaneTightness(double tightness)
This value should lie within [0,1] interval.
The greater the value, the more will the lane be forced to obtain its minimum possible width.
0.0d will disable compression of the lane.1.0d will try to force the lane to obtain its
minimum width.
tightness - a tightness value from [0,1] interval
java.lang.IllegalArgumentException - if the tightness value is outside [0,1] intervalpublic double getLaneTightness()
This value should lie within [0,1] interval.
The greater the value, the more will the lane be forced to obtain its minimum possible width.
0.0d will disable compression of the lane.1.0d will try to force the lane to obtain its
minimum width.
[0,1] intervalsetLaneTightness(double)public void setComparator(java.util.Comparator comparator)
Comparator instance used for sorting the lanes.
comparator - the given Comparator instance
java.lang.IllegalArgumentException - if the specified Comparator is null.public java.util.Comparator getComparator()
Comparator instance used for sorting the lanes.
Comparator instancesetComparator(Comparator)public double getMinimumLaneWidth()
The minimum width should be non-negative.
setMinimumLaneWidth(double)public void setMinimumLaneWidth(double laneWidth)
The minimum width should be non-negative.
public double getLeftLaneInset()
The inset should be non-negative.
setLeftLaneInset(double)public double getRightLaneInset()
The inset should be non-negative.
setRightLaneInset(double)public void setLeftLaneInset(double inset)
The inset should be non-negative.
public void setRightLaneInset(double inset)
The inset should be non-negative.
public double getComputedLanePosition()
public double getComputedLaneWidth()
public int getComputedLaneIndex()
-1 if no index has been computed for this lane.public int compareTo(java.lang.Object o)
Comparable interface using the getComparator() and
getClientObject() fields.
compareTo in interface java.lang.Comparable
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||