Last updated

API / geotoolkit / layout / CompositeLayout / CompositeLayout

Class: CompositeLayout

layout.CompositeLayout.CompositeLayout

Defines a container of layouts

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new CompositeLayout()

new CompositeLayout()

Overrides

Layout.constructor

Methods

add

add(layout): CompositeLayout

Add a child layout(s)

Parameters

Name Type Description
layoutLayout | Layout[]the child layout to be added

Returns

CompositeLayout


clearChildren

clearChildren(): void

Remove all child layouts from this composite layout

Returns

void


clone

clone(): Layout

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

Returns

Layout

Inherited from

Layout.clone


copyConstructor

Protected copyConstructor(src): void

copy constructor

Parameters

Name Type Description
srcCompositeLayoutSource to copy from

Returns

void

Overrides

Layout.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

Layout.dispose


getChild

getChild(i): Layout

Return layout by index

Parameters

Name Type Description
inumberindex of the layout

Returns

Layout


getChildren

getChildren(filter?): Iterator<Layout>

Return iterator by child layouts

Parameters

Name Type Description
Optional filter(item: Layout) => booleana filter function. Returns all layouts if null

Returns

Iterator<Layout>


getChildrenCount

getChildrenCount(): number

Return number of child layouts

Returns

number


getClassName

getClassName(): string

Returns

string

Inherited from

Layout.getClassName


getPreferredSize

getPreferredSize(rect, targets?): Rect

Return the preferable size of children. It returns an union of all children

Parameters

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

Returns

Rect

Overrides

Layout.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

Layout.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

Layout.hasEventListener


indexOfChild

indexOfChild(layout): number

Return index of child ( index of the specified child or -1 if layout is not found)

Parameters

Name Type Description
layoutLayoutlayout to check index

Returns

number


insertChild

insertChild(index, layout): CompositeLayout

Insert child layout at specified index

Parameters

Name Type Description
indexnumberspecified index
layoutLayouta child layout to add

Returns

CompositeLayout


invalidateLayout

invalidateLayout(): CompositeLayout

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Returns

CompositeLayout

this

Inherited from

Layout.invalidateLayout


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Layout.isDisposed


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

Layout.isSilent


layout

layout(layoutRect?, targets?): CompositeLayout

Performs layout operation

Parameters

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

Returns

CompositeLayout

this

Overrides

Layout.layout


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

CompositeLayout

this

Inherited from

Layout.notify


off

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

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

Returns

CompositeLayout

this

Inherited from

Layout.off


on

on<E>(type, callback): CompositeLayout

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

Returns

CompositeLayout

this

Inherited from

Layout.on


removeChild

removeChild(layout): CompositeLayout

Remove child layout

Parameters

Name Type Description
layoutLayoutlayout to be removed

Returns

CompositeLayout


setProperties

setProperties(properties): CompositeLayout

Sets all the properties pertaining to this object

Parameters

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

Returns

CompositeLayout

this

Inherited from

Layout.setProperties


setSilent

setSilent(bool): CompositeLayout

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

CompositeLayout

this

Inherited from

Layout.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

Layout.getClassName