fm.liveswitch.Rectangle Class Reference

A rectangle (size and origin). More...

Public Member Functions

int getHeight ()
 Gets the size height. More...
 
fm.liveswitch.Point getOrigin ()
 Gets the origin. More...
 
fm.liveswitch.Size getSize ()
 Gets the size. More...
 
int getWidth ()
 Gets the size width. More...
 
int getX ()
 Gets the origin X coordinate. More...
 
int getY ()
 Gets the origin Y coordinate. More...
 
boolean isEquivalent (fm.liveswitch.Rectangle rectangle)
 Determines whether the specified rectangle is equivalent. More...
 
 Rectangle ()
 Initializes a new instance of the fm.liveswitch.Rectangle class. More...
 
 Rectangle (fm.liveswitch.Point origin, fm.liveswitch.Size size)
 Initializes a new instance of the fm.liveswitch.Rectangle class. More...
 
void setOrigin (fm.liveswitch.Point value)
 Sets the origin. More...
 
void setSize (fm.liveswitch.Size value)
 Sets the size. More...
 
String toJson ()
 Serializes this instance to JSON. More...
 
String toString ()
 Returns a string that represents this instance using format "{origin}/{size}". More...
 

Static Public Member Functions

static fm.liveswitch.Rectangle fromJson (String rectangleJson)
 Deserializes an instance from JSON. More...
 
static fm.liveswitch.Rectangle getEmpty ()
 Gets the empty rectangle (0,0/0x0). More...
 
static boolean isEquivalent (fm.liveswitch.Rectangle rectangle1, fm.liveswitch.Rectangle rectangle2)
 Determines whether the two rectangles are equivalent. More...
 
static String toJson (final fm.liveswitch.Rectangle rectangle)
 Serializes an instance to JSON. More...
 

Detailed Description

A rectangle (size and origin).

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

fm.liveswitch.Rectangle.Rectangle ( )

Initializes a new instance of the fm.liveswitch.Rectangle class.

◆ Rectangle() [2/2]

fm.liveswitch.Rectangle.Rectangle ( fm.liveswitch.Point  origin,
fm.liveswitch.Size  size 
)

Initializes a new instance of the fm.liveswitch.Rectangle class.

Parameters
originThe origin.
sizeThe size.

Member Function Documentation

◆ fromJson()

static fm.liveswitch.Rectangle fm.liveswitch.Rectangle.fromJson ( String  rectangleJson)
static

Deserializes an instance from JSON.

Parameters
rectangleJsonThe JSON to deserialize.
Returns
The deserialized rectangle.

◆ getEmpty()

static fm.liveswitch.Rectangle fm.liveswitch.Rectangle.getEmpty ( )
static

Gets the empty rectangle (0,0/0x0).

◆ getHeight()

int fm.liveswitch.Rectangle.getHeight ( )

Gets the size height.

◆ getOrigin()

fm.liveswitch.Point fm.liveswitch.Rectangle.getOrigin ( )

Gets the origin.

◆ getSize()

fm.liveswitch.Size fm.liveswitch.Rectangle.getSize ( )

Gets the size.

◆ getWidth()

int fm.liveswitch.Rectangle.getWidth ( )

Gets the size width.

◆ getX()

int fm.liveswitch.Rectangle.getX ( )

Gets the origin X coordinate.

◆ getY()

int fm.liveswitch.Rectangle.getY ( )

Gets the origin Y coordinate.

◆ isEquivalent() [1/2]

boolean fm.liveswitch.Rectangle.isEquivalent ( fm.liveswitch.Rectangle  rectangle)

Determines whether the specified rectangle is equivalent.

Parameters
rectangleThe rectangle.

◆ isEquivalent() [2/2]

static boolean fm.liveswitch.Rectangle.isEquivalent ( fm.liveswitch.Rectangle  rectangle1,
fm.liveswitch.Rectangle  rectangle2 
)
static

Determines whether the two rectangles are equivalent.

Parameters
rectangle1The first rectangle.
rectangle2The second rectangle.

◆ setOrigin()

void fm.liveswitch.Rectangle.setOrigin ( fm.liveswitch.Point  value)

Sets the origin.

◆ setSize()

void fm.liveswitch.Rectangle.setSize ( fm.liveswitch.Size  value)

Sets the size.

◆ toJson() [1/2]

String fm.liveswitch.Rectangle.toJson ( )

Serializes this instance to JSON.

Returns
The serialized JSON.

◆ toJson() [2/2]

static String fm.liveswitch.Rectangle.toJson ( final fm.liveswitch.Rectangle  rectangle)
static

Serializes an instance to JSON.

Parameters
rectangleThe rectangle.
Returns
The serialized JSON.

◆ toString()

String fm.liveswitch.Rectangle.toString ( )

Returns a string that represents this instance using format "{origin}/{size}".