Skip to content

API / geotoolkit3d / tool / AbstractGestureTool / AbstractGestureTool

Class: AbstractGestureTool

tool.AbstractGestureTool.AbstractGestureTool

A tool that convert classic device events to gesture-like calls.<br> This tool inherits the 'device support' feature from AbstractTool and transforms the native events to a basic gesture mechanism.<br> <br> An 'armingkey' can be defined to limit when this tool operates.<br> This tool will operate only if the defined key is pressed.<br> <br> It will call onDrag/onPinch/onSide/onTap/etc when the corresponding pattern is detected.<br> Inheriting classes have to implement those functions.<br> <br>

Hierarchy

Table of contents

Constructors
  • [new AbstractGestureTool(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit3d.tool.abstractgesturetool.abstractgesturetool.md#new abstractgesturetool(options))
Methods

Contents

Constructors

new AbstractGestureTool(options)

• Protected new AbstractGestureTool(options)

Parameters

Name Type
optionsOptions

Overrides

AbstractTool.constructor

Methods

dispose

▸ dispose(): void

Function to clean up the references from this tool.

Returns

void

Overrides

AbstractTool.dispose


getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractTool.getClassName


getName

▸ getName(): string

Returns the tool name.

Returns

string

The tool's name

Inherited from

AbstractTool.getName


getOptions

▸ getOptions(): Required<Options&gt;

Get abstract gesture tool options

Returns

Required<Options&gt;

options

Overrides

AbstractTool.getOptions


getPlot

▸ getPlot(): Plot

Get the plot of this Tool.

Returns

Plot

Inherited from

AbstractTool.getPlot


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

AbstractTool.hasEventListener


isArmed

▸ isArmed(): boolean

Return if this tool is 'armed'.<br> The tool actions are disabled when not armed.<br> A tool can either be armed at all time, or only when a specific key is pressed. To set/unset the arming key, please see this tool option 'armingkey', via .setOptions().

Returns

boolean


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AbstractTool.isDisposed


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

AbstractTool.isSilent


isTouchEvent

▸ isTouchEvent(eventArgs): boolean

return true if the event is a touch event and false otherwise.

Parameters

Name Type Description
eventArgsEvent | EventArgscontains info of the event

Returns

boolean

Inherited from

AbstractTool.isTouchEvent


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

AbstractGestureTool

this

Inherited from

AbstractTool.notify


off

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

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

Returns

AbstractGestureTool

this

Inherited from

AbstractTool.off


on

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

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

Returns

AbstractGestureTool

this

Inherited from

AbstractTool.on


onContext

▸ onContext(event): void

Called when a 'context' event has occurred

Parameters

Name Type Description
eventPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onContext


onCursorMove

▸ Abstract onCursorMove(event): void

Called when a 'onCursorMove' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onDoubleClick

▸ onDoubleClick(event): void

Called when a 'doubleclick' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onDoubleClick


onDoubleTap

▸ Abstract onDoubleTap(event): void

Called when a 'onDoubleTap' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onDrag

▸ Abstract onDrag(event): void

Called when a 'onDrag' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onDragEnd

▸ Abstract onDragEnd(event): void

Called when a 'onDragEnd' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onDragStart

▸ Abstract onDragStart(event): void

Called when a 'onDragStart' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onKey

▸ Abstract onKey(event): void

Called when a 'onKey' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void


onKeyDown

▸ onKeyDown(event): void

Called when a 'keydown' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onKeyDown


onKeyEnd

▸ Abstract onKeyEnd(event): void

Called when a 'onKeyEnd' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void


onKeyStart

▸ Abstract onKeyStart(event): void

Called when a 'onKeyStart' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void


onKeyUp

▸ onKeyUp(event): void

Called when a 'keyup' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onKeyUp


onMouseDown

▸ onMouseDown(event): void

Called when a 'mousedown' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onMouseDown


onMouseMove

▸ onMouseMove(event): void

Called when a 'mousemove' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onMouseMove


onMouseOut

▸ onMouseOut(event): void

Called when a 'mouseout' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onMouseOut


onMouseUp

▸ onMouseUp(event): void

Called when a 'mouseup' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onMouseUp


onMouseWheel

▸ Abstract onMouseWheel(event): void

Called when a 'mousewheel' event has occurred

Parameters

Name Type Description
eventWheelEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractTool.onMouseWheel


onPinch

▸ Abstract onPinch(event): void

Called when a 'onPinch' event has occurred

Parameters

Name Type Description
eventMovePointerEventthe native event with plot coordinates added

Returns

void


onPinchEnd

▸ Abstract onPinchEnd(event): void

Called when a 'onPinchEnd' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onPinchStart

▸ Abstract onPinchStart(event): void

Called when a 'onPinchStart' event has occurred

Parameters

Name Type Description
eventMovePointerEventthe native event with plot coordinates added

Returns

void


onSlide

▸ Abstract onSlide(event): void

Called when a 'onSlide' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onSlideEnd

▸ Abstract onSlideEnd(event): void

Called when a 'onSlideEnd' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onSlideStart

▸ Abstract onSlideStart(event): void

Called when a 'onSlideStart' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onTap

▸ Abstract onTap(event): void

Called when a 'onTap' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onTouchEnd

▸ onTouchEnd(event): void

Called when a 'touchend' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onTouchEnd


onTouchMove

▸ onTouchMove(event): void

Called when a 'touchmove' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onTouchMove


onTouchStart

▸ onTouchStart(event): void

Called when a 'touchstart' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onTouchStart


onVisibilityChanged

▸ onVisibilityChanged(event): void

Called when a 'onVisibilityChanged' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Overrides

AbstractTool.onVisibilityChanged


onVisibilityGained

▸ Abstract onVisibilityGained(event): void

Called when a 'onVisibilityGained' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


onVisibilityLost

▸ Abstract onVisibilityLost(event): void

Called when a 'onVisibilityLost' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void


setOptions

▸ setOptions(options): AbstractGestureTool

Set options, the given json will be merged with the object's state so that only the given options will be changed.<br>

Parameters

Name Type Description
optionsOptionsThe options

Returns

AbstractGestureTool

this

Overrides

AbstractTool.setOptions


setSilent

▸ setSilent(bool): AbstractGestureTool

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

AbstractGestureTool

this

Inherited from

AbstractTool.setSilent


setup

▸ setup(deviceSupport): AbstractGestureTool

This function allows tools to bind their events to the device support

Parameters

Name Type Description
deviceSupportAbstractDeviceSupportthe type of device we are attaching to

Returns

AbstractGestureTool

Inherited from

AbstractTool.setup


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractTool.getClassName