API / geotoolkit / controls / tools / PolylineSelection / PolylineSelection
tools.PolylineSelection.PolylineSelection
PolylineSelection <br> <br> <h5>Events Events</h5> <table class="params"> <thead> <tr> <th>Event</th><th>Arguments</th><th>Description</th> </tr> </thead> <tbody> <tr> <td>onSelectionEnd</td> <td>PolylineSelectionEventArgs</td> <td>This Event is fired when the Selection Tool select a visual. (similar to Selection.Events.onPick)</td> </tr> <tr> <td>onSelectionChanged</td> <td>PolylineSelectionEventArgs</td> <td>This Event is fired when the Selection Tool select a visual and it is different from previous selection.</td> </tr> <tr> <td>beforeSelectionChange</td> <td>PolylineSelectionEventArgs</td> <td>This Event is fired before the Selection Tool select a visual and it is different from previous selection.</td> </tr> <tbody> </table> <br>
Tool name: 'polyline-selection'
↳
PolylineSelection
Constructors
- [new PolylineSelection(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tools.polylineselection.polylineselection.md#new polylineselection(options))
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
editmode | EditMode | Paint editor editing mode to determine which elements/features are allowed |
editor | Options | The extra editor properties to be provided for every new editor (see |
editor-enabled | boolean | Enabled state |
editor-layer | CompositeNode | Manipulator layer |
editor-layer-clipping | boolean | Enable clipping, this does not consider the clipstyle, it is related to bounds-clipping |
editor-layer-clipstyle | ClipStyle | Clipping style |
editor-layer-clipstyle-evenodd | boolean | True if evenodd mode is on ('nonzero' mode otherwise) |
editor-layer-clipstyle-geometry | GraphicsPath | Clipping geometry |
editor-layer-clipstyle-geometry-bounds | Rect | Bounds |
editor-layer-clipstyle-geometry-bounds-height | number | Height |
editor-layer-clipstyle-geometry-bounds-readonly | boolean | Readonly |
editor-layer-clipstyle-geometry-bounds-width | number | Width |
editor-layer-clipstyle-geometry-bounds-x | number | Left |
editor-layer-clipstyle-geometry-bounds-y | number | Top |
editor-layer-clipstyle | GraphicsPath | Clipping style |
editor-layer-cssclass | string | The css class name of this node |
editor-layer-csscursor | string | CSS cursor associated with node |
editor-layer-cssstyle | string | CSS style to be applied to inserted elements |
editor-layer-id | string | number | Id of the node, its a unique identifier |
editor-layer-infinity | boolean | Mode to render outside the model limits |
editor-layer-localtransform | Transformation | Local transformation |
editor-layer-localtransform-dx | number | X axis translation |
editor-layer-localtransform-dy | number | Y axis translation |
editor-layer-localtransform-xx | number | X scale |
editor-layer-localtransform-xy | number | Xy skew |
editor-layer-localtransform-yx | number | Yx skew |
editor-layer-localtransform-yy | number | Y scale |
editor-layer-margins | number | string | It has properties for specifying the margins for each side |
editor-layer-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
editor-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 |
editor-layer-opacityblendmode | BlendMode | Node opacity mode to blend it |
editor-layer-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
editor-layer-scalescrollstrategy-enabled | boolean | Enable flag |
editor-layer-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
editor-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 |
editor-layer-transform | string | Additional CSS transformation applied to node or 'none' |
editor-layer-transform | Transformation | Additional CSS transformation applied to node or 'none' |
editor-layer-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
editor-layer-z-index | number | Define node z-index |
editor-mouseradius | number | Device radius for mouse events |
editor-name | string | Name of the tool used like cross-hair etc |
editor-touchradius | number | Device radius for touch events |
editor | Options | The extra editor properties to be provided for every new editor (see |
editor-bbox | Path | Bounding box path to draw bounding rectangle OR bounding box path properties (see |
editor-bbox-bounds | Rect | Bounds |
editor-bbox-clipstyle | ClipStyle | Clipping style |
editor-bbox-clipstyle | GraphicsPath | Clipping style |
editor-bbox-cssclass | string | The css class name of this node |
editor-bbox-csscursor | string | CSS cursor associated with node |
editor-bbox-cssstyle | string | CSS style to be applied to inserted elements |
editor-bbox-fillstyle | string | Style applied on fill |
editor-bbox-fillstyle | FillStyle | Style applied on fill |
editor-bbox-fillstyle-color | string | Color in CSS form |
editor-bbox-fillstyle-evenoddmode | boolean | Even-odd fill mode |
editor-bbox-fillstyle-fillpattern | Pattern | Pattern |
editor-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 |
editor-bbox-fillstyle-fillpattern-patternname | string | Name of this pattern for indexing |
editor-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) |
editor-bbox-fillstyle-foreground | string | Foreground color |
editor-bbox-fillstyle-pattern | Pattern | Pattern |
editor-bbox-geometry | GraphicsPath | Geometry the path |
editor-bbox-id | string | number | Id of the node, its a unique identifier |
editor-bbox-linestyle | string | Style applied on outline |
editor-bbox-linestyle | LineStyle | Style applied on outline |
editor-bbox-linestyle-color | string | Color in CSS form |
editor-bbox-linestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
editor-bbox-linestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
editor-bbox-linestyle-linecap | CapStyle | The line cap style |
editor-bbox-linestyle-linedashoffset | number | Line dash offset of dashed line |
editor-bbox-linestyle-linejoin | JoinStyle | The line join style |
editor-bbox-linestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
editor-bbox-linestyle-scalable | boolean | True if width should depend on transformation |
editor-bbox-linestyle-unit | string | Optional unit for the width |
editor-bbox-linestyle-width | number | string | The line thickness |
editor-bbox-localtransform | Transformation | Local transformation |
editor-bbox-margins | number | string | It has properties for specifying the margins for each side |
editor-bbox-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
editor-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 |
editor-bbox-opacityblendmode | BlendMode | Node opacity mode to blend it |
editor-bbox-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
editor-bbox-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
editor-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 |
editor-bbox-transform | string | Additional CSS transformation applied to node or 'none' |
editor-bbox-transform | Transformation | Additional CSS transformation applied to node or 'none' |
editor-bbox-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
editor-bbox-z-index | number | Define node z-index |
editor-editmode | EditMode | Node edit mode |
editor-ghost | Options | Options for |
editor-ghost-cssclass | string | The css class name of this node |
editor-ghost-id | string | number | Id of the node, its a unique identifier |
editor-ghost-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
editor-ghost-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
editor-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 |
editor-ghost-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
editor-ghost-z-index | number | Define node z-index |
editor-ghost | GhostOptions | Options for |
editor-ghost-fillstyle | string | Ghost fill style |
editor-ghost-fillstyle | FillStyle | Ghost fill style |
editor-ghost-linestyle | string | Ghost line style |
editor-ghost-linestyle | LineStyle | Ghost line style |
editor-ghost-opacity | number | Ghost opacity from 0 to 1 |
editor-handles | HandlesOptions | Handles properties |
editor-handles-bbox | Options | Bbox resize handles properties (see |
editor-handles-bbox | Options | Bbox resize handles properties (see |
editor-handles-bbox-clipstyle | ClipStyle | Clipping style |
editor-handles-bbox-clipstyle | GraphicsPath | Clipping style |
editor-handles-bbox-csscursor | string | CSS cursor associated with node |
editor-handles-bbox-cssstyle | string | CSS style to be applied to inserted elements |
editor-handles-bbox-localtransform | Transformation | Local transformation |
editor-handles-bbox-margins | number | string | It has properties for specifying the margins for each side |
editor-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 |
editor-handles-bbox-opacityblendmode | BlendMode | Node opacity mode to blend it |
editor-handles-bbox-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
editor-handles-bbox-transform | string | Additional CSS transformation applied to node or 'none' |
editor-handles-bbox-transform | Transformation | Additional CSS transformation applied to node or 'none' |
editor-handles-bbox | Options | Bbox resize handles properties (see |
editor-handles-bbox-fillstyle | string | Style applied on fill |
editor-handles-bbox-fillstyle | FillStyle | Style applied on fill |
editor-handles-bbox-linestyle | string | Style applied on outline |
editor-handles-bbox-linestyle | LineStyle | Style applied on outline |
editor-handles-bbox | Options | Bbox resize handles properties (see |
editor-handles-bbox-alignment | AnchorType | Alignment according to the anchor point |
editor-handles-bbox-ax | number | Anchor x position |
editor-handles-bbox-ay | number | Anchor y position |
editor-handles-bbox-height | number | Shape height |
editor-handles-bbox-ispointingup | boolean | Defines whether the shape is always pointing up |
editor-handles-bbox-layoutstyle | LayoutStyle | Layout style to specify how to lay out shape |
editor-handles-bbox-layoutstyle-constraint | SizeConstraint | Layout constrains |
editor-handles-bbox-layoutstyle-flexgrow | number | Number specifying how much the item will grow relative to the rest of the items inside the same container |
editor-handles-bbox-layoutstyle-flexshrink | number | Number specifying how much the item will shrink relative to the rest of the items inside the same container |
editor-handles-bbox-layoutstyle-float | string | Float position |
editor-handles-bbox-layoutstyle-position | string | Layout position |
editor-handles-bbox-layoutstyle-size | number | string | Layout size |
editor-handles-bbox-maxdimension | Dimension | Maximum size for rendering |
editor-handles-bbox-maxdimension-height | number | Height of dimension |
editor-handles-bbox-maxdimension-width | number | Width of dimension or properties |
editor-handles-bbox-mindimension | Dimension | Minimum size for rendering |
editor-handles-bbox-preserveaspectratio | boolean | Preserve aspect ratio of the anchored shape |
editor-handles-bbox-preservereadingorientation | boolean | Preserve reading orientation for local transform |
editor-handles-bbox-preserverightangle | boolean | Preserve right angle for local transformation |
editor-handles-bbox-rotationangle | number | Rotation angle at anchor |
editor-handles-bbox-sizeisindevicespace | boolean | Is coordinate in device space |
editor-handles-bbox-useminmaxdimensions | boolean | Use the min max dimensions to limit visual size |
editor-handles-bbox-width | number | Shape width |
editor-handles-bbox | Options | Bbox resize handles properties (see |
editor-handles-bbox-alignment | AnchorType | Anchor type of symbol |
editor-handles-bbox-cache | boolean | Set it to true if you want to cache complex geometry to raster |
editor-handles-bbox-painter | string | A function with has parameters: symbol, box, context |
editor-handles-bbox-painterproperties | any | Symbol's painter's properties |
editor-handles-rotation | Options | Rotation handle properties (see |
editor-handles-rotation | Options | Rotation handle properties (see |
editor-handles-rotation | Options | Rotation handle properties (see |
editor-handles-rotation | Options | Rotation handle properties (see |
editor-handles-rotation | Options | Rotation handle properties (see |
enabled | boolean | Enabled state |
layer | CompositeNode | Manipulator layer |
mode | PaintMode | Paint mode to determine which shape is currently creating |
mouseradius | number | Device radius for mouse events |
name | string | Name of the tool used like cross-hair etc |
node | Options | Options to be applied to the new shapes |
touchradius | number | Device radius for touch events |
Constructors
• new PolylineSelection(options?)
| Name | Type | Description |
|---|---|---|
Optional options | CompositeNode<Node> | Options | used to display temporary shapes or tool options |
AbstractShapeSelection.constructor
Methods
▸ addListener(eventName, listener): PolylineSelection
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 |
AbstractShapeSelection.addListener
▸ canRedo(): boolean
Checks if there is command in history to redo
boolean
AbstractShapeSelection.canRedo
▸ canUndo(): boolean
Checks if there is command in history to undo
boolean
AbstractShapeSelection.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
AbstractShapeSelection.captureMouseUp
▸ clear(): PolylineSelection
Clears scene from all the painting elements
this
▸ Protected createEditor(options): AbstractEditorBase<Node | Node[]>
Returns editor to edit node with provided options
Throws
if supported editor was not found and default editor was not set
| Name | Type | Description |
|---|---|---|
options | Record<string, any> | editor options |
AbstractEditorBase<Node | Node[]>
AbstractShapeSelection.createEditor
▸ Protected createShapeSelectionEventArgs(eventArgs, selection, coordinates): PolylineSelectionEventArgs
| Name | Type |
|---|---|
eventArgs | EventArgs |
selection | (Node | SelectedItem<any>)[] |
coordinates | Object |
coordinates.x | number[] |
coordinates.y | number[] |
AbstractShapeSelection.createShapeSelectionEventArgs
▸ dispose(): void
Dispose tool.
void
AbstractShapeSelection.dispose
▸ editNode(node): PolylineSelection
Starts editing the node provided
this
AbstractShapeSelection.editNode
▸ execute(command): PolylineSelection
Applies the specified command to the associated node and appends it to history
| Name | Type | Description |
|---|---|---|
command | AbstractCommand | the command to execute |
AbstractShapeSelection.execute
▸ 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
AbstractShapeSelection.fireEvent
▸ getActiveShape(): Node
Returns currently edited shape. Relevant for EditMode.Ghost mode.
AbstractShapeSelection.getActiveShape
▸ getAllowIntersection(): boolean
Get allow intersection
boolean
will this select items that intersect
AbstractShapeSelection.getAllowIntersection
▸ getClassName(): string
string
AbstractShapeSelection.getClassName
▸ getEditMode(): EditMode
Returns tool current edit mode
AbstractShapeSelection.getEditMode
▸ getEditor(): Polyline
Returns current editor tool (if exists)
AbstractShapeSelection.getEditor
▸ getEvenOddMode(): boolean
Get even odd mode
boolean
will this use even odd mode or not
AbstractShapeSelection.getEvenOddMode
▸ Protected getEventRadius(eventArgs): number
Returns device radius for the provided event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | contains info of the event |
number
AbstractShapeSelection.getEventRadius
▸ getFillStyle(): FillStyle
Return fill style
fill style
AbstractShapeSelection.getFillStyle
▸ getHistory(): History
Returns current history
AbstractShapeSelection.getHistory
▸ getLineStyle(): LineStyle
Return line style
line style
AbstractShapeSelection.getLineStyle
▸ getManipulatorLayer(): CompositeNode<Node>
return manipulator layer
CompositeNode<Node>
layer
AbstractShapeSelection.getManipulatorLayer
▸ getMode(): PaintMode
Returns current painting mode
AbstractShapeSelection.getMode
▸ getMouseRadius(): number
Returns current device radius for mouse events
number
AbstractShapeSelection.getMouseRadius
▸ getName(): string
return tool name if any
string
name of the tool
AbstractShapeSelection.getName
▸ getParentTool(): AbstractCompositeTool
Gets parent tool
parent tool
AbstractShapeSelection.getParentTool
▸ getProperties(): OptionsOut
Returns all properties
tool options
AbstractShapeSelection.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
AbstractShapeSelection.getProperty
▸ getPropertyKeys(): string[]
Returns known properties keys
string[]
AbstractShapeSelection.getPropertyKeys
▸ Protected getRegistry(): Registry
AbstractShapeSelection.getRegistry
▸ getRoot(): AbstractCompositeTool
Gets root tool
parent tool
AbstractShapeSelection.getRoot
▸ getSelection(): (Node | SelectedItem<any>)[]
gets the currently selected items
(Node | SelectedItem<any>)[]
AbstractShapeSelection.getSelection
▸ getShape(): Polyline
Returns the origin of currently edited shape (if exists, null otherwise).
AbstractShapeSelection.getShape
▸ getTouchRadius(): number
Returns current device radius for touch events
number
AbstractShapeSelection.getTouchRadius
▸ 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
AbstractShapeSelection.hasEventListener
▸ isActive(): boolean
return active state
boolean
AbstractShapeSelection.isActive
▸ isAutoDisabled(): boolean
Get auto-disabled mode
boolean
does the selection automatically disable itself on selection changed
AbstractShapeSelection.isAutoDisabled
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
AbstractShapeSelection.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
AbstractShapeSelection.isDoubleClick
▸ isEnabled(): boolean
returns enable state
boolean
state
AbstractShapeSelection.isEnabled
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
AbstractShapeSelection.isSilent
▸ 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
AbstractShapeSelection.isTouchEvent
▸ notify<E>(type, source, args?): PolylineSelection
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | PolylineSelection | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): PolylineSelection
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: PolylineSelection, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): PolylineSelection
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 & {
[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: PolylineSelection, args: EventMap[E]) => void | to be called |
▸ Protected onActiveStateChanged(): void
Fires
void
AbstractShapeSelection.onActiveStateChanged
▸ Protected onBeforeCommandApplying(eventName, history, command): void
Fires the EditEvents.BeforeCommandApplied event
| Name | Type | Description |
|---|---|---|
eventName | EditEvents | the event name |
history | History | the source history |
command | AbstractCommand | the command applied |
void
AbstractShapeSelection.onBeforeCommandApplying
▸ Protected onCommandApplied(eventName, history, command): void
Fires the EditEvents.CommandApplied event and the event according to the command event name
| Name | Type | Description |
|---|---|---|
eventName | EditEvents | the event name |
history | History | the source history |
command | AbstractCommand | the command applied |
void
AbstractShapeSelection.onCommandApplied
▸ Protected onCommandApplying(eventName, history, command): void
Fires the EditEvents.CommandApplying event
| Name | Type | Description |
|---|---|---|
eventName | EditEvents | the event name |
history | History | the source history |
command | AbstractCommand | the command applied |
void
AbstractShapeSelection.onCommandApplying
▸ Protected onCommandRedo(eventName, history, command): void
Fires the EditEvents.Redo event
| Name | Type | Description |
|---|---|---|
eventName | EditEvents | the event name |
history | History | the source history |
command | AbstractCommand | the command |
void
AbstractShapeSelection.onCommandRedo
▸ Protected onCommandUndo(eventName, history, command): void
Fires the EditEvents.Undo event
| Name | Type | Description |
|---|---|---|
eventName | EditEvents | the event name |
history | History | the source history |
command | AbstractCommand | the command |
void
AbstractShapeSelection.onCommandUndo
▸ Protected onEnabledStateChanged(): void
Fires
void
AbstractShapeSelection.onEnabledStateChanged
▸ Protected onKeyDown(eventArgs): void
Handles key down event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractShapeSelection.onKeyDown
▸ Protected onKeyUp(eventArgs): void
Handles key up event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractShapeSelection.onKeyUp
▸ Protected onMouseDown(eventArgs): void
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractShapeSelection.onMouseDown
▸ Protected onMouseMove(eventArgs): void
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractShapeSelection.onMouseMove
▸ Protected onMouseUp(eventArgs): void
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | event args |
void
AbstractShapeSelection.onMouseUp
▸ Protected onNodeCreated(editor, eventArgs): void
Node created handler
| Name | Type | Description |
|---|---|---|
editor | AbstractEditorBase<Node | Node[]> | editor that created node |
eventArgs | PaintEventArgs | event args |
void
AbstractShapeSelection.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 |
AbstractShapeSelection.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. |
AbstractShapeSelection.pointToModel
▸ redo(): PolylineSelection
Reapplies last canceled command in history (if possible)
▸ removeListener(eventName, listener?): PolylineSelection
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 |
AbstractShapeSelection.removeListener
▸ Protected selection(root, x, y, eventArgs): PolylineSelection
starts the selection process
| Name | Type | Description |
|---|---|---|
root | Node | root node to select from |
x | number[] | x-coordinates |
y | number[] | y-coordinates |
eventArgs | PaintEventArgs | event args |
this
AbstractShapeSelection.selection
▸ setActive(active): PolylineSelection
set active state
Fires
| Name | Type | Description |
|---|---|---|
active | boolean | set active state |
AbstractShapeSelection.setActive
▸ setAllowIntersection(mode): PolylineSelection
Set allow intersection
| Name | Type | Description |
|---|---|---|
mode | boolean | will this select items that intersect |
this
AbstractShapeSelection.setAllowIntersection
▸ setAutoDisabled(mode): PolylineSelection
Set auto-disabled mode
| Name | Type | Description |
|---|---|---|
mode | boolean | does the selection automatically disable itself on selection changed |
this
AbstractShapeSelection.setAutoDisabled
▸ setEditMode(mode): PolylineSelection
Sets tool edit mode (for nodes with node manipulators)
| Name | Type | Description |
|---|---|---|
mode | EditMode | edit mode |
this
AbstractShapeSelection.setEditMode
▸ Protected setEditor(editor): PolylineSelection
Sets a new editor
Throws
Error if editor is not instance of Polyline
| Name | Type | Description |
|---|---|---|
editor | AbstractEditorBase<Node | Node[]> | the editor |
AbstractShapeSelection.setEditor
▸ setEnabled(enabled): PolylineSelection
set enable state
Fires
Fires
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets the enabled state |
this
AbstractShapeSelection.setEnabled
▸ setEvenOddMode(mode): PolylineSelection
Set even odd mode
| Name | Type | Description |
|---|---|---|
mode | boolean | even odd mode |
this
AbstractShapeSelection.setEvenOddMode
▸ setFillStyle(fillStyle, merge?): PolylineSelection
Sets fill style
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a new fill style |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
this
AbstractShapeSelection.setFillStyle
▸ setLineStyle(fillStyle, merge?): PolylineSelection
Sets line style
| Name | Type | Description |
|---|---|---|
fillStyle | Type | |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
AbstractShapeSelection.setLineStyle
▸ setMode(mode): PolylineSelection
Sets painting mode
| Name | Type | Description |
|---|---|---|
mode | PaintMode | painting mode |
AbstractShapeSelection.setMode
▸ setMouseRadius(radius): PolylineSelection
Sets device radius for mouse events
| Name | Type | Description |
|---|---|---|
radius | number | radius for mouse events |
this
AbstractShapeSelection.setMouseRadius
▸ setName(name): PolylineSelection
set tool name
| Name | Type | Description |
|---|---|---|
name | string | the tool name |
AbstractShapeSelection.setName
▸ setNodeFilter(filter): PolylineSelection
set filter handler
| Name | Type | Description |
|---|---|---|
filter | NodeFilterCallback | This allows to filter selected nodes. |
this
AbstractShapeSelection.setNodeFilter
▸ setProperties(props?): PolylineSelection
Sets paint tool properties (mode, styles, etc.)
| Name | Type | Description |
|---|---|---|
Optional props | Options | tool props |
this
AbstractShapeSelection.setProperties
▸ setProperty(name, value): PolylineSelection
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
AbstractShapeSelection.setProperty
▸ setSilent(bool): PolylineSelection
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
AbstractShapeSelection.setSilent
▸ setSlotEnabled(eventName, value, target?): PolylineSelection
Sets slot enabled
| Name | Type | Description |
|---|---|---|
eventName | string | eventName |
value | boolean | value |
Optional target | EventTarget | target |
AbstractShapeSelection.setSlotEnabled
▸ setSlots(slots?, merge?): PolylineSelection
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
AbstractShapeSelection.setSlots
▸ setTouchRadius(radius): PolylineSelection
Sets device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
this
AbstractShapeSelection.setTouchRadius
▸ Protected start(eventArgs?): PolylineSelection
start
| Name | Type | Description |
|---|---|---|
Optional eventArgs | EventArgs | event args |
▸ Protected stop(): PolylineSelection
stop
▸ toggle(): PolylineSelection
switch enable state to opposite state
▸ undo(): PolylineSelection
Cancels last command in history (if possible)
▸ update(): PolylineSelection
Forces editing shapes and handles to be updated
this
▸ updateHandles(): PolylineSelection
Forces editing handles to be synchronized with shape
this
AbstractShapeSelection.updateHandles
▸ Static canvasToClient(plotPoint, plot): Point
Convert plot coordinates to global coordinates
AbstractShapeSelection.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 |
AbstractShapeSelection.clientToCanvas
▸ Static getClassName(): string
string
AbstractShapeSelection.getClassName
▸ Static getExclusiveTool(plot): AbstractTool
return exclusive tool associated with plot
| Name | Type | Description |
|---|---|---|
plot | Plot | plot |
tool
AbstractShapeSelection.getExclusiveTool
▸ Static getNativeEventName(eventName): string[]
Returns native event name
| Name | Type | Description |
|---|---|---|
eventName | string | W3C Pointer Events Recommendation name |
string[]
AbstractShapeSelection.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
AbstractShapeSelection.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
AbstractShapeSelection.setDefaultMouseRadius
▸ Static setDefaultTouchRadius(radius): void
Sets default device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
void
AbstractShapeSelection.setDefaultTouchRadius
▸ Static unlock(value): void
Remove exclusive tool from plot
| Name | Type | Description |
|---|---|---|
value | AbstractTool | Plot | value |
void