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