Skip to content
Last updated

API / geotoolkit / controls / tools / editors / Line / Line

Class: Line

editors.Line.Line

Line editor can be used to create and modify Line shapes

Hierarchy

Table of contents

Constructors
  • [new Line(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tools.editors.line.line.md#new line(options))
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 ('nonzero' 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 'none'
bbox-transformTransformationAdditional CSS transformation applied to node or 'none'
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 'none'
handles-bbox-transformTransformationAdditional CSS transformation applied to node or 'none'
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's painter'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
handlesHandlesOptionsHandles properties
handles-fromOptionsNode from vertex handle properties (@see
handles-fromOptionsNode from vertex handle properties (@see
handles-fromOptionsNode from vertex handle properties (@see
handles-fromOptionsNode from vertex handle properties (@see
handles-fromOptionsNode from vertex handle properties (@see
handles-toOptionsNode to vertex handle properties (@see
handles-toOptionsNode to vertex handle properties (@see
handles-toOptionsNode to vertex handle properties (@see
handles-toOptionsNode to vertex handle properties (@see
handles-toOptionsNode to vertex 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 'none'
layer-transformTransformationAdditional CSS transformation applied to node or 'none'
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 Line(options)

• new Line(options?)

Parameters

Name Type Description
Optional optionsOptionseditor options

Overrides

AbstractLineEditor<LineShape>.constructor

Methods

addListener

▸ addListener(eventName, listener): Line

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

Line

Inherited from

AbstractLineEditor.addListener


apply

▸ apply(command): Line

Applies command to the current node

Parameters

Name Type Description
commandAbstractCommandcommand to apply

Returns

Line

this

Inherited from

AbstractLineEditor.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

AbstractLineEditor.canInsert


canRedo

▸ canRedo(): boolean

Checks if there is command in history to redo

Returns

boolean

Inherited from

AbstractLineEditor.canRedo


canUndo

▸ canUndo(): boolean

Checks if there is command in history to undo

Returns

boolean

Inherited from

AbstractLineEditor.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

AbstractLineEditor.captureMouseUp


changeNodeOrder

▸ changeNodeOrder(order, anchor?): Line

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

Line

this

Inherited from

AbstractLineEditor.changeNodeOrder


createGhost

▸ Protected createGhost(): Node

Creates a clone of the current node

Returns

Node

Inherited from

AbstractLineEditor.createGhost


deleteNode

▸ deleteNode(trash?, shape?): Line

Delete node or array of nodes to specified trash container

Parameters

Name Type
Optional trashCompositeNode<Node&gt;
Optional shapeNode | Node[]

Returns

Line

this

Inherited from

AbstractLineEditor.deleteNode


dispose

▸ dispose(): void

Dispose tool.

Returns

void

Inherited from

AbstractLineEditor.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

AbstractLineEditor.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

AbstractLineEditor.fireEvent


flipNodeOrientation

▸ flipNodeOrientation(flipX, flipY): Line

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

Line

this

Inherited from

AbstractLineEditor.flipNodeOrientation


getActiveNode

▸ getActiveNode(): Node

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

Returns

Node

Inherited from

AbstractLineEditor.getActiveNode


getActivePlot

▸ Protected getActivePlot(): Plot

Gets an active plot

Returns

Plot

Inherited from

AbstractLineEditor.getActivePlot


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

AbstractLineEditor.getBboxHandle


getBounds

▸ getBounds(): Rect

Returns bounds for the bounding box elements

Returns

Rect

Inherited from

AbstractLineEditor.getBounds


getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractLineEditor.getClassName


getDataLayer

▸ Protected getDataLayer(): Node

Gets the edited nodes' parent layer

Returns

Node

Inherited from

AbstractLineEditor.getDataLayer


getDeviceTransform

▸ getDeviceTransform(): Transformation

Returns current node-to-device transformation

Returns

Transformation

Inherited from

AbstractLineEditor.getDeviceTransform


getEditMode

▸ getEditMode(): EditMode

Returns current edit mode

Returns

EditMode

Inherited from

AbstractLineEditor.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

AbstractLineEditor.getEventRadius


getGhost

▸ Protected getGhost(): Node

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

Returns

Node

Inherited from

AbstractLineEditor.getGhost


getHandlesGroup

▸ getHandlesGroup(): Group<Node&gt;

Returns handles group

Returns

Group<Node&gt;

Inherited from

AbstractLineEditor.getHandlesGroup


getHistory

▸ getHistory(): History

Returns current history

Returns

History

Inherited from

AbstractLineEditor.getHistory


getLocalTransform

▸ Protected getLocalTransform(): Transformation

Returns current node local transformation

Returns

Transformation

Inherited from

AbstractLineEditor.getLocalTransform


getManipulatorLayer

▸ getManipulatorLayer(): CompositeNode<Node&gt;

return manipulator layer

Returns

CompositeNode<Node&gt;

layer

Inherited from

AbstractLineEditor.getManipulatorLayer


getMouseRadius

▸ getMouseRadius(): number

Returns current device radius for mouse events

Returns

number

Inherited from

AbstractLineEditor.getMouseRadius


getName

▸ getName(): string

return tool name if any

Returns

string

name of the tool

Inherited from

AbstractLineEditor.getName


getNode

▸ getNode(): Line

Returns current node

Returns

Line

Inherited from

AbstractLineEditor.getNode


getParentTool

▸ getParentTool(): AbstractCompositeTool

Gets parent tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractLineEditor.getParentTool


getProperties

▸ getProperties(): OptionsOut

Gets properties

Returns

OptionsOut

editor properties

Inherited from

AbstractLineEditor.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

AbstractLineEditor.getProperty


getPropertyKeys

▸ getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

AbstractLineEditor.getPropertyKeys


getRoot

▸ getRoot(): AbstractCompositeTool

Gets root tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractLineEditor.getRoot


getTouchRadius

▸ getTouchRadius(): number

Returns current device radius for touch events

Returns

number

Inherited from

AbstractLineEditor.getTouchRadius


getVisible

▸ Protected getVisible(): boolean

Gets the edited node visibility state

Returns

boolean

Inherited from

AbstractLineEditor.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

AbstractLineEditor.hasEventListener


initialize

▸ Protected initialize(options): void

Parameters

Name Type Description
optionsOptions<Line&gt;options

Returns

void

Inherited from

AbstractLineEditor.initialize


isActive

▸ isActive(): boolean

return active state

Returns

boolean

Inherited from

AbstractLineEditor.isActive


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AbstractLineEditor.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

AbstractLineEditor.isDoubleClick


isEnabled

▸ isEnabled(): boolean

returns enable state

Returns

boolean

state

Inherited from

AbstractLineEditor.isEnabled


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

AbstractLineEditor.isSilent


isStarted

▸ isStarted(): boolean

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

Returns

boolean

Inherited from

AbstractLineEditor.isStarted


isSupported

▸ Protected isSupported(options): boolean

Checks if editor supports the options provided

Parameters

Name Type Description
optionsRecord<string, any&gt;editor options

Returns

boolean

Inherited from

AbstractLineEditor.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

AbstractLineEditor.isTouchEvent


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceAbstractEditorBase<Line&gt;of the event
Optional argsEventMap[E]arguments of the event

Returns

Line

this

Inherited from

AbstractLineEditor.notify


off

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

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

Returns

Line

this

Inherited from

AbstractLineEditor.off


on

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

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> 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; {
&#91;MyToolEvents.onValueChanged&#93;: MyToolEventArgs
}
export enum MyToolEvents {
onValueChanged = 'onValueChanged'
}
export class MyTool extends AbstractTool {
public declare on: &lt;E extends keyof EventMap&gt;(type: E, callback: (eventType: E, sender: this, args: EventMap&#91;E&#93;) =&gt; void) =&gt; this;
protected declare notify: &lt;E extends keyof EventMap&gt;(type: E, source: AbstractTool, args?: EventMap&#91;E&#93;) =&gt; this;
public declare off: &lt;E extends keyof EventMap&gt;(type: E, callback?: (eventType: E, sender: this, args: EventMap&#91;E&#93;) =&gt; void) =&gt; this;
// ...
}

Type parameters

NameType
Eextends string

Parameters

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

Returns

Line

Inherited from

AbstractLineEditor.on


onActiveStateChanged

▸ Protected onActiveStateChanged(): void

Fires

Events.onStateChanged

Returns

void

Inherited from

AbstractLineEditor.onActiveStateChanged


onBeforeCommandApplied

▸ Protected onBeforeCommandApplied(command): void

Fires the EditEvents.BeforeCommandApplied event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractLineEditor.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

AbstractLineEditor.onCommandApplied


onCommandApplying

▸ Protected onCommandApplying(command): void

Fires the EditEvents.CommandApplying event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractLineEditor.onCommandApplying


onCommandRedo

▸ Protected onCommandRedo(command): void

Fires the EditEvents.Redo event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractLineEditor.onCommandRedo


onCommandUndo

▸ Protected onCommandUndo(command): void

Fires the EditEvents.Undo event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractLineEditor.onCommandUndo


onDoubleClick

▸ Protected onDoubleClick(eventArgs): void

Handles mouse double click event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractLineEditor.onDoubleClick


onEnabledStateChanged

▸ Protected onEnabledStateChanged(): void

Fires

Events.onEnabledStateChanged

Returns

void

Inherited from

AbstractLineEditor.onEnabledStateChanged


onKeyDown

▸ Protected onKeyDown(eventArgs): void

Handles key down event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractLineEditor.onKeyDown


onKeyUp

▸ Protected onKeyUp(eventArgs): void

Handles key up event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractLineEditor.onKeyUp


onLeave

▸ Protected onLeave(eventArgs): void

Handles mouse leave event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractLineEditor.onLeave


onMouseDown

▸ Protected onMouseDown(eventArgs): void

Handles mouse down event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractLineEditor.onMouseDown


onMouseMove

▸ Protected onMouseMove(eventArgs): void

Handles mouse move event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractLineEditor.onMouseMove


onMouseUp

▸ Protected onMouseUp(eventArgs): void

Handles mouse up event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractLineEditor.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

AbstractLineEditor.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

AbstractLineEditor.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

AbstractLineEditor.pointToModel


push

▸ Protected push(command): Line

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

Parameters

Name Type Description
commandAbstractCommandcommand to add to the history

Returns

Line

this

Inherited from

AbstractLineEditor.push


redo

▸ redo(): Line

Reapplies last canceled command in history (if possible)

Returns

Line

this

Inherited from

AbstractLineEditor.redo


removeListener

▸ removeListener(eventName, listener?): Line

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

Line

Inherited from

AbstractLineEditor.removeListener


resetNode

▸ Protected resetNode(unlink?): Line

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

Line

this

Inherited from

AbstractLineEditor.resetNode


resetNodeToGhost

▸ Protected resetNodeToGhost(): Line

Resets the current node to its ghost state

Returns

Line

Inherited from

AbstractLineEditor.resetNodeToGhost


rotateNode

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

Parameters

Name Type
nodeNode
anglenumber
Optional hintany

Returns

boolean

Inherited from

AbstractLineEditor.rotateNode


setActive

▸ setActive(active): Line

set active state

Fires

Events.onStateChanged

Parameters

Name Type Description
activebooleanset active state

Returns

Line

Inherited from

AbstractLineEditor.setActive


setEditMode

▸ setEditMode(mode): Line

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

Line

this

Inherited from

AbstractLineEditor.setEditMode


setEnabled

▸ setEnabled(enabled): Line

set enable state

Fires

Events.onEnabledStateChanged

Fires

Events.onStateChanged

Parameters

Name Type Description
enabledbooleansets the enabled state

Returns

Line

this

Inherited from

AbstractLineEditor.setEnabled


setLine

▸ Protected setLine(node, from, to): Line

Parameters

Name Type
nodeLine
fromPoint
toPoint

Returns

Line

Inherited from

AbstractLineEditor.setLine


setMouseRadius

▸ setMouseRadius(radius): Line

Sets device radius for mouse events

Parameters

Name Type Description
radiusnumberradius for mouse events

Returns

Line

this

Inherited from

AbstractLineEditor.setMouseRadius


setName

▸ setName(name): Line

set tool name

Parameters

Name Type Description
namestringthe tool name

Returns

Line

Inherited from

AbstractLineEditor.setName


setNode

▸ Protected setNode(node): Line

Sets node to edit

Parameters

Name Type Description
nodeLinenode to edit

Returns

Line

this

Inherited from

AbstractLineEditor.setNode


setNodeBounds

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

Parameters

Name Type
nodeNode
p1Point
p2Point
Optional hintany

Returns

boolean

Inherited from

AbstractLineEditor.setNodeBounds


setProperties

▸ setProperties(properties?): Line

Sets properties to the editing elements

Parameters

Name Type Description
Optional propertiesOptionseditor properties

Returns

Line

this

Overrides

AbstractLineEditor.setProperties


setProperty

▸ setProperty(name, value): Line

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

Line

this

Inherited from

AbstractLineEditor.setProperty


setSilent

▸ setSilent(bool): Line

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

Line

this

Inherited from

AbstractLineEditor.setSilent


setSlotEnabled

▸ setSlotEnabled(eventName, value, target?): Line

Sets slot enabled

Parameters

Name Type Description
eventNamestringeventName
valuebooleanvalue
Optional targetEventTargettarget

Returns

Line

Inherited from

AbstractLineEditor.setSlotEnabled


setSlots

▸ setSlots(slots?, merge?): Line

Sets new slots.

Example

const slots = {
'pointerdown': (event: EventArgs) =&gt; {
// 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&gt;type of system events
Optional mergebooleanset to true if you want to merge with existing slots

Returns

Line

this

Inherited from

AbstractLineEditor.setSlots


setTouchRadius

▸ setTouchRadius(radius): Line

Sets device radius for touch events

Parameters

Name Type Description
radiusnumberradius for touch events

Returns

Line

this

Inherited from

AbstractLineEditor.setTouchRadius


start

▸ Protected start(eventArgs?): Line

start

Parameters

Name Type Description
Optional eventArgsEventArgsevent args

Returns

Line

Inherited from

AbstractLineEditor.start


stop

▸ Protected stop(): Line

stop

Returns

Line

Inherited from

AbstractLineEditor.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

AbstractLineEditor.swapActiveHandles


toggle

▸ toggle(): Line

switch enable state to opposite state

Returns

Line

Inherited from

AbstractLineEditor.toggle


transformNode

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

Parameters

Name Type
nodeNode
trTransformation
Optional hintany

Returns

boolean

Inherited from

AbstractLineEditor.transformNode


translateNode

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

Parameters

Name Type
nodeNode
xnumber
ynumber
Optional hintany

Returns

boolean

Inherited from

AbstractLineEditor.translateNode


undo

▸ undo(): Line

Cancels last command in history (if possible)

Returns

Line

this

Inherited from

AbstractLineEditor.undo


update

▸ update(): Line

Forces editing shapes and handles to be updated

Returns

Line

this

Inherited from

AbstractLineEditor.update


updateBrowserCursor

▸ Protected updateBrowserCursor(eventArgs, cursor?): void

Parameters

Name Type Description
eventArgsEventArgsevent args
Optional cursorstringbrowser cursor to set

Returns

void

Inherited from

AbstractLineEditor.updateBrowserCursor


updateHandles

▸ updateHandles(): Line

Forces editing handles to be updated

Returns

Line

this

Inherited from

AbstractLineEditor.updateHandles


updateNodePosition

▸ Protected updateNodePosition(): void

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

Returns

void

Inherited from

AbstractLineEditor.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

AbstractLineEditor.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

AbstractLineEditor.clientToCanvas


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractLineEditor.getClassName


getExclusiveTool

▸ Static getExclusiveTool(plot): AbstractTool

return exclusive tool associated with plot

Parameters

Name Type Description
plotPlotplot

Returns

AbstractTool

tool

Inherited from

AbstractLineEditor.getExclusiveTool


getNativeEventName

▸ Static getNativeEventName(eventName): string[]

Returns native event name

Parameters

Name Type Description
eventNamestringW3C Pointer Events Recommendation name

Returns

string[]

Inherited from

AbstractLineEditor.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

AbstractLineEditor.isTouchEvent


lock

▸ Static lock(plot, tool): void

Set exclusive tool for plot

Parameters

Name Type Description
plotPlotplot
toolAbstractTooltool

Returns

void

Inherited from

AbstractLineEditor.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

AbstractLineEditor.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

AbstractLineEditor.setDefaultTouchRadius


unlock

▸ Static unlock(value): void

Remove exclusive tool from plot

Parameters

Name Type Description
valueAbstractTool | Plotvalue

Returns

void

Inherited from

AbstractLineEditor.unlock