Last updated

API / geotoolkit / report / elements / styles / ElementStyle / ElementStyle

Class: ElementStyle

styles.ElementStyle.ElementStyle

Parent class for all styles

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new ElementStyle(style)

new ElementStyle(style?)

Parameters

Name Type
Optional stylestring

Overrides

Style.constructor

Methods

clone

clone(): Style

All inheritors should implement copy constructor or provide custom implementation for this method

Returns

Style

this

Inherited from

Style.clone


copyConstructor

Protected copyConstructor(src, deepCopy?): ElementStyle

copy constructor

Parameters

Name Type Description
srcStyleSource to copy from
Optional deepCopybooleandeep copy

Returns

ElementStyle

this

Inherited from

Style.copyConstructor


createStyle

Protected createStyle(styleName, styleValue?): string | Record<string, any> | ElementStyle

Parameters

Name Type
styleNamestring
Optional styleValuestring

Returns

string | Record<string, any> | ElementStyle


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

Style.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

Style.getClassName


getProperties

getProperties(context?): Record<string, any>

Gets all the properties pertaining to this object

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

Record<string, any>

properties properties

Inherited from

Style.getProperties


getStyle

getStyle(styleName?): string | number | Record<string, any> | ElementStyle

Parameters

Name Type Description
Optional styleNamestringstyleName 'border-left'|'fill-pattern-position'|'float'|.....

Returns

string | number | Record<string, any> | ElementStyle

style


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

Style.getTimeStamp


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

Style.hasEventListener


invalidate

invalidate(): ElementStyle

notify the node that the style is invalidated

Returns

ElementStyle

this

Inherited from

Style.invalidate


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Style.isDisposed


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

Style.isSilent


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

ElementStyle

this

Inherited from

Style.notify


off

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

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

Returns

ElementStyle

this

Inherited from

Style.off


on

on<E>(type, callback): ElementStyle

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

Returns

ElementStyle

this

Inherited from

Style.on


parseStyle

Protected parseStyle(styleName, styleValue): string | Record<string, any> | ElementStyle

Parameters

Name Type
styleNamestring
styleValuestring | ElementStyle

Returns

string | Record<string, any> | ElementStyle


removeStyle

removeStyle(styleName): ElementStyle

Remove style attribute

Parameters

Name Type Description
styleNamestring | string[]style name

Returns

ElementStyle


setParent

setParent(parent): ElementStyle

Parameters

Name Type
parentElementStyle

Returns

ElementStyle


setProperties

setProperties(properties?, context?): ElementStyle

Sets all the properties pertaining to this object

Parameters

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

Returns

ElementStyle

this

Inherited from

Style.setProperties


setSilent

setSilent(bool, force?): ElementStyle

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode
Optional forcebooleantrue if parent should be invalidated immediately

Returns

ElementStyle

this

Inherited from

Style.setSilent


setStyle

setStyle(style, value?): ElementStyle

Parameters

Name Type
styleany
Optional valueany

Returns

ElementStyle


toString

toString(styleName?): string

Convert Style attribute to string

Parameters

Name Type Description
Optional styleNamestringstyle name

Returns

string


updateTimeStamp

updateTimeStamp(silent?): ElementStyle

Update time stamp to indicate that style has been changed.

Parameters

Name Type Description
Optional silentbooleansilent mode. If this parameter equals to true then style doesn't send invalidate event

Returns

ElementStyle

this

Inherited from

Style.updateTimeStamp


getClassName

Static getClassName(): string

Returns

string

Inherited from

Style.getClassName


isStyleNotificationEnabled

Static isStyleNotificationEnabled(): boolean

Return status of the global notification for all styles.

Returns

boolean

Inherited from

Style.isStyleNotificationEnabled