Packagecom.yworks.yfiles.layout.router.polyline
Classpublic class Channel
InheritanceChannel Inheritance YObject Inheritance Object

A channel is a set of vertical or horizontal edge segments whose locations depend on each other. Channels are used by the com.yworks.yfiles.layout.router.polyline.ChannelBasedPathRouting to route edges using com.yworks.yfiles.layout.router.polyline.SegmentInfo s describing their path.

See also

com.yworks.yfiles.layout.router.polyline.ChannelBasedPathRouting
com.yworks.yfiles.layout.router.polyline.SegmentInfo


Public Properties
 PropertyDefined By
  bounds : YRectangle
[read-only] Returns the bounds of this channel.
Channel
  lengthInterval : Interval
[read-only] Returns an interval spanning the union of the segment infos' maximum extension.
Channel
  vertical : Boolean
[read-only] Determines whether or not the segments in this channel are vertical.
Channel
  widthInterval : Interval
[read-only] Returns an interval spanning the union of the segment infos' location ranges.
Channel
Public Methods
 MethodDefined By
  
Channel(segment:SegmentInfo, init:Boolean = true)
Creates a new channel containing the given segment info.
Channel
  
addSegment(segment:SegmentInfo):void
Adds a new segment info to the channel.
Channel
  
Adds a segment group to this channel.
Channel
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
Channel
  
getCurrentLocation(segmentInfo:SegmentInfo):Number
Returns the current location the given com.yworks.yfiles.layout.router.polyline.SegmentInfo is assigned inside its location range (com.yworks.yfiles.layout.router.polyline.AbstractSegmentInfo.locationRange).
Channel
  
Returns the SegmentInfo with the given index in the segments list.
Channel
  
Returns the segment group with the given index of this channel.
Channel
 Inherited
hashCode():int
YObject
  
[static] Creates a new channel containing the given segment info.
Channel
  
Returns the number of segment infos in this channel.
Channel
  
Returns the number of segment groups in this channel.
Channel
  
setCurrentLocation(segmentInfo:SegmentInfo, location:Number):void
Sets the current location the given com.yworks.yfiles.layout.router.polyline.SegmentInfo is assigned inside its location range (com.yworks.yfiles.layout.router.polyline.AbstractSegmentInfo.locationRange).
Channel
  
toString():String
Channel
Protected Methods
 MethodDefined By
  
initChannel(segment:SegmentInfo):void
Initializes this object.
Channel
Property Detail
boundsproperty
bounds:YRectangle  [read-only]

Returns the bounds of this channel. These bounds are determined by the channel's width (widthInterval) and length (lengthInterval).


Implementation
    public function get bounds():YRectangle

See also

lengthIntervalproperty 
lengthInterval:Interval  [read-only]

Returns an interval spanning the union of the segment infos' maximum extension.


Implementation
    public function get lengthInterval():Interval

See also

verticalproperty 
vertical:Boolean  [read-only]

Determines whether or not the segments in this channel are vertical.


Implementation
    public function get vertical():Boolean
widthIntervalproperty 
widthInterval:Interval  [read-only]

Returns an interval spanning the union of the segment infos' location ranges.


Implementation
    public function get widthInterval():Interval

See also

Constructor Detail
Channel()Constructor
public function Channel(segment:SegmentInfo, init:Boolean = true)

Creates a new channel containing the given segment info.

Parameters
segment:SegmentInfo — The segment info the channel shall be created for.
 
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.
Method Detail
addSegment()method
public function addSegment(segment:SegmentInfo):void

Adds a new segment info to the channel.

Parameters

segment:SegmentInfo — The segment info to add to this channel.


Throws
IllegalArgumentException — If the given segment has a different orientation then the segments already contained in the channel.
addSegmentGroup()method 
public function addSegmentGroup(group:SegmentGroup):void

Adds a segment group to this channel.

Parameters

group:SegmentGroup — segment group to add

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

Returns
Class
getCurrentLocation()method 
public function getCurrentLocation(segmentInfo:SegmentInfo):Number

Returns the current location the given com.yworks.yfiles.layout.router.polyline.SegmentInfo is assigned inside its location range (com.yworks.yfiles.layout.router.polyline.AbstractSegmentInfo.locationRange).

Parameters

segmentInfo:SegmentInfo — The segmentInfo to return the current location for.

Returns
Number — The current location of the segment info or Double.NaN if no location was set before.

See also

getSegment()method 
public function getSegment(index:int):SegmentInfo

Returns the SegmentInfo with the given index in the segments list.

Parameters

index:int — The index of the segment in the list.

Returns
SegmentInfo — The SegmentInfo with the given index in the segments list.
getSegmentGroup()method 
public function getSegmentGroup(index:int):SegmentGroup

Returns the segment group with the given index of this channel.

Parameters

index:int — index of the segment group to return

Returns
SegmentGroup — the segment group with the given index of this channel
initChannel()method 
protected final function initChannel(segment:SegmentInfo):void

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

Parameters

segment:SegmentInfo

See also

newChannel()method 
public static function newChannel(segment:SegmentInfo):Channel

Creates a new channel containing the given segment info.

Parameters

segment:SegmentInfo — The segment info the channel shall be created for.

Returns
Channel
segmentCount()method 
public function segmentCount():int

Returns the number of segment infos in this channel.

Returns
int — The number of segment infos in this channel.
segmentGroupCount()method 
public function segmentGroupCount():int

Returns the number of segment groups in this channel.

Returns
int — the number of segment groups in this channel
setCurrentLocation()method 
public function setCurrentLocation(segmentInfo:SegmentInfo, location:Number):void

Sets the current location the given com.yworks.yfiles.layout.router.polyline.SegmentInfo is assigned inside its location range (com.yworks.yfiles.layout.router.polyline.AbstractSegmentInfo.locationRange).

During the distribution of the segments in the channel, different locations can be assigned and only the last one is finally set at the segment info.

Parameters

segmentInfo:SegmentInfo — The segment info to set the current location for.
 
location:Number — The current location of the segment info in its location range.

See also

toString()method 
public function toString():String

Returns
String