Last updated

API / geotoolkit / layout / CssLayout / CssLayout

Class: CssLayout

layout.CssLayout.CssLayout

Implements simple css layout (in absolute values)

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new CssLayout()

new CssLayout()

Overrides

ContainerLayout.constructor

Methods

add

add(item): CssLayout

Adds layoutable element

Parameters

Name Type Description
itemILayoutable | ILayoutable[] | Iterator<ILayoutable>layoutable element(s)

Returns

CssLayout

Overrides

ContainerLayout.add


clear

clear(): CssLayout

Remove all children items from layout

Returns

CssLayout

Overrides

ContainerLayout.clear


clone

clone(): CssLayout

All subclasses should override copyConstructor or provide custom implementation for this method

Returns

CssLayout

Overrides

ContainerLayout.clone


copyConstructor

Protected copyConstructor(src, deepCopy?): CssLayout

Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.

Parameters

Name Type Description
srcCssLayoutSource to copy from
Optional deepCopyboolean

Returns

CssLayout

Overrides

ContainerLayout.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

ContainerLayout.dispose


getBounds

Protected getBounds(modelLimits, layoutStyle, node?): Rect

Parameters

Name Type Description
modelLimitsRectmodel limits
layoutStyleLayoutStyle<string | number>layout style
Optional nodeILayoutablenode

Returns

Rect


getClassName

getClassName(): string

Returns

string

Inherited from

ContainerLayout.getClassName


getIterator

getIterator(targets?): Iterator<ILayoutable>

Parameters

Name Type Description
Optional targetsILayoutable[] | Iterator<ILayoutable>optional, items for iterator

Returns

Iterator<ILayoutable>

Overrides

ContainerLayout.getIterator


getLayoutStyle

Protected getLayoutStyle(current): LayoutStyle<string | number>

get node layout style

Parameters

Name Type
currentILayoutable

Returns

LayoutStyle<string | number>


getPreferredSize

getPreferredSize(rect, targets?): Rect

Return the preferable size of children. Default implementation returns desired rect

Parameters

Name Type Description
rectRectdesired rect to layout
Optional targetsILayoutable[] | Iterator<ILayoutable>array of nodes supposed to layout

Returns

Rect

Inherited from

ContainerLayout.getPreferredSize


getProperties

getProperties(): Record<string, any>

Gets all the properties pertaining to this object

Returns

Record<string, any>

properties An object containing the properties of the layout

Inherited from

ContainerLayout.getProperties


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

ContainerLayout.hasEventListener


insert

insert(index, item): CssLayout

Inserts layoutable element

Parameters

Name Type Description
indexnumberindex where element will be inserted
itemILayoutable | ILayoutable[] | Iterator<ILayoutable>layoutable element(s)

Returns

CssLayout

Overrides

ContainerLayout.insert


invalidateLayout

invalidateLayout(): CssLayout

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Returns

CssLayout

this

Inherited from

ContainerLayout.invalidateLayout


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

ContainerLayout.isDisposed


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

ContainerLayout.isSilent


layout

layout(rect, targets): CssLayout

Performs layout operation

Parameters

Name Type Description
rectRectdesired rect to layout
targetsILayoutable[]array of nodes or iterator of nodes supposed to layout

Returns

CssLayout

this

Overrides

ContainerLayout.layout


layoutItems

Protected layoutItems(rect, items): CssLayout

Parameters

Name Type
rectRect
itemsILayoutable[] | Iterator<ILayoutable>

Returns

CssLayout


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

CssLayout

this

Inherited from

ContainerLayout.notify


off

off<E>(type?, callback?): CssLayout

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

Returns

CssLayout

this

Inherited from

ContainerLayout.off


on

on<E>(type, callback): CssLayout

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: CssLayout, args: EventMap[E]) => voidto be called

Returns

CssLayout

this

Inherited from

ContainerLayout.on


remove

remove(item): CssLayout

Removes a layoutable node if found

Parameters

Name Type Description
itemILayoutablelayoutable element

Returns

CssLayout

Overrides

ContainerLayout.remove


setProperties

setProperties(properties): CssLayout

Sets all the properties pertaining to this object

Parameters

Name Type Description
propertiesRecord<string, any>An object containing the properties to set

Returns

CssLayout

this

Inherited from

ContainerLayout.setProperties


setSilent

setSilent(bool): CssLayout

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

CssLayout

this

Inherited from

ContainerLayout.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

ContainerLayout.getClassName


getDefault

Static getDefault(): CssLayout

Return Default CSS Layout

Returns

CssLayout