Last updated

API / geotoolkit / attributes / SpaceStyle / SpaceStyle

Class: SpaceStyle<T>

attributes.SpaceStyle.SpaceStyle

Defines properties to specify margins or padding

Type parameters

NameType
Textends number | string = number | string

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new SpaceStyle&lt;T&amp;gt;(space)

new SpaceStyle<T>(space?)

Type parameters

NameType
Textends string | number = string | number

Parameters

Name Type
Optional spaceType<T>

Overrides

Style.constructor

Methods

clone

clone(): SpaceStyle<T>

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

Returns

SpaceStyle<T>

this

Overrides

Style.clone


compile

compile(bounds?): SpaceStyle<number>

Compile style

Parameters

Name Type Description
Optional boundsRecttarget bounds

Returns

SpaceStyle<number>

compile(convertToUnit?, bounds?): SpaceStyle<number>

Compile style

Parameters

Name Type Description
Optional convertToUnitAbstractUnittarget unit
Optional boundsRecttarget bounds

Returns

SpaceStyle<number>


copyConstructor

Protected copyConstructor(src, deepCopy?): SpaceStyle<T>

copy constructor

Parameters

Name Type Description
srcSpaceStyle<T>Source to copy from
Optional deepCopybooleandeep copy

Returns

SpaceStyle<T>

this

Overrides

Style.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

Style.dispose


equalsTo

equalsTo(style): boolean

Return true if styles are equals

Parameters

Name Type Description
styleSpaceStyle<string | number>style to compare

Returns

boolean


getBottom

getBottom(): T

Return bottom position

Returns

T


getClassName

getClassName(): string

Returns

string

Inherited from

Style.getClassName


getLeft

getLeft(): T

Return left position

Returns

T


getProperties

getProperties(context?): OptionsOut<T>

Gets all the properties pertaining to this object

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

OptionsOut<T>

object which contains the following fields

Overrides

Style.getProperties


getRight

getRight(): T

Return right position

Returns

T


getStyle

getStyle(): Options<T>

return JSON representation of the space object

Returns

Options<T>

offsets


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

Style.getTimeStamp


getTop

getTop(): T

Return top position

Returns

T


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(): SpaceStyle<T>

notify the node that the style is invalidated

Returns

SpaceStyle<T>

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?): SpaceStyle<T>

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

SpaceStyle<T>

this

Inherited from

Style.notify


off

off<E>(type?, callback?): SpaceStyle<T>

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

Returns

SpaceStyle<T>

this

Inherited from

Style.off


on

on<E>(type, callback): SpaceStyle<T>

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

Returns

SpaceStyle<T>

this

Inherited from

Style.on


setBottom

setBottom(bottom): SpaceStyle<T>

Set bottom position

Parameters

Name Type Description
bottomTposition

Returns

SpaceStyle<T>

this


setLeft

setLeft(left): SpaceStyle<T>

Set left position

Parameters

Name Type Description
leftTposition

Returns

SpaceStyle<T>

this


setProperties

setProperties(properties?): SpaceStyle<T>

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<T>object which contains the following fields

Returns

SpaceStyle<T>

Overrides

Style.setProperties


setRight

setRight(right): SpaceStyle<T>

Set right position

Parameters

Name Type Description
rightTposition

Returns

SpaceStyle<T>

this


setSilent

setSilent(bool, force?): SpaceStyle<T>

Set silent mode

Parameters

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

Returns

SpaceStyle<T>

this

Inherited from

Style.setSilent


setStyle

setStyle(spaceStyle, silent?): SpaceStyle<T>

Set style

Parameters

Name Type Description
spaceStyleType<T>space style
Optional silentbooleansilent mode

Returns

SpaceStyle<T>


setTop

setTop(top): SpaceStyle<T>

Set top position

Parameters

Name Type Description
topTposition

Returns

SpaceStyle<T>

this


updateTimeStamp

updateTimeStamp(silent?): SpaceStyle<T>

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

SpaceStyle<T>

this

Inherited from

Style.updateTimeStamp


addSpace

Static addSpace(style, rect, transformation?): Rect

Return area including space

Parameters

Name Type Description
styleSpaceStyle<string | number>style to add space
rectRectoriginal area
Optional transformationTransformationscreen transformation

Returns

Rect

area with including space


excludeSpace

Static excludeSpace(style, rect, transformation?): Rect

Return area excluding space

Parameters

Name Type Description
stylenumber | SpaceStyle<string | number>style to exclude space
rectRectoriginal area
Optional transformationTransformationscreen transformation

Returns

Rect

area with excluding space


fromObject

Static fromObject(object?): SpaceStyle<string | number>

Create or get space style from object

Parameters

Name Type Description
Optional objectType<string | number>object can be in format of constructor geotoolkit.attributes.SpaceStyle

Returns

SpaceStyle<string | number>

space style


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


mergeFromObject

Static mergeFromObject(node, spaceStyle, object, merge?, invalidateMethod?): SpaceStyle<string | number>

Merge spaceStyle object with existing instance

Parameters

Name Type Description
nodeIStyleListenernode
spaceStyleSpaceStyle<string | number>instance of node property
objectType<string | number>contains space style
Optional mergebooleanmerge flag
Optional invalidateMethodAttributeCallback<EventDispatcher>invalidate method

Returns

SpaceStyle<string | number>

spaceStyle