Last updated

API / geotoolkit / layout / BoxLayout / BoxLayout

Class: BoxLayout

layout.BoxLayout.BoxLayout

Define an abstract class for box layout to line up child ILayoutable horizontally or vertically.

Children can be added using methods: add or insert or can be passed as parameter in method layout If layout has any item added directly it ignores items passed to layout as parameter

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
rectRectBounds of the layout
rect-heightnumberHeight
rect-readonlybooleanReadonly
rect-widthnumberWidth
rect-xnumberLeft
rect-ynumberTop
reversebooleanReverse flag

Contents

Constructors

new BoxLayout(dstRect)

Protected new BoxLayout(dstRect?)

Parameters

Name Type Description
Optional dstRectRect | Optionslayout area or properties object

Overrides

ContainerLayout.constructor

Methods

add

add(node): BoxLayout

Adds layoutable element

Parameters

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

Returns

BoxLayout

Overrides

ContainerLayout.add


clear

clear(): BoxLayout

Remove all children items from layout

Returns

BoxLayout

Overrides

ContainerLayout.clear


clone

clone(): Layout

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

Returns

Layout

Inherited from

ContainerLayout.clone


copyConstructor

Protected copyConstructor(src): void

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
srcLayoutSource to copy from

Returns

void

Inherited from

ContainerLayout.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

ContainerLayout.dispose


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


getLayoutable

getLayoutable(index): ILayoutable

Return node by index

Parameters

Name Type
indexnumber

Returns

ILayoutable


getLayoutableCount

getLayoutableCount(): number

Return number of layoutable nodes

Returns

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(): Options

Gets all the properties pertaining to this object

Returns

Options

properties An object containing the properties of the layout

Overrides

ContainerLayout.getProperties


getRect

getRect(): Rect

Gets rectangular layout area

Returns

Rect

rectangular layout area ("undefined" by default)


getReverse

getReverse(): boolean

Returns true if layout is in reverse order

Returns

boolean


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


indexOfLayoutable

indexOfLayoutable(node): number

Return index of layoutable node ( index of the specified child or -1 if node is not in layoutable list)

Parameters

Name Type Description
nodeILayoutablenode to check index

Returns

number


insert

insert(index, node): BoxLayout

Inserts layoutable element

Parameters

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

Returns

BoxLayout

Overrides

ContainerLayout.insert


invalidateLayout

invalidateLayout(): BoxLayout

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Returns

BoxLayout

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

Abstract layout(area?, targets?): BoxLayout

Performs layout operation

Parameters

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

Returns

BoxLayout

this

Inherited from

ContainerLayout.layout


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

BoxLayout

this

Inherited from

ContainerLayout.notify


off

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

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

Returns

BoxLayout

this

Inherited from

ContainerLayout.off


on

on<E>(type, callback): BoxLayout

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

Returns

BoxLayout

this

Inherited from

ContainerLayout.on


remove

remove(node): BoxLayout

Removes a layoutable node if found

Parameters

Name Type Description
nodeILayoutablelayoutable element

Returns

BoxLayout

Overrides

ContainerLayout.remove


setProperties

setProperties(properties?): BoxLayout

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

BoxLayout

this

Overrides

ContainerLayout.setProperties


setRect

setRect(dstRect): BoxLayout

Sets rectangular layout area

Parameters

Name Type Description
dstRectRectrectangular layout area

Returns

BoxLayout

this


setReverse

setReverse(reverse): BoxLayout

Set reverse order iteration flag

Parameters

Name Type Description
reversebooleanreverse order flag

Returns

BoxLayout

this


setSilent

setSilent(bool): BoxLayout

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

BoxLayout

this

Inherited from

ContainerLayout.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

ContainerLayout.getClassName