Skip to content
Last updated

API / geotoolkit / controls / tools / editors / Callout / Callout

Class: Callout

editors.Callout.Callout

Callout editor can be used to create and modify Callout nodes. Textarea dom element is used to modify text.

Hierarchy

Table of contents

Constructors
  • [new Callout(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tools.editors.callout.callout.md#new callout(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
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
previewPathPreview text path (for bounding box creation)
touchradiusnumberDevice radius for touch events

Contents

Constructors

new Callout(options)

• new Callout(options?)

Parameters

Name Type Description
Optional optionsOptionseditor options

Overrides

AbstractTextEditor<CalloutShape>.constructor

Methods

addListener

▸ addListener(eventName, listener): Callout

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

Callout

Inherited from

AbstractTextEditor.addListener


apply

▸ apply(command): Callout

Applies command to the current node

Parameters

Name Type Description
commandAbstractCommandcommand to apply

Returns

Callout

this

Inherited from

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

AbstractTextEditor.canInsert


canRedo

▸ canRedo(): boolean

Checks if there is command in history to redo

Returns

boolean

Inherited from

AbstractTextEditor.canRedo


canUndo

▸ canUndo(): boolean

Checks if there is command in history to undo

Returns

boolean

Inherited from

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

AbstractTextEditor.captureMouseUp


changeNodeOrder

▸ changeNodeOrder(order, anchor?): Callout

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

Callout

this

Inherited from

AbstractTextEditor.changeNodeOrder


createGhost

▸ Protected createGhost(): Node

Creates a clone of the current node

Returns

Node

Inherited from

AbstractTextEditor.createGhost


createTextOnClick

▸ Protected createTextOnClick(eventArgs): void

Creates shape basing on user click event and default text sizes

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Overrides

AbstractTextEditor.createTextOnClick


deleteNode

▸ deleteNode(trash?, shape?): Callout

Delete node or array of nodes to specified trash container

Parameters

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

Returns

Callout

this

Inherited from

AbstractTextEditor.deleteNode


dispose

▸ dispose(): void

Dispose tool.

Returns

void

Inherited from

AbstractTextEditor.dispose


end

▸ Protected end(eventArgs): void | Callout

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

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void | Callout

Inherited from

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

AbstractTextEditor.fireEvent


flipNodeOrientation

▸ flipNodeOrientation(flipX, flipY): Callout

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

Callout

this

Inherited from

AbstractTextEditor.flipNodeOrientation


getActiveNode

▸ getActiveNode(): Node

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

Returns

Node

Inherited from

AbstractTextEditor.getActiveNode


getActivePlot

▸ Protected getActivePlot(): Plot

Gets an active plot

Returns

Plot

Inherited from

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

AbstractTextEditor.getBboxHandle


getBounds

▸ getBounds(): Rect

Returns bounds for the bounding box elements

Returns

Rect

Inherited from

AbstractTextEditor.getBounds


getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractTextEditor.getClassName


getDataLayer

▸ Protected getDataLayer(): Node

Gets the edited nodes' parent layer

Returns

Node

Inherited from

AbstractTextEditor.getDataLayer


getDeviceTransform

▸ getDeviceTransform(): Transformation

Returns current node-to-device transformation

Returns

Transformation

Inherited from

AbstractTextEditor.getDeviceTransform


getEditMode

▸ getEditMode(): EditMode

Returns current edit mode

Returns

EditMode

Inherited from

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

AbstractTextEditor.getEventRadius


getGhost

▸ Protected getGhost(): Node

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

Returns

Node

Inherited from

AbstractTextEditor.getGhost


getHandlesGroup

▸ getHandlesGroup(): Group<Node&gt;

Returns handles group

Returns

Group<Node&gt;

Inherited from

AbstractTextEditor.getHandlesGroup


getHistory

▸ getHistory(): History

Returns current history

Returns

History

Inherited from

AbstractTextEditor.getHistory


getLocalTransform

▸ Protected getLocalTransform(): Transformation

Returns current node local transformation

Returns

Transformation

Inherited from

AbstractTextEditor.getLocalTransform


getManipulatorLayer

▸ getManipulatorLayer(): CompositeNode<Node&gt;

return manipulator layer

Returns

CompositeNode<Node&gt;

layer

Inherited from

AbstractTextEditor.getManipulatorLayer


getMouseRadius

▸ getMouseRadius(): number

Returns current device radius for mouse events

Returns

number

Inherited from

AbstractTextEditor.getMouseRadius


getName

▸ getName(): string

return tool name if any

Returns

string

name of the tool

Inherited from

AbstractTextEditor.getName


getNode

▸ getNode(): Callout

Returns current node

Returns

Callout

Inherited from

AbstractTextEditor.getNode


getParentTool

▸ getParentTool(): AbstractCompositeTool

Gets parent tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractTextEditor.getParentTool


getProperties

▸ getProperties(): OptionsOut

Returns properties

Returns

OptionsOut

editor properties

Overrides

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

AbstractTextEditor.getProperty


getPropertyKeys

▸ getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

AbstractTextEditor.getPropertyKeys


getRoot

▸ getRoot(): AbstractCompositeTool

Gets root tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractTextEditor.getRoot


getTextBounds

▸ getTextBounds(): Rect

Returns

Rect

Inherited from

AbstractTextEditor.getTextBounds


getTouchRadius

▸ getTouchRadius(): number

Returns current device radius for touch events

Returns

number

Inherited from

AbstractTextEditor.getTouchRadius


getVisible

▸ Protected getVisible(): boolean

Gets the edited node visibility state

Returns

boolean

Inherited from

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

AbstractTextEditor.hasEventListener


initialize

▸ Protected initialize(options): void

Parameters

Name Type Description
optionsOptionsoptions

Returns

void

Overrides

AbstractTextEditor.initialize


isActive

▸ isActive(): boolean

return active state

Returns

boolean

Inherited from

AbstractTextEditor.isActive


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

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

AbstractTextEditor.isDoubleClick


isEnabled

▸ isEnabled(): boolean

returns enable state

Returns

boolean

state

Inherited from

AbstractTextEditor.isEnabled


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

AbstractTextEditor.isSilent


isStarted

▸ isStarted(): boolean

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

Returns

boolean

Inherited from

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

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

AbstractTextEditor.isTouchEvent


move

▸ Protected move(node, x, y): Callout

Parameters

Name Type
nodeCallout
xnumber
ynumber

Returns

Callout


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

Callout

this

Inherited from

AbstractTextEditor.notify


off

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

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

Returns

Callout

this

Inherited from

AbstractTextEditor.off


on

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

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

Returns

Callout

Inherited from

AbstractTextEditor.on


onActiveStateChanged

▸ Protected onActiveStateChanged(): void

Fires

Events.onStateChanged

Returns

void

Inherited from

AbstractTextEditor.onActiveStateChanged


onBeforeCommandApplied

▸ Protected onBeforeCommandApplied(command): void

Fires the EditEvents.BeforeCommandApplied event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

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

AbstractTextEditor.onCommandApplied


onCommandApplying

▸ Protected onCommandApplying(command): void

Fires the EditEvents.CommandApplying event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractTextEditor.onCommandApplying


onCommandRedo

▸ Protected onCommandRedo(command): void

Fires the EditEvents.Redo event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractTextEditor.onCommandRedo


onCommandUndo

▸ Protected onCommandUndo(command): void

Fires the EditEvents.Undo event

Parameters

Name Type Description
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractTextEditor.onCommandUndo


onDoubleClick

▸ Protected onDoubleClick(eventArgs): void

Handles mouse double click event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractTextEditor.onDoubleClick


onEnabledStateChanged

▸ Protected onEnabledStateChanged(): void

Fires

Events.onEnabledStateChanged

Returns

void

Inherited from

AbstractTextEditor.onEnabledStateChanged


onKeyDown

▸ Protected onKeyDown(eventArgs): void

Handles key down event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractTextEditor.onKeyDown


onKeyUp

▸ Protected onKeyUp(eventArgs): void

Handles key up event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractTextEditor.onKeyUp


onLeave

▸ Protected onLeave(eventArgs): void

Handles mouse leave event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractTextEditor.onLeave


onMouseDown

▸ Protected onMouseDown(eventArgs): void

Handles mouse down event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractTextEditor.onMouseDown


onMouseMove

▸ Protected onMouseMove(eventArgs): void

Handles mouse move event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractTextEditor.onMouseMove


onMouseUp

▸ Protected onMouseUp(eventArgs): void

Handles mouse up event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

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

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

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

AbstractTextEditor.pointToModel


push

▸ Protected push(command): Callout

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

Parameters

Name Type Description
commandAbstractCommandcommand to add to the history

Returns

Callout

this

Inherited from

AbstractTextEditor.push


redo

▸ redo(): Callout

Reapplies last canceled command in history (if possible)

Returns

Callout

this

Inherited from

AbstractTextEditor.redo


removeListener

▸ removeListener(eventName, listener?): Callout

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

Callout

Inherited from

AbstractTextEditor.removeListener


resetNode

▸ Protected resetNode(unlink?): Callout

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

Callout

this

Inherited from

AbstractTextEditor.resetNode


resetNodeToGhost

▸ Protected resetNodeToGhost(): Callout

Resets the current node to its ghost state

Returns

Callout

Inherited from

AbstractTextEditor.resetNodeToGhost


rotateNode

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

Parameters

Name Type
nodeNode
anglenumber
Optional hintany

Returns

boolean

Inherited from

AbstractTextEditor.rotateNode


setActive

▸ setActive(active): Callout

set active state

Fires

Events.onStateChanged

Parameters

Name Type Description
activebooleanset active state

Returns

Callout

Inherited from

AbstractTextEditor.setActive


setAnchor

▸ Protected setAnchor(node, ax, ay?): Callout

Sets anchor to provided node

Parameters

Name Type Description
nodeCalloutthe node
axnumber | Pointthe anchor x-coordinate or anchor point
Optional aynumberthe anchor y-coordinate

Returns

Callout

Overrides

AbstractTextEditor.setAnchor


setEditMode

▸ setEditMode(mode): Callout

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

Callout

this

Inherited from

AbstractTextEditor.setEditMode


setEnabled

▸ setEnabled(enabled): Callout

set enable state

Fires

Events.onEnabledStateChanged

Fires

Events.onStateChanged

Parameters

Name Type Description
enabledbooleansets the enabled state

Returns

Callout

this

Inherited from

AbstractTextEditor.setEnabled


setMouseRadius

▸ setMouseRadius(radius): Callout

Sets device radius for mouse events

Parameters

Name Type Description
radiusnumberradius for mouse events

Returns

Callout

this

Inherited from

AbstractTextEditor.setMouseRadius


setName

▸ setName(name): Callout

set tool name

Parameters

Name Type Description
namestringthe tool name

Returns

Callout

Inherited from

AbstractTextEditor.setName


setNode

▸ Protected setNode(node): Callout

Sets node to edit

Parameters

Name Type Description
nodeCalloutnode to edit

Returns

Callout

this

Inherited from

AbstractTextEditor.setNode


setNodeBounds

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

Parameters

Name Type
nodeNode
p1Point
p2Point
Optional hintany

Returns

boolean

Inherited from

AbstractTextEditor.setNodeBounds


setProperties

▸ setProperties(properties?): Callout

Sets properties to the editing elements

Parameters

Name Type Description
Optional propertiesOptionseditor properties

Returns

Callout

this

Overrides

AbstractTextEditor.setProperties


setProperty

▸ setProperty(name, value): Callout

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

Callout

this

Inherited from

AbstractTextEditor.setProperty


setSilent

▸ setSilent(bool): Callout

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

Callout

this

Inherited from

AbstractTextEditor.setSilent


setSlotEnabled

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

Sets slot enabled

Parameters

Name Type Description
eventNamestringeventName
valuebooleanvalue
Optional targetEventTargettarget

Returns

Callout

Inherited from

AbstractTextEditor.setSlotEnabled


setSlots

▸ setSlots(slots?, merge?): Callout

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

Callout

this

Inherited from

AbstractTextEditor.setSlots


setTextAreaVisible

▸ Protected setTextAreaVisible(visible): Callout

Shows/hides textarea dom element (and hides/shows scene text shape respectively

Parameters

Name Type Description
visiblebooleantrue to show textarea and hide scene text, false otherwise

Returns

Callout

this

Inherited from

AbstractTextEditor.setTextAreaVisible


setTouchRadius

▸ setTouchRadius(radius): Callout

Sets device radius for touch events

Parameters

Name Type Description
radiusnumberradius for touch events

Returns

Callout

this

Inherited from

AbstractTextEditor.setTouchRadius


start

▸ Protected start(eventArgs?): Callout

start

Parameters

Name Type Description
Optional eventArgsEventArgsevent args

Returns

Callout

Inherited from

AbstractTextEditor.start


stop

▸ Protected stop(): Callout

stop

Returns

Callout

Inherited from

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

AbstractTextEditor.swapActiveHandles


toggle

▸ toggle(): Callout

switch enable state to opposite state

Returns

Callout

Inherited from

AbstractTextEditor.toggle


transformNode

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

Parameters

Name Type
nodeNode
trTransformation
Optional hintany

Returns

boolean

Inherited from

AbstractTextEditor.transformNode


translateNode

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

Parameters

Name Type
nodeNode
xnumber
ynumber
Optional hintany

Returns

boolean

Inherited from

AbstractTextEditor.translateNode


undo

▸ undo(): Callout

Cancels last command in history (if possible)

Returns

Callout

this

Inherited from

AbstractTextEditor.undo


update

▸ update(): Callout

Forces editing shapes and handles to be updated

Returns

Callout

this

Inherited from

AbstractTextEditor.update


updateBounds

▸ Protected updateBounds(bounds, node): Rect

Updates bounds for provided node

Parameters

Name Type Description
boundsRectthe input bounds
nodeCalloutthe text node

Returns

Rect

Overrides

AbstractTextEditor.updateBounds


updateBrowserCursor

▸ Protected updateBrowserCursor(eventArgs, cursor?): void

Parameters

Name Type Description
eventArgsEventArgsevent args
Optional cursorstringbrowser cursor to set

Returns

void

Inherited from

AbstractTextEditor.updateBrowserCursor


updateHandles

▸ updateHandles(): Callout

Forces editing handles to be updated

Returns

Callout

this

Inherited from

AbstractTextEditor.updateHandles


updateNodePosition

▸ Protected updateNodePosition(): void

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

Returns

void

Inherited from

AbstractTextEditor.updateNodePosition


updateTextShape

▸ Protected updateTextShape(): void

Updates text shape bounds (anchor + size)

Returns

void

Inherited from

AbstractTextEditor.updateTextShape


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

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

AbstractTextEditor.clientToCanvas


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractTextEditor.getClassName


getExclusiveTool

▸ Static getExclusiveTool(plot): AbstractTool

return exclusive tool associated with plot

Parameters

Name Type Description
plotPlotplot

Returns

AbstractTool

tool

Inherited from

AbstractTextEditor.getExclusiveTool


getNativeEventName

▸ Static getNativeEventName(eventName): string[]

Returns native event name

Parameters

Name Type Description
eventNamestringW3C Pointer Events Recommendation name

Returns

string[]

Inherited from

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

AbstractTextEditor.isTouchEvent


lock

▸ Static lock(plot, tool): void

Set exclusive tool for plot

Parameters

Name Type Description
plotPlotplot
toolAbstractTooltool

Returns

void

Inherited from

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

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

AbstractTextEditor.setDefaultTouchRadius


unlock

▸ Static unlock(value): void

Remove exclusive tool from plot

Parameters

Name Type Description
valueAbstractTool | Plotvalue

Returns

void

Inherited from

AbstractTextEditor.unlock