Skip to content
Last updated

API / geotoolkit / controls / editing / ShapeAdapter / ShapeAdapter

Class: ShapeAdapter<T&gt;

editing.ShapeAdapter.ShapeAdapter

Defines an abstract adapter to perform operation for shapes<br> This is the parent class for shape adapters responsible for implementing editing capabilities for a shape.

Type parameters

NameType
TNode

Hierarchy

Table of contents

Constructors
  • [new ShapeAdapter<T&gt;()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.editing.shapeadapter.shapeadapter.md#new shapeadapter<t>())
Methods

Contents

Constructors

new ShapeAdapter&lt;T&amp;gt;()

• Protected new ShapeAdapter<T&gt;()

Creates adapter

Type parameters

NameType
TNode

Overrides

EventDispatcher.constructor

Methods

dispose

▸ dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getActiveHandle

▸ getActiveHandle(): AbstractHandle

Gets active handle

Returns

AbstractHandle


getClassName

▸ getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getManipulatorLayer

▸ getManipulatorLayer(): CompositeNode<Node&gt;

Return manipulator layer

Returns

CompositeNode<Node&gt;


getPosition

▸ getPosition(): Point

Gets position

Returns

Point


getProperties

▸ getProperties(): any

Gets properties pertaining to this handle

Returns

any

properties properties


getShape

▸ getShape(): T

Shape

Returns

T


getTransformation

▸ getTransformation(): Transformation

Return transformation

Returns

Transformation


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

EventDispatcher.hasEventListener


initialize

▸ initialize(): boolean

Initialize

Returns

boolean


isActive

▸ isActive(): boolean

Returns active state of this handle

Returns

boolean


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isInitialized

▸ isInitialized(): boolean

Get state of the adapter

Returns

boolean


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

EventDispatcher.isSilent


move

▸ move(x, y): ShapeAdapter<T&gt;

Move adapter and send event Events.Moved

Parameters

Name Type Description
xnumberx position
ynumbery position

Returns

ShapeAdapter<T&gt;

this


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceShapeAdapter<T&gt;of the event
Optional argsEventMap[E]arguments of the event

Returns

ShapeAdapter<T&gt;

this

Overrides

EventDispatcher.notify


off

▸ off<E&gt;(type?, callback?): ShapeAdapter<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: ShapeAdapter<T&gt;, args: EventMap[E]) => voidfunction to be called

Returns

ShapeAdapter<T&gt;

this

Overrides

EventDispatcher.off


on

▸ on<E&gt;(type, callback): ShapeAdapter<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: ShapeAdapter<T&gt;, args: EventMap[E]) => voidto be called

Returns

ShapeAdapter<T&gt;

this

Overrides

EventDispatcher.on


onActiveStateChanged

▸ Protected Abstract onActiveStateChanged(active): void

Active state is changed

Parameters

Name Type Description
activebooleanactive state or not

Returns

void


onInitialize

▸ Protected Abstract onInitialize(): boolean

OnInitialize

Returns

boolean

success true if initialized successfully


onMove

▸ Protected Abstract onMove(x, y): ShapeAdapter<T&gt;

OnMove

Parameters

Name Type Description
xnumberx coordinate
ynumbery coordinate

Returns

ShapeAdapter<T&gt;


setActive

▸ setActive(active): ShapeAdapter<T&gt;

Activate

Parameters

Name Type Description
activebooleanactive state or not

Returns

ShapeAdapter<T&gt;


setActiveHandle

▸ setActiveHandle(handle): ShapeAdapter<T&gt;

Sets active handle

Parameters

Name Type Description
handleAbstractHandleactive handle

Returns

ShapeAdapter<T&gt;

this


setPosition

▸ setPosition(x?, y?): ShapeAdapter<T&gt;

Sets position

Parameters

Name Type Description
Optional xnumberx coordinate
Optional ynumbery coordinate

Returns

ShapeAdapter<T&gt;


setProperties

▸ setProperties(props?): ShapeAdapter<T&gt;

Sets properties pertaining to this object

Parameters

Name Type Description
Optional propsanyAn object containing the properties to set

Returns

ShapeAdapter<T&gt;

this


setRegistry

▸ setRegistry(registry): ShapeAdapter<T&gt;

Sets registry

Parameters

Name Type Description
registryShapeAdapterRegistryassociated with current shape adapter

Returns

ShapeAdapter<T&gt;

this


setShape

▸ setShape(shape): ShapeAdapter<T&gt;

Sets shape to be modified

Parameters

Name Type Description
shapeTshape to be modified

Returns

ShapeAdapter<T&gt;


setSilent

▸ setSilent(bool): ShapeAdapter<T&gt;

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ShapeAdapter<T&gt;

this

Inherited from

EventDispatcher.setSilent


update

▸ update(): void

Update

Returns

void


updateHandles

▸ Abstract updateHandles(): ShapeAdapter<T&gt;

Update handles

Returns

ShapeAdapter<T&gt;

this


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName