API / geotoolkit / controls / editing / GhostBearingHandle / GhostBearingHandle
editing.GhostBearingHandle.GhostBearingHandle
Implements a handle which has an option to create a ghost of itself and has the api to manage the ghost.
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
active | boolean | Active state flag |
activefillstyle | string | Fill style of the handle when it is active |
activefillstyle | FillStyle | Fill style of the handle when it is active |
activefillstyle-color | string | Color in CSS form |
activefillstyle-evenoddmode | boolean | Even-odd fill mode |
activefillstyle-fillpattern | Pattern | Pattern |
activefillstyle-fillpattern-containername | string | An optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself |
activefillstyle-fillpattern-patternname | string | Name of this pattern for indexing |
activefillstyle-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
activefillstyle-foreground | string | Foreground color |
activefillstyle-pattern | Pattern | Pattern |
activelinestyle | string | Line style of the handle when it is active |
activelinestyle | LineStyle | Line style of the handle when it is active |
activelinestyle-color | string | Color in CSS form |
activelinestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
activelinestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
activelinestyle-linecap | CapStyle | The line cap style |
activelinestyle-linedashoffset | number | Line dash offset of dashed line |
activelinestyle-linejoin | JoinStyle | The line join style |
activelinestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
activelinestyle-scalable | boolean | True if width should depend on transformation |
activelinestyle-unit | string | Optional unit for the width |
activelinestyle-width | number | string | The line thickness |
clipstyle | ClipStyle | Clipping style |
clipstyle-evenodd | boolean | True if evenodd mode is on ('nonzero' mode otherwise) |
clipstyle-geometry | GraphicsPath | Clipping geometry |
clipstyle-geometry-bounds | Rect | Bounds |
clipstyle-geometry-bounds-height | number | Height |
clipstyle-geometry-bounds-readonly | boolean | Readonly |
clipstyle-geometry-bounds-width | number | Width |
clipstyle-geometry-bounds-x | number | Left |
clipstyle-geometry-bounds-y | number | Top |
clipstyle | GraphicsPath | Clipping style |
cssclass | string | The css class name of this node |
csscursor | string | CSS cursor associated with node |
cssstyle | string | CSS style to be applied to inserted elements |
fillstyle | string | Style applied on fill |
fillstyle | FillStyle | Style applied on fill |
ghostfillstyle | string | The fill style to apply to the ghost |
ghostfillstyle | FillStyle | The fill style to apply to the ghost |
ghostlinestyle | string | The line style to apply to the ghost |
ghostlinestyle | LineStyle | The line style to apply to the ghost |
id | string | number | Id of the node, its a unique identifier |
inactivefillstyle | string | Fill style to apply to handle when it is not active |
inactivefillstyle | FillStyle | Fill style to apply to handle when it is not active |
inactivelinestyle | string | Line style to apply to handle when it is not active |
inactivelinestyle | LineStyle | Line style to apply to handle when it is not active |
isghost | boolean | Is Ghost flag width and height will be set to that number |
linestyle | string | Style applied on outline |
linestyle | LineStyle | Style applied on outline |
localtransform | Transformation | Local transformation |
localtransform-dx | number | X axis translation |
localtransform-dy | number | Y axis translation |
localtransform-xx | number | X scale |
localtransform-xy | number | Xy skew |
localtransform-yx | number | Yx skew |
localtransform-yy | number | Y scale |
margins | number | string | It has properties for specifying the margins for each side |
name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
opacity | number | Node opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context |
opacityblendmode | BlendMode | Node opacity mode to blend it |
operationinfo | OperationInfo | Operation info contains x, y, width and height as numbers |
operationinfo-height | number | |
operationinfo-index | number | |
operationinfo-width | number | |
operationinfo-x | number | |
operationinfo-y | number | |
scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
scalescrollstrategy-enabled | boolean | Enable flag |
selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
tag | any | Custom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape |
transform | string | Additional CSS transformation applied to node or 'none' |
transform | Transformation | Additional CSS transformation applied to node or 'none' |
visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
z-index | number | Define node z-index |
Constructors
• Protected new GhostBearingHandle(options?)
| Name | Type |
|---|---|
Optional options | Options |
AbstractHandle.constructor
Methods
▸ addCssClass(cssclass): GhostBearingHandle
Adds new css class to node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
▸ addInvalidateHandler(handler): GhostBearingHandle
Add invalidate handler
Deprecated
since 4.0, use Node.on instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
AbstractHandle.addInvalidateHandler
▸ Protected applyOpacity(context): GhostBearingHandle
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
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
this
▸ Protected applyResponsiveStyle(): void
Apply a responsive style rules it is exists
void
AbstractHandle.applyResponsiveStyle
▸ checkCollision(context): boolean
Check if this node is within the area being rendered by the context
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
boolean
true if object is inside of renderable area
▸ clone(): Node
All subclasses should override copyConstructor or provide custom implementation for this method
clone
▸ connectStyle(style, type, callback): GhostBearingHandle
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
| Name | Type | Description |
|---|---|---|
style | EventDispatcher | connect style |
type | string | type of event or property |
callback | AttributeCallback<EventDispatcher> | function to be called |
this
▸ copyConstructor(src): GhostBearingHandle
Used for cloning
| Name | Type | Description |
|---|---|---|
src | AbstractHandle | Source to copy from |
AbstractHandle.copyConstructor
▸ createGhost(): GhostBearingHandle
Creates a copy of this handle, sets ghost styles, registers it as a ghosts and returns the ghost
▸ disconnectStyle(style, type, callback): GhostBearingHandle
Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.
| Name | Type | Description |
|---|---|---|
style | EventDispatcher | connect style |
type | string | type of event or property |
callback | AttributeCallback<EventDispatcher> | function to be called |
this
AbstractHandle.disconnectStyle
▸ dispose(): void
Disposes this handle, Clear all listeners and remove the ghost
void
▸ enableEventPropagation(enable): GhostBearingHandle
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();| Name | Type | Description |
|---|---|---|
enable | boolean | enable |
this
AbstractHandle.enableEventPropagation
▸ execute(delegate): GhostBearingHandle
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");
});| Name | Type | Description |
|---|---|---|
delegate | (this: GhostBearingHandle) => void | Function to execute |
The result if any or this
▸ execute<T>(delegate): T
| Name |
|---|
T |
| Name | Type |
|---|---|
delegate | (this: GhostBearingHandle) => T |
T
▸ Protected filter(context): boolean
Filter node
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
boolean
flag filter flag ("true" to render node; "false" otherwise)
▸ getActiveFillStyle(): FillStyle
Return fill style for active state
fillStyle current fill style
AbstractHandle.getActiveFillStyle
▸ getActiveLineStyle(): LineStyle
Return line style for inactive state
gets current active line style
AbstractHandle.getActiveLineStyle
▸ getAdapter(): ShapeAdapter<Node>
Returns current adapter of the real handle if this is a ghost, otherwise returns the adapter to this handle
▸ getAnimationStyle(): AnimationStyle
Return animation style
animationStyle current animation style
AbstractHandle.getAnimationStyle
▸ getClassName(): string
string
▸ getClipStyle(): ClipStyle
Gets the current clipping style
clipping style
▸ getCss(): CssStyle
Return CSS style
▸ getCssClass(): string
Returns css class name to be used to apply CSS style
string
the css class name
▸ getCssClasses(): string[]
Gets list of css class names which applied to this node
string[]
▸ getCssTransform(): string
Returns CSS transformation
string
AbstractHandle.getCssTransform
▸ getFillStyle(): FillStyle
Return fill style
fillStyle current fill style
▸ getGhost(): GhostBearingHandle
Returns the ghost registered with this handle. If ghost does not exist, returns null
▸ getGhostFillStyle(): FillStyle
Return fill style for ghost mode state
fillStyle current ghost fill style
▸ getGhostLineStyle(): LineStyle
Return line style for ghost mode stat
gets current ghost line style
▸ getId(): string | number
Returns the associated identifier of the node
string | number
The node's id
▸ getInactiveFillStyle(): FillStyle
Return fill style for inactive state
fillStyle current fill style
AbstractHandle.getInactiveFillStyle
▸ getInactiveLineStyle(): LineStyle
Return fill style for inactive state
gets current inactive line style
AbstractHandle.getInactiveLineStyle
▸ Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>
Gets invalidate method
AttributeCallback<EventDispatcher>
method to invalidate this object
AbstractHandle.getInvalidateMethod
▸ getLineStyle(): LineStyle
Return line style
lineStyle current line style
▸ getLocalTransform(): Transformation
Retrieves the transformation of bounds to parent
transform the local transform.
AbstractHandle.getLocalTransform
▸ getMarginsStyle(): SpaceStyle<string | number>
Return margins style
SpaceStyle<string | number>
AbstractHandle.getMarginsStyle
▸ getName(): string
Returns the node name
string
The node name
▸ getOpacity(): number
Returns current node opacity
number
opacity
▸ getOpacityBlendMode(): BlendMode
Returns current node opacity
opacity blend mode
AbstractHandle.getOpacityBlendMode
▸ 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
any
The Operation Info
AbstractHandle.getOperationInfo
▸ getParent(): Node
Return parent node
parent node
▸ getParentHandle(): GhostBearingHandle
Gets the handle to which this ghost is associated
▸ getProperties(): OptionsOut
Gets properties pertaining to this handle
▸ getProperty(name): any
Gets dynamic property by name. These properties can be used as a property bags
| Name | Type | Description |
|---|---|---|
name | string | property name |
any
▸ getPropertyKeys(): string[]
Returns known properties keys
string[]
AbstractHandle.getPropertyKeys
▸ getRenderingFilter(): IFilter
Return filter to be used for rendering and picking
current filter
AbstractHandle.getRenderingFilter
▸ getResponsiveStyle(): ResponsiveStyle
Return responsive style
AbstractHandle.getResponsiveStyle
▸ getRoot(): Node
Returns root node.
If node doesn't have parent then it returns itself.
the root node
▸ getScaleScrollStrategy(): Delegate
Gets scale scroll strategy
scale scroll strategy
AbstractHandle.getScaleScrollStrategy
▸ getSceneTransform(): Transformation
Returns transformation from node to root scene
a transformation from node to root scene
AbstractHandle.getSceneTransform
▸ getTag(): any
Returns the object associated with the node by user.
any
The node's user-object
▸ getVisible(): boolean
Return visibility of the node
boolean
true if node is visible
▸ getWorldTransform(): Transformation
Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.
transform the world transform.
AbstractHandle.getWorldTransform
▸ getZIndex(): number
Returns node z-index (null if not set)
number
▸ hasCssClass(cssClass): boolean
Check if node has specified css class
| Name | Type | Description |
|---|---|---|
cssClass | string | css class name |
boolean
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
AbstractHandle.hasEventListener
▸ hasGhost(): boolean
Returns true if a ghost has been initialized for this handle
boolean
▸ invalidate(bounds?, force?): GhostBearingHandle
Invalidate area of the shape. This method invalidates parent by default. invalidated from parent to root node.
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | bounds of the invalid rectangle in the inner node coordinates |
Optional force | boolean | true 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 |
this
▸ invalidateParent(bounds?, force?): GhostBearingHandle
Invalidate bounds
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | if null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed |
Optional force | boolean | flag indicating if the parent must be forcibly invalidated |
this
AbstractHandle.invalidateParent
▸ isActive(): boolean
Returns active state of this handle. Active state defines which style will be used when rendering the handle.
boolean
active Active state flag
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isEventPropagationEnabled(): boolean
Return true if event propagation is enabled from child to parent
boolean
AbstractHandle.isEventPropagationEnabled
▸ isGhost(): boolean
Returns true if this handle is a ghost
boolean
▸ isNotificationEnabled(): boolean
return state of notification
boolean
current notification state
AbstractHandle.isNotificationEnabled
▸ isSelectable(): boolean
Returns true if node can be picked/selected.
boolean
The selectable flag
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(event, source, args?): GhostBearingHandle
Notify listeners of the Node
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
event | E | type of event |
source | AbstractNode | source who called the event |
Optional args | EventMap[E] | event arguments |
this
▸ off<E>(type?, callback?): GhostBearingHandle
Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: GhostBearingHandle, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): GhostBearingHandle
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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: GhostBearingHandle, args: EventMap[E]) => void | to be called |
this
▸ Protected onParentChanged(node): GhostBearingHandle
This method is called when parent changes. Do not call it directly.
| Name | Type | Description |
|---|---|---|
node | Node | node to change parent |
this
AbstractHandle.onParentChanged
▸ Protected onVisibilityChanged(): void
This method is called if visibility is changed. Send event Events.VisibilityChanged
void
AbstractHandle.onVisibilityChanged
▸ Protected postRendering(context): void
To be called after rendering. Call this method if you override method render
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
void
▸ Protected preRendering(context): void
Occurs before rendering this method sets clipping by default. Call this method if you override method render
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
void
▸ registerAnimationStyle(root): void
Register animation style.
| Name | Type | Description |
|---|---|---|
root | Node | root node for node |
void
AbstractHandle.registerAnimationStyle
▸ removeCssClass(cssclass): GhostBearingHandle
Removes css class from node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
▸ removeGhost(): GhostBearingHandle
If a ghost exists, this method disposes the ghost
▸ removeInvalidateHandler(handler): GhostBearingHandle
Remove invalidate handler
Deprecated
since 4.0, use Node.off instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
AbstractHandle.removeInvalidateHandler
▸ Abstract render(context): void
Renders node
| Name | Type | Description |
|---|---|---|
context | RenderingContext | The rendering context to be used to draw the node |
void
▸ renderAsync(context, callback): void
Render node in asynchronous mode. Default implementation creates call method "render" inside
| Name | Type | Description |
|---|---|---|
context | RenderingContext | The rendering context to be used to draw the node |
callback | () => void | callback function |
void
▸ resetGhost(): GhostBearingHandle
Resets ghost anchors and transformation to match the real handle
this
▸ rotate(theta, x, y): GhostBearingHandle
Rotate bounds around a given coordinate
| Name | Type | Description |
|---|---|---|
theta | number | angle to rotate node, in radians |
x | number | x coordinate to rotate around |
y | number | y coordinate to rotate around |
this
▸ scale(xx, yy): GhostBearingHandle
Scale node
| Name | Type | Description |
|---|---|---|
xx | number | x scale factor |
yy | number | y scale factor |
this
▸ setActive(active): GhostBearingHandle
Sets active state of this handle. Active state defines which style will be used when rendering the handle.
| Name | Type | Description |
|---|---|---|
active | boolean | Active state flag |
▸ setActiveFillStyle(fillStyle, merge?): GhostBearingHandle
Sets fill style for active state
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a new fill style |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
this
AbstractHandle.setActiveFillStyle
▸ setActiveLineStyle(lineStyle, merge?): GhostBearingHandle
Sets line style for active state
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
AbstractHandle.setActiveLineStyle
▸ setAdapter(adapter?): GhostBearingHandle
Sets current adapter of the real handle if this is a ghost, otherwise sets the adapter to this handle
| Name | Type | Description |
|---|---|---|
Optional adapter | ShapeAdapter<Node> | adapter for current shape |
this
▸ setAnimationStyle(animationStyle): GhostBearingHandle
Sets animation style
| Name | Type | Description |
|---|---|---|
animationStyle | Type | animation style |
AbstractHandle.setAnimationStyle
▸ setClipStyle(style): GhostBearingHandle
Sets a new clipping style
| Name | Type | Description |
|---|---|---|
style | GraphicsPath | ClipStyle | Options | a new clipping style |
this
▸ setCss(style, merge?): GhostBearingHandle
Sets CSS style. This style will be applied for all inserted elements
| Name | Type | Description |
|---|---|---|
style | Type | CSS style to be applied to inserted elements |
Optional merge | boolean | merge flag |
this
▸ setCssClass(name): GhostBearingHandle
Sets css class name of the node to be used to apply CSS style
| Name | Type | Description |
|---|---|---|
name | string | css class name of the node |
this
▸ setCssTransform(transform): GhostBearingHandle
Set CSS transformation
| Name | Type | Description |
|---|---|---|
transform | string | Transformation | transformation css transformation instruction or Transformation instance |
this
AbstractHandle.setCssTransform
▸ setFillStyle(fillStyle, merge?): GhostBearingHandle
Sets fill style
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a new fill style |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
this
▸ setGhostFillStyle(fillStyle, merge?): GhostBearingHandle
Sets fill style for ghost mode state
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a new fill style |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
this
▸ setGhostLineStyle(lineStyle, merge?): GhostBearingHandle
Set line style for ghost mode state
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ Protected setGhostMode(ghost): GhostBearingHandle
Sets a flag to this handle which specifies if it is currently a ghost, used internally
| Name | Type | Description |
|---|---|---|
ghost | boolean | Is Ghost flag |
▸ setId(id): GhostBearingHandle
Allows the user to associate any identifier
| Name | Type | Description |
|---|---|---|
id | string | number | object id |
this
▸ setInactiveFillStyle(fillStyle, merge?): GhostBearingHandle
Sets fill style for inactive state
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a new fill style |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
this
AbstractHandle.setInactiveFillStyle
▸ setInactiveLineStyle(lineStyle, merge?): GhostBearingHandle
Sets line style for inactive state
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
AbstractHandle.setInactiveLineStyle
▸ setLineStyle(lineStyle, merge?): GhostBearingHandle
Sets line style
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setLocalTransform(localTransform, force?): GhostBearingHandle
Sets local transformation to be used to transform from local to parent coordinate
| Name | Type | Description |
|---|---|---|
localTransform | Transformation | local transformation for this node |
Optional force | boolean | boolean flag to force update event if transformations are equal, false by default |
this
AbstractHandle.setLocalTransform
▸ setMarginsStyle(margins, merge?): GhostBearingHandle
Sets margins style
| Name | Type | Description |
|---|---|---|
margins | Type<string | number> | margins style |
Optional merge | boolean | true if you want to merge marginsStyle with existing attribute, false by default |
this
AbstractHandle.setMarginsStyle
▸ setName(name): GhostBearingHandle
Sets name of the node
| Name | Type | Description |
|---|---|---|
name | string | The node name |
this
▸ setNotification(notify, force?): GhostBearingHandle
set notification state
| Name | Type | Description |
|---|---|---|
notify | boolean | flag set to invalidate parent or not |
Optional force | boolean | true if parent should be invalidated immediately |
this
AbstractHandle.setNotification
▸ setOpacity(opacity, blendMode?): GhostBearingHandle
Sets node opacity
| Name | Type | Description |
|---|---|---|
opacity | number | node opacity from 0 to 1 |
Optional blendMode | BlendMode | opacity blend mode. If it is normal, opacity will be replaced. |
this
▸ setOperationInfo(operationInfo): GhostBearingHandle
Sets a json with information required to operate this handle. The information may be different for every adapter and defined by adapter itself
| Name | Type |
|---|---|
operationInfo | any |
AbstractHandle.setOperationInfo
▸ Protected setParentHandle(parent): GhostBearingHandle
Sets the handle to which this ghost is associated, used internally
| Name | Type | Description |
|---|---|---|
parent | GhostBearingHandle | The parent to associate this handle with |
▸ setProperties(props?): GhostBearingHandle
Sets properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional props | Options | properties |
this
▸ setProperty(name, value): GhostBearingHandle
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
▸ setRenderingFilter(filter): GhostBearingHandle
Sets filter to be applied before rendering and picking
| Name | Type | Description |
|---|---|---|
filter | IFilter | filter to set |
this
AbstractHandle.setRenderingFilter
▸ setResponsiveStyle(style): GhostBearingHandle
Sets responsive style.
| Name | Type | Description |
|---|---|---|
style | Options | ResponsiveStyle | responsive style |
this
AbstractHandle.setResponsiveStyle
▸ setScaleScrollStrategy(strategy?): GhostBearingHandle
Sets scale scroll strategy
| Name | Type | Description |
|---|---|---|
Optional strategy | Delegate | scale scroll strategy |
this
AbstractHandle.setScaleScrollStrategy
▸ setSelectable(selectable): GhostBearingHandle
Allows to select node. If node is not selectable then child node is not selectable.
| Name | Type | Description |
|---|---|---|
selectable | boolean | flag to allow node selection |
this
▸ setSilent(bool): GhostBearingHandle
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setTag(tag): GhostBearingHandle
Allows the user to associate any arbitrary object with the node.
| Name | Type | Description |
|---|---|---|
tag | any | The object to be associated with the node. |
this
▸ setVisible(visible): GhostBearingHandle
Sets visibility of the handle and its ghost
| Name | Type | Description |
|---|---|---|
visible | boolean | Visibility flag |
▸ setZIndex(value): GhostBearingHandle
Sets z-index for node (set null for default)
| Name | Type | Description |
|---|---|---|
value | number | index determining node z-position |
this
▸ shear(shx, shy): GhostBearingHandle
Shear this node's bounds
| Name | Type | Description |
|---|---|---|
shx | number | x-axis shear |
shy | number | y-axis shear |
this
▸ toString(): string
Returns a string representation of this object (generally the classname)
string
A string representation
▸ translate(tx, ty): GhostBearingHandle
Translate bounds
| Name | Type | Description |
|---|---|---|
tx | number | x translation |
ty | number | y translation |
this
▸ unregisterAnimationStyle(root): void
Unregister animation style.
| Name | Type | Description |
|---|---|---|
root | Node | root node for node |
void
AbstractHandle.unregisterAnimationStyle
▸ updateSceneTransformation(): GhostBearingHandle
Update scene transformation
this
AbstractHandle.updateSceneTransformation
▸ updateState(regions?, changes?): GhostBearingHandle
Update state. These methods reset node state and update state for children. this method is useful to refresh a scene graph
| Name | Type | Description |
|---|---|---|
Optional regions | Rect[] | optional array to return invalid rectangles in the parent coordinates |
Optional changes | StateChanges | optional parameter to specify a reason of changes |
this
▸ Protected updateTimeStamp(): GhostBearingHandle
Update time stamp to indicate that Node or Children has been changed.
this
AbstractHandle.updateTimeStamp
▸ Static enableSceneGraphNotification(enabled): void
Enable / disable all notifications
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets if this object sends notifications |
void
AbstractHandle.enableSceneGraphNotification
▸ Static findParent<T>(node, classType, filter?): InstanceType<T>
Find root of the node with specified type
| Name | Type |
|---|---|
T | extends Constructor<any> |
| Name | Type | Description |
|---|---|---|
node | Node | node to start search |
classType | T | type of the class to search for |
Optional filter | (node: Node) => boolean | additional filter to apply |
InstanceType<T>
▸ Static findParent(node, classType, filter?): Node
Find root of the node with specified type
| Name | Type | Description |
|---|---|---|
node | Node | node to start search |
classType | string | interface name to search for |
Optional filter | (node: Node) => boolean | additional filter to apply |
▸ Static getClassName(): string
string
▸ Static intersectsBounds(bounds, localTransformation, parentInvalidArea, expand?): boolean
Check collision of the shape bounds with parent invalid area
| Name | Type | Description |
|---|---|---|
bounds | Rect | shape bounds |
localTransformation | Transformation | local transformation of the bounds |
parentInvalidArea | Rect | invalid parent area |
Optional expand | Dimension | optional expand the bounds in model coordinate |
boolean
true if bounds intersect the invalid area
AbstractHandle.intersectsBounds
▸ Static isSceneGraphNotificationEnabled(): boolean
Return status of the global notification for all nodes.
boolean