Packagecom.yworks.canvas.geom
Classpublic class ImmutableRectangle
InheritanceImmutableRectangle Inheritance Object
Implements IRectangle

An implementation of an IRectangle whose state cannot be changed.



Public Properties
 PropertyDefined By
  EMPTY : IRectangle
[static] An immutable empty IRectangle with width and height of -1.
ImmutableRectangle
  height : Number
[read-only] Gets the height of the rectangle.
ImmutableRectangle
  width : Number
[read-only] Gets the width of the rectangle.
ImmutableRectangle
  x : Number
[read-only] Gets the x coordinate of the upper left corner of the rectangle.
ImmutableRectangle
  y : Number
[read-only] Gets the y coordinate of the upper left corner of the rectangle.
ImmutableRectangle
Public Methods
 MethodDefined By
  
ImmutableRectangle(x:Number, y:Number, width:Number, height:Number)
Creates a new immutable instance using the provided values to initialize the position and size.
ImmutableRectangle
  
create(x:Number = 0.0, y:Number = 0.0, width:Number = 0.0, height:Number = 0.0):ImmutableRectangle
[static] Creates a new immutable instance using the provided values to initialize the position and size.
ImmutableRectangle
  
[static] Creates a new immutable instance using the provided rectangle to initialize the position and size.
ImmutableRectangle
Property Detail
EMPTYproperty
public static var EMPTY:IRectangle

An immutable empty IRectangle with width and height of -1.

heightproperty 
height:Number  [read-only]

Gets the height of the rectangle.

This instance will always return the same value.


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

Gets the width of the rectangle.

This instance will always return the same value.


Implementation
    public function get width():Number
xproperty 
x:Number  [read-only]

Gets the x coordinate of the upper left corner of the rectangle.

This instance will always return the same value.


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]

Gets the y coordinate of the upper left corner of the rectangle.

This instance will always return the same value.


Implementation
    public function get y():Number
Constructor Detail
ImmutableRectangle()Constructor
public function ImmutableRectangle(x:Number, y:Number, width:Number, height:Number)

Creates a new immutable instance using the provided values to initialize the position and size.

Parameters
x:Number — The x coordinate of the upper left corner of the rectangle.
 
y:Number — The y coordinate of the upper left corner of the rectangle.
 
width:Number — The width of the rectangle.
 
height:Number — The height of the rectangle.
Method Detail
create()method
public static function create(x:Number = 0.0, y:Number = 0.0, width:Number = 0.0, height:Number = 0.0):ImmutableRectangle

Creates a new immutable instance using the provided values to initialize the position and size.

Parameters

x:Number (default = 0.0) — The x coordinate of the upper left corner of the rectangle.
 
y:Number (default = 0.0) — The y coordinate of the upper left corner of the rectangle.
 
width:Number (default = 0.0) — The width of the rectangle.
 
height:Number (default = 0.0) — The height of the rectangle.

Returns
ImmutableRectangle
createFrom()method 
public static function createFrom(rectangle:IRectangle):ImmutableRectangle

Creates a new immutable instance using the provided rectangle to initialize the position and size.

Parameters

rectangle:IRectangle — The rectangle to create an instance from

Returns
ImmutableRectangle