Skip to content

API / geotoolkit / layout / LayoutStyle / LayoutStyle

Class: LayoutStyle<T&gt;

layout.LayoutStyle.LayoutStyle

Defines properties for node layout.

Type parameters

NameType
Textends number | string = number | string

Hierarchy

Table of contents

Constructors
  • [new LayoutStyle<T&gt;(layoutStyle)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.layout.layoutstyle.layoutstyle.md#new layoutstyle<t>(layoutstyle))
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&gt;(layoutStyle?)

Create LayoutStyle

Type parameters

NameType
Textends string | number = string | number

Parameters

Name Type Description
Optional layoutStyleLayoutStyle<T&gt; | Options<T&gt;object which contains the following fields

Overrides

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

Methods

clamp

▸ clamp(): LayoutStyle<T&gt;

Clamp the style to the min/max values if specified

Returns

LayoutStyle<T&gt;

this


clone

▸ clone(): LayoutStyle<T&gt;

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

Returns

LayoutStyle<T&gt;

this

Overrides

SpaceStyle.clone


compile

▸ compile(bounds?): LayoutStyle<number&gt;

Compile style

Parameters

Name Type Description
Optional boundsRecttarget bounds

Returns

LayoutStyle<number&gt;

Overrides

SpaceStyle.compile

▸ compile(convertToUnit?, bounds?): LayoutStyle<number&gt;

Compile style

Parameters

Name Type Description
Optional convertToUnitAbstractUnittarget unit
Optional boundsRecttarget bounds

Returns

LayoutStyle<number&gt;

Overrides

SpaceStyle.compile


copyConstructor

▸ Protected copyConstructor(src, deepCopy?): LayoutStyle<T&gt;

copy constructor

Parameters

Name Type Description
srcSpaceStyle<T&gt;Source to copy from
Optional deepCopybooleandeep copy

Returns

LayoutStyle<T&gt;

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&gt;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&gt;

Gets all the properties pertaining to this object

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

OptionsOut<T&gt;

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&gt;

return JSON representation of the space object

Returns

Options<T&gt;

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&gt;

notify the node that the style is invalidated

Returns

LayoutStyle<T&gt;

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&gt;(type, source, args?): LayoutStyle<T&gt;

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&gt;

this

Inherited from

SpaceStyle.notify


off

▸ off<E&gt;(type?, callback?): LayoutStyle<T&gt;

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&gt;, args: EventMap[E]) => voidfunction to be called

Returns

LayoutStyle<T&gt;

this

Inherited from

SpaceStyle.off


on

▸ on<E&gt;(type, callback): LayoutStyle<T&gt;

Attach listener on event that will be called whenever the specified event is delivered to the target <p> If the callback function is already in the list of event listeners for this target, the function is not added a second time. </p> <p> 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. </p>

Type parameters

NameType
Eextends string

Parameters

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

Returns

LayoutStyle<T&gt;

this

Inherited from

SpaceStyle.on


setBottom

▸ setBottom(bottom): LayoutStyle<T&gt;

Set bottom position

Parameters

Name Type Description
bottomTposition

Returns

LayoutStyle<T&gt;

this

Inherited from

SpaceStyle.setBottom


setCenterX

▸ setCenterX(centerX): LayoutStyle<T&gt;

Set center-x position

Parameters

Name Type
centerXT

Returns

LayoutStyle<T&gt;

this


setCenterY

▸ setCenterY(centerY): LayoutStyle<T&gt;

Set center-y position

Parameters

Name Type
centerYT

Returns

LayoutStyle<T&gt;

this


setFlexGrow

▸ setFlexGrow(flexGrow): LayoutStyle<T&gt;

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&gt;


setFlexShrink

▸ setFlexShrink(flexGrow): LayoutStyle<T&gt;

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&gt;


setFloat

▸ setFloat(float): LayoutStyle<T&gt;

set float type

Parameters

Name Type Description
floatstringfloat type

Returns

LayoutStyle<T&gt;

this


setHeight

▸ setHeight(height): LayoutStyle<T&gt;

set height

Parameters

Name Type Description
heightTposition

Returns

LayoutStyle<T&gt;

this


setLeft

▸ setLeft(left): LayoutStyle<T&gt;

Set left position

Parameters

Name Type Description
leftTposition

Returns

LayoutStyle<T&gt;

this

Inherited from

SpaceStyle.setLeft


setMaxHeight

▸ setMaxHeight(height): LayoutStyle<T&gt;

sets maximum height

Parameters

Name Type Description
heightTheight

Returns

LayoutStyle<T&gt;


setMaxWidth

▸ setMaxWidth(width): LayoutStyle<T&gt;

sets maximum width

Parameters

Name Type Description
widthTwidth

Returns

LayoutStyle<T&gt;


setMinHeight

▸ setMinHeight(height): LayoutStyle<T&gt;

sets minimum height

Parameters

Name Type Description
heightTheight

Returns

LayoutStyle<T&gt;


setMinWidth

▸ setMinWidth(width): LayoutStyle<T&gt;

sets minimum width

Parameters

Name Type Description
widthTwidth

Returns

LayoutStyle<T&gt;


setPosition

▸ setPosition(position): LayoutStyle<T&gt;

set position type

Parameters

Name Type Description
positionstringposition type

Returns

LayoutStyle<T&gt;

this


setProperties

▸ setProperties(properties?): LayoutStyle<T&gt;

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<T&gt;An object containing the properties to set

Returns

LayoutStyle<T&gt;

Overrides

SpaceStyle.setProperties


setRight

▸ setRight(right): LayoutStyle<T&gt;

Set right position

Parameters

Name Type Description
rightTposition

Returns

LayoutStyle<T&gt;

this

Inherited from

SpaceStyle.setRight


setSilent

▸ setSilent(bool, force?): LayoutStyle<T&gt;

Set silent mode

Parameters

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

Returns

LayoutStyle<T&gt;

this

Inherited from

SpaceStyle.setSilent


setSize

▸ setSize(size): LayoutStyle<T&gt;

set size

Parameters

Name Type Description
sizestring | numbersize

Returns

LayoutStyle<T&gt;

this


setSizeConstraint

▸ setSizeConstraint(constraint): LayoutStyle<T&gt;

set size constraint

Parameters

Name Type Description
constraintSizeConstraintsize constraint

Returns

LayoutStyle<T&gt;

this


setStyle

▸ setStyle(layoutStyle, silent?): LayoutStyle<T&gt;

Set style

Parameters

Name Type Description
layoutStyleLayoutStyle<T&gt; | Options<T&gt;space style
Optional silentbooleansilent mode

Returns

LayoutStyle<T&gt;

Overrides

SpaceStyle.setStyle


setTop

▸ setTop(top): LayoutStyle<T&gt;

Set top position

Parameters

Name Type Description
topTposition

Returns

LayoutStyle<T&gt;

this

Inherited from

SpaceStyle.setTop


setWidth

▸ setWidth(width): LayoutStyle<T&gt;

set width

Parameters

Name Type Description
widthTposition

Returns

LayoutStyle<T&gt;

this


updateTimeStamp

▸ updateTimeStamp(silent?): LayoutStyle<T&gt;

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&gt;

this

Inherited from

SpaceStyle.updateTimeStamp


addSpace

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

Return area including space

Parameters

Name Type Description
styleSpaceStyle<string | number&gt;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&gt;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&gt;

Create or get layout style from object

Parameters

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

Returns

LayoutStyle<string | number&gt;

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&gt;

Merge layoutStyle object with existing instance

Parameters

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

Returns

LayoutStyle<string | number&gt;

layoutStyle

Overrides

SpaceStyle.mergeFromObject