Packagecom.yworks.yfiles.layout.hierarchic.incremental
Classpublic class SwimLaneDescriptor
InheritanceSwimLaneDescriptor Inheritance YObject Inheritance Object
Implements Comparable, Comparators_PartialOrder

This class is used by com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl 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 com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.SWIMLANE_DESCRIPTOR_DPKEY com.yworks.yfiles.base.DataProvider key. This class is designed as a class to allow for future additions of new getter methods.

See also

com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.SWIMLANE_DESCRIPTOR_DPKEY
com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl
com.yworks.yfiles.base.DataProvider


Public Properties
 PropertyDefined By
  clientObject : Object
Specifies the client object.
SwimLaneDescriptor
  comparator : Comparator
Specifies the comparator that is used for sorting the lanes.
SwimLaneDescriptor
  computedLaneIndex : int
[read-only] Returns the computed zero-based index of the lane after the layout has been calculated.
SwimLaneDescriptor
  computedLanePosition : Number
[read-only] Returns the computed position (smaller coordinate) of the lane after the layout has been calculated.
SwimLaneDescriptor
  computedLaneWidth : Number
[read-only] Returns the computed width of the lane after the layout has been calculated.
SwimLaneDescriptor
  indexFixed : Boolean
Getter: Returns whether the index of this swim lane is fixed or whether the algorithm should try to find the best possible position.
SwimLaneDescriptor
  laneTightness : Number
Getter: Returns the tightness factor of the lane.
SwimLaneDescriptor
  leftLaneInset : Number
Specifies the left lane insets where no element will lie in the resulting drawing.
SwimLaneDescriptor
  minimumLaneWidth : Number
Getter: Returns the minimum lane width.
SwimLaneDescriptor
  rightLaneInset : Number
Specifies the right lane insets where no element will lie in the resulting drawing.
SwimLaneDescriptor
Public Methods
 MethodDefined By
  
SwimLaneDescriptor(clientObject:Comparable, init:Boolean = true)
Creates a new swim lane descriptor with an associated client object.
SwimLaneDescriptor
  
compareTo(o:Object):int
Implements the Comparable interface using the comparator and clientObject fields.
SwimLaneDescriptor
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
SwimLaneDescriptor
 Inherited
hashCode():int
YObject
  
[static] Creates a new swim lane descriptor with an associated client object.
SwimLaneDescriptor
  
[static] Creates a new swim lane descriptor using the given client object and comparator.
SwimLaneDescriptor
Protected Methods
 MethodDefined By
  
Initializes this object.
SwimLaneDescriptor
  
initSwimLaneDescriptor2(clientObject:Object, cmp:Comparator):void
Initializes this object.
SwimLaneDescriptor
Property Detail
clientObjectproperty
clientObject:Object

Specifies the client object.


Implementation
    public function get clientObject():Object
    public function set clientObject(value:Object):void

Throws
IllegalArgumentException — if there is currently no comparator set and the specified object is not a com.yworks.bridge.util.Comparable instance.

See also

comparatorproperty 
comparator:Comparator

Specifies the comparator that is used for sorting the lanes.


Implementation
    public function get comparator():Comparator
    public function set comparator(value:Comparator):void

Throws
ReferenceError — if the specified comparator is null.
computedLaneIndexproperty 
computedLaneIndex:int  [read-only]

Returns the computed zero-based index of the lane after the layout has been calculated.


Implementation
    public function get computedLaneIndex():int
computedLanePositionproperty 
computedLanePosition:Number  [read-only]

Returns the computed position (smaller coordinate) of the lane after the layout has been calculated.


Implementation
    public function get computedLanePosition():Number
computedLaneWidthproperty 
computedLaneWidth:Number  [read-only]

Returns the computed width of the lane after the layout has been calculated.


Implementation
    public function get computedLaneWidth():Number
indexFixedproperty 
indexFixed:Boolean

Getter: Returns whether the index of this swim lane is fixed or whether the algorithm should try to find the best possible position. The default is true

Setter: 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.

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.


Implementation
    public function get indexFixed():Boolean
    public function set indexFixed(value:Boolean):void
laneTightnessproperty 
laneTightness:Number

Getter: Returns the tightness factor of the lane. The default is 0.0d.

Setter: Sets the tightness factor of the lane. The greater the value the more will the lane to be forced to be of its minimal possible width. A value of 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 (minimumLaneWidth).


Implementation
    public function get laneTightness():Number
    public function set laneTightness(value:Number):void

Throws
IllegalArgumentException — if tightness is out of the valid range

See also

leftLaneInsetproperty 
leftLaneInset:Number

Specifies the left lane insets where no element will lie in the resulting drawing. The default is 0.0d.


Implementation
    public function get leftLaneInset():Number
    public function set leftLaneInset(value:Number):void

Throws
IllegalArgumentException — if the specified value is less than 0.
minimumLaneWidthproperty 
minimumLaneWidth:Number

Getter: Returns the minimum lane width. The default is 0.0d.

Setter: Sets the minimum width of the lane.


Implementation
    public function get minimumLaneWidth():Number
    public function set minimumLaneWidth(value:Number):void

Throws
IllegalArgumentException — if the specified value is less than 0.
rightLaneInsetproperty 
rightLaneInset:Number

Specifies the right lane insets where no element will lie in the resulting drawing. The default is 0.0d.


Implementation
    public function get rightLaneInset():Number
    public function set rightLaneInset(value:Number):void

Throws
IllegalArgumentException — if the specified value is less than 0.
Constructor Detail
SwimLaneDescriptor()Constructor
public function SwimLaneDescriptor(clientObject:Comparable, init:Boolean = true)

Creates a new swim lane descriptor with an associated client object.

Parameters
clientObject:Comparable — an object provided by the client that will be used for determining the order of the lanes.
 
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.

Throws
ReferenceError — if the specified client object is null.
Method Detail
compareTo()method
public function compareTo(o:Object):int

Implements the Comparable interface using the comparator and clientObject fields.

Parameters

o:Object

Returns
int

See also

getClass()method 
override public function getClass():Class

Returns
Class
initSwimLaneDescriptor1()method 
protected final function initSwimLaneDescriptor1(clientObject:Comparable):void

Initializes this object. See the documentation of the corresponding factory method newSwimLaneDescriptor1() for details.

Parameters

clientObject:Comparable

See also

initSwimLaneDescriptor2()method 
protected final function initSwimLaneDescriptor2(clientObject:Object, cmp:Comparator):void

Initializes this object. See the documentation of the corresponding factory method newSwimLaneDescriptor2() for details.

Parameters

clientObject:Object
 
cmp:Comparator

See also

newSwimLaneDescriptor1()method 
public static function newSwimLaneDescriptor1(clientObject:Comparable):SwimLaneDescriptor

Creates a new swim lane descriptor with an associated client object.

Parameters

clientObject:Comparable — an object provided by the client that will be used for determining the order of the lanes.

Returns
SwimLaneDescriptor

Throws
ReferenceError — if the specified client object is null.
newSwimLaneDescriptor2()method 
public static function newSwimLaneDescriptor2(clientObject:Object, cmp:Comparator):SwimLaneDescriptor

Creates a new swim lane descriptor using the given client object and comparator.

Parameters

clientObject:Object — a client object used for sorting the lanes
 
cmp:Comparator — a Comparator used for comparing the client objects.

Returns
SwimLaneDescriptor

Throws
ReferenceError — if the specified client object is null or the specified comparator is null but the specified client object is not a com.yworks.bridge.util.Comparable instance.

See also