Last updated

API / geotoolkit / layout / HorizontalBoxLayout / HorizontalBoxLayout

Class: HorizontalBoxLayout

layout.HorizontalBoxLayout.HorizontalBoxLayout

The HorizontalBoxLayout class lines up child elements geotoolkit.layout.ILayoutable horizontally.

Each child will get at least its desired width and at most its desired height, minimum and maximum height. If height is not specified a child takes a height of layout area. This area can be passed via method setRect or as a parameter of the layout.

The desired width can be specified in model parent units or in percentage to width of the a layout area.

Hierarchy

Table of contents

Constructors
[new HorizontalBoxLayout(dstRect, alignment, direction)](/solutions/geotoolkit/apis/classes/geotoolkit.layout.horizontalboxlayout.horizontalboxlayout.md#new horizontalboxlayout(dstrect, alignment, direction))[new HorizontalBoxLayout(options)](/solutions/geotoolkit/apis/classes/geotoolkit.layout.horizontalboxlayout.horizontalboxlayout.md#new horizontalboxlayout(options))
Methods
Css Properties
Name Type Description
alignmentAlignmentAlignment of the layout
directionDirectionDirection of the layout
rectRectBounds of the layout
rect-heightnumberHeight
rect-readonlybooleanReadonly
rect-widthnumberWidth
rect-xnumberLeft
rect-ynumberTop
reversebooleanReverse flag

Contents

Constructors

new HorizontalBoxLayout(dstRect, alignment, direction)

new HorizontalBoxLayout(dstRect?, alignment?, direction?)

Parameters

Name Type Description
Optional dstRectRectoptional layout area
Optional alignmentAlignmentvertical alignment
Optional directionDirectionoptional direction of layout

Overrides

BoxLayout.constructor


new HorizontalBoxLayout(options)

new HorizontalBoxLayout(options?)

Parameters

Name Type
Optional optionsOptions

Overrides

BoxLayout.constructor

Methods

add

add(node): HorizontalBoxLayout

Adds layoutable element

Parameters

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

Returns

HorizontalBoxLayout

Inherited from

BoxLayout.add


clear

clear(): HorizontalBoxLayout

Remove all children items from layout

Returns

HorizontalBoxLayout

Inherited from

BoxLayout.clear


clone

clone(): Layout

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

Returns

Layout

Inherited from

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

BoxLayout.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

BoxLayout.dispose


getAlignment

getAlignment(): Alignment

Returns vertical alignment

Returns

Alignment

alignment vertical alignment


getClassName

getClassName(): string

Returns

string

Inherited from

BoxLayout.getClassName


getDirection

getDirection(): Direction

Returns direction of layout

Returns

Direction


getIterator

getIterator(targets?): Iterator<ILayoutable>

Parameters

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

Returns

Iterator<ILayoutable>

Inherited from

BoxLayout.getIterator


getLayoutable

getLayoutable(index): ILayoutable

Return node by index

Parameters

Name Type
indexnumber

Returns

ILayoutable

Inherited from

BoxLayout.getLayoutable


getLayoutableCount

getLayoutableCount(): number

Return number of layoutable nodes

Returns

number

Inherited from

BoxLayout.getLayoutableCount


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

BoxLayout.getPreferredSize


getProperties

getProperties(): Options

Gets all the properties pertaining to this object

Returns

Options

properties An object containing the properties of the layout

Overrides

BoxLayout.getProperties


getRect

getRect(): Rect

Gets rectangular layout area

Returns

Rect

rectangular layout area ("undefined" by default)

Inherited from

BoxLayout.getRect


getReverse

getReverse(): boolean

Returns true if layout is in reverse order

Returns

boolean

Inherited from

BoxLayout.getReverse


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

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

Inherited from

BoxLayout.indexOfLayoutable


insert

insert(index, node): HorizontalBoxLayout

Inserts layoutable element

Parameters

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

Returns

HorizontalBoxLayout

Inherited from

BoxLayout.insert


invalidateLayout

invalidateLayout(): HorizontalBoxLayout

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Returns

HorizontalBoxLayout

this

Inherited from

BoxLayout.invalidateLayout


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

BoxLayout.isDisposed


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

BoxLayout.isSilent


layout

layout(layoutRect?, targets?): HorizontalBoxLayout

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

HorizontalBoxLayout

this

Overrides

BoxLayout.layout


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

HorizontalBoxLayout

this

Inherited from

BoxLayout.notify


off

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

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

Returns

HorizontalBoxLayout

this

Inherited from

BoxLayout.off


on

on<E>(type, callback): HorizontalBoxLayout

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

Returns

HorizontalBoxLayout

this

Inherited from

BoxLayout.on


remove

remove(node): HorizontalBoxLayout

Removes a layoutable node if found

Parameters

Name Type Description
nodeILayoutablelayoutable element

Returns

HorizontalBoxLayout

Inherited from

BoxLayout.remove


setAlignment

setAlignment(alignment): HorizontalBoxLayout

Sets vertical alignment

Parameters

Name Type Description
alignmentAlignmentalignment

Returns

HorizontalBoxLayout

this


setDirection

setDirection(value): HorizontalBoxLayout

Set direction

Parameters

Name Type Description
valueDirectiondirection

Returns

HorizontalBoxLayout

this


setProperties

setProperties(properties?): HorizontalBoxLayout

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

HorizontalBoxLayout

this

Overrides

BoxLayout.setProperties


setRect

setRect(dstRect): HorizontalBoxLayout

Sets rectangular layout area

Parameters

Name Type Description
dstRectRectrectangular layout area

Returns

HorizontalBoxLayout

this

Inherited from

BoxLayout.setRect


setReverse

setReverse(reverse): HorizontalBoxLayout

Set reverse order iteration flag

Parameters

Name Type Description
reversebooleanreverse order flag

Returns

HorizontalBoxLayout

this

Inherited from

BoxLayout.setReverse


setSilent

setSilent(bool): HorizontalBoxLayout

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

HorizontalBoxLayout

this

Inherited from

BoxLayout.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

BoxLayout.getClassName