Skip to content

API / geotoolkit / attributes / SpaceStyle / SpaceStyle

Class: SpaceStyle<T&gt;

attributes.SpaceStyle.SpaceStyle

Defines properties to specify margins or padding

Type parameters

NameType
Textends number | string = number | string

Hierarchy

Table of contents

Constructors
  • [new SpaceStyle<T&gt;(space)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.attributes.spacestyle.spacestyle.md#new spacestyle<t>(space))
Methods

Contents

Constructors

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

• new SpaceStyle<T&gt;(space?)

Type parameters

NameType
Textends string | number = string | number

Parameters

Name Type
Optional spaceType<T&gt;

Overrides

Style.constructor

Methods

clone

▸ clone(): SpaceStyle<T&gt;

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

Returns

SpaceStyle<T&gt;

this

Overrides

Style.clone


compile

▸ compile(bounds?): SpaceStyle<number&gt;

Compile style

Parameters

Name Type Description
Optional boundsRecttarget bounds

Returns

SpaceStyle<number&gt;

▸ compile(convertToUnit?, bounds?): SpaceStyle<number&gt;

Compile style

Parameters

Name Type Description
Optional convertToUnitAbstractUnittarget unit
Optional boundsRecttarget bounds

Returns

SpaceStyle<number&gt;


copyConstructor

▸ Protected copyConstructor(src, deepCopy?): SpaceStyle<T&gt;

copy constructor

Parameters

Name Type Description
srcSpaceStyle<T&gt;Source to copy from
Optional deepCopybooleandeep copy

Returns

SpaceStyle<T&gt;

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&gt;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&gt;

Gets all the properties pertaining to this object

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

OptionsOut<T&gt;

object which contains the following fields

Overrides

Style.getProperties


getRight

▸ getRight(): T

Return right position

Returns

T


getStyle

▸ getStyle(): Options<T&gt;

return JSON representation of the space object

Returns

Options<T&gt;

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&gt;

notify the node that the style is invalidated

Returns

SpaceStyle<T&gt;

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&gt;(type, source, args?): SpaceStyle<T&gt;

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&gt;

this

Inherited from

Style.notify


off

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

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

Returns

SpaceStyle<T&gt;

this

Inherited from

Style.off


on

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

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

Returns

SpaceStyle<T&gt;

this

Inherited from

Style.on


setBottom

▸ setBottom(bottom): SpaceStyle<T&gt;

Set bottom position

Parameters

Name Type Description
bottomTposition

Returns

SpaceStyle<T&gt;

this


setLeft

▸ setLeft(left): SpaceStyle<T&gt;

Set left position

Parameters

Name Type Description
leftTposition

Returns

SpaceStyle<T&gt;

this


setProperties

▸ setProperties(properties?): SpaceStyle<T&gt;

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<T&gt;object which contains the following fields

Returns

SpaceStyle<T&gt;

Overrides

Style.setProperties


setRight

▸ setRight(right): SpaceStyle<T&gt;

Set right position

Parameters

Name Type Description
rightTposition

Returns

SpaceStyle<T&gt;

this


setSilent

▸ setSilent(bool, force?): SpaceStyle<T&gt;

Set silent mode

Parameters

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

Returns

SpaceStyle<T&gt;

this

Inherited from

Style.setSilent


setStyle

▸ setStyle(spaceStyle, silent?): SpaceStyle<T&gt;

Set style

Parameters

Name Type Description
spaceStyleType<T&gt;space style
Optional silentbooleansilent mode

Returns

SpaceStyle<T&gt;


setTop

▸ setTop(top): SpaceStyle<T&gt;

Set top position

Parameters

Name Type Description
topTposition

Returns

SpaceStyle<T&gt;

this


updateTimeStamp

▸ updateTimeStamp(silent?): SpaceStyle<T&gt;

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&gt;

this

Inherited from

Style.updateTimeStamp


addSpace

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

Return area including space

Parameters

Name Type Description
styleSpaceStyle<string | number&gt;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&gt;style to exclude space
rectRectoriginal area
Optional transformationTransformationscreen transformation

Returns

Rect

area with excluding space


fromObject

▸ Static fromObject(object?): SpaceStyle<string | number&gt;

Create or get space style from object

Parameters

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

Returns

SpaceStyle<string | number&gt;

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&gt;

Merge spaceStyle object with existing instance

Parameters

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

Returns

SpaceStyle<string | number&gt;

spaceStyle