Last updated

API / geotoolkit / controls / editing / Handle / Handle

Class: Handle

editing.Handle.Handle

Defines a shape to draw a handle. The shape is part of the editor feature that lets a user interact with a shape.
It provides the rendering for the handles that can be grabbed and moved by the user.

Hierarchy

Table of contents

Constructors
[new Handle(params)](/solutions/geotoolkit/apis/classes/geotoolkit.controls.editing.handle.handle.md#new handle(params))[new Handle(x, y, size)](/solutions/geotoolkit/apis/classes/geotoolkit.controls.editing.handle.handle.md#new handle(x, y, size))
Methods
addCssClassaddInvalidateHandlerapplyOpacity
applyResponsiveStylecheckCollisionclone
connectStylecopyConstructorcreateGhost
disconnectStyledisposeenableEventPropagation
executefiltergetActiveFillStyle
getActiveLineStylegetAdaptergetAnchor
getAnimationStylegetClassNamegetClipStyle
getCssgetCssClassgetCssClasses
getCssTransformgetFillStylegetGhost
getGhostFillStylegetGhostLineStylegetHandleSize
getIdgetInactiveFillStylegetInactiveLineStyle
getInvalidateMethodgetLineStylegetLocalTransform
getMarginsStylegetNamegetOpacity
getOpacityBlendModegetOperationInfogetParent
getParentHandlegetPropertiesgetProperty
getPropertyKeysgetRenderingFiltergetResponsiveStyle
getRootgetScaleScrollStrategygetSceneTransform
getTaggetVisiblegetWorldTransform
getZIndexhasCssClasshasEventListener
hasGhostinvalidateinvalidateParent
isActiveisDisposedisEventPropagationEnabled
isGhostisNotificationEnabledisSelectable
isSilentnotifyoff
ononParentChangedonVisibilityChanged
postRenderingpreRenderingregisterAnimationStyle
removeCssClassremoveGhostremoveInvalidateHandler
renderrenderAsyncresetGhost
rotatescalesetActive
setActiveFillStylesetActiveLineStylesetAdapter
setAnchorsetAnimationStylesetClipStyle
setCsssetCssClasssetCssTransform
setFillStylesetGhostFillStylesetGhostLineStyle
setGhostModesetHandleSizesetId
setInactiveFillStylesetInactiveLineStylesetLineStyle
setLocalTransformsetMarginsStylesetName
setNotificationsetOpacitysetOperationInfo
setParentHandlesetPropertiessetProperty
setRenderingFiltersetResponsiveStylesetScaleScrollStrategy
setSelectablesetSilentsetTag
setVisiblesetZIndexshear
toStringtranslateunregisterAnimationStyle
updateSceneTransformationupdateStateupdateTimeStamp
enableSceneGraphNotificationfindParentgetClassName
intersectsBoundsisSceneGraphNotificationEnabled
Css Properties
Name Type Description
activebooleanActive state flag
activefillstylestringFill style of the handle when it is active
activefillstyleFillStyleFill style of the handle when it is active
activefillstyle-colorstringColor in CSS form
activefillstyle-evenoddmodebooleanEven-odd fill mode
activefillstyle-fillpatternPatternPattern
activefillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
activefillstyle-fillpattern-patternnamestringName of this pattern for indexing
activefillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
activefillstyle-foregroundstringForeground color
activefillstyle-patternPatternPattern
activelinestylestringLine style of the handle when it is active
activelinestyleLineStyleLine style of the handle when it is active
activelinestyle-colorstringColor in CSS form
activelinestyle-fillstringOptional fill style to be used to fill lines generated with this style
activelinestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
activelinestyle-linecapCapStyleThe line cap style
activelinestyle-linedashoffsetnumberLine dash offset of dashed line
activelinestyle-linejoinJoinStyleThe line join style
activelinestyle-pixelsnapmodebooleanPixel Snap Mode, default(
activelinestyle-scalablebooleanTrue if width should depend on transformation
activelinestyle-unitstringOptional unit for the width
activelinestyle-widthnumber | stringThe line thickness
clipstyleClipStyleClipping style
clipstyle-evenoddbooleanTrue if evenodd mode is on ('nonzero' mode otherwise)
clipstyle-geometryGraphicsPathClipping geometry
clipstyle-geometry-boundsRectBounds
clipstyle-geometry-bounds-heightnumberHeight
clipstyle-geometry-bounds-readonlybooleanReadonly
clipstyle-geometry-bounds-widthnumberWidth
clipstyle-geometry-bounds-xnumberLeft
clipstyle-geometry-bounds-ynumberTop
clipstyleGraphicsPathClipping style
cssclassstringThe css class name of this node
csscursorstringCSS cursor associated with node
cssstylestringCSS style to be applied to inserted elements
fillstylestringStyle applied on fill
fillstyleFillStyleStyle applied on fill
ghostfillstylestringThe fill style to apply to the ghost
ghostfillstyleFillStyleThe fill style to apply to the ghost
ghostlinestylestringThe line style to apply to the ghost
ghostlinestyleLineStyleThe line style to apply to the ghost
heightnumber
idstring | numberId of the node, its a unique identifier
inactivefillstylestringFill style to apply to handle when it is not active
inactivefillstyleFillStyleFill style to apply to handle when it is not active
inactivelinestylestringLine style to apply to handle when it is not active
inactivelinestyleLineStyleLine style to apply to handle when it is not active
isghostbooleanIs Ghost flag width and height will be set to that number
isindevicespacebooleanFlag defining if the handle is in device space
linestylestringStyle applied on outline
linestyleLineStyleStyle applied on outline
localtransformTransformationLocal transformation
localtransform-dxnumberX axis translation
localtransform-dynumberY axis translation
localtransform-xxnumberX scale
localtransform-xynumberXy skew
localtransform-yxnumberYx skew
localtransform-yynumberY scale
marginsnumber | stringIt has properties for specifying the margins for each side
namestringName of the node. It is often used for debugging purposes or to simplify queries
opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
opacityblendmodeBlendModeNode opacity mode to blend it
operationinfoOperationInfoOperation info contains x, y, width and height as numbers
operationinfo-heightnumber
operationinfo-indexnumber
operationinfo-widthnumber
operationinfo-xnumber
operationinfo-ynumber
painterstringPainter used to draw the handle
scalescrollstrategyScaleScrollStrategyScale scroll strategy
scalescrollstrategy-enabledbooleanEnable flag
selectablebooleanSelectable node, a boolean to determine if selection should consider this node
sizenumberThe two dimensional size of the anchor
sizeDimensionThe two dimensional size of the anchor
size-heightnumberHeight of dimension
size-widthnumberWidth of dimension or properties
taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
transformstringAdditional CSS transformation applied to node or 'none'
transformTransformationAdditional CSS transformation applied to node or 'none'
visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
widthnumber
xnumberX coordinate of handle's anchor
ynumberY coordinate of handle's anchor
z-indexnumberDefine node z-index

Contents

Constructors

new Handle(params)

new Handle(params?)

Anchored handle

Parameters

Name Type Description
Optional paramsOptionsJSON with handle properties

Inherited from

AnchoredHandle.constructor


new Handle(x, y, size)

new Handle(x, y, size?)

Anchored handle

Parameters

Name Type Description
xnumberX coordinate of handle anchor
ynumberY coordinate of handle anchor
Optional sizenumber | DimensionThe two dimensional size of the anchor

Inherited from

AnchoredHandle.constructor

Methods

addCssClass

addCssClass(cssclass): Handle

Adds new css class to node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

Handle

this

Inherited from

AnchoredHandle.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): Handle

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

Handle

this

Inherited from

AnchoredHandle.addInvalidateHandler


applyOpacity

Protected applyOpacity(context): Handle

This method is called to apply opacity if it is specified on the rendering context. The default implementation sets global alpha on the rendering context

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

Handle

this

Inherited from

AnchoredHandle.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

AnchoredHandle.applyResponsiveStyle


checkCollision

checkCollision(context): boolean

Check if this node is within the area being rendered by the context

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if object is inside of renderable area

Inherited from

AnchoredHandle.checkCollision


clone

clone(): Node

All subclasses should override copyConstructor or provide custom implementation for this method

Returns

Node

clone

Inherited from

AnchoredHandle.clone


connectStyle

connectStyle(style, type, callback): Handle

Connects style.

This convenience method subscribes a listener to given style for the specified type.
And automatically un-subscribes listener if node is disposed to prevent memory leaks

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

Handle

this

Inherited from

AnchoredHandle.connectStyle


copyConstructor

copyConstructor(src): Handle

Used for cloning

Parameters

Name Type Description
srcAbstractHandleSource to copy from

Returns

Handle

Inherited from

AnchoredHandle.copyConstructor


createGhost

createGhost(): GhostBearingHandle

Creates a copy of this handle, sets ghost styles, registers it as a ghosts and returns the ghost

Returns

GhostBearingHandle

Inherited from

AnchoredHandle.createGhost


disconnectStyle

disconnectStyle(style, type, callback): Handle

Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

Handle

this

Inherited from

AnchoredHandle.disconnectStyle


dispose

dispose(): void

Disposes this handle, Clear all listeners and remove the ghost

Returns

void

Inherited from

AnchoredHandle.dispose


enableEventPropagation

enableEventPropagation(enable): Handle

Enable event propagation from the node hierarchy from bottom to top

This option is similar to DOM Event bubbling, which allows to get any event from child node. By default it is disabled for better performance.

Example

import {Group} from '@int/geotoolkit/scene/Group';
import {Events as SceneEvents} from '@int/geotoolkit/scene/Node';
const parentGroup = new Group()
.setName('ParentGroup')
.enableEventPropagation(true);
const childGroup = new Group()
.setName('ChildGroup');

parentGroup.addChild(childGroup);
parentGroup.on(SceneEvents.Invalidate, (eventName, sender, args) => {
// Got notifications from all children of parent group
});
childGroup.invalidate();

Parameters

Name Type Description
enablebooleanenable

Returns

Handle

this

Inherited from

AnchoredHandle.enableEventPropagation


execute

execute(delegate): Handle

Executes delegate and return the result. It allows us to keep all initialization calls in one place,
and we do not need to scroll up or down in IDE to find how and where it was initialized.

Example

// All setters (.setName() for example) returns reference to the this.
// In order to modify inner object like LineStyle or Pattern, to get this object (property) we should call getter to get object reference.
// Then modify it as shown below in Option 1 or you can use execute methods shown in Option 2.
import {Group} from '@int/geotoolkit/scene/Group';
import {Rect} from '@int/geotoolkit/util/Rect';
// Option 1
const group = new Group()
.setName('MyGroup')
.setBounds(new Rect(0, 0, 42, 16))
.enableClipping(true)
.setTag({'type': 'sometype'});

group.getLineStyle().setPattern('pattern');
return group;

// Options 2 ( using execute method )
return group
.execute(function () {
this.getLineStyle()
.setPattern("pattern");
});

Parameters

Name Type Description
delegate(this: Handle) => voidFunction to execute

Returns

Handle

The result if any or this

Inherited from

AnchoredHandle.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: Handle) => T

Returns

T

Inherited from

AnchoredHandle.execute


filter

Protected filter(context): boolean

Filter node

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

flag filter flag ("true" to render node; "false" otherwise)

Inherited from

AnchoredHandle.filter


getActiveFillStyle

getActiveFillStyle(): FillStyle

Return fill style for active state

Returns

FillStyle

fillStyle current fill style

Inherited from

AnchoredHandle.getActiveFillStyle


getActiveLineStyle

getActiveLineStyle(): LineStyle

Return line style for inactive state

Returns

LineStyle

gets current active line style

Inherited from

AnchoredHandle.getActiveLineStyle


getAdapter

getAdapter(): ShapeAdapter<Node>

Returns current adapter of the real handle if this is a ghost, otherwise returns the adapter to this handle

Returns

ShapeAdapter<Node>

Inherited from

AnchoredHandle.getAdapter


getAnchor

getAnchor(): Point

Returns the position of the handle

Returns

Point

Inherited from

AnchoredHandle.getAnchor


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

AnchoredHandle.getAnimationStyle


getClassName

getClassName(): string

Returns

string

Inherited from

AnchoredHandle.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

AnchoredHandle.getClipStyle


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

AnchoredHandle.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

AnchoredHandle.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

AnchoredHandle.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

AnchoredHandle.getCssTransform


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Inherited from

AnchoredHandle.getFillStyle


getGhost

getGhost(): GhostBearingHandle

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

Returns

GhostBearingHandle

Inherited from

AnchoredHandle.getGhost


getGhostFillStyle

getGhostFillStyle(): FillStyle

Return fill style for ghost mode state

Returns

FillStyle

fillStyle current ghost fill style

Inherited from

AnchoredHandle.getGhostFillStyle


getGhostLineStyle

getGhostLineStyle(): LineStyle

Return line style for ghost mode stat

Returns

LineStyle

gets current ghost line style

Inherited from

AnchoredHandle.getGhostLineStyle


getHandleSize

getHandleSize(): Dimension

Return handle size as a two-dimensional unit

Returns

Dimension

Inherited from

AnchoredHandle.getHandleSize


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

AnchoredHandle.getId


getInactiveFillStyle

getInactiveFillStyle(): FillStyle

Return fill style for inactive state

Returns

FillStyle

fillStyle current fill style

Inherited from

AnchoredHandle.getInactiveFillStyle


getInactiveLineStyle

getInactiveLineStyle(): LineStyle

Return fill style for inactive state

Returns

LineStyle

gets current inactive line style

Inherited from

AnchoredHandle.getInactiveLineStyle


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

AnchoredHandle.getInvalidateMethod


getLineStyle

getLineStyle(): LineStyle

Return line style

Returns

LineStyle

lineStyle current line style

Inherited from

AnchoredHandle.getLineStyle


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

AnchoredHandle.getLocalTransform


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

AnchoredHandle.getMarginsStyle


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

AnchoredHandle.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

AnchoredHandle.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

AnchoredHandle.getOpacityBlendMode


getOperationInfo

getOperationInfo(): any

Returns a json with information required to operate this handle. The information may be different for every adapter and defined by adapter itself

Returns

any

The Operation Info

Inherited from

AnchoredHandle.getOperationInfo


getParent

getParent(): Node

Return parent node

Returns

Node

parent node

Inherited from

AnchoredHandle.getParent


getParentHandle

getParentHandle(): GhostBearingHandle

Gets the handle to which this ghost is associated

Returns

GhostBearingHandle

Inherited from

AnchoredHandle.getParentHandle


getProperties

getProperties(): OptionsOut

Gets properties pertaining to this handle

Returns

OptionsOut

properties

Inherited from

AnchoredHandle.getProperties


getProperty

getProperty(name): any

Gets dynamic property by name. These properties can be used as a property bags

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

AnchoredHandle.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

AnchoredHandle.getPropertyKeys


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

AnchoredHandle.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

AnchoredHandle.getResponsiveStyle


getRoot

getRoot(): Node

Returns root node.
If node doesn't have parent then it returns itself.

Returns

Node

the root node

Inherited from

AnchoredHandle.getRoot


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets scale scroll strategy

Returns

Delegate

scale scroll strategy

Inherited from

AnchoredHandle.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

AnchoredHandle.getSceneTransform


getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

AnchoredHandle.getTag


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

AnchoredHandle.getVisible


getWorldTransform

getWorldTransform(): Transformation

Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.

Returns

Transformation

transform the world transform.

Inherited from

AnchoredHandle.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

AnchoredHandle.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

AnchoredHandle.hasCssClass


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

AnchoredHandle.hasEventListener


hasGhost

hasGhost(): boolean

Returns true if a ghost has been initialized for this handle

Returns

boolean

Inherited from

AnchoredHandle.hasGhost


invalidate

invalidate(bounds?, force?): Handle

Invalidate area of the shape. This method invalidates parent by default. invalidated from parent to root node.

Parameters

Name Type Description
Optional boundsRectbounds of the invalid rectangle in the inner node coordinates
Optional forcebooleantrue if parent should be invalidated immediately if null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed

Returns

Handle

this

Inherited from

AnchoredHandle.invalidate


invalidateParent

invalidateParent(bounds?, force?): Handle

Invalidate bounds

Parameters

Name Type Description
Optional boundsRectif null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed
Optional forcebooleanflag indicating if the parent must be forcibly invalidated

Returns

Handle

this

Inherited from

AnchoredHandle.invalidateParent


isActive

isActive(): boolean

Returns active state of this handle. Active state defines which style will be used when rendering the handle.

Returns

boolean

active Active state flag

Inherited from

AnchoredHandle.isActive


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AnchoredHandle.isDisposed


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

AnchoredHandle.isEventPropagationEnabled


isGhost

isGhost(): boolean

Returns true if this handle is a ghost

Returns

boolean

Inherited from

AnchoredHandle.isGhost


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

AnchoredHandle.isNotificationEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

AnchoredHandle.isSelectable


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

AnchoredHandle.isSilent


notify

notify<E>(event, source, args?): Handle

Notify listeners of the Node

Type parameters

NameType
Eextends string

Parameters

Name Type Description
eventEtype of event
sourceAbstractNodesource who called the event
Optional argsEventMap[E]event arguments

Returns

Handle

this

Inherited from

AnchoredHandle.notify


off

off<E>(type?, callback?): Handle

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: Handle, args: EventMap[E]) => voidfunction to be called

Returns

Handle

this

Inherited from

AnchoredHandle.off


on

on<E>(type, callback): Handle

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: Handle, args: EventMap[E]) => voidto be called

Returns

Handle

this

Inherited from

AnchoredHandle.on


onParentChanged

Protected onParentChanged(node): Handle

This method is called when parent changes. Do not call it directly.

Parameters

Name Type Description
nodeNodenode to change parent

Returns

Handle

this

Inherited from

AnchoredHandle.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

This method is called if visibility is changed. Send event Events.VisibilityChanged

Returns

void

Inherited from

AnchoredHandle.onVisibilityChanged


postRendering

Protected postRendering(context): void

To be called after rendering. Call this method if you override method render

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

AnchoredHandle.postRendering


preRendering

Protected preRendering(context): void

Occurs before rendering this method sets clipping by default. Call this method if you override method render

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

AnchoredHandle.preRendering


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

AnchoredHandle.registerAnimationStyle


removeCssClass

removeCssClass(cssclass): Handle

Removes css class from node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

Handle

this

Inherited from

AnchoredHandle.removeCssClass


removeGhost

removeGhost(): Handle

If a ghost exists, this method disposes the ghost

Returns

Handle

Inherited from

AnchoredHandle.removeGhost


removeInvalidateHandler

removeInvalidateHandler(handler): Handle

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

Handle

this

Inherited from

AnchoredHandle.removeInvalidateHandler


render

render(context): void

Renders node

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node

Returns

void

Inherited from

AnchoredHandle.render


renderAsync

renderAsync(context, callback): void

Render node in asynchronous mode. Default implementation creates call method "render" inside

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node
callback() => voidcallback function

Returns

void

Inherited from

AnchoredHandle.renderAsync


resetGhost

resetGhost(): Handle

Resets ghost anchors and transformation to match the real handle

Returns

Handle

this

Inherited from

AnchoredHandle.resetGhost


rotate

rotate(theta, x, y): Handle

Rotate bounds around a given coordinate

Parameters

Name Type Description
thetanumberangle to rotate node, in radians
xnumberx coordinate to rotate around
ynumbery coordinate to rotate around

Returns

Handle

this

Inherited from

AnchoredHandle.rotate


scale

scale(xx, yy): Handle

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

Handle

this

Inherited from

AnchoredHandle.scale


setActive

setActive(active): Handle

Sets active state of this handle. Active state defines which style will be used when rendering the handle.

Parameters

Name Type Description
activebooleanActive state flag

Returns

Handle

Inherited from

AnchoredHandle.setActive


setActiveFillStyle

setActiveFillStyle(fillStyle, merge?): Handle

Sets fill style for active state

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setActiveFillStyle


setActiveLineStyle

setActiveLineStyle(lineStyle, merge?): Handle

Sets line style for active state

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setActiveLineStyle


setAdapter

setAdapter(adapter?): Handle

Sets current adapter of the real handle if this is a ghost, otherwise sets the adapter to this handle

Parameters

Name Type Description
Optional adapterShapeAdapter<Node>adapter for current shape

Returns

Handle

this

Inherited from

AnchoredHandle.setAdapter


setAnchor

setAnchor(anchor): Handle

Sets the point defining the anchor of this handle (coordinates of the symbol)

Parameters

Name Type Description
anchorPointposition

Returns

Handle

Inherited from

AnchoredHandle.setAnchor


setAnimationStyle

setAnimationStyle(animationStyle): Handle

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

Handle

Inherited from

AnchoredHandle.setAnimationStyle


setClipStyle

setClipStyle(style): Handle

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

Handle

this

Inherited from

AnchoredHandle.setClipStyle


setCss

setCss(style, merge?): Handle

Sets CSS style. This style will be applied for all inserted elements

Parameters

Name Type Description
styleTypeCSS style to be applied to inserted elements
Optional mergebooleanmerge flag

Returns

Handle

this

Inherited from

AnchoredHandle.setCss


setCssClass

setCssClass(name): Handle

Sets css class name of the node to be used to apply CSS style

Parameters

Name Type Description
namestringcss class name of the node

Returns

Handle

this

Inherited from

AnchoredHandle.setCssClass


setCssTransform

setCssTransform(transform): Handle

Set CSS transformation

Parameters

Name Type Description
transformstring | Transformationtransformation css transformation instruction or Transformation instance

Returns

Handle

this

Inherited from

AnchoredHandle.setCssTransform


setFillStyle

setFillStyle(fillStyle, merge?): Handle

Sets fill style

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setFillStyle


setGhostFillStyle

setGhostFillStyle(fillStyle, merge?): Handle

Sets fill style for ghost mode state

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setGhostFillStyle


setGhostLineStyle

setGhostLineStyle(lineStyle, merge?): Handle

Set line style for ghost mode state

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setGhostLineStyle


setGhostMode

Protected setGhostMode(ghost): Handle

Sets a flag to this handle which specifies if it is currently a ghost, used internally

Parameters

Name Type Description
ghostbooleanIs Ghost flag

Returns

Handle

Inherited from

AnchoredHandle.setGhostMode


setHandleSize

setHandleSize(size): Handle

Sets the size of the handle. Size is defined in two dimensions and is rendered with respect to the anchor of this handle

Parameters

Name Type Description
sizenumber | Dimensionsize of the handle

Returns

Handle

Inherited from

AnchoredHandle.setHandleSize


setId

setId(id): Handle

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

Handle

this

Inherited from

AnchoredHandle.setId


setInactiveFillStyle

setInactiveFillStyle(fillStyle, merge?): Handle

Sets fill style for inactive state

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setInactiveFillStyle


setInactiveLineStyle

setInactiveLineStyle(lineStyle, merge?): Handle

Sets line style for inactive state

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setInactiveLineStyle


setLineStyle

setLineStyle(lineStyle, merge?): Handle

Sets line style

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setLineStyle


setLocalTransform

setLocalTransform(localTransform, force?): Handle

Sets local transformation to be used to transform from local to parent coordinate

Parameters

Name Type Description
localTransformTransformationlocal transformation for this node
Optional forcebooleanboolean flag to force update event if transformations are equal, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setLocalTransform


setMarginsStyle

setMarginsStyle(margins, merge?): Handle

Sets margins style

Parameters

Name Type Description
marginsType<string | number>margins style
Optional mergebooleantrue if you want to merge marginsStyle with existing attribute, false by default

Returns

Handle

this

Inherited from

AnchoredHandle.setMarginsStyle


setName

setName(name): Handle

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

Handle

this

Inherited from

AnchoredHandle.setName


setNotification

setNotification(notify, force?): Handle

set notification state

Parameters

Name Type Description
notifybooleanflag set to invalidate parent or not
Optional forcebooleantrue if parent should be invalidated immediately

Returns

Handle

this

Inherited from

AnchoredHandle.setNotification


setOpacity

setOpacity(opacity, blendMode?): Handle

Sets node opacity

Parameters

Name Type Description
opacitynumbernode opacity from 0 to 1
Optional blendModeBlendModeopacity blend mode. If it is normal, opacity will be replaced.

Returns

Handle

this

Inherited from

AnchoredHandle.setOpacity


setOperationInfo

setOperationInfo(operationInfo): Handle

Sets a json with information required to operate this handle. The information may be different for every adapter and defined by adapter itself

Parameters

Name Type
operationInfoany

Returns

Handle

Inherited from

AnchoredHandle.setOperationInfo


setParentHandle

Protected setParentHandle(parent): Handle

Sets the handle to which this ghost is associated, used internally

Parameters

Name Type Description
parentGhostBearingHandleThe parent to associate this handle with

Returns

Handle

Inherited from

AnchoredHandle.setParentHandle


setProperties

setProperties(props?): Handle

Gets properties pertaining to this handle

Parameters

Name Type Description
Optional propsOptionsproperties

Returns

Handle

Inherited from

AnchoredHandle.setProperties


setProperty

setProperty(name, value): Handle

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

Handle

this

Inherited from

AnchoredHandle.setProperty


setRenderingFilter

setRenderingFilter(filter): Handle

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

Handle

this

Inherited from

AnchoredHandle.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): Handle

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

Handle

this

Inherited from

AnchoredHandle.setResponsiveStyle


setScaleScrollStrategy

setScaleScrollStrategy(strategy?): Handle

Sets scale scroll strategy

Parameters

Name Type Description
Optional strategyDelegatescale scroll strategy

Returns

Handle

this

Inherited from

AnchoredHandle.setScaleScrollStrategy


setSelectable

setSelectable(selectable): Handle

Allows to select node. If node is not selectable then child node is not selectable.

Parameters

Name Type Description
selectablebooleanflag to allow node selection

Returns

Handle

this

Inherited from

AnchoredHandle.setSelectable


setSilent

setSilent(bool): Handle

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

Handle

this

Inherited from

AnchoredHandle.setSilent


setTag

setTag(tag): Handle

Allows the user to associate any arbitrary object with the node.

Parameters

Name Type Description
taganyThe object to be associated with the node.

Returns

Handle

this

Inherited from

AnchoredHandle.setTag


setVisible

setVisible(visible): Handle

Sets visibility of the handle and its ghost

Parameters

Name Type Description
visiblebooleanVisibility flag

Returns

Handle

Inherited from

AnchoredHandle.setVisible


setZIndex

setZIndex(value): Handle

Sets z-index for node (set null for default)

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

Handle

this

Inherited from

AnchoredHandle.setZIndex


shear

shear(shx, shy): Handle

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

Handle

this

Inherited from

AnchoredHandle.shear


toString

toString(): string

Returns a string representation of this object (generally the classname)

Returns

string

A string representation

Inherited from

AnchoredHandle.toString


translate

translate(tx, ty): Handle

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

Handle

this

Inherited from

AnchoredHandle.translate


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

AnchoredHandle.unregisterAnimationStyle


updateSceneTransformation

updateSceneTransformation(): Handle

Update scene transformation

Returns

Handle

this

Inherited from

AnchoredHandle.updateSceneTransformation


updateState

updateState(regions?, changes?): Handle

Update state. These methods reset node state and update state for children. this method is useful to refresh a scene graph

Parameters

Name Type Description
Optional regionsRect[]optional array to return invalid rectangles in the parent coordinates
Optional changesStateChangesoptional parameter to specify a reason of changes

Returns

Handle

this

Inherited from

AnchoredHandle.updateState


updateTimeStamp

Protected updateTimeStamp(): Handle

Update time stamp to indicate that Node or Children has been changed.

Returns

Handle

this

Inherited from

AnchoredHandle.updateTimeStamp


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

AnchoredHandle.enableSceneGraphNotification


findParent

Static findParent<T>(node, classType, filter?): InstanceType<T>

Find root of the node with specified type

Type parameters

NameType
Textends Constructor<any>

Parameters

Name Type Description
nodeNodenode to start search
classTypeTtype of the class to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

InstanceType<T>

Inherited from

AnchoredHandle.findParent

Static findParent(node, classType, filter?): Node

Find root of the node with specified type

Parameters

Name Type Description
nodeNodenode to start search
classTypestringinterface name to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

Node

Inherited from

AnchoredHandle.findParent


getClassName

Static getClassName(): string

Returns

string

Inherited from

AnchoredHandle.getClassName


intersectsBounds

Static intersectsBounds(bounds, localTransformation, parentInvalidArea, expand?): boolean

Check collision of the shape bounds with parent invalid area

Parameters

Name Type Description
boundsRectshape bounds
localTransformationTransformationlocal transformation of the bounds
parentInvalidAreaRectinvalid parent area
Optional expandDimensionoptional expand the bounds in model coordinate

Returns

boolean

true if bounds intersect the invalid area

Inherited from

AnchoredHandle.intersectsBounds


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

AnchoredHandle.isSceneGraphNotificationEnabled