Skip to content
Last updated

API / geotoolkit / controls / editing / SymbolAdapter / SymbolAdapter

Class: SymbolAdapter

editing.SymbolAdapter.SymbolAdapter

Defines a shape adapter which has functionality to manipulate Symbols. This adapter associates itself to an instance of Symbol shape, creates a handle rendered on top of the shape and allows dragging the shape around the scene.

Hierarchy

Table of contents

Constructors
  • [new SymbolAdapter()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.editing.symboladapter.symboladapter.md#new symboladapter())
Methods

Contents

Constructors

new SymbolAdapter()

• new SymbolAdapter()

Overrides

ShapeAdapter<SymbolShape>.constructor

Methods

dispose

▸ dispose(): void

Dispose.

Returns

void

Inherited from

ShapeAdapter.dispose


engage

▸ engage(x, y, eventArgs?): void

Called when a handle owned by this adapter has been selected and activated. The editing began.

Parameters

Name Type Description
xnumberX coordinate of the point where the mouse was clicked to engage the handle
ynumberY coordinate of the point where the mouse was clicked to engage the handle
Optional eventArgsEventArgsarguments from the event that started the change

Returns

void


getActiveHandle

▸ getActiveHandle(): AnchoredHandle

Gets active handle

Returns

AnchoredHandle

Overrides

ShapeAdapter.getActiveHandle


getAllowShapeEdit

▸ getAllowShapeEdit(): boolean

Returns the flag defining if this adapter directly edits the shape which it is associated with.

Returns

boolean

True if shape is being edited


getClassName

▸ getClassName(): string

Returns

string

Inherited from

ShapeAdapter.getClassName


getManipulatorLayer

▸ getManipulatorLayer(): CompositeNode<Node&gt;

Return manipulator layer

Returns

CompositeNode<Node&gt;

Inherited from

ShapeAdapter.getManipulatorLayer


getPosition

▸ getPosition(): Point

Gets position

Returns

Point

Inherited from

ShapeAdapter.getPosition


getProperties

▸ getProperties(): any

Gets properties pertaining to this handle

Returns

any

properties properties

Inherited from

ShapeAdapter.getProperties


getShape

▸ getShape(): SymbolShape

Shape

Returns

SymbolShape

Inherited from

ShapeAdapter.getShape


getShowGhost

▸ getShowGhost(): boolean

Returns the flag defining if a ghost is moved instead of an actual handle when the shape is being manipulated.

Returns

boolean


getTransformation

▸ getTransformation(): Transformation

Return transformation

Returns

Transformation

Inherited from

ShapeAdapter.getTransformation


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

ShapeAdapter.hasEventListener


initialize

▸ initialize(): boolean

Initialize

Returns

boolean

Inherited from

ShapeAdapter.initialize


isActive

▸ isActive(): boolean

Returns active state of this handle

Returns

boolean

Inherited from

ShapeAdapter.isActive


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

ShapeAdapter.isDisposed


isInitialized

▸ isInitialized(): boolean

Get state of the adapter

Returns

boolean

Inherited from

ShapeAdapter.isInitialized


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

ShapeAdapter.isSilent


move

▸ move(x, y): SymbolAdapter

Move adapter and send event Events.Moved

Parameters

Name Type Description
xnumberx position
ynumbery position

Returns

SymbolAdapter

this

Inherited from

ShapeAdapter.move


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

SymbolAdapter

this

Overrides

ShapeAdapter.notify


off

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

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

Returns

SymbolAdapter

this

Overrides

ShapeAdapter.off


on

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

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

Returns

SymbolAdapter

this

Overrides

ShapeAdapter.on


onActiveStateChanged

▸ onActiveStateChanged(active): void

Called when adapter goes from active to non-active and vice versa

Parameters

Name Type Description
activebooleanNew state of the adapter

Returns

void

Overrides

ShapeAdapter.onActiveStateChanged


onInitialize

▸ onInitialize(): boolean

Called during initialization process. Create handles

Returns

boolean

Overrides

ShapeAdapter.onInitialize


onMove

▸ onMove(x, y, eventArgs?): SymbolAdapter

Moves the handle and the shape, if shape editing is enabled

Parameters

Name Type Description
xnumberThe device x position to move to
ynumberThe device y position to move to
Optional eventArgsEventArgsEvent arguments from the calling tool

Returns

SymbolAdapter

Overrides

ShapeAdapter.onMove


release

▸ release(x, y, eventArgs?): SymbolAdapter

Called when a handle owned by this adapter has been released and editing stops.

Parameters

Name Type Description
xnumberX coordinate of pointer when mouseup occurred
ynumberY coordinate of pointer when mouseup occurred
Optional eventArgsEventArgsEvent arguments from the calling tool

Returns

SymbolAdapter


setActive

▸ setActive(active): SymbolAdapter

Activate

Parameters

Name Type Description
activebooleanactive state or not

Returns

SymbolAdapter

Inherited from

ShapeAdapter.setActive


setActiveHandle

▸ setActiveHandle(handle): SymbolAdapter

Sets active handle

Parameters

Name Type Description
handleAbstractHandleactive handle

Returns

SymbolAdapter

this

Inherited from

ShapeAdapter.setActiveHandle


setAllowShapeEdit

▸ setAllowShapeEdit(allow): SymbolAdapter

Sets the flag defining if this adapter has to directly edit the shape which it is associated with. Otherwise, it will only send an event.

Parameters

Name Type Description
allowbooleanTrue to edit the shape directly

Returns

SymbolAdapter


setHandleStyles

▸ setHandleStyles(styles): SymbolAdapter

Sets styles for active, inactive, and ghost states of all handles, and redraws the handle

Parameters

Name Type Description
stylesHandleStylesobject containing styling for different types of handle states

Returns

SymbolAdapter


setHandlesVisible

▸ setHandlesVisible(visible): SymbolAdapter

Sets the visibility of the handles registered with this adapter

Parameters

Name Type Description
visiblebooleanVisibility to set on handles

Returns

SymbolAdapter


setPosition

▸ setPosition(x?, y?): SymbolAdapter

Sets position

Parameters

Name Type Description
Optional xnumberx coordinate
Optional ynumbery coordinate

Returns

SymbolAdapter

Inherited from

ShapeAdapter.setPosition


setProperties

▸ setProperties(props?): SymbolAdapter

Sets properties pertaining to this object

Parameters

Name Type Description
Optional propsanyAn object containing the properties to set

Returns

SymbolAdapter

this

Inherited from

ShapeAdapter.setProperties


setRegistry

▸ setRegistry(registry): SymbolAdapter

Sets registry

Parameters

Name Type Description
registryShapeAdapterRegistryassociated with current shape adapter

Returns

SymbolAdapter

this

Inherited from

ShapeAdapter.setRegistry


setShape

▸ setShape(shape): SymbolAdapter

Sets shape to be modified

Parameters

Name Type Description
shapeSymbolShapeshape to be modified

Returns

SymbolAdapter

Overrides

ShapeAdapter.setShape


setShowGhost

▸ setShowGhost(show): SymbolAdapter

Sets the flag defining if a ghost should be moved instead of an actual handle when the shape is being manipulated.

Parameters

Name Type Description
showbooleanTrue to display a ghost handle

Returns

SymbolAdapter


setSilent

▸ setSilent(bool): SymbolAdapter

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

SymbolAdapter

this

Inherited from

ShapeAdapter.setSilent


update

▸ update(): SymbolAdapter

Updates the state of the adapter, recalculates position and size of handles, and redraws.

Returns

SymbolAdapter

Overrides

ShapeAdapter.update


updateHandles

▸ updateHandles(): SymbolAdapter

Update handles

Returns

SymbolAdapter

this

Overrides

ShapeAdapter.updateHandles


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

ShapeAdapter.getClassName