Skip to content

API / geotoolkit / widgets / legends / LegendLayout / LegendCssLayout

Class: LegendCssLayout

legends.LegendLayout.LegendCssLayout

Implements simple Legend layout (in absolute values) to layout LegendPanels

Hierarchy

Table of contents

Constructors
  • [new LegendCssLayout(referenceModel)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.widgets-1.legends.legendlayout.legendcsslayout.md#new legendcsslayout(referencemodel))
Methods
Css Properties
Name Type Description
horizontalalignmentHorizontalAlignmentHorizontal alignment for Stacked Layout
horizontalalignmentStackedAlignmentHorizontal alignment for Stacked Layout
layoutmodeLayoutModeLayout mode, free or stacked
verticalalignmentVerticalAlignmentVertical alignment for Stacked Layout
verticalalignmentStackedAlignmentVertical alignment for Stacked Layout

Contents

Constructors

new LegendCssLayout(referenceModel)

• new LegendCssLayout(referenceModel?)

Parameters

Name Type
Optional referenceModelGroup<Node&gt;

Overrides

CssLayout.constructor

Methods

add

▸ add(item): LegendCssLayout

Adds layoutable element

Parameters

Name Type Description
itemILayoutable | ILayoutable[] | Iterator<ILayoutable&gt;layoutable element(s)

Returns

LegendCssLayout

Inherited from

CssLayout.add


calculateLayoutStyle

▸ calculateLayoutStyle(node, model, nodeDeviceRect): Options<string | number&gt;

Parameters

Name Type
nodeNode & ILayoutable
modelGroup<Node&gt;
nodeDeviceRectRect

Returns

Options<string | number&gt;


clear

▸ clear(): LegendCssLayout

Remove all children items from layout

Returns

LegendCssLayout

Inherited from

CssLayout.clear


clone

▸ clone(): LegendCssLayout

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

Returns

LegendCssLayout

Overrides

CssLayout.clone


copyConstructor

▸ Protected copyConstructor(src, deepCopy?): LegendCssLayout

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

Parameters

Name Type Description
srcLegendCssLayoutSource to copy from
Optional deepCopyboolean

Returns

LegendCssLayout

Overrides

CssLayout.copyConstructor


dispose

▸ dispose(): void

Dispose.

Returns

void

Inherited from

CssLayout.dispose


getBounds

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

Parameters

Name Type Description
modelLimitsRectmodel limits
layoutStyleLayoutStyle<string | number&gt;layout style
Optional nodeILayoutablenode

Returns

Rect

Inherited from

CssLayout.getBounds


getClassName

▸ getClassName(): string

Returns

string

Inherited from

CssLayout.getClassName


getHorizontalAlignment

▸ getHorizontalAlignment(): HorizontalAlignment | StackedAlignment

Returns

HorizontalAlignment | StackedAlignment


getIterator

▸ getIterator(targets?): Iterator<ILayoutable&gt;

Parameters

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

Returns

Iterator<ILayoutable&gt;

Inherited from

CssLayout.getIterator


getLayoutMode

▸ getLayoutMode(): LayoutMode

Returns

LayoutMode


getLayoutStyle

▸ Protected getLayoutStyle(current): LayoutStyle<string | number&gt;

get node layout style

Parameters

Name Type
currentILayoutable

Returns

LayoutStyle<string | number&gt;

Inherited from

CssLayout.getLayoutStyle


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&gt;array of nodes supposed to layout

Returns

Rect

Inherited from

CssLayout.getPreferredSize


getProperties

▸ getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties An object containing the properties of the layout

Overrides

CssLayout.getProperties


getReferenceModel

▸ getReferenceModel(): Group<Node&gt;

Returns

Group<Node&gt;


getVerticalAlignment

▸ getVerticalAlignment(): VerticalAlignment | StackedAlignment

Returns

VerticalAlignment | StackedAlignment


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

CssLayout.hasEventListener


insert

▸ insert(index, item): LegendCssLayout

Inserts layoutable element

Parameters

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

Returns

LegendCssLayout

Inherited from

CssLayout.insert


invalidateLayout

▸ invalidateLayout(): LegendCssLayout

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Returns

LegendCssLayout

this

Inherited from

CssLayout.invalidateLayout


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

CssLayout.isDisposed


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

CssLayout.isSilent


layout

▸ layout(rect, targets): LegendCssLayout

Performs layout operation

Parameters

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

Returns

LegendCssLayout

this

Inherited from

CssLayout.layout


layoutItems

▸ Protected layoutItems(rect, items): LegendCssLayout

Parameters

Name Type
rectRect
itemsILayoutable[] | Iterator<ILayoutable&gt;

Returns

LegendCssLayout

Inherited from

CssLayout.layoutItems


notify

▸ notify<E&gt;(type, source, args?): LegendCssLayout

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

LegendCssLayout

this

Inherited from

CssLayout.notify


off

▸ off<E&gt;(type?, callback?): LegendCssLayout

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

Returns

LegendCssLayout

this

Inherited from

CssLayout.off


on

▸ on<E&gt;(type, callback): LegendCssLayout

Attach listener on event that will be called whenever the specified event is delivered to the target <p> If the callback function is already in the list of event listeners for this target, the function is not added a second time. </p> <p> 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. </p>

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: LegendCssLayout, args: EventMap[E]) => voidto be called

Returns

LegendCssLayout

this

Inherited from

CssLayout.on


remove

▸ remove(item): LegendCssLayout

Removes a layoutable node if found

Parameters

Name Type Description
itemILayoutablelayoutable element

Returns

LegendCssLayout

Inherited from

CssLayout.remove


setHorizontalAlignment

▸ setHorizontalAlignment(alignment): LegendCssLayout

Parameters

Returns

LegendCssLayout


setLayoutMode

▸ setLayoutMode(mode): LegendCssLayout

Parameters

Name Type
modeLayoutMode

Returns

LegendCssLayout


setProperties

▸ setProperties(properties): LegendCssLayout

Sets all the properties pertaining to this object

Parameters

Name Type Description
propertiesOptionsAn object containing the properties to set

Returns

LegendCssLayout

this

Overrides

CssLayout.setProperties


setSilent

▸ setSilent(bool): LegendCssLayout

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

LegendCssLayout

this

Inherited from

CssLayout.setSilent


setVerticalAlignment

▸ setVerticalAlignment(alignment): LegendCssLayout

Parameters

Name Type
alignmentVerticalAlignment | StackedAlignment

Returns

LegendCssLayout


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

CssLayout.getClassName


getDefault

▸ Static getDefault(): CssLayout

Return Default CSS Layout

Returns

CssLayout

Inherited from

CssLayout.getDefault