API / geotoolkit / controls / tools / editors / Callout / Callout
Callout editor can be used to create and modify Callout nodes. Textarea dom element is used to modify text.
↳
Callout
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
bbox | Path | Bounding box path to draw bounding rectangle OR bounding box path properties (see |
bbox-bounds | Rect | Bounds |
bbox-bounds-height | number | Height |
bbox-bounds-readonly | boolean | Readonly |
bbox-bounds-width | number | Width |
bbox-bounds-x | number | Left |
bbox-bounds-y | number | Top |
bbox-clipstyle | ClipStyle | Clipping style |
bbox-clipstyle-evenodd | boolean | True if evenodd mode is on ('nonzero' mode otherwise) |
bbox-clipstyle-geometry | GraphicsPath | Clipping geometry |
bbox-clipstyle-geometry-bounds | Rect | Bounds |
bbox-clipstyle | GraphicsPath | Clipping style |
bbox-cssclass | string | The css class name of this node |
bbox-csscursor | string | CSS cursor associated with node |
bbox-cssstyle | string | CSS style to be applied to inserted elements |
bbox-fillstyle | string | Style applied on fill |
bbox-fillstyle | FillStyle | Style applied on fill |
bbox-fillstyle-color | string | Color in CSS form |
bbox-fillstyle-evenoddmode | boolean | Even-odd fill mode |
bbox-fillstyle-fillpattern | Pattern | Pattern |
bbox-fillstyle-fillpattern-containername | string | An 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-patternname | string | Name of this pattern for indexing |
bbox-fillstyle-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
bbox-fillstyle-foreground | string | Foreground color |
bbox-fillstyle-pattern | Pattern | Pattern |
bbox-geometry | GraphicsPath | Geometry the path |
bbox-id | string | number | Id of the node, its a unique identifier |
bbox-linestyle | string | Style applied on outline |
bbox-linestyle | LineStyle | Style applied on outline |
bbox-linestyle-color | string | Color in CSS form |
bbox-linestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
bbox-linestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
bbox-linestyle-linecap | CapStyle | The line cap style |
bbox-linestyle-linedashoffset | number | Line dash offset of dashed line |
bbox-linestyle-linejoin | JoinStyle | The line join style |
bbox-linestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
bbox-linestyle-scalable | boolean | True if width should depend on transformation |
bbox-linestyle-unit | string | Optional unit for the width |
bbox-linestyle-width | number | string | The line thickness |
bbox-localtransform | Transformation | Local transformation |
bbox-localtransform-dx | number | X axis translation |
bbox-localtransform-dy | number | Y axis translation |
bbox-localtransform-xx | number | X scale |
bbox-localtransform-xy | number | Xy skew |
bbox-localtransform-yx | number | Yx skew |
bbox-localtransform-yy | number | Y scale |
bbox-margins | number | string | It has properties for specifying the margins for each side |
bbox-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
bbox-opacity | number | Node 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-opacityblendmode | BlendMode | Node opacity mode to blend it |
bbox-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
bbox-scalescrollstrategy-enabled | boolean | Enable flag |
bbox-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
bbox-tag | any | Custom 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-transform | string | Additional CSS transformation applied to node or 'none' |
bbox-transform | Transformation | Additional CSS transformation applied to node or 'none' |
bbox-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
bbox-z-index | number | Define node z-index |
editmode | EditMode | Node edit mode |
enabled | boolean | Enabled state |
ghost | Options | Options for |
ghost-cssclass | string | The css class name of this node |
ghost-id | string | number | Id of the node, its a unique identifier |
ghost-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
ghost-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
ghost-tag | any | Custom 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-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
ghost-z-index | number | Define node z-index |
ghost | GhostOptions | Options for |
ghost-fillstyle | string | Ghost fill style |
ghost-fillstyle | FillStyle | Ghost fill style |
ghost-linestyle | string | Ghost line style |
ghost-linestyle | LineStyle | Ghost line style |
ghost-opacity | number | Ghost opacity from 0 to 1 |
handles | HandlesOptions | Handles properties |
handles-bbox | Options | Bbox resize handles properties (see |
handles-bbox | Options | Bbox resize handles properties (see |
handles-bbox-clipstyle | ClipStyle | Clipping style |
handles-bbox-clipstyle | GraphicsPath | Clipping style |
handles-bbox-csscursor | string | CSS cursor associated with node |
handles-bbox-cssstyle | string | CSS style to be applied to inserted elements |
handles-bbox-localtransform | Transformation | Local transformation |
handles-bbox-margins | number | string | It has properties for specifying the margins for each side |
handles-bbox-opacity | number | Node 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-opacityblendmode | BlendMode | Node opacity mode to blend it |
handles-bbox-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
handles-bbox-transform | string | Additional CSS transformation applied to node or 'none' |
handles-bbox-transform | Transformation | Additional CSS transformation applied to node or 'none' |
handles-bbox | Options | Bbox resize handles properties (see |
handles-bbox-fillstyle | string | Style applied on fill |
handles-bbox-fillstyle | FillStyle | Style applied on fill |
handles-bbox-linestyle | string | Style applied on outline |
handles-bbox-linestyle | LineStyle | Style applied on outline |
handles-bbox | Options | Bbox resize handles properties (see |
handles-bbox-alignment | AnchorType | Alignment according to the anchor point |
handles-bbox-ax | number | Anchor x position |
handles-bbox-ay | number | Anchor y position |
handles-bbox-height | number | Shape height |
handles-bbox-ispointingup | boolean | Defines whether the shape is always pointing up |
handles-bbox-layoutstyle | LayoutStyle | Layout style to specify how to lay out shape |
handles-bbox-layoutstyle-constraint | SizeConstraint | Layout constrains |
handles-bbox-layoutstyle-flexgrow | number | Number specifying how much the item will grow relative to the rest of the items inside the same container |
handles-bbox-layoutstyle-flexshrink | number | Number specifying how much the item will shrink relative to the rest of the items inside the same container |
handles-bbox-layoutstyle-float | string | Float position |
handles-bbox-layoutstyle-position | string | Layout position |
handles-bbox-layoutstyle-size | number | string | Layout size |
handles-bbox-maxdimension | Dimension | Maximum size for rendering |
handles-bbox-maxdimension-height | number | Height of dimension |
handles-bbox-maxdimension-width | number | Width of dimension or properties |
handles-bbox-mindimension | Dimension | Minimum size for rendering |
handles-bbox-preserveaspectratio | boolean | Preserve aspect ratio of the anchored shape |
handles-bbox-preservereadingorientation | boolean | Preserve reading orientation for local transform |
handles-bbox-preserverightangle | boolean | Preserve right angle for local transformation |
handles-bbox-rotationangle | number | Rotation angle at anchor |
handles-bbox-sizeisindevicespace | boolean | Is coordinate in device space |
handles-bbox-useminmaxdimensions | boolean | Use the min max dimensions to limit visual size |
handles-bbox-width | number | Shape width |
handles-bbox | Options | Bbox resize handles properties (see |
handles-bbox-alignment | AnchorType | Anchor type of symbol |
handles-bbox-cache | boolean | Set it to true if you want to cache complex geometry to raster |
handles-bbox-painter | string | A function with has parameters: symbol, box, context |
handles-bbox-painterproperties | any | Symbol's painter's properties |
handles-rotation | Options | Rotation handle properties (see |
handles-rotation | Options | Rotation handle properties (see |
handles-rotation | Options | Rotation handle properties (see |
handles-rotation | Options | Rotation handle properties (see |
handles-rotation | Options | Rotation handle properties (see |
layer | CompositeNode | Manipulator layer |
layer-clipping | boolean | Enable clipping, this does not consider the clipstyle, it is related to bounds-clipping |
layer-clipstyle | ClipStyle | Clipping style |
layer-clipstyle | GraphicsPath | Clipping style |
layer-cssclass | string | The css class name of this node |
layer-csscursor | string | CSS cursor associated with node |
layer-cssstyle | string | CSS style to be applied to inserted elements |
layer-id | string | number | Id of the node, its a unique identifier |
layer-infinity | boolean | Mode to render outside the model limits |
layer-localtransform | Transformation | Local transformation |
layer-margins | number | string | It has properties for specifying the margins for each side |
layer-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
layer-opacity | number | Node 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-opacityblendmode | BlendMode | Node opacity mode to blend it |
layer-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
layer-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
layer-tag | any | Custom 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-transform | string | Additional CSS transformation applied to node or 'none' |
layer-transform | Transformation | Additional CSS transformation applied to node or 'none' |
layer-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
layer-z-index | number | Define node z-index |
mouseradius | number | Device radius for mouse events |
name | string | Name of the tool used like cross-hair etc |
preview | Path | Preview text path (for bounding box creation) |
touchradius | number | Device radius for touch events |
Constructors
• new Callout(options?)
| Name | Type | Description |
|---|---|---|
Optional options | Options | editor options |
AbstractTextEditor<CalloutShape&gt;.constructor
Methods
▸ 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)
| Name | Type | Description |
|---|---|---|
eventName | string | event name or unique event identifier |
listener | Function | the event listener |
AbstractTextEditor.addListener
▸ apply(command): Callout
Applies command to the current node
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | command to apply |
this
▸ Protected canInsert(eventArgs): boolean
Determines if the editor can insert a new node at the point
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | the event arguments |
boolean
▸ canRedo(): boolean
Checks if there is command in history to redo
boolean
▸ canUndo(): boolean
Checks if there is command in history to undo
boolean
▸ 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.
void
AbstractTextEditor.captureMouseUp
▸ changeNodeOrder(order, anchor?): Callout
changes the z-order of the nodes being rendered.
| Name | Type | Description |
|---|---|---|
order | NodeOrder | position to be added |
Optional anchor | Node | anchor node to specify changeNodeOrder with respect to this node |
this
AbstractTextEditor.changeNodeOrder
▸ Protected createGhost(): Node
Creates a clone of the current node
AbstractTextEditor.createGhost
▸ Protected createTextOnClick(eventArgs): void
Creates shape basing on user click event and default text sizes
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractTextEditor.createTextOnClick
▸ deleteNode(trash?, shape?): Callout
Delete node or array of nodes to specified trash container
| Name | Type |
|---|---|
Optional trash | CompositeNode<Node> |
Optional shape | Node | Node[] |
this
▸ dispose(): void
Dispose tool.
void
▸ Protected end(eventArgs): void
Ends current node creation, fires the corresponding event and clones new empty node for the new creation
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
▸ 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()
| Name | Type | Description |
|---|---|---|
eventName | string | event name |
Optional eventArgs | any | contains info of the event |
void
▸ flipNodeOrientation(flipX, flipY): Callout
Flip node vertically and/or horizontally
| Name | Type | Description |
|---|---|---|
flipX | boolean | true if node should be flipped horizontally, false otherwise |
flipY | boolean | true if node should be flipped vertically, false otherwise |
this
AbstractTextEditor.flipNodeOrientation
▸ getActiveNode(): Node
Returns the ghost if ghost mode is enabled and initialized and the original node otherwise
AbstractTextEditor.getActiveNode
▸ Protected getActivePlot(): Plot
Gets an active plot
AbstractTextEditor.getActivePlot
▸ 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
| Name | Type | Description |
|---|---|---|
Optional eventArgs | EventArgs | event args |
AbstractTextEditor.getBboxHandle
▸ getBounds(): Rect
Returns bounds for the bounding box elements
▸ getClassName(): string
string
AbstractTextEditor.getClassName
▸ Protected getDataLayer(): Node
Gets the edited nodes' parent layer
AbstractTextEditor.getDataLayer
▸ getDeviceTransform(): Transformation
Returns current node-to-device transformation
AbstractTextEditor.getDeviceTransform
▸ getEditMode(): EditMode
Returns current edit mode
AbstractTextEditor.getEditMode
▸ Protected getEventRadius(eventArgs): number
Returns device radius for the provided event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | contains info of the event |
number
AbstractTextEditor.getEventRadius
▸ Protected getGhost(): Node
Returns the ghost registered with this editor. If ghost does not exist, returns null
▸ getHandlesGroup(): Group<Node>
Returns handles group
AbstractTextEditor.getHandlesGroup
▸ getHistory(): History
Returns current history
▸ Protected getLocalTransform(): Transformation
Returns current node local transformation
AbstractTextEditor.getLocalTransform
▸ getManipulatorLayer(): CompositeNode<Node>
return manipulator layer
layer
AbstractTextEditor.getManipulatorLayer
▸ getMouseRadius(): number
Returns current device radius for mouse events
number
AbstractTextEditor.getMouseRadius
▸ getName(): string
return tool name if any
string
name of the tool
▸ getNode(): Callout
Returns current node
▸ getParentTool(): AbstractCompositeTool
Gets parent tool
parent tool
AbstractTextEditor.getParentTool
▸ getProperties(): OptionsOut
Returns properties
editor properties
AbstractTextEditor.getProperties
▸ getProperty(name): any
Gets dynamic property by name. These properties can be used as a property bags
| Name | Type | Description |
|---|---|---|
name | string | property name |
any
AbstractTextEditor.getProperty
▸ getPropertyKeys(): string[]
Returns known properties keys
string[]
AbstractTextEditor.getPropertyKeys
▸ getRoot(): AbstractCompositeTool
Gets root tool
parent tool
▸ getTextBounds(): Rect
AbstractTextEditor.getTextBounds
▸ getTouchRadius(): number
Returns current device radius for touch events
number
AbstractTextEditor.getTouchRadius
▸ Protected getVisible(): boolean
Gets the edited node visibility state
boolean
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
AbstractTextEditor.hasEventListener
▸ Protected initialize(options): void
| Name | Type | Description |
|---|---|---|
options | Options | options |
void
▸ isActive(): boolean
return active state
boolean
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ Protected isDoubleClick(point, eventArgs?): boolean
returns true if double clicked
| Name | Type | Description |
|---|---|---|
point | Point | Click point |
Optional eventArgs | EventArgs | optional event args to verify double click |
boolean
AbstractTextEditor.isDoubleClick
▸ isEnabled(): boolean
returns enable state
boolean
state
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ isStarted(): boolean
Tests if editing was started (editor is active and at least one command was applied)
boolean
▸ Protected isSupported(options): boolean
Checks if editor supports the options provided
| Name | Type | Description |
|---|---|---|
options | Record<string, any> | editor options |
boolean
AbstractTextEditor.isSupported
▸ isTouchEvent(eventArgs): boolean
return true if the event is a touch event and false otherwise.
| Name | Type | Description |
|---|---|---|
eventArgs | Event | EventArgs | contains info of the event |
boolean
AbstractTextEditor.isTouchEvent
▸ Protected move(node, x, y): Callout
| Name | Type |
|---|---|
node | Callout |
x | number |
y | number |
▸ notify<E>(type, source, args?): Callout
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | AbstractEditorBase<Callout> | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: Callout, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): Callout
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 & {
[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;
// ...
}| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: Callout, args: EventMap[E]) => void | to be called |
▸ Protected onActiveStateChanged(): void
Fires
void
AbstractTextEditor.onActiveStateChanged
▸ Protected onBeforeCommandApplied(command): void
Fires the EditEvents.BeforeCommandApplied event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractTextEditor.onBeforeCommandApplied
▸ Protected onCommandApplied(command): void
Fires the EditEvents.CommandApplied and the command.getEventName() events
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | command applied |
void
AbstractTextEditor.onCommandApplied
▸ Protected onCommandApplying(command): void
Fires the EditEvents.CommandApplying event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractTextEditor.onCommandApplying
▸ Protected onCommandRedo(command): void
Fires the EditEvents.Redo event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractTextEditor.onCommandRedo
▸ Protected onCommandUndo(command): void
Fires the EditEvents.Undo event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractTextEditor.onCommandUndo
▸ Protected onDoubleClick(eventArgs): void
Handles mouse double click event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractTextEditor.onDoubleClick
▸ Protected onEnabledStateChanged(): void
Fires
void
AbstractTextEditor.onEnabledStateChanged
▸ Protected onKeyDown(eventArgs): void
Handles key down event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
▸ Protected onKeyUp(eventArgs): void
Handles key up event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
▸ Protected onLeave(eventArgs): void
Handles mouse leave event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
▸ Protected onMouseDown(eventArgs): void
Handles mouse down event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractTextEditor.onMouseDown
▸ Protected onMouseMove(eventArgs): void
Handles mouse move event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractTextEditor.onMouseMove
▸ Protected onMouseUp(eventArgs): void
Handles mouse up event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
▸ Protected onNodeCreated(node, eventArgs?): void
Fires the EditEvents.End event
void
AbstractTextEditor.onNodeCreated
▸ pageToCanvas(eventArgs, externalPlot?): Object
return position relative to the canvas
| Name | Type | Description |
|---|---|---|
eventArgs | Event | EventArgs | parentElement the parent HTML element |
Optional externalPlot | Plot | plot |
Object
| Name | Type |
|---|---|
x | number |
y | number |
AbstractTextEditor.pageToCanvas
▸ pointToModel(model, eventArgs): Point
converts device coordinates to inner coordinates of node
| Name | Type | Description |
|---|---|---|
model | Node | the model |
eventArgs | Point | EventArgs | arguments of the event OR point in device (plot) coordinates. |
AbstractTextEditor.pointToModel
▸ Protected push(command): Callout
Pushes command to the history after applying it and firing the corresponding event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | command to add to the history |
this
▸ redo(): Callout
Reapplies last canceled command in history (if possible)
this
▸ removeListener(eventName, listener?): Callout
remove event listener. The listener reveives the message when the system event happens.
Deprecated
since 4.0 use .off() instead.
| Name | Type | Description |
|---|---|---|
eventName | string | event name |
Optional listener | Function | Function[] | the event listener, if null, remove all listeners for the event |
AbstractTextEditor.removeListener
▸ Protected resetNode(unlink?): Callout
Resets current node to the initial state before all the changes were made
| Name | Type | Description |
|---|---|---|
Optional unlink | boolean | true, for remove node from parent, else false |
this
▸ Protected resetNodeToGhost(): Callout
Resets the current node to its ghost state
AbstractTextEditor.resetNodeToGhost
▸ Protected rotateNode(node, angle, hint?): boolean
| Name | Type |
|---|---|
node | Node |
angle | number |
Optional hint | any |
boolean
▸ setActive(active): Callout
set active state
Fires
| Name | Type | Description |
|---|---|---|
active | boolean | set active state |
▸ Protected setAnchor(node, ax, ay?): Callout
Sets anchor to provided node
| Name | Type | Description |
|---|---|---|
node | Callout | the node |
ax | number | Point | the anchor x-coordinate or anchor point |
Optional ay | number | the anchor y-coordinate |
▸ setEditMode(mode): Callout
Sets edit mode to determine operations that can be applied to the current node. Use bitwise operations for the full customization.
| Name | Type | Description |
|---|---|---|
mode | EditMode | mode to edit |
this
AbstractTextEditor.setEditMode
▸ setEnabled(enabled): Callout
set enable state
Fires
Fires
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets the enabled state |
this
▸ setMouseRadius(radius): Callout
Sets device radius for mouse events
| Name | Type | Description |
|---|---|---|
radius | number | radius for mouse events |
this
AbstractTextEditor.setMouseRadius
▸ setName(name): Callout
set tool name
| Name | Type | Description |
|---|---|---|
name | string | the tool name |
▸ Protected setNode(node): Callout
Sets node to edit
| Name | Type | Description |
|---|---|---|
node | Callout | node to edit |
this
▸ Protected setNodeBounds(node, p1, p2, hint?): boolean
boolean
AbstractTextEditor.setNodeBounds
▸ setProperties(properties?): Callout
Sets properties to the editing elements
| Name | Type | Description |
|---|---|---|
Optional properties | Options | editor properties |
this
AbstractTextEditor.setProperties
▸ setProperty(name, value): Callout
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
AbstractTextEditor.setProperty
▸ setSilent(bool): Callout
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setSlotEnabled(eventName, value, target?): Callout
Sets slot enabled
| Name | Type | Description |
|---|---|---|
eventName | string | eventName |
value | boolean | value |
Optional target | EventTarget | target |
AbstractTextEditor.setSlotEnabled
▸ setSlots(slots?, merge?): Callout
Sets new slots.
Example
const slots = {
'pointerdown': (event: EventArgs) => {
// event is an instance of @int/geotoolkit/controls/tools/EventArgs
...
}
};
tool.setSlots(slots);| Name | Type | Description |
|---|---|---|
Optional slots | Record<string, Slot | Slot[] | (eventArgs: EventArgs) => void> | type of system events |
Optional merge | boolean | set to true if you want to merge with existing slots |
this
▸ Protected setTextAreaVisible(visible): Callout
Shows/hides textarea dom element (and hides/shows scene text shape respectively
| Name | Type | Description |
|---|---|---|
visible | boolean | true to show textarea and hide scene text, false otherwise |
this
AbstractTextEditor.setTextAreaVisible
▸ setTouchRadius(radius): Callout
Sets device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
this
AbstractTextEditor.setTouchRadius
▸ Protected start(eventArgs?): Callout
start
| Name | Type | Description |
|---|---|---|
Optional eventArgs | EventArgs | event args |
▸ Protected stop(): Callout
stop
▸ Protected swapActiveHandles(handleId, vertical): EditHandleId
Swaps active handles vertically/horizontally
| Name | Type | Description |
|---|---|---|
handleId | EditHandleId | current active handle id |
vertical | boolean | true if handles should be swapped vertically and false otherwise |
swapped handle id
AbstractTextEditor.swapActiveHandles
▸ toggle(): Callout
switch enable state to opposite state
▸ Protected transformNode(node, tr, hint?): boolean
| Name | Type |
|---|---|
node | Node |
tr | Transformation |
Optional hint | any |
boolean
AbstractTextEditor.transformNode
▸ Protected translateNode(node, x, y, hint?): boolean
| Name | Type |
|---|---|
node | Node |
x | number |
y | number |
Optional hint | any |
boolean
AbstractTextEditor.translateNode
▸ undo(): Callout
Cancels last command in history (if possible)
this
▸ update(): Callout
Forces editing shapes and handles to be updated
this
▸ Protected updateBounds(bounds, node): Rect
Updates bounds for provided node
AbstractTextEditor.updateBounds
▸ Protected updateBrowserCursor(eventArgs, cursor?): void
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
Optional cursor | string | browser cursor to set |
void
AbstractTextEditor.updateBrowserCursor
▸ updateHandles(): Callout
Forces editing handles to be updated
this
AbstractTextEditor.updateHandles
▸ Protected updateNodePosition(): void
Updates active node's position if scene transformation was changed but pointer position wasn't
void
AbstractTextEditor.updateNodePosition
▸ Protected updateTextShape(): void
Updates text shape bounds (anchor + size)
void
AbstractTextEditor.updateTextShape
▸ Static canvasToClient(plotPoint, plot): Point
Convert plot coordinates to global coordinates
AbstractTextEditor.canvasToClient
▸ Static clientToCanvas(nativeEvent, plot): Point
Convert global coordinates to plot coordinates
| Name | Type | Description |
|---|---|---|
nativeEvent | Event | native browser event |
plot | Plot | plot with canvas |
AbstractTextEditor.clientToCanvas
▸ Static getClassName(): string
string
AbstractTextEditor.getClassName
▸ Static getExclusiveTool(plot): AbstractTool
return exclusive tool associated with plot
| Name | Type | Description |
|---|---|---|
plot | Plot | plot |
tool
AbstractTextEditor.getExclusiveTool
▸ Static getNativeEventName(eventName): string[]
Returns native event name
| Name | Type | Description |
|---|---|---|
eventName | string | W3C Pointer Events Recommendation name |
string[]
AbstractTextEditor.getNativeEventName
▸ Static isTouchEvent(eventArgs): eventArgs is TouchEvent
return true if the event is a touch event and false otherwise.
| Name | Type | Description |
|---|---|---|
eventArgs | Event | EventArgs | contains info of the event |
eventArgs is TouchEvent
AbstractTextEditor.isTouchEvent
▸ Static lock(plot, tool): void
Set exclusive tool for plot
| Name | Type | Description |
|---|---|---|
plot | Plot | plot |
tool | AbstractTool | tool |
void
▸ Static setDefaultMouseRadius(radius): void
Sets default device radius for mouse events
| Name | Type | Description |
|---|---|---|
radius | number | radius for mouse events |
void
AbstractTextEditor.setDefaultMouseRadius
▸ Static setDefaultTouchRadius(radius): void
Sets default device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
void
AbstractTextEditor.setDefaultTouchRadius
▸ Static unlock(value): void
Remove exclusive tool from plot
| Name | Type | Description |
|---|---|---|
value | AbstractTool | Plot | value |
void