API / geotoolkit / layout / LayoutStyle / LayoutStyle
layout.LayoutStyle.LayoutStyle
Defines properties for node layout.
| Name | Type |
|---|---|
T | extends number | string = number | string |
SpaceStyle<T>↳
LayoutStyle
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
constraint | SizeConstraint | Layout constrains |
flexgrow | number | Number specifying how much the item will grow relative to the rest of the items inside the same container |
flexshrink | number | Number specifying how much the item will shrink relative to the rest of the items inside the same container |
float | string | Float position |
position | string | Layout position |
size | number | string | Layout size |
Constructors
• new LayoutStyle<T>(layoutStyle?)
Create LayoutStyle
| Name | Type |
|---|---|
T | extends string | number = string | number |
| Name | Type | Description |
|---|---|---|
Optional layoutStyle | LayoutStyle<T> | Options<T> | object which contains the following fields |
SpaceStyle<T&gt;.constructor
Methods
▸ clamp(): LayoutStyle<T>
Clamp the style to the min/max values if specified
LayoutStyle<T>
this
▸ clone(): LayoutStyle<T>
All inheritors should implement copy constructor or provide custom implementation for this method
LayoutStyle<T>
this
▸ compile(bounds?): LayoutStyle<number>
Compile style
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | target bounds |
LayoutStyle<number>
▸ compile(convertToUnit?, bounds?): LayoutStyle<number>
Compile style
| Name | Type | Description |
|---|---|---|
Optional convertToUnit | AbstractUnit | target unit |
Optional bounds | Rect | target bounds |
LayoutStyle<number>
▸ Protected copyConstructor(src, deepCopy?): LayoutStyle<T>
copy constructor
| Name | Type | Description |
|---|---|---|
src | SpaceStyle<T> | Source to copy from |
Optional deepCopy | boolean | deep copy |
LayoutStyle<T>
this
▸ dispose(): void
Dispose.
void
▸ equalsTo(style): boolean
Return true if styles are equals
| Name | Type | Description |
|---|---|---|
style | LayoutStyle<string | number> | style to compare |
boolean
▸ getBottom(): T
Return bottom position
T
▸ getCenterX(): T
Return center-x position
T
▸ getCenterY(): T
Return center-y position
T
▸ getClassName(): string
string
▸ getFlexGrow(): number
Returns a number specifying how much the item will grow relative to the rest of the items inside the same container. Default value is 0
number
▸ getFlexShrink(): number
Returns a number specifying how much the item will shrink relative to the rest of the items inside the same container. Default value is 1
number
▸ getFloat(): string
return float type
string
▸ getHeight(): T
return height position
T
▸ getLeft(): T
Return left position
T
▸ getMaxHeight(): T
Returns maximum height
T
maximum height
▸ getMaxWidth(): T
Returns maximum width
T
maximum width
▸ getMinHeight(): string | number
Returns minimum height
string | number
minimum height
▸ getMinWidth(): T
Returns minimum width
T
minimum width
▸ getPosition(): string
return position type
string
▸ getProperties(context?): OptionsOut<T>
Gets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional context | ISerializationContext | serialization context |
OptionsOut<T>
properties object
▸ getRight(): T
Return right position
T
▸ getSize(): string | number
return size
string | number
▸ getSizeConstraint(): SizeConstraint
Return size constraint
constraint size constraint
▸ getStyle(): Options<T>
return JSON representation of the space object
Options<T>
offsets
▸ getTimeStamp(): number
Gets time stamp
number
timeStamp
▸ getTop(): T
Return top position
T
▸ getWidth(): T
return width position
T
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
▸ invalidate(): LayoutStyle<T>
notify the node that the style is invalidated
LayoutStyle<T>
this
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): LayoutStyle<T>
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | Style | of the event |
Optional args | EventMap[E] | arguments of the event |
LayoutStyle<T>
this
▸ off<E>(type?, callback?): LayoutStyle<T>
Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: LayoutStyle<T>, args: EventMap[E]) => void | function to be called |
LayoutStyle<T>
this
▸ on<E>(type, callback): LayoutStyle<T>
Attach listener on event that will be called whenever the specified event is delivered to the target
If the callback function is already in the list of event listeners for this target, the function is not added a second time.
If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: LayoutStyle<T>, args: EventMap[E]) => void | to be called |
LayoutStyle<T>
this
▸ setBottom(bottom): LayoutStyle<T>
Set bottom position
| Name | Type | Description |
|---|---|---|
bottom | T | position |
LayoutStyle<T>
this
▸ setCenterX(centerX): LayoutStyle<T>
Set center-x position
| Name | Type |
|---|---|
centerX | T |
LayoutStyle<T>
this
▸ setCenterY(centerY): LayoutStyle<T>
Set center-y position
| Name | Type |
|---|---|
centerY | T |
LayoutStyle<T>
this
▸ setFlexGrow(flexGrow): LayoutStyle<T>
Sets a number specifying how much the item will grow relative to the rest of the items inside the same container
| Name | Type | Description |
|---|---|---|
flexGrow | number | the value |
LayoutStyle<T>
▸ setFlexShrink(flexGrow): LayoutStyle<T>
Sets a number specifying how much the item will shrink relative to the rest of the items inside the same container.
| Name | Type | Description |
|---|---|---|
flexGrow | number | the value |
LayoutStyle<T>
▸ setFloat(float): LayoutStyle<T>
set float type
| Name | Type | Description |
|---|---|---|
float | string | float type |
LayoutStyle<T>
this
▸ setHeight(height): LayoutStyle<T>
set height
| Name | Type | Description |
|---|---|---|
height | T | position |
LayoutStyle<T>
this
▸ setLeft(left): LayoutStyle<T>
Set left position
| Name | Type | Description |
|---|---|---|
left | T | position |
LayoutStyle<T>
this
▸ setMaxHeight(height): LayoutStyle<T>
sets maximum height
| Name | Type | Description |
|---|---|---|
height | T | height |
LayoutStyle<T>
▸ setMaxWidth(width): LayoutStyle<T>
sets maximum width
| Name | Type | Description |
|---|---|---|
width | T | width |
LayoutStyle<T>
▸ setMinHeight(height): LayoutStyle<T>
sets minimum height
| Name | Type | Description |
|---|---|---|
height | T | height |
LayoutStyle<T>
▸ setMinWidth(width): LayoutStyle<T>
sets minimum width
| Name | Type | Description |
|---|---|---|
width | T | width |
LayoutStyle<T>
▸ setPosition(position): LayoutStyle<T>
set position type
| Name | Type | Description |
|---|---|---|
position | string | position type |
LayoutStyle<T>
this
▸ setProperties(properties?): LayoutStyle<T>
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options<T> | An object containing the properties to set |
LayoutStyle<T>
▸ setRight(right): LayoutStyle<T>
Set right position
| Name | Type | Description |
|---|---|---|
right | T | position |
LayoutStyle<T>
this
▸ setSilent(bool, force?): LayoutStyle<T>
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
Optional force | boolean | true if parent should be invalidated immediately |
LayoutStyle<T>
this
▸ setSize(size): LayoutStyle<T>
set size
| Name | Type | Description |
|---|---|---|
size | string | number | size |
LayoutStyle<T>
this
▸ setSizeConstraint(constraint): LayoutStyle<T>
set size constraint
| Name | Type | Description |
|---|---|---|
constraint | SizeConstraint | size constraint |
LayoutStyle<T>
this
▸ setStyle(layoutStyle, silent?): LayoutStyle<T>
Set style
| Name | Type | Description |
|---|---|---|
layoutStyle | LayoutStyle<T> | Options<T> | space style |
Optional silent | boolean | silent mode |
LayoutStyle<T>
▸ setTop(top): LayoutStyle<T>
Set top position
| Name | Type | Description |
|---|---|---|
top | T | position |
LayoutStyle<T>
this
▸ setWidth(width): LayoutStyle<T>
set width
| Name | Type | Description |
|---|---|---|
width | T | position |
LayoutStyle<T>
this
▸ updateTimeStamp(silent?): LayoutStyle<T>
Update time stamp to indicate that style has been changed.
| Name | Type | Description |
|---|---|---|
Optional silent | boolean | silent mode. If this parameter equals to true then style doesn't send invalidate event |
LayoutStyle<T>
this
▸ Static addSpace(style, rect, transformation?): Rect
Return area including space
| Name | Type | Description |
|---|---|---|
style | SpaceStyle<string | number> | style to add space |
rect | Rect | original area |
Optional transformation | Transformation | screen transformation |
area with including space
▸ Static excludeSpace(style, rect, transformation?): Rect
Return area excluding space
| Name | Type | Description |
|---|---|---|
style | number | SpaceStyle<string | number> | style to exclude space |
rect | Rect | original area |
Optional transformation | Transformation | screen transformation |
area with excluding space
▸ Static fromObject(object?): LayoutStyle<string | number>
Create or get layout style from object
| Name | Type | Description |
|---|---|---|
Optional object | LayoutStyle<string | number> | Options<string | number> | object can be in format of constructor LayoutStyle |
LayoutStyle<string | number>
layout style
▸ Static getClassName(): string
string
▸ Static isStyleNotificationEnabled(): boolean
Return status of the global notification for all styles.
boolean
SpaceStyle.isStyleNotificationEnabled
▸ Static mergeFromObject(node, layoutStyle, object, merge?, invalidateMethod?, silent?): LayoutStyle<string | number>
Merge layoutStyle object with existing instance
| Name | Type | Description |
|---|---|---|
node | IStyleListener | node |
layoutStyle | LayoutStyle<string | number> | instance of node property |
object | LayoutStyle<string | number> | Options<string | number> | contains layout style |
Optional merge | boolean | merge flag |
Optional invalidateMethod | AttributeCallback<EventDispatcher> | invalidate method |
Optional silent | boolean | silent setting |
LayoutStyle<string | number>
layoutStyle