Class: Dimension

graphics.geom. Dimension


new Dimension( [width] [, height])

The Dimension object encapsulates the width and height components of an object.

The Dimension object encapsulates the width and height components of an object.

Parameters:
Name Type Argument Default Description
width number <optional>
0

the width value.

height number <optional>
0

The height value.

Extends

  • Object

Members


height :Number

The height of the rectangle, in pixels.

Type:
  • Number
Default Value:
  • 0

width :Number

The width of the rectangle, in pixels.

Type:
  • Number
Default Value:
  • 0

Methods


clone()

Returns a shallow copy of the object.

Returns:

a shallow copy of the object.


copyFrom()

Copies all of data from the source Dimension object into the calling Dimension object.


decrease( [dWidth] [, dHeight])

Decreases the size by a specific width/height values and return its self(this).

Parameters:
Name Type Argument Default Description
dWidth number <optional>
0

A number value to descrease the width component of the object (default 0).

dHeight number <optional>
0

A number value to descrease the height component of the object (default 0).


equals()

Compares the passed-in object with this object for equality.

Returns:

true if the the specified object is equal with this object.


increase( [dWidth] [, dHeight])

Increases the size by a specific width/height values and return its self(this).

Parameters:
Name Type Argument Default Description
dWidth number <optional>
0

A number value to increase the width component of the object (default 0).

dHeight number <optional>
0

A number value to inscrease the height component of the object (default 0).

Returns:

the current reference of this object.


isEmpty()

Determines whether or not this Rectangle object is empty.

Returns:

A value of true if the Rectangle object's width or height is less than or equal to 0; otherwise false.

Type
boolean

setTo(width, height)

Sets the members of Dimension to the specified values.

Parameters:
Name Type Description
width number

The width component value to change (default 0).

height number

The height component value to change (default 0).

Returns:

The object reference.

Type
graphics.geom.Dimension

toObject()

Returns the Object representation of this object.

Returns:

the Object representation of this object.


toString()

Returns the string representation of this object.

Returns:

the string representation of this object.