Packagecom.yworks.yfiles.geom
Classpublic class YDimension
InheritanceYDimension Inheritance YObject Inheritance Object
Implements Comparable
Subclasses YRectangle

This class represents the size of an object. An instance of this class implements the immutable design pattern.



Public Properties
 PropertyDefined By
  height : Number
[read-only] Get the height of the dimension object.
YDimension
  width : Number
[read-only] Get the width of the dimension object.
YDimension
Public Methods
 MethodDefined By
  
YDimension(width:Number, height:Number, init:Boolean = true)
Creates a new YDimension2D object for given size.
YDimension
  
compareTo(o:Object):int
YDimension
  
equals(o:Object):Boolean
[override] Tests a dimension to equality to another dimension.
YDimension
  
getClass():Class
[override]
YDimension
  
hashCode():int
[override]
YDimension
  
newYDimension(width:Number, height:Number):YDimension
[static] Creates a new YDimension2D object for given size.
YDimension
  
toString():String
Returns the size in the form: "W: width H: height"
YDimension
Protected Methods
 MethodDefined By
  
initYDimension(width:Number, height:Number):void
Initializes this object.
YDimension
Property Detail
heightproperty
height:Number  [read-only]

Get the height of the dimension object.


Implementation
    public function get height():Number
widthproperty 
width:Number  [read-only]

Get the width of the dimension object.


Implementation
    public function get width():Number
Constructor Detail
YDimension()Constructor
public function YDimension(width:Number, height:Number, init:Boolean = true)

Creates a new YDimension2D object for given size.

Parameters
width:Number
 
height:Number
 
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
compareTo()method
public function compareTo(o:Object):int

Parameters

o:Object

Returns
int
equals()method 
override public function equals(o:Object):Boolean

Tests a dimension to equality to another dimension.

Parameters

o:Object

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

Returns
Class
hashCode()method 
override public function hashCode():int

Returns
int
initYDimension()method 
protected final function initYDimension(width:Number, height:Number):void

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

Parameters

width:Number
 
height:Number

See also

newYDimension()method 
public static function newYDimension(width:Number, height:Number):YDimension

Creates a new YDimension2D object for given size.

Parameters

width:Number
 
height:Number

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

Returns the size in the form: "W: width H: height"

Returns
String