API / geotoolkit / controls / tools / editors / Polyline / Polyline
Polyline editor can be used to create and modify Polyline shapes
AbstractPointSetEditor<Polyline>↳
Polyline
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 | Options | Preview path properties (@see |
preview | Options | Preview path properties (@see |
preview | Options | Preview path properties (@see |
preview | Options | Preview path properties (@see |
preview-bounds | Rect | Bounds |
preview-geometry | GraphicsPath | Geometry the path |
touchradius | number | Device radius for touch events |
Constructors
• new Polyline(options?)
| Name | Type | Description |
|---|---|---|
Optional options | Options | editor options |
AbstractPointSetEditor<PolylineShape&gt;.constructor
Methods
▸ addListener(eventName, listener): Polyline
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 |
AbstractPointSetEditor.addListener
▸ addPointAt(index, eventArgs?): Polyline
Start to add joint point at specified node index (can be 0 or end index)
| Name | Type | Description |
|---|---|---|
index | number | start or end polyline index |
Optional eventArgs | Event | EventArgs | event args |
this
▸ apply(command): Polyline
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
AbstractPointSetEditor.canInsert
▸ canRedo(): boolean
Checks if there is command in history to redo
boolean
AbstractPointSetEditor.canRedo
▸ canUndo(): boolean
Checks if there is command in history to undo
boolean
AbstractPointSetEditor.canUndo
▸ 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
AbstractPointSetEditor.captureMouseUp
▸ changeNodeOrder(order, anchor?): Polyline
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
AbstractPointSetEditor.changeNodeOrder
▸ close(): Polygon
Convert active shape to Polygon
▸ Protected createGhost(): Node
Creates a clone of the current node
AbstractPointSetEditor.createGhost
▸ deleteNode(trash?, shape?): Polyline
Delete node or array of nodes to specified trash container
| Name | Type |
|---|---|
Optional trash | CompositeNode<Node> |
Optional shape | Node | Node[] |
this
AbstractPointSetEditor.deleteNode
▸ deletePointAt(index): Polyline
Delete joint point at specified index
| Name | Type | Description |
|---|---|---|
index | number | joint point index |
this
AbstractPointSetEditor.deletePointAt
▸ dispose(): void
Dispose tool.
void
AbstractPointSetEditor.dispose
▸ 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
AbstractPointSetEditor.fireEvent
▸ flipNodeOrientation(flipX, flipY): Polyline
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
AbstractPointSetEditor.flipNodeOrientation
▸ getActiveHandle(): number
Returns active handle index
number
active handle index if any
AbstractPointSetEditor.getActiveHandle
▸ getActiveNode(): Node
Returns the ghost if ghost mode is enabled and initialized and the original node otherwise
AbstractPointSetEditor.getActiveNode
▸ Protected getActivePlot(): Plot
Gets an active plot
AbstractPointSetEditor.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 |
AbstractPointSetEditor.getBboxHandle
▸ getBounds(): Rect
Returns bounds for the bounding box elements
AbstractPointSetEditor.getBounds
▸ getClassName(): string
string
AbstractPointSetEditor.getClassName
▸ Protected getDataLayer(): Node
Gets the edited nodes' parent layer
AbstractPointSetEditor.getDataLayer
▸ getDeviceTransform(): Transformation
Returns current node-to-device transformation
AbstractPointSetEditor.getDeviceTransform
▸ getEditMode(): EditMode
Returns current edit mode
AbstractPointSetEditor.getEditMode
▸ Protected getEventRadius(eventArgs): number
Returns device radius for the provided event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | contains info of the event |
number
AbstractPointSetEditor.getEventRadius
▸ Protected getGhost(): Node
Returns the ghost registered with this editor. If ghost does not exist, returns null
AbstractPointSetEditor.getGhost
▸ getHandlesGroup(): Group<Node>
Returns handles group
AbstractPointSetEditor.getHandlesGroup
▸ getHistory(): History
Returns current history
AbstractPointSetEditor.getHistory
▸ Protected getLocalTransform(): Transformation
Returns current node local transformation
AbstractPointSetEditor.getLocalTransform
▸ getManipulatorLayer(): CompositeNode<Node>
return manipulator layer
layer
AbstractPointSetEditor.getManipulatorLayer
▸ getMouseRadius(): number
Returns current device radius for mouse events
number
AbstractPointSetEditor.getMouseRadius
▸ getName(): string
return tool name if any
string
name of the tool
AbstractPointSetEditor.getName
▸ getNode(): Polyline
Returns current node
AbstractPointSetEditor.getNode
▸ getParentTool(): AbstractCompositeTool
Gets parent tool
parent tool
AbstractPointSetEditor.getParentTool
▸ getProperties(): OptionsOut
Returns properties to the editing elements
editor properties
AbstractPointSetEditor.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
AbstractPointSetEditor.getProperty
▸ getPropertyKeys(): string[]
Returns known properties keys
string[]
AbstractPointSetEditor.getPropertyKeys
▸ getRoot(): AbstractCompositeTool
Gets root tool
parent tool
AbstractPointSetEditor.getRoot
▸ getTouchRadius(): number
Returns current device radius for touch events
number
AbstractPointSetEditor.getTouchRadius
▸ Protected getVisible(): boolean
Gets the edited node visibility state
boolean
AbstractPointSetEditor.getVisible
▸ 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
AbstractPointSetEditor.hasEventListener
▸ Protected initialize(options): void
void
AbstractPointSetEditor.initialize
▸ isActive(): boolean
return active state
boolean
AbstractPointSetEditor.isActive
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
AbstractPointSetEditor.isDisposed
▸ 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
AbstractPointSetEditor.isDoubleClick
▸ isEnabled(): boolean
returns enable state
boolean
state
AbstractPointSetEditor.isEnabled
▸ isEndHandle(handle): boolean
Checks if current node handle should end node creation
| Name | Type | Description |
|---|---|---|
handle | number | node handle index that was clicked |
boolean
AbstractPointSetEditor.isEndHandle
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
AbstractPointSetEditor.isSilent
▸ isStarted(): boolean
Tests if editing was started (editor is active and at least one command was applied)
boolean
AbstractPointSetEditor.isStarted
▸ Protected isSupported(options): boolean
Checks if editor supports the options provided
| Name | Type | Description |
|---|---|---|
options | Record<string, any> | editor options |
boolean
AbstractPointSetEditor.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
AbstractPointSetEditor.isTouchEvent
▸ notify<E>(type, source, args?): Polyline
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | AbstractEditorBase<Polyline> | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): Polyline
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: Polyline, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): Polyline
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: Polyline, args: EventMap[E]) => void | to be called |
▸ Protected onActiveStateChanged(): void
Fires
void
AbstractPointSetEditor.onActiveStateChanged
▸ Protected onBeforeCommandApplied(command): void
Fires the EditEvents.BeforeCommandApplied event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractPointSetEditor.onBeforeCommandApplied
▸ Protected onCommandApplied(command): void
Fires the EditEvents.CommandApplied and the command.getEventName() events
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | command applied |
void
AbstractPointSetEditor.onCommandApplied
▸ Protected onCommandApplying(command): void
Fires the EditEvents.CommandApplying event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractPointSetEditor.onCommandApplying
▸ Protected onCommandRedo(command): void
Fires the EditEvents.Redo event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractPointSetEditor.onCommandRedo
▸ Protected onCommandUndo(command): void
Fires the EditEvents.Undo event
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command applied |
void
AbstractPointSetEditor.onCommandUndo
▸ Protected onDoubleClick(eventArgs): void
Handles mouse double click event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractPointSetEditor.onDoubleClick
▸ Protected onEnabledStateChanged(): void
Fires
void
AbstractPointSetEditor.onEnabledStateChanged
▸ Protected onKeyDown(eventArgs): void
Handles key down event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractPointSetEditor.onKeyDown
▸ Protected onKeyUp(eventArgs): void
Handles key up event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractPointSetEditor.onKeyUp
▸ Protected onLeave(eventArgs): void
Handles mouse leave event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractPointSetEditor.onLeave
▸ Protected onMouseDown(eventArgs): void
Handles mouse down event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractPointSetEditor.onMouseDown
▸ Protected onMouseMove(eventArgs): void
Handles mouse move event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractPointSetEditor.onMouseMove
▸ Protected onMouseUp(eventArgs): void
Handles mouse up event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractPointSetEditor.onMouseUp
▸ Protected onNodeCreated(node, eventArgs?): void
Fires the EditEvents.End event
void
AbstractPointSetEditor.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 |
AbstractPointSetEditor.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. |
AbstractPointSetEditor.pointToModel
▸ Protected push(command): Polyline
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(): Polyline
Reapplies last canceled command in history (if possible)
this
▸ removeListener(eventName, listener?): Polyline
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 |
AbstractPointSetEditor.removeListener
▸ Protected resetNode(unlink?): Polyline
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
AbstractPointSetEditor.resetNode
▸ Protected resetNodeToGhost(): Polyline
Resets the current node to its ghost state
AbstractPointSetEditor.resetNodeToGhost
▸ Protected rotateNode(node, angle, hint?): boolean
| Name | Type |
|---|---|
node | Node |
angle | number |
Optional hint | any |
boolean
AbstractPointSetEditor.rotateNode
▸ setActive(active): Polyline
set active state
Fires
| Name | Type | Description |
|---|---|---|
active | boolean | set active state |
AbstractPointSetEditor.setActive
▸ setActiveHandle(handle): Polyline
Set active handle index
| Name | Type | Description |
|---|---|---|
handle | number | active handle index |
this
AbstractPointSetEditor.setActiveHandle
▸ Protected setCoordinates(node, x, y): Polyline
Sets coordinates to the specified point set
| Name | Type | Description |
|---|---|---|
node | Node | the point set |
x | number[] | the x-coordinates array |
y | number[] | the y-coordinates array |
AbstractPointSetEditor.setCoordinates
▸ setEditMode(mode): Polyline
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
AbstractPointSetEditor.setEditMode
▸ setEnabled(enabled): Polyline
set enable state
Fires
Fires
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets the enabled state |
this
AbstractPointSetEditor.setEnabled
▸ setMouseRadius(radius): Polyline
Sets device radius for mouse events
| Name | Type | Description |
|---|---|---|
radius | number | radius for mouse events |
this
AbstractPointSetEditor.setMouseRadius
▸ setName(name): Polyline
set tool name
| Name | Type | Description |
|---|---|---|
name | string | the tool name |
AbstractPointSetEditor.setName
▸ Protected setNode(node): Polyline
Sets node to edit
| Name | Type | Description |
|---|---|---|
node | Polyline | node to edit |
this
AbstractPointSetEditor.setNode
▸ Protected setNodeBounds(node, p1, p2, hint?): boolean
boolean
AbstractPointSetEditor.setNodeBounds
▸ setProperties(properties?): Polyline
Sets properties to the editing elements
| Name | Type | Description |
|---|---|---|
Optional properties | Options | editor properties |
this
AbstractPointSetEditor.setProperties
▸ setProperty(name, value): Polyline
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
AbstractPointSetEditor.setProperty
▸ setSilent(bool): Polyline
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
AbstractPointSetEditor.setSilent
▸ setSlotEnabled(eventName, value, target?): Polyline
Sets slot enabled
| Name | Type | Description |
|---|---|---|
eventName | string | eventName |
value | boolean | value |
Optional target | EventTarget | target |
AbstractPointSetEditor.setSlotEnabled
▸ setSlots(slots?, merge?): Polyline
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
AbstractPointSetEditor.setSlots
▸ setTouchRadius(radius): Polyline
Sets device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
this
AbstractPointSetEditor.setTouchRadius
▸ Protected start(eventArgs?): Polyline
start
| Name | Type | Description |
|---|---|---|
Optional eventArgs | EventArgs | event args |
▸ Protected stop(): Polyline
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
AbstractPointSetEditor.swapActiveHandles
▸ toggle(): Polyline
switch enable state to opposite state
▸ Protected transformNode(node, tr, hint?): boolean
| Name | Type |
|---|---|
node | Node |
tr | Transformation |
Optional hint | any |
boolean
AbstractPointSetEditor.transformNode
▸ Protected translateNode(node, x, y, hint?): boolean
| Name | Type |
|---|---|
node | Node |
x | number |
y | number |
Optional hint | any |
boolean
AbstractPointSetEditor.translateNode
▸ undo(): Polyline
Cancels last command in history (if possible)
this
▸ update(): Polyline
Forces editing shapes and handles to be updated
this
▸ Protected updateBrowserCursor(eventArgs, cursor?): void
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
Optional cursor | string | browser cursor to set |
void
AbstractPointSetEditor.updateBrowserCursor
▸ updateHandles(): Polyline
Forces editing handles to be updated
this
AbstractPointSetEditor.updateHandles
▸ Protected updateNodePosition(): void
Updates active node's position if scene transformation was changed but pointer position wasn't
void
AbstractPointSetEditor.updateNodePosition
▸ Static canvasToClient(plotPoint, plot): Point
Convert plot coordinates to global coordinates
AbstractPointSetEditor.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 |
AbstractPointSetEditor.clientToCanvas
▸ Static getClassName(): string
string
AbstractPointSetEditor.getClassName
▸ Static getExclusiveTool(plot): AbstractTool
return exclusive tool associated with plot
| Name | Type | Description |
|---|---|---|
plot | Plot | plot |
tool
AbstractPointSetEditor.getExclusiveTool
▸ Static getNativeEventName(eventName): string[]
Returns native event name
| Name | Type | Description |
|---|---|---|
eventName | string | W3C Pointer Events Recommendation name |
string[]
AbstractPointSetEditor.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
AbstractPointSetEditor.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
AbstractPointSetEditor.setDefaultMouseRadius
▸ Static setDefaultTouchRadius(radius): void
Sets default device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
void
AbstractPointSetEditor.setDefaultTouchRadius
▸ Static unlock(value): void
Remove exclusive tool from plot
| Name | Type | Description |
|---|---|---|
value | AbstractTool | Plot | value |
void