@jimka/typescript-ui / primitive / Insets
Class: Insets
Defined in: src/typescript/lib/primitive/Insets.ts:18
Represents the four directional inset (padding/margin) values for a rectangular area. All values are expressed in pixels.
Example
import { Insets } from '@jimka/typescript-ui/primitive';
component.setInsets(new Insets(8, 12, 8, 12)); // top, right, bottom, leftExtends
Constructors
new Insets()
new Insets(
top: number,
right: number,
bottom: number,
left: number): InsetsDefined in: src/typescript/lib/primitive/Insets.ts:31
Parameters
top
number
Top inset in pixels.
right
number
Right inset in pixels.
bottom
number
Bottom inset in pixels.
left
number
Left inset in pixels.
Returns
Overrides
Methods
getBottom()
getBottom(): numberDefined in: src/typescript/lib/primitive/Insets.ts:85
Returns the bottom inset in pixels.
Returns
number
The bottom inset value, defaulting to 0 if unset.
getClassName()
getClassName(): stringDefined in: src/typescript/lib/core/BaseObject.ts:44
Returns the runtime class name of this object.
Returns
string
The name of the constructor function as a string.
Inherited from
getId()
getId(): stringDefined in: src/typescript/lib/core/BaseObject.ts:24
Returns the unique identifier for this object.
Returns
string
The UUID string assigned at construction time.
Inherited from
getLeft()
getLeft(): numberDefined in: src/typescript/lib/primitive/Insets.ts:105
Returns the left inset in pixels.
Returns
number
The left inset value, defaulting to 0 if unset.
getRight()
getRight(): numberDefined in: src/typescript/lib/primitive/Insets.ts:65
Returns the right inset in pixels.
Returns
number
The right inset value, defaulting to 0 if unset.
getTop()
getTop(): numberDefined in: src/typescript/lib/primitive/Insets.ts:45
Returns the top inset in pixels.
Returns
number
The top inset value, defaulting to 0 if unset.
render()
render(): stringDefined in: src/typescript/lib/primitive/Insets.ts:142
Returns the insets as a CSS shorthand string (e.g. "4px 4px 4px 4px").
Returns
string
A CSS margin/padding shorthand string with all four sides in top-right-bottom-left order.
set()
set(
top: number,
right: number,
bottom: number,
left: number): thisDefined in: src/typescript/lib/primitive/Insets.ts:128
Sets all four inset values at once.
Parameters
top
number
Top inset in pixels.
right
number
Right inset in pixels.
bottom
number
Bottom inset in pixels.
left
number
Left inset in pixels.
Returns
this
setBottom()
setBottom(value: number): thisDefined in: src/typescript/lib/primitive/Insets.ts:94
Sets the bottom inset in pixels.
Parameters
value
number
The new bottom inset value in pixels.
Returns
this
setId()
setId(id: string): thisDefined in: src/typescript/lib/core/BaseObject.ts:33
Sets the unique identifier for this object.
Parameters
id
string
The new identifier string to assign.
Returns
this
Inherited from
setLeft()
setLeft(value: number): thisDefined in: src/typescript/lib/primitive/Insets.ts:114
Sets the left inset in pixels.
Parameters
value
number
The new left inset value in pixels.
Returns
this
setRight()
setRight(value: number): thisDefined in: src/typescript/lib/primitive/Insets.ts:74
Sets the right inset in pixels.
Parameters
value
number
The new right inset value in pixels.
Returns
this
setTop()
setTop(value: number): thisDefined in: src/typescript/lib/primitive/Insets.ts:54
Sets the top inset in pixels.
Parameters
value
number
The new top inset value in pixels.
Returns
this