Last updated

API / geotoolkit / layout / RegularGridLayout / RegularGridLayout

Class: RegularGridLayout

layout.RegularGridLayout.RegularGridLayout

Children are arranged in a grid based on number of Rows and Columns in the grid.

Hierarchy

Table of contents

Constructors
[new RegularGridLayout(properties)](/solutions/geotoolkit/apis/classes/geotoolkit.layout.regulargridlayout.regulargridlayout.md#new regulargridlayout(properties))[new RegularGridLayout(rowCount, colCount, containerDirection, dstRect)](/solutions/geotoolkit/apis/classes/geotoolkit.layout.regulargridlayout.regulargridlayout.md#new regulargridlayout(rowcount, colcount, containerdirection, dstrect))
Methods
Css Properties
Name Type Description
columncountnumberColumncount columncount
directionContainerDirectionDirection of the layout
rectRectBounds of the layout
rect-heightnumberHeight
rect-readonlybooleanReadonly
rect-widthnumberWidth
rect-xnumberLeft
rect-ynumberTop
reversebooleanReverse flag
rowcountnumberRowcount rowcount

Contents

Constructors

new RegularGridLayout(properties)

new RegularGridLayout(properties?)

Parameters

Name Type Description
Optional propertiesOptionsproperties objecta

Overrides

BoxLayout.constructor


new RegularGridLayout(rowCount, colCount, containerDirection, dstRect)

new RegularGridLayout(rowCount?, colCount?, containerDirection?, dstRect?)

Parameters

Name Type Description
Optional rowCountnumbernumber of columns for layout
Optional colCountnumbernumber of rows for layout
Optional containerDirectionContainerDirectiondirection for container's layout
Optional dstRectRectrectangular layout area

Overrides

BoxLayout.constructor

Methods

add

add(node): RegularGridLayout

Adds layoutable element

Parameters

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

Returns

RegularGridLayout

Inherited from

BoxLayout.add


clear

clear(): RegularGridLayout

Remove all children items from layout

Returns

RegularGridLayout

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


getClassName

getClassName(): string

Returns

string

Inherited from

BoxLayout.getClassName


getColumnCount

getColumnCount(): number

Gets number of columns for layout

Returns

number


getDirection

getDirection(): ContainerDirection

Gets direction of the container that this layout for

Returns

ContainerDirection


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


getRowCount

getRowCount(): number

Gets number of rows for layout

Returns

number


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): RegularGridLayout

Inserts layoutable element

Parameters

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

Returns

RegularGridLayout

Inherited from

BoxLayout.insert


invalidateLayout

invalidateLayout(): RegularGridLayout

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Returns

RegularGridLayout

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?): RegularGridLayout

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

RegularGridLayout

this

Overrides

BoxLayout.layout


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

RegularGridLayout

this

Inherited from

BoxLayout.notify


off

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

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

Returns

RegularGridLayout

this

Inherited from

BoxLayout.off


on

on<E>(type, callback): RegularGridLayout

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

Returns

RegularGridLayout

this

Inherited from

BoxLayout.on


remove

remove(node): RegularGridLayout

Removes a layoutable node if found

Parameters

Name Type Description
nodeILayoutablelayoutable element

Returns

RegularGridLayout

Inherited from

BoxLayout.remove


setColumnCount

setColumnCount(colCount): RegularGridLayout

Sets number of columns for layout

Parameters

Name Type Description
colCountnumbernumber of columns for layout

Returns

RegularGridLayout

this


setDirection

setDirection(direction): RegularGridLayout

Sets direction for container's layout

Parameters

Name Type Description
directionContainerDirectiondirection for container's layout

Returns

RegularGridLayout

this


setProperties

setProperties(properties?): RegularGridLayout

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

RegularGridLayout

this

Overrides

BoxLayout.setProperties


setRect

setRect(dstRect): RegularGridLayout

Sets rectangular layout area

Parameters

Name Type Description
dstRectRectrectangular layout area

Returns

RegularGridLayout

this

Inherited from

BoxLayout.setRect


setReverse

setReverse(reverse): RegularGridLayout

Set reverse order iteration flag

Parameters

Name Type Description
reversebooleanreverse order flag

Returns

RegularGridLayout

this

Inherited from

BoxLayout.setReverse


setRowCount

setRowCount(rowCount): RegularGridLayout

Sets number of rows for layout

Parameters

Name Type Description
rowCountnumbernumber of rows for layout

Returns

RegularGridLayout

this


setSilent

setSilent(bool): RegularGridLayout

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

RegularGridLayout

this

Inherited from

BoxLayout.setSilent


getClassName

Static getClassName(): string

Returns

string

Inherited from

BoxLayout.getClassName