Last updated

API / geotoolkit / controls / editing / ShapeAdapter / ShapeAdapter

Class: ShapeAdapter<T>

editing.ShapeAdapter.ShapeAdapter

Defines an abstract adapter to perform operation for shapes
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
Methods

Contents

Constructors

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

Protected new ShapeAdapter<T>()

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>

Return manipulator layer

Returns

CompositeNode<Node>


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>

Move adapter and send event Events.Moved

Parameters

Name Type Description
xnumberx position
ynumbery position

Returns

ShapeAdapter<T>

this


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

ShapeAdapter<T>

this

Overrides

EventDispatcher.notify


off

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

Returns

ShapeAdapter<T>

this

Overrides

EventDispatcher.off


on

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

Returns

ShapeAdapter<T>

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>

OnMove

Parameters

Name Type Description
xnumberx coordinate
ynumbery coordinate

Returns

ShapeAdapter<T>


setActive

setActive(active): ShapeAdapter<T>

Activate

Parameters

Name Type Description
activebooleanactive state or not

Returns

ShapeAdapter<T>


setActiveHandle

setActiveHandle(handle): ShapeAdapter<T>

Sets active handle

Parameters

Name Type Description
handleAbstractHandleactive handle

Returns

ShapeAdapter<T>

this


setPosition

setPosition(x?, y?): ShapeAdapter<T>

Sets position

Parameters

Name Type Description
Optional xnumberx coordinate
Optional ynumbery coordinate

Returns

ShapeAdapter<T>


setProperties

setProperties(props?): ShapeAdapter<T>

Sets properties pertaining to this object

Parameters

Name Type Description
Optional propsanyAn object containing the properties to set

Returns

ShapeAdapter<T>

this


setRegistry

setRegistry(registry): ShapeAdapter<T>

Sets registry

Parameters

Name Type Description
registryShapeAdapterRegistryassociated with current shape adapter

Returns

ShapeAdapter<T>

this


setShape

setShape(shape): ShapeAdapter<T>

Sets shape to be modified

Parameters

Name Type Description
shapeTshape to be modified

Returns

ShapeAdapter<T>


setSilent

setSilent(bool): ShapeAdapter<T>

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ShapeAdapter<T>

this

Inherited from

EventDispatcher.setSilent


update

update(): void

Update

Returns

void


updateHandles

Abstract updateHandles(): ShapeAdapter<T>

Update handles

Returns

ShapeAdapter<T>

this


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName