Last updated

API / geotoolkit / scene / shapes / ColoredSpline / ColoredSpline

Class: ColoredSpline

shapes.ColoredSpline.ColoredSpline

A spline with gradient color.

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
boundsRectBounds
bounds-heightnumberHeight
bounds-readonlybooleanReadonly
bounds-widthnumberWidth
bounds-xnumberLeft
bounds-ynumberTop
clipstyleClipStyleClipping style
clipstyle-evenoddbooleanTrue if evenodd mode is on ('nonzero' mode otherwise)
clipstyle-geometryGraphicsPathClipping geometry
clipstyle-geometry-boundsRectBounds
clipstyleGraphicsPathClipping style
colorproviderColorProviderThe color provider used to color line based on Z value
colorprovider-maxnumber
colorprovider-minnumber
colorprovider-scaleKnownScales
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
geometryGraphicsPathGeometry the path
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
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 ColoredSpline(options)

new ColoredSpline(options?)

Constructor

Parameters

Name Type Description
Optional optionsOptionsColored spline options

Overrides

Spline.constructor

Methods

addCssClass

addCssClass(cssclass): ColoredSpline

Adds new css class to node

Parameters

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

Returns

ColoredSpline

this

Inherited from

Spline.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): ColoredSpline

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

ColoredSpline

this

Inherited from

Spline.addInvalidateHandler


applyOpacity

Protected applyOpacity(context): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

Spline.applyResponsiveStyle


arcTo

arcTo(x1, y1, x2, y2, radius): ColoredSpline

Add command to draw an arc from the current position to specified point

Parameters

Name Type Description
x1numberThe x-coordinate of the destination point
y1numberThe y-coordinate of the destination point
x2numberx-coordinate of control point
y2numbery-coordinate of control point
radiusnumberThe radius of arc

Returns

ColoredSpline

this

Inherited from

Spline.arcTo


beginPath

beginPath(): ColoredSpline

Make path API compatible with graphics context

Returns

ColoredSpline

Inherited from

Spline.beginPath


bezierCurveTo

bezierCurveTo(options?): ColoredSpline

Draws a cubic Bezier curve from the current point to the point (x, y),

Parameters

Name Type Description
Optional optionsBezierOptionsBezierParamsType

Returns

ColoredSpline

Inherited from

Spline.bezierCurveTo

bezierCurveTo(cp1x?, cp1y?, cp2x?, cp2y?, x?, y?): ColoredSpline

Draws a cubic Bezier curve from the current point to the point (x, y),

Parameters

Name Type Description
Optional cp1xnumberx coordinate of the first control point
Optional cp1ynumbery coordinate of the first control point
Optional cp2xnumberx coordinate of the second control point
Optional cp2ynumbery coordinate of the second control point
Optional xnumberx coordinate of the end point
Optional ynumbery coordinate of the end point

Returns

ColoredSpline

Inherited from

Spline.bezierCurveTo


checkCollision

checkCollision(context): boolean

Check collision

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if object is inside of rendering area

Inherited from

Spline.checkCollision


clear

clear(): ColoredSpline

Remove all of this path's points.

Returns

ColoredSpline

Inherited from

Spline.clear


clone

clone(): Spline

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

Returns

Spline

clone

Inherited from

Spline.clone


close

close(): ColoredSpline

Close path

Returns

ColoredSpline

this

Inherited from

Spline.close


closePath

closePath(): ColoredSpline

Close path (same as .close)

Returns

ColoredSpline

this

Inherited from

Spline.closePath


connectStyle

connectStyle(style, type, callback): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.connectStyle


copyConstructor

Protected copyConstructor(src, deepCopy?): ColoredSpline

copy constructor

Parameters

Name Type Description
srcSplineSource to copy from
Optional deepCopyboolean

Returns

ColoredSpline

Inherited from

Spline.copyConstructor


disconnectStyle

disconnectStyle(style, type, callback): ColoredSpline

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

ColoredSpline

this

Inherited from

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

Spline.dispose


enableEventPropagation

enableEventPropagation(enable): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.enableEventPropagation


execute

execute(delegate): ColoredSpline

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

Returns

ColoredSpline

The result if any or this

Inherited from

Spline.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: ColoredSpline) => T

Returns

T

Inherited from

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

Spline.filter


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

Spline.getAnimationStyle


getBounds

getBounds(): Rect

Return bounds

Returns

Rect

Inherited from

Spline.getBounds


getClassName

getClassName(): string

Returns

string

Inherited from

Spline.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

Spline.getClipStyle


getColorProvider

getColorProvider(): ColorProvider

Returns the color provider used to color line based on Z value

Returns

ColorProvider

the color provider


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

Spline.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

Spline.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

Spline.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

Spline.getCssTransform


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Inherited from

Spline.getFillStyle


getGeometry

getGeometry(): GraphicsPath

Returns the geometry of this item as a GeometryPath in model coordinates.

Returns

GraphicsPath

Inherited from

Spline.getGeometry


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

Spline.getId


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

Spline.getInvalidateMethod


getLineStyle

getLineStyle(): LineStyle

Return line style

Returns

LineStyle

lineStyle current line style

Inherited from

Spline.getLineStyle


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

Spline.getLocalTransform


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

Spline.getMarginsStyle


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

Spline.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

Spline.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

Spline.getOpacityBlendMode


getParent

getParent(): Node

Return parent node

Returns

Node

parent node

Inherited from

Spline.getParent


getPointsX

getPointsX(): number[]

Gets x-coords of points

Returns

number[]

Inherited from

Spline.getPointsX


getPointsY

getPointsY(): number[]

Gets y-coords of points

Returns

number[]

Inherited from

Spline.getPointsY


getPointsZ

getPointsZ(): number[]

Returns z coordinates (color values)

Returns

number[]

z coordinates


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties

Overrides

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

Spline.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

Spline.getPropertyKeys


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

Spline.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

Spline.getResponsiveStyle


getRoot

getRoot(): Node

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

Returns

Node

the root node

Inherited from

Spline.getRoot


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets scale scroll strategy

Returns

Delegate

scale scroll strategy

Inherited from

Spline.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

Spline.getSceneTransform


getSize

getSize(): number

Returns

number

a number of the points

Inherited from

Spline.getSize


getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

Spline.getTag


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

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

Spline.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

Spline.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

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

Spline.hasEventListener


invalidate

invalidate(bounds?, force?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.invalidate


invalidateParent

invalidateParent(bounds?, force?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.invalidateParent


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Spline.isDisposed


isEmpty

isEmpty(): boolean

Returns true if there are no elements in this path

Returns

boolean

Inherited from

Spline.isEmpty


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

Spline.isEventPropagationEnabled


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

Spline.isNotificationEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

Spline.isSelectable


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

Spline.isSilent


lineTo

lineTo(x, y): ColoredSpline

Add command to draw a line from the current position to specified point

Parameters

Name Type Description
xnumberThe x-coordinate of the destination point
ynumberThe y-coordinate of the destination point

Returns

ColoredSpline

this

Inherited from

Spline.lineTo


moveTo

moveTo(x, y): ColoredSpline

Add command to move the current position.

Parameters

Name Type Description
xnumberThe x-coordinate of the destination point
ynumberThe y-coordinate of the destination point

Returns

ColoredSpline

Inherited from

Spline.moveTo


notify

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

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

ColoredSpline

this

Inherited from

Spline.notify


off

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

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

Returns

ColoredSpline

this

Inherited from

Spline.off


on

on<E>(type, callback): ColoredSpline

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

Returns

ColoredSpline

this

Inherited from

Spline.on


onParentChanged

Protected onParentChanged(node): ColoredSpline

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

Parameters

Name Type Description
nodeNodenode to change parent

Returns

ColoredSpline

this

Inherited from

Spline.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

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

Returns

void

Inherited from

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

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

Spline.preRendering


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Spline.registerAnimationStyle


removeCssClass

removeCssClass(cssclass): ColoredSpline

Removes css class from node

Parameters

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

Returns

ColoredSpline

this

Inherited from

Spline.removeCssClass


removeInvalidateHandler

removeInvalidateHandler(handler): ColoredSpline

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

ColoredSpline

this

Inherited from

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

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

Spline.renderAsync


rotate

rotate(theta, x, y): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.rotate


scale

scale(xx, yy): ColoredSpline

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

ColoredSpline

this

Inherited from

Spline.scale


setAnimationStyle

setAnimationStyle(animationStyle): ColoredSpline

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

ColoredSpline

Inherited from

Spline.setAnimationStyle


setClipStyle

setClipStyle(style): ColoredSpline

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

ColoredSpline

this

Inherited from

Spline.setClipStyle


setColorProvider

setColorProvider(colorprovider?): void

Sets the color provider used to color line based on Z value

Parameters

Name Type Description
Optional colorproviderColorProviderthe color provider used to color line based on Z value

Returns

void


setCoordinates

setCoordinates(x, y): ColoredSpline

Sets arrays of points

Parameters

Name Type Description
xnumber[]x coordinates
ynumber[]y coordinates

Returns

ColoredSpline

this

Inherited from

Spline.setCoordinates


setCss

setCss(style, merge?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setCss


setCssClass

setCssClass(name): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setCssClass


setCssTransform

setCssTransform(transform): ColoredSpline

Set CSS transformation

Parameters

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

Returns

ColoredSpline

this

Inherited from

Spline.setCssTransform


setFillStyle

setFillStyle(fillStyle, merge?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setFillStyle


setGeometry

setGeometry(geometry): ColoredSpline

Sets a geometry for the path in model coordinates

Parameters

Name Type Description
geometryGraphicsPathNew geometry

Returns

ColoredSpline

Inherited from

Spline.setGeometry


setId

setId(id): ColoredSpline

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

ColoredSpline

this

Inherited from

Spline.setId


setLineStyle

setLineStyle(lineStyle, merge?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setLineStyle


setLocalTransform

setLocalTransform(localTransform, force?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setLocalTransform


setMarginsStyle

setMarginsStyle(margins, merge?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setMarginsStyle


setName

setName(name): ColoredSpline

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

ColoredSpline

this

Inherited from

Spline.setName


setNotification

setNotification(notify, force?): ColoredSpline

set notification state

Parameters

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

Returns

ColoredSpline

this

Inherited from

Spline.setNotification


setOpacity

setOpacity(opacity, blendMode?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setOpacity


setPointsZ

setPointsZ(z?): ColoredSpline

Sets z coordinates (color values)

Parameters

Name Type Description
Optional znumber[]z coordinates

Returns

ColoredSpline


setProperties

setProperties(properties?): ColoredSpline

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsobject containing the properties to set

Returns

ColoredSpline

Overrides

Spline.setProperties


setProperty

setProperty(name, value): ColoredSpline

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

ColoredSpline

this

Inherited from

Spline.setProperty


setRenderingFilter

setRenderingFilter(filter): ColoredSpline

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

ColoredSpline

this

Inherited from

Spline.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): ColoredSpline

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

ColoredSpline

this

Inherited from

Spline.setResponsiveStyle


setScaleScrollStrategy

setScaleScrollStrategy(strategy?): ColoredSpline

Sets scale scroll strategy

Parameters

Name Type Description
Optional strategyDelegatescale scroll strategy

Returns

ColoredSpline

this

Inherited from

Spline.setScaleScrollStrategy


setSelectable

setSelectable(selectable): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.setSelectable


setSilent

setSilent(bool): ColoredSpline

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ColoredSpline

this

Inherited from

Spline.setSilent


setTag

setTag(tag): ColoredSpline

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

Parameters

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

Returns

ColoredSpline

this

Inherited from

Spline.setTag


setVisible

setVisible(value): ColoredSpline

Sets visibility of the node. Send event Events.VisibilityChanged

Parameters

Name Type Description
valuebooleanflag specifying visibility of the node

Returns

ColoredSpline

this

Inherited from

Spline.setVisible


setZIndex

setZIndex(value): ColoredSpline

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

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

ColoredSpline

this

Inherited from

Spline.setZIndex


shear

shear(shx, shy): ColoredSpline

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

ColoredSpline

this

Inherited from

Spline.shear


toString

toString(): string

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

Returns

string

A string representation

Inherited from

Spline.toString


translate

translate(tx, ty): ColoredSpline

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

ColoredSpline

this

Inherited from

Spline.translate


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Spline.unregisterAnimationStyle


updateSceneTransformation

updateSceneTransformation(): ColoredSpline

Update scene transformation

Returns

ColoredSpline

this

Inherited from

Spline.updateSceneTransformation


updateState

updateState(regions?, changes?): ColoredSpline

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

ColoredSpline

this

Inherited from

Spline.updateState


updateTimeStamp

Protected updateTimeStamp(): ColoredSpline

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

Returns

ColoredSpline

this

Inherited from

Spline.updateTimeStamp


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

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

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

Spline.findParent


getClassName

Static getClassName(): string

Returns

string

Inherited from

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

Spline.intersectsBounds


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

Spline.isSceneGraphNotificationEnabled