Packagecom.yworks.yfiles.layout.router.polyline
Classpublic class OrthogonalInterval
InheritanceOrthogonalInterval Inheritance YObject Inheritance Object

A horizontal or vertical com.yworks.yfiles.layout.router.polyline.Interval that additionally stores a y- (in the horizontal case) or x-coordinate (in the vertical case).

During a com.yworks.yfiles.layout.router.polyline.PathSearch, orthogonal intervals are used to describe where an edge enters or leaves a com.yworks.yfiles.layout.router.polyline.PartitionCell.

See also

com.yworks.yfiles.layout.router.polyline.PathSearch
com.yworks.yfiles.layout.router.polyline.Interval
com.yworks.yfiles.layout.router.polyline.PartitionCell


Public Properties
 PropertyDefined By
  center : YPoint
[read-only] Returns the center of this orthogonal interval in the 2d-coordinate system.
OrthogonalInterval
  location : Number
[read-only] Returns the vertical coordinate for horizontal intervals or the horizontal coordinate for vertical intervals, respectively.
OrthogonalInterval
  max : Number
[read-only] Returns the upper bound of the orthogonal interval.
OrthogonalInterval
  min : Number
[read-only] Returns the lower bound of the orthogonal interval.
OrthogonalInterval
  range : Interval
[read-only] Returns the range of this orthogonal interval.
OrthogonalInterval
  size : Number
[read-only] Returns the length of the orthogonal interval.
OrthogonalInterval
  vertical : Boolean
[read-only] Determines whether the orthogonal interval is oriented vertically.
OrthogonalInterval
Public Methods
 MethodDefined By
  
OrthogonalInterval(range:Interval, location:Number, isVertical:Boolean, init:Boolean = true)
Creates a new instance using the range as interval bounds.
OrthogonalInterval
  
[static] Calculates the intersection of the given orthogonal intervals.
OrthogonalInterval
  
[static] Calculates the union of the given orthogonal intervals.
OrthogonalInterval
  
Checks if the given orthogonal interval covers this one fully.
OrthogonalInterval
  
Determines whether this orthogonal interval crosses the given one.
OrthogonalInterval
  
Returns the distance of the range s of this orthogonal interval and the given orthogonal interval.
OrthogonalInterval
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
OrthogonalInterval
 Inherited
hashCode():int
YObject
  
Checks if this orthogonal interval and the given orthogonal interval cover the same range.
OrthogonalInterval
  
Checks if this orthogonal interval intersects the given orthogonal interval.
OrthogonalInterval
  
intersects2(other:OrthogonalInterval, minIntersection:Number):Boolean
Checks if this orthogonal interval intersects the given orthogonal interval and the intersection has a minimal size of minIntersection.
OrthogonalInterval
  
Returns the manhattan distance of this orthogonal interval and the given orthogonal interval.
OrthogonalInterval
  
newOrthogonalInterval1(range:Interval, location:Number, isVertical:Boolean):OrthogonalInterval
[static] Creates a new instance using the range as interval bounds.
OrthogonalInterval
  
newOrthogonalInterval2(from:Number, to:Number, location:Number, isVertical:Boolean):OrthogonalInterval
[static] Creates a new instance using the from and to value as interval bounds.
OrthogonalInterval
  
toString():String
OrthogonalInterval
Protected Methods
 MethodDefined By
  
initOrthogonalInterval1(range:Interval, location:Number, isVertical:Boolean):void
Initializes this object.
OrthogonalInterval
  
initOrthogonalInterval2(from:Number, to:Number, location:Number, isVertical:Boolean):void
Initializes this object.
OrthogonalInterval
Property Detail
centerproperty
center:YPoint  [read-only]

Returns the center of this orthogonal interval in the 2d-coordinate system.


Implementation
    public function get center():YPoint
locationproperty 
location:Number  [read-only]

Returns the vertical coordinate for horizontal intervals or the horizontal coordinate for vertical intervals, respectively.


Implementation
    public function get location():Number
maxproperty 
max:Number  [read-only]

Returns the upper bound of the orthogonal interval.


Implementation
    public function get max():Number
minproperty 
min:Number  [read-only]

Returns the lower bound of the orthogonal interval.


Implementation
    public function get min():Number
rangeproperty 
range:Interval  [read-only]

Returns the range of this orthogonal interval.


Implementation
    public function get range():Interval
sizeproperty 
size:Number  [read-only]

Returns the length of the orthogonal interval.


Implementation
    public function get size():Number

See also

verticalproperty 
vertical:Boolean  [read-only]

Determines whether the orthogonal interval is oriented vertically.


Implementation
    public function get vertical():Boolean
Constructor Detail
OrthogonalInterval()Constructor
public function OrthogonalInterval(range:Interval, location:Number, isVertical:Boolean, init:Boolean = true)

Creates a new instance using the range as interval bounds.

Parameters
range:Interval — the range
 
location:Number — the location in the 2D coordinate system
 
isVertical:Booleantrue, if the orthogonal interval is vertical; false, if it is horizontal.
 
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
IllegalArgumentException — if range is null
Method Detail
calculateIntersection()method
public static function calculateIntersection(i1:OrthogonalInterval, i2:OrthogonalInterval):OrthogonalInterval

Calculates the intersection of the given orthogonal intervals.

If the created orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical range of both intervals. If it is horizontal, it will have the same vertical location as i2 and the shared horizontal range of both intervals. The orthogonal intervals must have same orientation.

Parameters

i1:OrthogonalInterval — The first orthogonal interval.
 
i2:OrthogonalInterval — The second orthogonal interval.

Returns
OrthogonalInterval — The shared orthogonal interval of both given orthogonal intervals.

Throws
IllegalArgumentException — if the orthogonal intervals have different orientations

See also

calculateUnion()method 
public static function calculateUnion(i1:OrthogonalInterval, i2:OrthogonalInterval):OrthogonalInterval

Calculates the union of the given orthogonal intervals.

If the created orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical range of both orthogonal intervals. If it is horizontal, it will have the same vertical location as i2 and the shared vertical range of both orthogonal intervals. The orthogonal intervals must have same orientation.

Parameters

i1:OrthogonalInterval — The first orthogonal interval.
 
i2:OrthogonalInterval — The second orthogonal interval.

Returns
OrthogonalInterval — The union of both given orthogonal intervals.

Throws
IllegalArgumentException — if the orthogonal intervals have different orientations

See also

coveredBy()method 
public function coveredBy(other:OrthogonalInterval):Boolean

Checks if the given orthogonal interval covers this one fully.

The given orthogonal interval covers this orthogonal interval, if this interval's range is covered by the given interval's range. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same orientation.

Parameters

other:OrthogonalInterval — The other orthogonal interval

Returns
Booleantrue, if this orthogonal interval is fully covered by the other orthogonal interval, false otherwise.

Throws
IllegalArgumentException — if the orthogonal intervals have different orientations

See also

crosses()method 
public function crosses(other:OrthogonalInterval):Boolean

Determines whether this orthogonal interval crosses the given one.

The orthogonal intervals must have different orientations.

Parameters

other:OrthogonalInterval — The other orthogonal interval.

Returns
Booleantrue if this orthogonal interval crosses the given one, false otherwise.

Throws
IllegalArgumentException — if orthogonal intervals have same orientation
distanceTo()method 
public function distanceTo(other:OrthogonalInterval):Number

Returns the distance of the range s of this orthogonal interval and the given orthogonal interval.

The orthogonal intervals must have same orientation.

Parameters

other:OrthogonalInterval — The second orthogonal interval.

Returns
Number0 if the orthogonal intervals intersects(), otherwise the minimal distance between the orthogonal intervals.

Throws
IllegalArgumentException — if the orthogonal intervals have different orientations

See also

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

Returns
Class
hasSameRange()method 
public function hasSameRange(other:OrthogonalInterval):Boolean

Checks if this orthogonal interval and the given orthogonal interval cover the same range.

If both orthogonal intervals cover the same range, they are considered same. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same orientation.

Parameters

other:OrthogonalInterval — The second orthogonal interval

Returns
Booleantrue, if the orthogonal intervals cover the same range, false otherwise.

Throws
IllegalArgumentException — if the orthogonal intervals have different orientations

See also

initOrthogonalInterval1()method 
protected final function initOrthogonalInterval1(range:Interval, location:Number, isVertical:Boolean):void

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

Parameters

range:Interval
 
location:Number
 
isVertical:Boolean

See also

initOrthogonalInterval2()method 
protected final function initOrthogonalInterval2(from:Number, to:Number, location:Number, isVertical:Boolean):void

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

Parameters

from:Number
 
to:Number
 
location:Number
 
isVertical:Boolean

See also

intersects()method 
public function intersects(other:OrthogonalInterval):Boolean

Checks if this orthogonal interval intersects the given orthogonal interval.

Orthogonal intervals intersect each other, if their ranges intersect each other. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same orientation.

Parameters

other:OrthogonalInterval — the second orthogonal interval.

Returns
Booleantrue if both orthogonal intervals intersect, false otherwise.

Throws
IllegalArgumentException — if the orthogonal intervals have different orientations

See also

intersects2()method 
public function intersects2(other:OrthogonalInterval, minIntersection:Number):Boolean

Checks if this orthogonal interval intersects the given orthogonal interval and the intersection has a minimal size of minIntersection.

Orthogonal intervals intersect each other, if their ranges intersect each other by at least minIntersection. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same orientation.

Parameters

other:OrthogonalInterval — the second orthogonal interval.
 
minIntersection:Number — The minimal size of the intersection.

Returns
Booleantrue if both orthogonal intervals intersect, false otherwise.

Throws
IllegalArgumentException — if the orthogonal intervals have different orientations

See also

manhattanDistanceTo()method 
public function manhattanDistanceTo(other:OrthogonalInterval):Number

Returns the manhattan distance of this orthogonal interval and the given orthogonal interval.

If both intervals have the same orientation, the manhattan distance is the sum of the distance between the intervals' ranges and the distance between the intervals' locations.

If the intervals have different orientations, the manhattan distance is the sum of the distances between one interval's range with the other interval's location.

Parameters

other:OrthogonalInterval — The second orthogonal interval.

Returns
Number — The manhattan distance between this interval and the given one.
newOrthogonalInterval1()method 
public static function newOrthogonalInterval1(range:Interval, location:Number, isVertical:Boolean):OrthogonalInterval

Creates a new instance using the range as interval bounds.

Parameters

range:Interval — the range
 
location:Number — the location in the 2D coordinate system
 
isVertical:Booleantrue, if the orthogonal interval is vertical; false, if it is horizontal.

Returns
OrthogonalInterval

Throws
IllegalArgumentException — if range is null
newOrthogonalInterval2()method 
public static function newOrthogonalInterval2(from:Number, to:Number, location:Number, isVertical:Boolean):OrthogonalInterval

Creates a new instance using the from and to value as interval bounds.

Parameters

from:Number — the start of the interval bounds
 
to:Number — the end of the interval bounds
 
location:Number — the location in the 2D coordinate system
 
isVertical:Booleantrue, if the orthogonal interval is vertical; false, if it is horizontal vertical.

Returns
OrthogonalInterval
toString()method 
public function toString():String

Returns
String