Last updated

API / geotoolkit / flowcharts / shapes / connectors / LinkVisual / LinkVisual

Class: LinkVisual

connectors.LinkVisual.LinkVisual

A simple polygonal link that connects two shapes together.

Hierarchy

Implements

Table of contents

Constructors
Methods
addCssClassaddInvalidateHandlerapplyOpacity
applyResponsiveStylecanConnectcheckCollision
cloneconnectStyleconnectTo
copyConstructordisconnectFromdisconnectStyle
disposeenableEventPropagationexecute
filtergetAnimationStylegetBounds
getCategorygetClassNamegetClipStyle
getConnectedIndexesgetConnectionsgetCss
getCssClassgetCssClassesgetCssTransform
getDefaultIconSizegetDefaultSizegetFillStyle
getGeometrygetIdgetInvalidateMethod
getLineStylegetLinkPointsgetLinkType
getLinkingModegetLocalTransformgetMarginsStyle
getNamegetOpacitygetOpacityBlendMode
getOptimizationgetOptimizationTypegetOutline
getParentgetPointgetPointsX
getPointsYgetPropertiesgetProperty
getPropertyKeysgetPrototypeIdgetPrototypeName
getRenderingFiltergetResponsiveStylegetRoot
getScaleScrollStrategygetSceneTransformgetSearchKeywords
getSizegetSymbolSizegetTag
getTubingWidthgetUrlgetVisible
getWorldTransformgetZIndexhasCssClass
hasEventListenerinsertinvalidate
invalidateParentisDisposedisEventPropagationEnabled
isNotificationEnabledisSelectableisSilent
moveLinkHandlenotifyoff
ononParentChangedonVisibilityChanged
postRenderingpreRenderingpush
registerAnimationStyleremoveremoveCssClass
removeInvalidateHandlerrenderrenderAsync
rotatescalesetAnimationStyle
setClipStylesetCoordinatessetCss
setCssClasssetCssTransformsetDefaultSize
setFillStylesetIdsetLineStyle
setLinkPointssetLinkTypesetLinkingMode
setLocalTransformsetMarginsStylesetName
setNotificationsetOpacitysetOptimization
setOptimizationTypesetPointsetProperties
setPropertysetRenderingFiltersetResponsiveStyle
setScaleScrollStrategysetSelectablesetSilent
setTagsetTextsetTubingWidth
setUrlsetVisiblesetZIndex
sheartoStringtranslate
unregisterAnimationStyleupdateBoundsupdateLinks
updateSceneTransformationupdateStateupdateTimeStamp
enableSceneGraphNotificationfindParentgetClassName
intersectsBoundsisSceneGraphNotificationEnabled
Css Properties
Name Type Description
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
fillstyle-colorstringColor in CSS form
fillstyle-evenoddmodebooleanEven-odd fill mode
fillstyle-fillpatternPatternPattern
fillstyle-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
fillstyle-fillpattern-patternnamestringName of this pattern for indexing
fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
fillstyle-foregroundstringForeground color
fillstyle-patternPatternPattern
idstring | numberId of the node, its a unique identifier
linestylestringStyle applied on outline
linestyleLineStyleStyle applied on outline
linestyle-colorstringColor in CSS form
linestyle-fillstringOptional fill style to be used to fill lines generated with this style
linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
linestyle-linecapCapStyleThe line cap style
linestyle-linedashoffsetnumberLine dash offset of dashed line
linestyle-linejoinJoinStyleThe line join style
linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
linestyle-scalablebooleanTrue if width should depend on transformation
linestyle-unitstringOptional unit for the width
linestyle-widthnumber | stringThe line thickness
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
optimizationbooleanOptimization type boolean || ['none' | 'rdp' | 'closepoints']
scalescrollstrategyScaleScrollStrategyScale scroll strategy
scalescrollstrategy-enabledbooleanEnable flag
selectablebooleanSelectable node, a boolean to determine if selection should consider this node
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
z-indexnumberDefine node z-index

Contents

Constructors

new LinkVisual(options)

new LinkVisual(options?)

Create link visual

Parameters

Name Type Description
Optional optionsOptionsvisual properties

Overrides

Polyline.constructor

Methods

addCssClass

addCssClass(cssclass): LinkVisual

Adds new css class to node

Parameters

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

Returns

LinkVisual

this

Inherited from

Polyline.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): LinkVisual

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

LinkVisual

this

Inherited from

Polyline.addInvalidateHandler


applyOpacity

Protected applyOpacity(context): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

Polyline.applyResponsiveStyle


canConnect

canConnect(component, modelPoint, minDistance): Point

Checks if the link visual can connect to a component at the given model point (in parent's coordinate system)

Parameters

Name Type Description
componentNodea component to check if the link visual can connect to
modelPointPointa point in model space
minDistancenumberminimum distance in device units (pixels) for snapping

Returns

Point

model link point or null if can not connect


checkCollision

checkCollision(context): boolean

Check collision

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if object is inside of rendering area

Inherited from

Polyline.checkCollision


clone

clone(): LinkVisual

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

Returns

LinkVisual

clone

Overrides

Polyline.clone


connectStyle

connectStyle(style, type, callback): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.connectStyle


connectTo

connectTo(visual, linkSide, visualModelPoint): boolean

Connects self to the given visual, using the given linkside to the model point (in coordinates of visual)

Parameters

Name Type Description
visualComponenta visual to connect to
linkSideLinkSidelink side (begin or end)
visualModelPointPointmodel coordinates (in visual model space)

Returns

boolean

true on success, false on fail

Implementation of

ILink.connectTo


copyConstructor

Protected copyConstructor(src, deepCopy?): LinkVisual

copy constructor

Parameters

Name Type Description
srcPolylineSource to copy from
Optional deepCopyboolean

Returns

LinkVisual

this

Inherited from

Polyline.copyConstructor


disconnectFrom

disconnectFrom(linkSide): void

Checks if the link visual was previously connected and disconnects if so. If devicePoint coordinates are specified, then a point with index pointIndex will be set to model position, calculated from devicePoint value. The devicePoint X Y values are used to provide "sticky" behavior for hot points.

Parameters

Name Type Description
linkSideLinkSidedefines side of the link

Returns

void

Implementation of

ILink.disconnectFrom


disconnectStyle

disconnectStyle(style, type, callback): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.disconnectStyle


dispose

dispose(): void

Disposes this node, once disposes a node should not be used anymore.
Clear all listeners, and disconnect styles to avoid memory leaks.
Also aggressively 'cleanup' this node by setting some of its members to null.

Returns

void

Inherited from

Polyline.dispose


enableEventPropagation

enableEventPropagation(enable): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.enableEventPropagation


execute

execute(delegate): LinkVisual

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: LinkVisual) => voidFunction to execute

Returns

LinkVisual

The result if any or this

Inherited from

Polyline.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: LinkVisual) => T

Returns

T

Inherited from

Polyline.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

Polyline.filter


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

Polyline.getAnimationStyle


getBounds

getBounds(): Rect

Gets current bounds

Returns

Rect

current bounds

Overrides

Polyline.getBounds


getCategory

getCategory(): string

Gets component category

Returns

string

string instance representing component catetory

Implementation of

ILink.getCategory


getClassName

getClassName(): string

Returns

string

Implementation of

ILink.getClassName

Inherited from

Polyline.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

Polyline.getClipStyle


getConnectedIndexes

getConnectedIndexes(visual): number[]

checks if the visual connected to the link and returns all link point indexes. If not connected, an empty array returns

Parameters

Name Type Description
visualNodea visual to get connection points.

Returns

number[]


getConnections

getConnections(): Record<LinkSide, LinkConnection>

Gets array of connections

Returns

Record<LinkSide, LinkConnection>

an array of connections

Implementation of

ILink.getConnections


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

Polyline.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

Polyline.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

Polyline.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

Polyline.getCssTransform


getDefaultIconSize

getDefaultIconSize(): Dimension

Gets the default icon size for UI representation

Returns

Dimension

Implementation of

ILink.getDefaultIconSize


getDefaultSize

getDefaultSize(): Dimension

Gets default size of the link visual

Returns

Dimension

Implementation of

ILink.getDefaultSize


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Inherited from

Polyline.getFillStyle


getGeometry

getGeometry(): Node

Gets geometry for the current link visual

Returns

Node

Implementation of

ILink.getGeometry


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

Polyline.getId


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

Polyline.getInvalidateMethod


getLineStyle

getLineStyle(): LineStyle

Return line style

Returns

LineStyle

lineStyle current line style

Inherited from

Polyline.getLineStyle


getLinkPoints

getLinkPoints(): Point[]

Returns an array of link points: begin and end

Returns

Point[]

an array of linking points

Implementation of

ILink.getLinkPoints


getLinkType

getLinkType(): LinkType

Get link type

Returns

LinkType

a type of the link


getLinkingMode

getLinkingMode(): LinkingMode

Gets linking mode. This mode defines logic of the link as well as its appearance.

Returns

LinkingMode

current linking mode


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

Polyline.getLocalTransform


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

Polyline.getMarginsStyle


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

Polyline.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

Polyline.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

Polyline.getOpacityBlendMode


getOptimization

getOptimization(): boolean

Returns current optimization state

Returns

boolean

optimization state

Inherited from

Polyline.getOptimization


getOptimizationType

getOptimizationType(): OptimizationType

Returns optimization type

Returns

OptimizationType

optimization type

Inherited from

Polyline.getOptimizationType


getOutline

getOutline(): GraphicsPath

Gets outline (path) for the Link Visual

Returns

GraphicsPath

Implementation of

ILink.getOutline


getParent

getParent(): Node

Return parent node

Returns

Node

parent node

Inherited from

Polyline.getParent


getPoint

getPoint(index): Point

Returns polyline point at specified index (null if no point found)

Parameters

Name Type Description
indexnumberthe point index

Returns

Point

Inherited from

Polyline.getPoint


getPointsX

getPointsX(): number[]

Gets x-coords of points

Returns

number[]

Inherited from

Polyline.getPointsX


getPointsY

getPointsY(): number[]

Gets y-coords of points

Returns

number[]

Inherited from

Polyline.getPointsY


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties

Inherited from

Polyline.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

Polyline.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

Polyline.getPropertyKeys


getPrototypeId

getPrototypeId(): string

Returns component class, string value

Returns

string

string instance representing component class

Implementation of

ILink.getPrototypeId


getPrototypeName

getPrototypeName(): string

Gets component name

Returns

string

string instance representing component name

Implementation of

ILink.getPrototypeName


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

Polyline.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

Polyline.getResponsiveStyle


getRoot

getRoot(): Node

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

Returns

Node

the root node

Inherited from

Polyline.getRoot


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets scale scroll strategy

Returns

Delegate

scale scroll strategy

Inherited from

Polyline.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

Polyline.getSceneTransform


getSearchKeywords

getSearchKeywords(): string[]

Gets an array of keywords for better search

Returns

string[]

an array of search keywords

Implementation of

ILink.getSearchKeywords


getSize

getSize(): number

Returns

number

a number of the points

Inherited from

Polyline.getSize


getSymbolSize

getSymbolSize(): Object

Gets symbol size

Returns

Object

symbol width and height

NameType
heightnumber
widthnumber

getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

Polyline.getTag


getTubingWidth

getTubingWidth(): number

Gets tubing width, if set to Schematics/skin mode

Returns

number

a tubing width


getUrl

getUrl(): string

Gets url for icon

Returns

string

Implementation of

ILink.getUrl


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

Polyline.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

Polyline.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

Polyline.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

Polyline.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

Polyline.hasEventListener


insert

insert(index, point): LinkVisual

Inserts point into array at specified index.

Parameters

Name Type Description
indexnumberthe point position index
pointPointPoint

Returns

LinkVisual

this

Inherited from

Polyline.insert

insert(index, x, y): LinkVisual

Inserts point into array at specified index.

Parameters

Name Type Description
indexnumberthe point position index
xnumberx-coordinate
ynumbery-coordinate

Returns

LinkVisual

this

Inherited from

Polyline.insert


invalidate

invalidate(bounds?, force?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.invalidate


invalidateParent

invalidateParent(bounds?, force?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.invalidateParent


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Polyline.isDisposed


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

Polyline.isEventPropagationEnabled


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

Polyline.isNotificationEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

Polyline.isSelectable


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

Polyline.isSilent


moveLinkHandle

moveLinkHandle(linkSide, modelPoint): void

Moves link handle to the given device coordinates

Parameters

Name Type Description
linkSideLinkSidea link side to move (begin or end)
modelPointPointnew position for the link handle in parent's model coordinates

Returns

void


notify

notify<E>(type, source, args?): LinkVisual

Notify listeners of the Node

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event
sourceLinkVisualsource who called the event
Optional argsEventMap[E]event arguments

Returns

LinkVisual

this

Overrides

Polyline.notify


off

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

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: LinkVisual, args: EventMap[E]) => voidfunction to be called

Returns

LinkVisual

this

Overrides

Polyline.off


on

on<E>(type, callback): LinkVisual

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: LinkVisual, args: EventMap[E]) => voidto be called

Returns

LinkVisual

this

Overrides

Polyline.on


onParentChanged

Protected onParentChanged(node): LinkVisual

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

Parameters

Name Type Description
nodeNodenode to change parent

Returns

LinkVisual

this

Inherited from

Polyline.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

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

Returns

void

Inherited from

Polyline.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

Polyline.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

Polyline.preRendering


push

push(x, y): LinkVisual

Adds point to array of points.

Parameters

Name Type Description
xnumberx-coordinate
ynumbery coordinate

Returns

LinkVisual

this

Inherited from

Polyline.push

push(point): LinkVisual

Adds point to array of points.

Parameters

Name Type Description
pointPointPoint

Returns

LinkVisual

this

Inherited from

Polyline.push


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Polyline.registerAnimationStyle


remove

remove(start, count?): XYCoords

Removes point(s) from the polygon.

Parameters

Name Type Description
startnumberindex of the first removing point
Optional countnumberthe number of points to be removed

Returns

XYCoords

an object containing the deleted points

Inherited from

Polyline.remove


removeCssClass

removeCssClass(cssclass): LinkVisual

Removes css class from node

Parameters

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

Returns

LinkVisual

this

Inherited from

Polyline.removeCssClass


removeInvalidateHandler

removeInvalidateHandler(handler): LinkVisual

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

LinkVisual

this

Inherited from

Polyline.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

Polyline.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

Polyline.renderAsync


rotate

rotate(theta, x, y): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.rotate


scale

scale(xx, yy): LinkVisual

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

LinkVisual

this

Inherited from

Polyline.scale


setAnimationStyle

setAnimationStyle(animationStyle): LinkVisual

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

LinkVisual

Inherited from

Polyline.setAnimationStyle


setClipStyle

setClipStyle(style): LinkVisual

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

LinkVisual

this

Inherited from

Polyline.setClipStyle


setCoordinates

setCoordinates(x, y): LinkVisual

Sets arrays of points

Parameters

Name Type Description
xnumber[]an array of x coordinates
ynumber[]an array of y coordinates

Returns

LinkVisual

this

Inherited from

Polyline.setCoordinates


setCss

setCss(style, merge?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setCss


setCssClass

setCssClass(name): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setCssClass


setCssTransform

setCssTransform(transform): LinkVisual

Set CSS transformation

Parameters

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

Returns

LinkVisual

this

Inherited from

Polyline.setCssTransform


setDefaultSize

setDefaultSize(dimension): LinkVisual

This method does nothing for the link visual

Parameters

Name Type Description
dimensionDimensionnew default dimension

Returns

LinkVisual

this

Implementation of

ILink.setDefaultSize


setFillStyle

setFillStyle(fillStyle, merge?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setFillStyle


setId

setId(id): LinkVisual

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

LinkVisual

this

Inherited from

Polyline.setId


setLineStyle

setLineStyle(lineStyle, merge?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setLineStyle


setLinkPoints

setLinkPoints(ignored): LinkVisual

LinkVisual does not let setting alternative linking points, only begin and end

Parameters

Name Type Description
ignoredPoint[]ignored parameter

Returns

LinkVisual

this

Implementation of

ILink.setLinkPoints


setLinkType

setLinkType(value): LinkVisual

Sets link type

Parameters

Name Type Description
valueLinkTypedesired link type

Returns

LinkVisual

this


setLinkingMode

setLinkingMode(mode): LinkVisual

Sets linking mode. This mode defines logic of the link as well as its appearance.

Parameters

Name Type Description
modeLinkingModea new linking mode to set

Returns

LinkVisual

this


setLocalTransform

setLocalTransform(localTransform, force?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setLocalTransform


setMarginsStyle

setMarginsStyle(margins, merge?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setMarginsStyle


setName

setName(name): LinkVisual

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

LinkVisual

this

Inherited from

Polyline.setName


setNotification

setNotification(notify, force?): LinkVisual

set notification state

Parameters

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

Returns

LinkVisual

this

Inherited from

Polyline.setNotification


setOpacity

setOpacity(opacity, blendMode?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setOpacity


setOptimization

setOptimization(needOptimization?): LinkVisual

Turns on/off optimization for line

Parameters

Name Type Description
Optional needOptimizationbooleanIs optimization for line on

Returns

LinkVisual

this

Inherited from

Polyline.setOptimization


setOptimizationType

setOptimizationType(optimizationType): LinkVisual

Sets optimization type

Parameters

Name Type Description
optimizationTypeOptimizationTypeoptimization type which used with current line

Returns

LinkVisual

this

Inherited from

Polyline.setOptimizationType


setPoint

setPoint(index, point): LinkVisual

Sets new coordinates for the polyline point at specified index

Parameters

Name Type Description
indexnumberthe point index
pointPointPoint

Returns

LinkVisual

this

Inherited from

Polyline.setPoint

setPoint(index, x, y): LinkVisual

Sets new coordinates for the polyline point at specified index

Parameters

Name Type Description
indexnumberthe point index
xnumberpoint x-coordinate
ynumberpoint y-coordinate

Returns

LinkVisual

this

Inherited from

Polyline.setPoint


setProperties

setProperties(properties?): LinkVisual

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsobject containing the properties to set

Returns

LinkVisual

Inherited from

Polyline.setProperties


setProperty

setProperty(name, value): LinkVisual

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

LinkVisual

this

Inherited from

Polyline.setProperty


setRenderingFilter

setRenderingFilter(filter): LinkVisual

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

LinkVisual

this

Inherited from

Polyline.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): LinkVisual

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

LinkVisual

this

Inherited from

Polyline.setResponsiveStyle


setScaleScrollStrategy

setScaleScrollStrategy(strategy?): LinkVisual

Sets scale scroll strategy

Parameters

Name Type Description
Optional strategyDelegatescale scroll strategy

Returns

LinkVisual

this

Inherited from

Polyline.setScaleScrollStrategy


setSelectable

setSelectable(selectable): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.setSelectable


setSilent

setSilent(bool): LinkVisual

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

LinkVisual

this

Inherited from

Polyline.setSilent


setTag

setTag(tag): LinkVisual

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

Parameters

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

Returns

LinkVisual

this

Inherited from

Polyline.setTag


setText

setText(textOptions): LinkVisual

Sets text and its options

Parameters

Name Type Description
textOptionsTexttext and/or its options

Returns

LinkVisual

this

Implementation of

ILink.setText


setTubingWidth

setTubingWidth(value): LinkVisual

Ses tubing width for schematic/skin mode

Parameters

Name Type Description
valuenumbera width for the "tubing"

Returns

LinkVisual

this


setUrl

setUrl(value): LinkVisual

Sets url for icon

Parameters

Name Type Description
valuestringurl for icon

Returns

LinkVisual

this

Implementation of

ILink.setUrl


setVisible

setVisible(value): LinkVisual

Sets visibility of the node. Send event Events.VisibilityChanged

Parameters

Name Type Description
valuebooleanflag specifying visibility of the node

Returns

LinkVisual

this

Inherited from

Polyline.setVisible


setZIndex

setZIndex(value): LinkVisual

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

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

LinkVisual

this

Inherited from

Polyline.setZIndex


shear

shear(shx, shy): LinkVisual

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

LinkVisual

this

Inherited from

Polyline.shear


toString

toString(): string

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

Returns

string

A string representation

Inherited from

Polyline.toString


translate

translate(tx, ty): LinkVisual

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

LinkVisual

this

Inherited from

Polyline.translate


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Polyline.unregisterAnimationStyle


updateBounds

updateBounds(): LinkVisual

Update shape bounds

Returns

LinkVisual

Implementation of

ILink.updateBounds

Inherited from

Polyline.updateBounds


updateLinks(force?): void

Performs links update, using previously set up connections. It takes connected shapes and updates self begin and end points depending on connected points

Parameters

Name Type Description
Optional forcebooleanforce

Returns

void

Implementation of

ILink.updateLinks


updateSceneTransformation

updateSceneTransformation(): LinkVisual

Update scene transformation

Returns

LinkVisual

this

Inherited from

Polyline.updateSceneTransformation


updateState

updateState(regions?, changes?): LinkVisual

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

LinkVisual

this

Inherited from

Polyline.updateState


updateTimeStamp

Protected updateTimeStamp(): LinkVisual

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

Returns

LinkVisual

this

Inherited from

Polyline.updateTimeStamp


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

Polyline.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

Polyline.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

Polyline.findParent


getClassName

Static getClassName(): string

Returns

string

Inherited from

Polyline.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

Polyline.intersectsBounds


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

Polyline.isSceneGraphNotificationEnabled