Skip to content
Reference > Classes

Rectangle

Definition

Rectangle var = .... ;

Extends

Extended By

None

Method Summary

Owner Name Return Type Description
Rectangle constructor(left, top, width, height) Rectangle Creates a new Rectangle.
Object getClassName() String Returns the string name of this object's class type.
Rectangle getHeight() Integer Returns the Height value as an Integer.
Rectangle getLeft() Integer Returns the Left value as an Integer.
Rectangle getTop() Integer Returns the Top value as an Integer.
Rectangle getWidth() Integer Returns the Width value as an Integer.
Object toJson() String Returns a string of a json representation of this object.

Method Definitions


constructor(left,top,width,height)

Rectangle rectangle = new Rectangle(Integer left, Integer top, Integer width, Integer height)

Description

Creates a new Rectangle.

Parameter Definition

Name Type Description
left Integer  A measure of how far this rectangle is from the leftmost pixel. Similar to X
top Integer  A measure of how far this rectangle is from the topmost pixel. Similar to Y
width Integer  width of rectangle
height Integer  height of rectangle

Example 1

1
2
3
Rectangle r = new Rectangle(0,0,3,4);

// r = WebRectangle [top=0, left=0, width=3, height=4]

getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.

Example 15

1
2
3
4
Rectangle r = new Rectangle(0,0,3,4);
r.getClassName();

// r.getClassName() = Rectangle

getHeight()

Integer Rectangle::getHeight()

Description

Returns the Height value as an Integer.

Example 1

1
2
3
4
Rectangle r = new Rectangle(0,0,3,4);
r.getHeight();

// r.getHeight() = 4

getLeft()

Integer Rectangle::getLeft()

Description

Returns the Left value as an Integer.

Example 1

1
2
3
4
Rectangle r = new Rectangle(0,0,3,4);
r.getLeft();

// r.getLeft() = 0

getTop()

Integer Rectangle::getTop()

Description

Returns the Top value as an Integer.

Example 1

1
2
3
4
Rectangle r = new Rectangle(0,0,3,4);
r.getTop();

// r.getTop() = 0

getWidth()

Integer Rectangle::getWidth()

Description

Returns the Width value as an Integer.

Example 1

1
2
3
4
Rectangle r = new Rectangle(0,0,3,4);
r.getWidth();

// r.getWidth() = 3

toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.

Example 15

1
2
3
4
Rectangle r = new Rectangle(0,0,3,4);
r.toJson();

// r.toJson() = "WebRectangle [top=0, left=0, width=3, height=4]"