Last updated

API / geotoolkit / controls / tools / editors / AbstractCombinedEditor / AbstractCombinedEditor

Class: AbstractCombinedEditor<T>

editors.AbstractCombinedEditor.AbstractCombinedEditor

The base abstract class for editors that can be used to create and modify both RectangularShape and AnchoredShape shapes

Type parameters

NameType
Textends RectangularShape | AnchoredShape

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
bboxPathBounding box path to draw bounding rectangle OR bounding box path properties (see
bbox-boundsRectBounds
bbox-bounds-heightnumberHeight
bbox-bounds-readonlybooleanReadonly
bbox-bounds-widthnumberWidth
bbox-bounds-xnumberLeft
bbox-bounds-ynumberTop
bbox-clipstyleClipStyleClipping style
bbox-clipstyle-evenoddbooleanTrue if evenodd mode is on (&#x27;nonzero&#x27; mode otherwise)
bbox-clipstyle-geometryGraphicsPathClipping geometry
bbox-clipstyle-geometry-boundsRectBounds
bbox-clipstyleGraphicsPathClipping style
bbox-cssclassstringThe css class name of this node
bbox-csscursorstringCSS cursor associated with node
bbox-cssstylestringCSS style to be applied to inserted elements
bbox-fillstylestringStyle applied on fill
bbox-fillstyleFillStyleStyle applied on fill
bbox-fillstyle-colorstringColor in CSS form
bbox-fillstyle-evenoddmodebooleanEven-odd fill mode
bbox-fillstyle-fillpatternPatternPattern
bbox-fillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
bbox-fillstyle-fillpattern-patternnamestringName of this pattern for indexing
bbox-fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
bbox-fillstyle-foregroundstringForeground color
bbox-fillstyle-patternPatternPattern
bbox-geometryGraphicsPathGeometry the path
bbox-idstring | numberId of the node, its a unique identifier
bbox-linestylestringStyle applied on outline
bbox-linestyleLineStyleStyle applied on outline
bbox-linestyle-colorstringColor in CSS form
bbox-linestyle-fillstringOptional fill style to be used to fill lines generated with this style
bbox-linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
bbox-linestyle-linecapCapStyleThe line cap style
bbox-linestyle-linedashoffsetnumberLine dash offset of dashed line
bbox-linestyle-linejoinJoinStyleThe line join style
bbox-linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
bbox-linestyle-scalablebooleanTrue if width should depend on transformation
bbox-linestyle-unitstringOptional unit for the width
bbox-linestyle-widthnumber | stringThe line thickness
bbox-localtransformTransformationLocal transformation
bbox-localtransform-dxnumberX axis translation
bbox-localtransform-dynumberY axis translation
bbox-localtransform-xxnumberX scale
bbox-localtransform-xynumberXy skew
bbox-localtransform-yxnumberYx skew
bbox-localtransform-yynumberY scale
bbox-marginsnumber | stringIt has properties for specifying the margins for each side
bbox-namestringName of the node. It is often used for debugging purposes or to simplify queries
bbox-opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
bbox-opacityblendmodeBlendModeNode opacity mode to blend it
bbox-scalescrollstrategyScaleScrollStrategyScale scroll strategy
bbox-scalescrollstrategy-enabledbooleanEnable flag
bbox-selectablebooleanSelectable node, a boolean to determine if selection should consider this node
bbox-taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
bbox-transformstringAdditional CSS transformation applied to node or &#x27;none&#x27;
bbox-transformTransformationAdditional CSS transformation applied to node or &#x27;none&#x27;
bbox-visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
bbox-z-indexnumberDefine node z-index
editmodeEditModeNode edit mode
enabledbooleanEnabled state
ghostOptionsOptions for
ghost-cssclassstringThe css class name of this node
ghost-idstring | numberId of the node, its a unique identifier
ghost-namestringName of the node. It is often used for debugging purposes or to simplify queries
ghost-selectablebooleanSelectable node, a boolean to determine if selection should consider this node
ghost-taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
ghost-visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
ghost-z-indexnumberDefine node z-index
ghostGhostOptionsOptions for
ghost-fillstylestringGhost fill style
ghost-fillstyleFillStyleGhost fill style
ghost-linestylestringGhost line style
ghost-linestyleLineStyleGhost line style
ghost-opacitynumberGhost opacity from 0 to 1
handlesHandlesOptionsHandles properties
handles-bboxOptionsBbox resize handles properties (see
handles-bboxOptionsBbox resize handles properties (see
handles-bbox-clipstyleClipStyleClipping style
handles-bbox-clipstyleGraphicsPathClipping style
handles-bbox-csscursorstringCSS cursor associated with node
handles-bbox-cssstylestringCSS style to be applied to inserted elements
handles-bbox-localtransformTransformationLocal transformation
handles-bbox-marginsnumber | stringIt has properties for specifying the margins for each side
handles-bbox-opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
handles-bbox-opacityblendmodeBlendModeNode opacity mode to blend it
handles-bbox-scalescrollstrategyScaleScrollStrategyScale scroll strategy
handles-bbox-transformstringAdditional CSS transformation applied to node or &#x27;none&#x27;
handles-bbox-transformTransformationAdditional CSS transformation applied to node or &#x27;none&#x27;
handles-bboxOptionsBbox resize handles properties (see
handles-bbox-fillstylestringStyle applied on fill
handles-bbox-fillstyleFillStyleStyle applied on fill
handles-bbox-linestylestringStyle applied on outline
handles-bbox-linestyleLineStyleStyle applied on outline
handles-bboxOptionsBbox resize handles properties (see
handles-bbox-alignmentAnchorTypeAlignment according to the anchor point
handles-bbox-axnumberAnchor x position
handles-bbox-aynumberAnchor y position
handles-bbox-heightnumberShape height
handles-bbox-ispointingupbooleanDefines whether the shape is always pointing up
handles-bbox-layoutstyleLayoutStyleLayout style to specify how to lay out shape
handles-bbox-layoutstyle-constraintSizeConstraintLayout constrains
handles-bbox-layoutstyle-flexgrownumberNumber specifying how much the item will grow relative to the rest of the items inside the same container
handles-bbox-layoutstyle-flexshrinknumberNumber specifying how much the item will shrink relative to the rest of the items inside the same container
handles-bbox-layoutstyle-floatstringFloat position
handles-bbox-layoutstyle-positionstringLayout position
handles-bbox-layoutstyle-sizenumber | stringLayout size
handles-bbox-maxdimensionDimensionMaximum size for rendering
handles-bbox-maxdimension-heightnumberHeight of dimension
handles-bbox-maxdimension-widthnumberWidth of dimension or properties
handles-bbox-mindimensionDimensionMinimum size for rendering
handles-bbox-preserveaspectratiobooleanPreserve aspect ratio of the anchored shape
handles-bbox-preservereadingorientationbooleanPreserve reading orientation for local transform
handles-bbox-preserverightanglebooleanPreserve right angle for local transformation
handles-bbox-rotationanglenumberRotation angle at anchor
handles-bbox-sizeisindevicespacebooleanIs coordinate in device space
handles-bbox-useminmaxdimensionsbooleanUse the min max dimensions to limit visual size
handles-bbox-widthnumberShape width
handles-bboxOptionsBbox resize handles properties (see
handles-bbox-alignmentAnchorTypeAnchor type of symbol
handles-bbox-cachebooleanSet it to true if you want to cache complex geometry to raster
handles-bbox-painterstringA function with has parameters: symbol, box, context
handles-bbox-painterpropertiesanySymbol&#x27;s painter&#x27;s properties
handles-rotationOptionsRotation handle properties (see
handles-rotationOptionsRotation handle properties (see
handles-rotationOptionsRotation handle properties (see
handles-rotationOptionsRotation handle properties (see
handles-rotationOptionsRotation handle properties (see
layerCompositeNodeManipulator layer
layer-clippingbooleanEnable clipping, this does not consider the clipstyle, it is related to bounds-clipping
layer-clipstyleClipStyleClipping style
layer-clipstyleGraphicsPathClipping style
layer-cssclassstringThe css class name of this node
layer-csscursorstringCSS cursor associated with node
layer-cssstylestringCSS style to be applied to inserted elements
layer-idstring | numberId of the node, its a unique identifier
layer-infinitybooleanMode to render outside the model limits
layer-localtransformTransformationLocal transformation
layer-marginsnumber | stringIt has properties for specifying the margins for each side
layer-namestringName of the node. It is often used for debugging purposes or to simplify queries
layer-opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
layer-opacityblendmodeBlendModeNode opacity mode to blend it
layer-scalescrollstrategyScaleScrollStrategyScale scroll strategy
layer-selectablebooleanSelectable node, a boolean to determine if selection should consider this node
layer-taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
layer-transformstringAdditional CSS transformation applied to node or &#x27;none&#x27;
layer-transformTransformationAdditional CSS transformation applied to node or &#x27;none&#x27;
layer-visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
layer-z-indexnumberDefine node z-index
mouseradiusnumberDevice radius for mouse events
namestringName of the tool used like cross-hair etc
touchradiusnumberDevice radius for touch events

Contents

Constructors

new AbstractCombinedEditor&lt;T&amp;gt;(options)

Protected new AbstractCombinedEditor<T>(options?)

Type parameters

NameType
Textends AnchoredShape | RectangularShape

Parameters

Name Type Description
Optional optionsOptions<T>editor options

Overrides

AbstractEditor&lt;T&amp;gt;.constructor

Methods

addListener

addListener(eventName, listener): AbstractCombinedEditor<T>

add event listener. The listener receives the message when the system event happens.

Deprecated

since 4.0 use .on() instead. Note that 3 args callback should be used in subscription via .on(): (eventType, source, args)

Parameters

Name Type Description
eventNamestringevent name or unique event identifier
listenerFunctionthe event listener

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.addListener


apply

apply(command): AbstractCombinedEditor<T>

Applies command to the current node

Parameters

Name Type Description
commandAbstractCommandcommand to apply

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.apply


canInsert

Protected canInsert(eventArgs): boolean

Determines if the editor can insert a new node at the point

Parameters

Name Type Description
eventArgsEventArgsthe event arguments

Returns

boolean

Inherited from

AbstractEditor.canInsert


canRedo

canRedo(): boolean

Checks if there is command in history to redo

Returns

boolean

Inherited from

AbstractEditor.canRedo


canUndo

canUndo(): boolean

Checks if there is command in history to undo

Returns

boolean

Inherited from

AbstractEditor.canUndo


captureMouseUp

captureMouseUp(): void

listen to window mouse events in order to catch a mouse up action outside of the tool container DOM element. useful for example when you pan and release click outside of DOM element.

Returns

void

Inherited from

AbstractEditor.captureMouseUp


changeNodeOrder

changeNodeOrder(order, anchor?): AbstractCombinedEditor<T>

changes the z-order of the nodes being rendered.

Parameters

Name Type Description
orderNodeOrderposition to be added
Optional anchorNodeanchor node to specify changeNodeOrder with respect to this node

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.changeNodeOrder


createGhost

Protected createGhost(): Node

Creates a clone of the current node

Returns

Node

Inherited from

AbstractEditor.createGhost


deleteNode

deleteNode(trash?, shape?): AbstractCombinedEditor<T>

Delete node or array of nodes to specified trash container

Parameters

Name Type
Optional trashCompositeNode<Node>
Optional shapeNode | Node[]

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.deleteNode


dispose

dispose(): void

Dispose tool.

Returns

void

Inherited from

AbstractEditor.dispose


end

Protected end(eventArgs?): void

Ends current node creation, fires the corresponding event and clones new empty node for the new creation

Parameters

Name Type Description
Optional eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.end


fireEvent

fireEvent(eventName, eventArgs?): void

This method is Protected. Fire an Event.

Deprecated

since 4.0 use .notify() instead. Note that 3 args callback should be used in subscription via .on()

Parameters

Name Type Description
eventNamestringevent name
Optional eventArgsanycontains info of the event

Returns

void

Inherited from

AbstractEditor.fireEvent


flipNodeOrientation

flipNodeOrientation(flipX, flipY): AbstractCombinedEditor<T>

Flip node vertically and/or horizontally

Parameters

Name Type Description
flipXbooleantrue if node should be flipped horizontally, false otherwise
flipYbooleantrue if node should be flipped vertically, false otherwise

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.flipNodeOrientation


getActiveNode

getActiveNode(): Node

Returns the ghost if ghost mode is enabled and initialized and the original node otherwise

Returns

Node

Inherited from

AbstractEditor.getActiveNode


getActivePlot

Protected getActivePlot(): Plot

Gets an active plot

Returns

Plot

Inherited from

AbstractEditor.getActivePlot


getAspectRatio

getAspectRatio(): number

Returns

number


getBboxHandle

Protected getBboxHandle(eventArgs?): EditHandleId

Returns current bounding box handle if no arguments provided, or bounding box element index that is currently under mouse event, null if nothing is

Parameters

Name Type Description
Optional eventArgsEventArgsevent args

Returns

EditHandleId

Inherited from

AbstractEditor.getBboxHandle


getBounds

getBounds(): Rect

Returns bounds for the bounding box elements

Returns

Rect

Inherited from

AbstractEditor.getBounds


getClassName

getClassName(): string

Returns

string

Inherited from

AbstractEditor.getClassName


getDataLayer

Protected getDataLayer(): Node

Gets the edited nodes' parent layer

Returns

Node

Inherited from

AbstractEditor.getDataLayer


getDeviceTransform

getDeviceTransform(): Transformation

Returns current node-to-device transformation

Returns

Transformation

Inherited from

AbstractEditor.getDeviceTransform


getEditMode

getEditMode(): EditMode

Returns current edit mode

Returns

EditMode

Inherited from

AbstractEditor.getEditMode


getEventRadius

Protected getEventRadius(eventArgs): number

Returns device radius for the provided event

Parameters

Name Type Description
eventArgsEventArgscontains info of the event

Returns

number

Inherited from

AbstractEditor.getEventRadius


getGhost

Protected getGhost(): Node

Returns the ghost registered with this editor. If ghost does not exist, returns null

Returns

Node

Inherited from

AbstractEditor.getGhost


getHandlesGroup

getHandlesGroup(): Group<Node>

Returns handles group

Returns

Group<Node>

Inherited from

AbstractEditor.getHandlesGroup


getHistory

getHistory(): History

Returns current history

Returns

History

Inherited from

AbstractEditor.getHistory


getLocalTransform

Protected getLocalTransform(): Transformation

Returns current node local transformation

Returns

Transformation

Inherited from

AbstractEditor.getLocalTransform


getManipulatorLayer

getManipulatorLayer(): CompositeNode<Node>

return manipulator layer

Returns

CompositeNode<Node>

layer

Inherited from

AbstractEditor.getManipulatorLayer


getMouseRadius

getMouseRadius(): number

Returns current device radius for mouse events

Returns

number

Inherited from

AbstractEditor.getMouseRadius


getName

getName(): string

return tool name if any

Returns

string

name of the tool

Inherited from

AbstractEditor.getName


getNode

getNode(): T

Returns current node

Returns

T

Inherited from

AbstractEditor.getNode


getParentTool

getParentTool(): AbstractCompositeTool

Gets parent tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractEditor.getParentTool


getProperties

getProperties(): OptionsOut

Returns properties

Returns

OptionsOut

editor properties

Inherited from

AbstractEditor.getProperties


getProperty

getProperty(name): any

Gets dynamic property by name. These properties can be used as a property bags

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

AbstractEditor.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

AbstractEditor.getPropertyKeys


getRoot

getRoot(): AbstractCompositeTool

Gets root tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractEditor.getRoot


getTouchRadius

getTouchRadius(): number

Returns current device radius for touch events

Returns

number

Inherited from

AbstractEditor.getTouchRadius


getVisible

Protected getVisible(): boolean

Gets the edited node visibility state

Returns

boolean

Inherited from

AbstractEditor.getVisible


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

AbstractEditor.hasEventListener


initialize

Protected initialize(options): void

Parameters

Name Type Description
optionsOptions<T>options

Returns

void

Overrides

AbstractEditor.initialize


isActive

isActive(): boolean

return active state

Returns

boolean

Inherited from

AbstractEditor.isActive


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AbstractEditor.isDisposed


isDoubleClick

Protected isDoubleClick(point, eventArgs?): boolean

returns true if double clicked

Parameters

Name Type Description
pointPointClick point
Optional eventArgsEventArgsoptional event args to verify double click

Returns

boolean

Inherited from

AbstractEditor.isDoubleClick


isEnabled

isEnabled(): boolean

returns enable state

Returns

boolean

state

Inherited from

AbstractEditor.isEnabled


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

AbstractEditor.isSilent


isStarted

isStarted(): boolean

Tests if editing was started (editor is active and at least one command was applied)

Returns

boolean

Inherited from

AbstractEditor.isStarted


isSupported

Protected isSupported(options): boolean

Checks if editor supports the options provided

Parameters

Name Type Description
optionsRecord<string, any>editor options

Returns

boolean

Inherited from

AbstractEditor.isSupported


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

AbstractEditor.isTouchEvent


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.notify


off

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

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.off


on

on<E>(type, callback): AbstractCombinedEditor<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.

TypeScript hint: in case of creating derived tool with own events, EventMap should be extended and .on() and .notify() methods redeclared, see sample.

Example

// Using in derived tool
import type {EventMap as EventMapBase} from '@int/geotoolkit/controls/tools/AbstractTool';
export type EventMap = EventMapBase &amp; {
[MyToolEvents.onValueChanged]: MyToolEventArgs
}
export enum MyToolEvents {
onValueChanged = 'onValueChanged'
}
export class MyTool extends AbstractTool {
public declare on: <E extends keyof EventMap>(type: E, callback: (eventType: E, sender: this, args: EventMap[E]) => void) => this;
protected declare notify: <E extends keyof EventMap>(type: E, source: AbstractTool, args?: EventMap[E]) => this;
public declare off: <E extends keyof EventMap>(type: E, callback?: (eventType: E, sender: this, args: EventMap[E]) => void) => this;
// ...
}

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: AbstractCombinedEditor<T>, args: EventMap[E]) => voidto be called

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.on


onActiveStateChanged

Protected onActiveStateChanged(): void

Fires

Events.onStateChanged

Returns

void

Inherited from

AbstractEditor.onActiveStateChanged


onBeforeCommandApplied

Protected onBeforeCommandApplied(command): void

Fires the EditEvents.BeforeCommandApplied event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractEditor.onBeforeCommandApplied


onCommandApplied

Protected onCommandApplied(command): void

Fires the EditEvents.CommandApplied and the command.getEventName() events

Parameters

Name Type Description
commandAbstractCommandcommand applied

Returns

void

Inherited from

AbstractEditor.onCommandApplied


onCommandApplying

Protected onCommandApplying(command): void

Fires the EditEvents.CommandApplying event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractEditor.onCommandApplying


onCommandRedo

Protected onCommandRedo(command): void

Fires the EditEvents.Redo event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractEditor.onCommandRedo


onCommandUndo

Protected onCommandUndo(command): void

Fires the EditEvents.Undo event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractEditor.onCommandUndo


onDoubleClick

Protected onDoubleClick(eventArgs): void

Handles mouse double click event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.onDoubleClick


onEnabledStateChanged

Protected onEnabledStateChanged(): void

Fires

Events.onEnabledStateChanged

Returns

void

Inherited from

AbstractEditor.onEnabledStateChanged


onKeyDown

Protected onKeyDown(eventArgs): void

Handles key down event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.onKeyDown


onKeyUp

Protected onKeyUp(eventArgs): void

Handles key up event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.onKeyUp


onLeave

Protected onLeave(eventArgs): void

Handles mouse leave event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.onLeave


onMouseDown

Protected onMouseDown(eventArgs): void

Handles mouse down event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.onMouseDown


onMouseMove

Protected onMouseMove(eventArgs): void

Handles mouse move event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.onMouseMove


onMouseUp

Protected onMouseUp(eventArgs): void

Handles mouse up event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractEditor.onMouseUp


onNodeCreated

Protected onNodeCreated(node, eventArgs?): void

Fires the EditEvents.End event

Parameters

Name Type Description
nodeNodethe created node
Optional eventArgsEventArgsthe event arguments

Returns

void

Inherited from

AbstractEditor.onNodeCreated


pageToCanvas

pageToCanvas(eventArgs, externalPlot?): Object

return position relative to the canvas

Parameters

Name Type Description
eventArgsEvent | EventArgsparentElement the parent HTML element
Optional externalPlotPlotplot

Returns

Object

NameType
xnumber
ynumber

Inherited from

AbstractEditor.pageToCanvas


pointToModel

pointToModel(model, eventArgs): Point

converts device coordinates to inner coordinates of node

Parameters

Name Type Description
modelNodethe model
eventArgsPoint | EventArgsarguments of the event OR point in device (plot) coordinates.

Returns

Point

Inherited from

AbstractEditor.pointToModel


push

Protected push(command): AbstractCombinedEditor<T>

Pushes command to the history after applying it and firing the corresponding event

Parameters

Name Type Description
commandAbstractCommandcommand to add to the history

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.push


redo

redo(): AbstractCombinedEditor<T>

Reapplies last canceled command in history (if possible)

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.redo


removeListener

removeListener(eventName, listener?): AbstractCombinedEditor<T>

remove event listener. The listener reveives the message when the system event happens.

Deprecated

since 4.0 use .off() instead.

Parameters

Name Type Description
eventNamestringevent name
Optional listenerFunction | Function[]the event listener, if null, remove all listeners for the event

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.removeListener


resetNode

Protected resetNode(unlink?): AbstractCombinedEditor<T>

Resets current node to the initial state before all the changes were made

Parameters

Name Type Description
Optional unlinkbooleantrue, for remove node from parent, else false

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.resetNode


resetNodeToGhost

Protected resetNodeToGhost(): AbstractCombinedEditor<T>

Resets the current node to its ghost state

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.resetNodeToGhost


rotateNode

Protected rotateNode(node, angle, hint?): boolean

Parameters

Name Type
nodeNode
anglenumber
Optional hintany

Returns

boolean

Inherited from

AbstractEditor.rotateNode


setActive

setActive(active): AbstractCombinedEditor<T>

set active state

Fires

Events.onStateChanged

Parameters

Name Type Description
activebooleanset active state

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.setActive


setEditMode

setEditMode(mode): AbstractCombinedEditor<T>

Sets edit mode to determine operations that can be applied to the current node. Use bitwise operations for the full customization.

Parameters

Name Type Description
modeEditModemode to edit

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setEditMode


setEnabled

setEnabled(enabled): AbstractCombinedEditor<T>

set enable state

Fires

Events.onEnabledStateChanged

Fires

Events.onStateChanged

Parameters

Name Type Description
enabledbooleansets the enabled state

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setEnabled


setMouseRadius

setMouseRadius(radius): AbstractCombinedEditor<T>

Sets device radius for mouse events

Parameters

Name Type Description
radiusnumberradius for mouse events

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setMouseRadius


setName

setName(name): AbstractCombinedEditor<T>

set tool name

Parameters

Name Type Description
namestringthe tool name

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.setName


setNode

Protected setNode(node): AbstractCombinedEditor<T>

Sets node to edit

Parameters

Name Type Description
nodeTnode to edit

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setNode


setNodeBounds

Protected setNodeBounds(node, p1, p2, hint?): boolean

Parameters

Name Type
nodeNode
p1Point
p2Point
Optional hintany

Returns

boolean

Inherited from

AbstractEditor.setNodeBounds


setProperties

setProperties(properties?): AbstractCombinedEditor<T>

Sets properties to the editing elements

Parameters

Name Type Description
Optional propertiesOptions<T>editor properties

Returns

AbstractCombinedEditor<T>

this

Overrides

AbstractEditor.setProperties


setProperty

setProperty(name, value): AbstractCombinedEditor<T>

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setProperty


setSilent

setSilent(bool): AbstractCombinedEditor<T>

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setSilent


setSlotEnabled

setSlotEnabled(eventName, value, target?): AbstractCombinedEditor<T>

Sets slot enabled

Parameters

Name Type Description
eventNamestringeventName
valuebooleanvalue
Optional targetEventTargettarget

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.setSlotEnabled


setSlots

setSlots(slots?, merge?): AbstractCombinedEditor<T>

Sets new slots.

Example

const slots = {
'pointerdown': (event: EventArgs) => {
// event is an instance of @int/geotoolkit/controls/tools/EventArgs
...
}
};
tool.setSlots(slots);

Parameters

Name Type Description
Optional slotsRecord<string, Slot | Slot[] | (eventArgs: EventArgs) => void>type of system events
Optional mergebooleanset to true if you want to merge with existing slots

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setSlots


setTouchRadius

setTouchRadius(radius): AbstractCombinedEditor<T>

Sets device radius for touch events

Parameters

Name Type Description
radiusnumberradius for touch events

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.setTouchRadius


start

Protected start(eventArgs?): AbstractCombinedEditor<T>

start

Parameters

Name Type Description
Optional eventArgsEventArgsevent args

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.start


stop

Protected stop(): AbstractCombinedEditor<T>

stop

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.stop


swapActiveHandles

Protected swapActiveHandles(handleId, vertical): EditHandleId

Swaps active handles vertically/horizontally

Parameters

Name Type Description
handleIdEditHandleIdcurrent active handle id
verticalbooleantrue if handles should be swapped vertically and false otherwise

Returns

EditHandleId

swapped handle id

Inherited from

AbstractEditor.swapActiveHandles


toggle

toggle(): AbstractCombinedEditor<T>

switch enable state to opposite state

Returns

AbstractCombinedEditor<T>

Inherited from

AbstractEditor.toggle


transformNode

Protected transformNode(node, tr, hint?): boolean

Parameters

Name Type
nodeNode
trTransformation
Optional hintany

Returns

boolean

Inherited from

AbstractEditor.transformNode


translateNode

Protected translateNode(node, x, y, hint?): boolean

Parameters

Name Type
nodeNode
xnumber
ynumber
Optional hintany

Returns

boolean

Inherited from

AbstractEditor.translateNode


undo

undo(): AbstractCombinedEditor<T>

Cancels last command in history (if possible)

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.undo


update

update(): AbstractCombinedEditor<T>

Forces editing shapes and handles to be updated

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.update


updateBrowserCursor

Protected updateBrowserCursor(eventArgs, cursor?): void

Parameters

Name Type Description
eventArgsEventArgsevent args
Optional cursorstringbrowser cursor to set

Returns

void

Inherited from

AbstractEditor.updateBrowserCursor


updateHandles

updateHandles(): AbstractCombinedEditor<T>

Forces editing handles to be updated

Returns

AbstractCombinedEditor<T>

this

Inherited from

AbstractEditor.updateHandles


updateNodePosition

Protected updateNodePosition(): void

Updates active node's position if scene transformation was changed but pointer position wasn't

Returns

void

Inherited from

AbstractEditor.updateNodePosition


canvasToClient

Static canvasToClient(plotPoint, plot): Point

Convert plot coordinates to global coordinates

Parameters

Name Type Description
plotPointPointpoint in plot coordinates
plotPlotplot with canvas

Returns

Point

Inherited from

AbstractEditor.canvasToClient


clientToCanvas

Static clientToCanvas(nativeEvent, plot): Point

Convert global coordinates to plot coordinates

Parameters

Name Type Description
nativeEventEventnative browser event
plotPlotplot with canvas

Returns

Point

Inherited from

AbstractEditor.clientToCanvas


getClassName

Static getClassName(): string

Returns

string

Inherited from

AbstractEditor.getClassName


getExclusiveTool

Static getExclusiveTool(plot): AbstractTool

return exclusive tool associated with plot

Parameters

Name Type Description
plotPlotplot

Returns

AbstractTool

tool

Inherited from

AbstractEditor.getExclusiveTool


getNativeEventName

Static getNativeEventName(eventName): string[]

Returns native event name

Parameters

Name Type Description
eventNamestringW3C Pointer Events Recommendation name

Returns

string[]

Inherited from

AbstractEditor.getNativeEventName


isTouchEvent

Static isTouchEvent(eventArgs): eventArgs is TouchEvent

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

Parameters

Name Type Description
eventArgsEvent | EventArgscontains info of the event

Returns

eventArgs is TouchEvent

Inherited from

AbstractEditor.isTouchEvent


lock

Static lock(plot, tool): void

Set exclusive tool for plot

Parameters

Name Type Description
plotPlotplot
toolAbstractTooltool

Returns

void

Inherited from

AbstractEditor.lock


setDefaultMouseRadius

Static setDefaultMouseRadius(radius): void

Sets default device radius for mouse events

Parameters

Name Type Description
radiusnumberradius for mouse events

Returns

void

Inherited from

AbstractEditor.setDefaultMouseRadius


setDefaultTouchRadius

Static setDefaultTouchRadius(radius): void

Sets default device radius for touch events

Parameters

Name Type Description
radiusnumberradius for touch events

Returns

void

Inherited from

AbstractEditor.setDefaultTouchRadius


unlock

Static unlock(value): void

Remove exclusive tool from plot

Parameters

Name Type Description
valueAbstractTool | Plotvalue

Returns

void

Inherited from

AbstractEditor.unlock