Skip to content
Last updated

API / geotoolkit / controls / editing / ShapeAdapterRegistry / ShapeAdapterRegistry

Class: ShapeAdapterRegistry

editing.ShapeAdapterRegistry.ShapeAdapterRegistry

Defines a registry of shape adapters to edit shapes

Hierarchy

Table of contents

Constructors
  • [new ShapeAdapterRegistry(plot, manipulatorLayer)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.editing.shapeadapterregistry.shapeadapterregistry.md#new shapeadapterregistry(plot, manipulatorlayer))
Methods

Contents

Constructors

new ShapeAdapterRegistry(plot, manipulatorLayer)

• new ShapeAdapterRegistry(plot, manipulatorLayer)

Shape adapter registry

Parameters

Name Type Description
plotPlotplot which renders node
manipulatorLayerCompositeNode<Node&gt;layer to put temporary shapes in

Overrides

EventDispatcher.constructor

Methods

dispose

▸ dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getActiveAdapter

▸ getActiveAdapter(): ShapeAdapter<Node&gt;

Return adapter

Returns

ShapeAdapter<Node&gt;


getAdapter

▸ getAdapter(shape): ShapeAdapter<Node&gt;

Return adapter for the specified shape

Parameters

Name Type Description
shapeNodecurrent shape

Returns

ShapeAdapter<Node&gt;


getClassName

▸ getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getManipulatorLayer

▸ getManipulatorLayer(): CompositeNode<Node&gt;

Return manipulator layer

Returns

CompositeNode<Node&gt;


getRegisteredClasses

▸ getRegisteredClasses(): string[]

Gets a list of all shape classes, previously registered using register method

Returns

string[]

a collection of classes that have associated adapters


getTransformation

▸ getTransformation(): Transformation

Gets 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


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

EventDispatcher.isSilent


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

ShapeAdapterRegistry

this

Overrides

EventDispatcher.notify


off

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

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

Returns

ShapeAdapterRegistry

this

Overrides

EventDispatcher.off


on

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

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

Returns

ShapeAdapterRegistry

this

Overrides

EventDispatcher.on


register

▸ register(classType, shapeAdapter): ShapeAdapterRegistry

Register shape adapter

Parameters

Name Type Description
classTypestringclass name of shape
shapeAdapterShapeAdapter<Node&gt;instance of shape adapter

Returns

ShapeAdapterRegistry

this


setActiveAdapter

▸ setActiveAdapter(adapter?): ShapeAdapterRegistry

Sets active adapter and send events

Parameters

Name Type Description
Optional adapterShapeAdapter<Node&gt;instance of shape adapter

Returns

ShapeAdapterRegistry

this


setSilent

▸ setSilent(bool): ShapeAdapterRegistry

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ShapeAdapterRegistry

this

Inherited from

EventDispatcher.setSilent


setTransformation

▸ setTransformation(transformation): ShapeAdapterRegistry

Sets transformation

Parameters

Name Type Description
transformationTransformationtransformation

Returns

ShapeAdapterRegistry

this


update

▸ update(): void

Update plot

Returns

void


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName