/ fm / liveswitch / Rectangle
Class: Rectangle
fm.liveswitch.Rectangle
A rectangle (size and origin).
Table of contents
Constructors
Methods
- getHeight
- getOrigin
- getSize
- getTypeString
- getWidth
- getX
- getY
- isEquivalent
- setOrigin
- setSize
- toJson
- toString
- fromJson
- getEmpty
- isEquivalent
- toJson
Constructors
constructor
+ new Rectangle(): Rectangle
Initializes a new instance of the [[fm.liveswitch.rectangle]] class.
Returns: Rectangle
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:17
+ new Rectangle(origin
: Point, size
: Size): Rectangle
Initializes a new instance of the [[fm.liveswitch.rectangle]] class.
Parameters:
Name | Type | Description |
---|---|---|
origin |
Point | The origin. |
size |
Size | The size. |
Returns: Rectangle
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:24
Methods
getHeight
▸ getHeight(): number
Gets the size height.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:150
getOrigin
▸ getOrigin(): Point
Gets the origin.
Returns: Point
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:162
getSize
▸ getSize(): Size
Gets the size.
Returns: Size
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:174
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:9
getWidth
▸ getWidth(): number
Gets the size width.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:186
getX
▸ getX(): number
Gets the origin X coordinate.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:198
getY
▸ getY(): number
Gets the origin Y coordinate.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:210
isEquivalent
▸ isEquivalent(rectangle
: Rectangle): boolean
Determines whether the specified rectangle is equivalent.
Parameters:
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | The rectangle. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:223
setOrigin
▸ setOrigin(value
: Point): void
Sets the origin.
Parameters:
Name | Type |
---|---|
value |
Point |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:235
setSize
▸ setSize(value
: Size): void
Sets the size.
Parameters:
Name | Type |
---|---|
value |
Size |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:250
toJson
▸ toJson(): string
Serializes this instance to JSON.
Returns: string
The serialized JSON.
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:268
toString
▸ toString(): string
Returns a string that represents this instance using format "{origin}/{size}".
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:280
fromJson
▸ Static
fromJson(rectangleJson
: string): Rectangle
Deserializes an instance from JSON.
Parameters:
Name | Type | Description |
---|---|---|
rectangleJson |
string | The JSON to deserialize. |
Returns: Rectangle
The deserialized rectangle.
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:59
getEmpty
▸ Static
getEmpty(): Rectangle
Gets the empty rectangle (0,0/0x0).
Returns: Rectangle
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:84
isEquivalent
▸ Static
isEquivalent(rectangle1
: Rectangle, rectangle2
: Rectangle): boolean
Determines whether the two rectangles are equivalent.
Parameters:
Name | Type | Description |
---|---|---|
rectangle1 |
Rectangle | The first rectangle. |
rectangle2 |
Rectangle | The second rectangle. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:101
toJson
▸ Static
toJson(rectangle
: Rectangle): string
Serializes an instance to JSON.
Parameters:
Name | Type | Description |
---|---|---|
rectangle |
Rectangle | The rectangle. |
Returns: string
The serialized JSON.
Defined in: Generated/TypeScript/fm.liveswitch/Rectangle.ts:131