Last updated

API / geotoolkit / layout / LayoutStyle / LayoutStyle

Class: LayoutStyle<T>

layout.LayoutStyle.LayoutStyle

Defines properties for node layout.

Type parameters

NameType
Textends number | string = number | string

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
constraintSizeConstraintLayout constrains
flexgrownumberNumber specifying how much the item will grow relative to the rest of the items inside the same container
flexshrinknumberNumber specifying how much the item will shrink relative to the rest of the items inside the same container
floatstringFloat position
positionstringLayout position
sizenumber | stringLayout size

Contents

Constructors

new LayoutStyle&lt;T&amp;gt;(layoutStyle)

new LayoutStyle<T>(layoutStyle?)

Create LayoutStyle

Type parameters

NameType
Textends string | number = string | number

Parameters

Name Type Description
Optional layoutStyleLayoutStyle<T> | Options<T>object which contains the following fields

Overrides

SpaceStyle&lt;T&amp;gt;.constructor

Methods

clamp

clamp(): LayoutStyle<T>

Clamp the style to the min/max values if specified

Returns

LayoutStyle<T>

this


clone

clone(): LayoutStyle<T>

All inheritors should implement copy constructor or provide custom implementation for this method

Returns

LayoutStyle<T>

this

Overrides

SpaceStyle.clone


compile

compile(bounds?): LayoutStyle<number>

Compile style

Parameters

Name Type Description
Optional boundsRecttarget bounds

Returns

LayoutStyle<number>

Overrides

SpaceStyle.compile

compile(convertToUnit?, bounds?): LayoutStyle<number>

Compile style

Parameters

Name Type Description
Optional convertToUnitAbstractUnittarget unit
Optional boundsRecttarget bounds

Returns

LayoutStyle<number>

Overrides

SpaceStyle.compile


copyConstructor

Protected copyConstructor(src, deepCopy?): LayoutStyle<T>

copy constructor

Parameters

Name Type Description
srcSpaceStyle<T>Source to copy from
Optional deepCopybooleandeep copy

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

SpaceStyle.dispose


equalsTo

equalsTo(style): boolean

Return true if styles are equals

Parameters

Name Type Description
styleLayoutStyle<string | number>style to compare

Returns

boolean

Overrides

SpaceStyle.equalsTo


getBottom

getBottom(): T

Return bottom position

Returns

T

Inherited from

SpaceStyle.getBottom


getCenterX

getCenterX(): T

Return center-x position

Returns

T


getCenterY

getCenterY(): T

Return center-y position

Returns

T


getClassName

getClassName(): string

Returns

string

Inherited from

SpaceStyle.getClassName


getFlexGrow

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

Returns

number


getFlexShrink

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

Returns

number


getFloat

getFloat(): string

return float type

Returns

string


getHeight

getHeight(): T

return height position

Returns

T


getLeft

getLeft(): T

Return left position

Returns

T

Inherited from

SpaceStyle.getLeft


getMaxHeight

getMaxHeight(): T

Returns maximum height

Returns

T

maximum height


getMaxWidth

getMaxWidth(): T

Returns maximum width

Returns

T

maximum width


getMinHeight

getMinHeight(): string | number

Returns minimum height

Returns

string | number

minimum height


getMinWidth

getMinWidth(): T

Returns minimum width

Returns

T

minimum width


getPosition

getPosition(): string

return position type

Returns

string


getProperties

getProperties(context?): OptionsOut<T>

Gets all the properties pertaining to this object

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

OptionsOut<T>

properties object

Overrides

SpaceStyle.getProperties


getRight

getRight(): T

Return right position

Returns

T

Inherited from

SpaceStyle.getRight


getSize

getSize(): string | number

return size

Returns

string | number


getSizeConstraint

getSizeConstraint(): SizeConstraint

Return size constraint

Returns

SizeConstraint

constraint size constraint


getStyle

getStyle(): Options<T>

return JSON representation of the space object

Returns

Options<T>

offsets

Overrides

SpaceStyle.getStyle


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

SpaceStyle.getTimeStamp


getTop

getTop(): T

Return top position

Returns

T

Inherited from

SpaceStyle.getTop


getWidth

getWidth(): T

return width position

Returns

T


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

SpaceStyle.hasEventListener


invalidate

invalidate(): LayoutStyle<T>

notify the node that the style is invalidated

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.invalidate


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

SpaceStyle.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

SpaceStyle.isSilent


notify

notify<E>(type, source, args?): LayoutStyle<T>

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceStyleof the event
Optional argsEventMap[E]arguments of the event

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.notify


off

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: LayoutStyle<T>, args: EventMap[E]) => voidfunction to be called

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.off


on

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: LayoutStyle<T>, args: EventMap[E]) => voidto be called

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.on


setBottom

setBottom(bottom): LayoutStyle<T>

Set bottom position

Parameters

Name Type Description
bottomTposition

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.setBottom


setCenterX

setCenterX(centerX): LayoutStyle<T>

Set center-x position

Parameters

Name Type
centerXT

Returns

LayoutStyle<T>

this


setCenterY

setCenterY(centerY): LayoutStyle<T>

Set center-y position

Parameters

Name Type
centerYT

Returns

LayoutStyle<T>

this


setFlexGrow

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

Parameters

Name Type Description
flexGrownumberthe value

Returns

LayoutStyle<T>


setFlexShrink

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.

Parameters

Name Type Description
flexGrownumberthe value

Returns

LayoutStyle<T>


setFloat

setFloat(float): LayoutStyle<T>

set float type

Parameters

Name Type Description
floatstringfloat type

Returns

LayoutStyle<T>

this


setHeight

setHeight(height): LayoutStyle<T>

set height

Parameters

Name Type Description
heightTposition

Returns

LayoutStyle<T>

this


setLeft

setLeft(left): LayoutStyle<T>

Set left position

Parameters

Name Type Description
leftTposition

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.setLeft


setMaxHeight

setMaxHeight(height): LayoutStyle<T>

sets maximum height

Parameters

Name Type Description
heightTheight

Returns

LayoutStyle<T>


setMaxWidth

setMaxWidth(width): LayoutStyle<T>

sets maximum width

Parameters

Name Type Description
widthTwidth

Returns

LayoutStyle<T>


setMinHeight

setMinHeight(height): LayoutStyle<T>

sets minimum height

Parameters

Name Type Description
heightTheight

Returns

LayoutStyle<T>


setMinWidth

setMinWidth(width): LayoutStyle<T>

sets minimum width

Parameters

Name Type Description
widthTwidth

Returns

LayoutStyle<T>


setPosition

setPosition(position): LayoutStyle<T>

set position type

Parameters

Name Type Description
positionstringposition type

Returns

LayoutStyle<T>

this


setProperties

setProperties(properties?): LayoutStyle<T>

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<T>An object containing the properties to set

Returns

LayoutStyle<T>

Overrides

SpaceStyle.setProperties


setRight

setRight(right): LayoutStyle<T>

Set right position

Parameters

Name Type Description
rightTposition

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.setRight


setSilent

setSilent(bool, force?): LayoutStyle<T>

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode
Optional forcebooleantrue if parent should be invalidated immediately

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.setSilent


setSize

setSize(size): LayoutStyle<T>

set size

Parameters

Name Type Description
sizestring | numbersize

Returns

LayoutStyle<T>

this


setSizeConstraint

setSizeConstraint(constraint): LayoutStyle<T>

set size constraint

Parameters

Name Type Description
constraintSizeConstraintsize constraint

Returns

LayoutStyle<T>

this


setStyle

setStyle(layoutStyle, silent?): LayoutStyle<T>

Set style

Parameters

Name Type Description
layoutStyleLayoutStyle<T> | Options<T>space style
Optional silentbooleansilent mode

Returns

LayoutStyle<T>

Overrides

SpaceStyle.setStyle


setTop

setTop(top): LayoutStyle<T>

Set top position

Parameters

Name Type Description
topTposition

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.setTop


setWidth

setWidth(width): LayoutStyle<T>

set width

Parameters

Name Type Description
widthTposition

Returns

LayoutStyle<T>

this


updateTimeStamp

updateTimeStamp(silent?): LayoutStyle<T>

Update time stamp to indicate that style has been changed.

Parameters

Name Type Description
Optional silentbooleansilent mode. If this parameter equals to true then style doesn't send invalidate event

Returns

LayoutStyle<T>

this

Inherited from

SpaceStyle.updateTimeStamp


addSpace

Static addSpace(style, rect, transformation?): Rect

Return area including space

Parameters

Name Type Description
styleSpaceStyle<string | number>style to add space
rectRectoriginal area
Optional transformationTransformationscreen transformation

Returns

Rect

area with including space

Inherited from

SpaceStyle.addSpace


excludeSpace

Static excludeSpace(style, rect, transformation?): Rect

Return area excluding space

Parameters

Name Type Description
stylenumber | SpaceStyle<string | number>style to exclude space
rectRectoriginal area
Optional transformationTransformationscreen transformation

Returns

Rect

area with excluding space

Inherited from

SpaceStyle.excludeSpace


fromObject

Static fromObject(object?): LayoutStyle<string | number>

Create or get layout style from object

Parameters

Name Type Description
Optional objectLayoutStyle<string | number> | Options<string | number>object can be in format of constructor LayoutStyle

Returns

LayoutStyle<string | number>

layout style

Overrides

SpaceStyle.fromObject


getClassName

Static getClassName(): string

Returns

string

Inherited from

SpaceStyle.getClassName


isStyleNotificationEnabled

Static isStyleNotificationEnabled(): boolean

Return status of the global notification for all styles.

Returns

boolean

Inherited from

SpaceStyle.isStyleNotificationEnabled


mergeFromObject

Static mergeFromObject(node, layoutStyle, object, merge?, invalidateMethod?, silent?): LayoutStyle<string | number>

Merge layoutStyle object with existing instance

Parameters

Name Type Description
nodeIStyleListenernode
layoutStyleLayoutStyle<string | number>instance of node property
objectLayoutStyle<string | number> | Options<string | number>contains layout style
Optional mergebooleanmerge flag
Optional invalidateMethodAttributeCallback<EventDispatcher>invalidate method
Optional silentbooleansilent setting

Returns

LayoutStyle<string | number>

layoutStyle

Overrides

SpaceStyle.mergeFromObject