API / geotoolkit / report / edit / widget / DocumentEditorWidget / DocumentEditorWidget
widget.DocumentEditorWidget.DocumentEditorWidget
DocumentEditorWidget is essentially a base widget specialized for display and design report document.
↳
DocumentEditorWidget
Constructors
Methods
Constructors
• new DocumentEditorWidget(options?)
| Name | Type |
|---|---|
Optional options | Options |
DocumentViewWidget.constructor
Methods
▸ addBaseLayer(baseLayer): DocumentEditorWidget
Add baseLayer to container
this
DocumentViewWidget.addBaseLayer
▸ addChild(node): DocumentEditorWidget
Add a child node
this
▸ addCssClass(cssclass): DocumentEditorWidget
Adds new css class to node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
DocumentViewWidget.addCssClass
▸ addInvalidateHandler(handler): DocumentEditorWidget
Add invalidate handler
Deprecated
since 4.0, use Node.on instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
DocumentViewWidget.addInvalidateHandler
▸ addOverlay(overlay): DocumentEditorWidget
Add overlay to container
this
▸ adjustPages(): DocumentEditorWidget
this
DocumentViewWidget.adjustPages
▸ adjustPosition(area?, vAlign?, hAlign?): DocumentEditorWidget
Adjust position of node to specified area
| Name | Type | Description |
|---|---|---|
Optional area | Rect | specified area. Default to Parent Model Limits |
Optional vAlign | string | vertical alignment. It can be "top", "bottom", "center". Defaults to "top". |
Optional hAlign | string | horizontal alignment It can be "left", "right", "center". Defaults to "left". |
this
DocumentViewWidget.adjustPosition
▸ Protected applyOpacity(context): DocumentEditorWidget
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
DocumentViewWidget.applyOpacity
▸ Protected applyResponsiveStyle(): void
Apply a responsive style rules it is exists
void
DocumentViewWidget.applyResponsiveStyle
▸ canRedo(): boolean
Return true if user can ReDo
boolean
can redo
▸ canSelectDomElement(domElement): boolean
Returns true if DOM element can be selected
| Name | Type | Description |
|---|---|---|
domElement | AbstractElement | to check if it can be selected |
boolean
▸ canUndo(): boolean
Return true if user can UnDo
boolean
can undo
▸ changeBaseLayerOrder(overlay, order, anchor?): DocumentEditorWidget
Changes the z-order of the baseLayer.
| Name | Type | Description |
|---|---|---|
overlay | Node | |
order | NodeOrder | position to be added |
Optional anchor | Node | anchor node to specify changeOrder with respect to this node |
this
DocumentViewWidget.changeBaseLayerOrder
▸ changeChildOrder(node, order, anchor?): DocumentEditorWidget
changes the z-order of the nodes being rendered.
| Name | Type | Description |
|---|---|---|
node | Node | any child added in the Composite node |
order | NodeOrder | position to be added |
Optional anchor | Node | anchor node to specify changeOrder with respect to this node |
this
DocumentViewWidget.changeChildOrder
▸ changeOverlayOrder(overlay, order, anchor?): DocumentEditorWidget
Changes the z-order of the overlay.
| Name | Type | Description |
|---|---|---|
overlay | Node | child overlay |
order | NodeOrder | position to be added |
Optional anchor | Node | anchor node to specify changeOrder with respect to this node |
this
DocumentViewWidget.changeOverlayOrder
▸ checkCollision(context): boolean
Check culling Returns true if object is inside of renderable area
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
boolean
true if node is collided
DocumentViewWidget.checkCollision
▸ clearBaseLayers(disposeBaseLayers?): DocumentEditorWidget
Remove all child baseLayers from group
| Name | Type | Description |
|---|---|---|
Optional disposeBaseLayers | boolean | automatically dispose baseLayers. If it is true then method dispose is called for each baseLayer, false by default |
this
DocumentViewWidget.clearBaseLayers
▸ clearCache(): DocumentEditorWidget
Clear cache
this
▸ clearChildren(disposeChildren?): DocumentEditorWidget
Remove all child nodes from this composite group
| Name | Type | Description |
|---|---|---|
Optional disposeChildren | boolean | automatically dispose children. If it is true then method dispose is called for each child. |
this
DocumentViewWidget.clearChildren
▸ clearDomSelection(): DocumentEditorWidget
Clear selection
▸ clearOverlays(disposeOverlays?): DocumentEditorWidget
Remove all child overlays from group
| Name | Type | Description |
|---|---|---|
Optional disposeOverlays | boolean | automatically dispose overlays. If it is true then method dispose is called for each overlay, false by default |
this
DocumentViewWidget.clearOverlays
All subclasses should override copyConstructor or provide custom implementation for this method
clone
▸ connectStyle(style, type, callback): DocumentEditorWidget
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
DocumentViewWidget.connectStyle
▸ connectTool(tool): DocumentEditorWidget
Connect a new tool with a toolname to the widget
| Name | Type | Description |
|---|---|---|
tool | AbstractTool | AbstractTool[] | tool associated with the widget |
this
DocumentViewWidget.connectTool
▸ Protected copyConstructor(src, deepCopy?): DocumentEditorWidget
Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.
this
DocumentViewWidget.copyConstructor
▸ createDomElement(xml): Promise<Element[]>
Create DOM element
| Name | Type | Description |
|---|---|---|
xml | string | string[] | description like ' test |
Promise<Element[]>
▸ createState(documentElement?, fullState?): IState
Save document or document element state
| Name | Type | Description |
|---|---|---|
Optional documentElement | Element | Element[] | document element or array of elements |
Optional fullState | boolean | true in case if you need to save whole DOM tree |
this
▸ disconnectStyle(style, type, callback): DocumentEditorWidget
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
DocumentViewWidget.disconnectStyle
▸ disconnectTool(tool): DocumentEditorWidget
Disconnect the tool from the widget
| Name | Type | Description |
|---|---|---|
tool | AbstractTool | AbstractTool[] | tool to disconnect |
this
DocumentViewWidget.disconnectTool
▸ dispose(): void
Dispose node. Clear all listeners and disconnect style to avoid memory leaks
void
▸ Protected drawBorder(localContext, bounds?): DocumentEditorWidget
Draws a rectangle at the bounding box (in parent coordinates)
| Name | Type | Description |
|---|---|---|
localContext | RenderingContext | The local rendering context |
Optional bounds | Rect | group bounds |
this
▸ enableClipping(doClip): DocumentEditorWidget
Enables or disables clipping of this node. If enabled, shapes will not be rendered outside of its bounds.
| Name | Type | Description |
|---|---|---|
doClip | boolean | enable clipping on this node |
this
DocumentViewWidget.enableClipping
▸ enableContentClipping(doClip): DocumentEditorWidget
Enables or disables page content clipping of this widget. If enabled, document content will not be rendered outside of margin bounds.
| Name | Type | Description |
|---|---|---|
doClip | boolean | enable content clipping on this widget |
DocumentViewWidget.enableContentClipping
▸ enableEventPropagation(enable): DocumentEditorWidget
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
DocumentViewWidget.enableEventPropagation
▸ enablePickingChildren(enable): DocumentEditorWidget
Enables or disables picking children
| Name | Type | Description |
|---|---|---|
enable | boolean | enable picking children |
this
DocumentViewWidget.enablePickingChildren
▸ enumerateNodes(callback, target?): void
Executes a provided function once for each child node
| Name | Type | Description |
|---|---|---|
callback | Callback<Node> | provided function |
Optional target | QueryBuilder<any> | target to pass to callback as a second parameter |
void
DocumentViewWidget.enumerateNodes
▸ execute(delegate): DocumentEditorWidget
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: DocumentEditorWidget) => void | Function to execute |
The result if any or this
▸ execute<T>(delegate): T
| Name |
|---|
T |
| Name | Type |
|---|---|
delegate | (this: DocumentEditorWidget) => 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)
▸ getActiveDomElement(): Element
Returns active dom element
▸ getActivePageIndex(): number
Returns active page index
number
active page index
DocumentViewWidget.getActivePageIndex
▸ getActivePropertiesDescriptor(iPropertiesDescriptorType): any
Query for properties descriptor interface implementation
| Name | Type | Description |
|---|---|---|
iPropertiesDescriptorType | ClassType<any> | properties descriptor type |
any
▸ getActiveShape(): Element | TextElement
Returns active dom shape
▸ getAnimationStyle(): AnimationStyle
Return animation style
animationStyle current animation style
DocumentViewWidget.getAnimationStyle
▸ getAutoModelLimitsMode(): boolean
Get Model Limits Logics to use when no Model Limits have been set set to true: will use parents width and height, starting at 0 set to false: will use parents bounds
boolean
mode
DocumentViewWidget.getAutoModelLimitsMode
▸ getAutoModelLimitsStrategy(): ModelLimitsStrategy
Get Model Limits Logics Strategy
strategy
DocumentViewWidget.getAutoModelLimitsStrategy
▸ getBaseLayer(index): Node
Return baseLayer at specified index
| Name | Type | Description |
|---|---|---|
index | number | index at which to get the baseLayer for |
track
DocumentViewWidget.getBaseLayer
▸ getBaseLayers<S>(predicate, modify?): Iterator<Node>
Return iterator by baseLayers nodes
| Name | Type |
|---|---|
S | extends Node<S> |
| Name | Type | Description |
|---|---|---|
predicate | (value: Node) => value is S | a filter function |
Optional modify | boolean | An option to specify if the iterator supports adding/removing items from the collection. false by default. |
DocumentViewWidget.getBaseLayers
▸ getBaseLayers(filter?, modify?): Iterator<Node>
Returns an iterator for child baseLayers. The iterator does not support adding or deleting items from overlays by default. If it is necessary to modify a collection of overlays, pass true as the last parameter.
Example
// Gets a writable iterator
const it = node.getOverlays(null, true);| Name | Type | Description |
|---|---|---|
Optional filter | (node: Node) => boolean | A filter function. Returns all overlays if null. |
Optional modify | boolean | An option to specify if the iterator supports adding/removing items from the collection. false by default. |
An iterator for child overlays.
DocumentViewWidget.getBaseLayers
▸ getBaseLayersCount(): number
Returns amount of baseLayers
number
DocumentViewWidget.getBaseLayersCount
▸ getBounds(): Rect
Get the bounds in the parents model space. If bounds are not set, then parent model limits are used.
current bounds
▸ getCache(): Cache
Return cache strategy to be used to cache children nodes
cache
▸ getChild(i): Node
Return node by index
| Name | Type | Description |
|---|---|---|
i | number | index of the node |
▸ getChildren<S>(predicate, modify?): Iterator<S>
Return iterator by child nodes
| Name | Type |
|---|---|
S | extends Node<S> |
| Name | Type | Description |
|---|---|---|
predicate | (value: Node) => value is S | a filter function |
Optional modify | boolean | An option to specify if the iterator supports adding/removing items from the collection. false by default. |
Iterator<S>
DocumentViewWidget.getChildren
▸ getChildren(filter?, modify?): Iterator<Node>
Returns an iterator for child nodes. The iterator does not support adding or deleting items from children by default. If it is necessary to modify a collection of children, pass true as the last parameter.
Example
// Gets a writable iterator
const it = node.getChildren(null, true);| Name | Type | Description |
|---|---|---|
Optional filter | (node: Node) => boolean | A filter function. Returns all nodes if null. |
Optional modify | boolean | An option to specify if the iterator supports adding/removing items from the collection. false by default. |
An iterator for child nodes.
DocumentViewWidget.getChildren
▸ getChildrenCount(): number
Return number of child nodes
number
DocumentViewWidget.getChildrenCount
▸ getClassName(): string
string
DocumentViewWidget.getClassName
▸ getClipStyle(): ClipStyle
Gets the current clipping style
clipping style
DocumentViewWidget.getClipStyle
▸ getContentOrientation(): Orientation
Return content orientation
content orientation
DocumentViewWidget.getContentOrientation
▸ getContentsArea(transformation?): Rect
Return area without paddings. Model limits are mapped to content area, where children are layout.
| Name | Type | Description |
|---|---|---|
Optional transformation | Transformation | scene transformation |
DocumentViewWidget.getContentsArea
▸ getContentsTransform(): Transformation
getContentsTransform() retrieves the world transformation of the node.
transformation from model coordinates to bounds of the group
DocumentViewWidget.getContentsTransform
▸ getCss(): CssStyle
Return CSS style
▸ getCssClass(): string
Returns css class name to be used to apply CSS style
string
the css class name
DocumentViewWidget.getCssClass
▸ getCssClasses(): string[]
Gets list of css class names which applied to this node
string[]
DocumentViewWidget.getCssClasses
▸ getCssTransform(): string
Returns CSS transformation
string
DocumentViewWidget.getCssTransform
▸ getData(data?): object
get options
| Name | Type | Description |
|---|---|---|
Optional data | unknown | how to extract data, null by default |
object
▸ getDesiredHeight(): string | number
Returns desired height of the group as a layoutable object This method is a helper method to get access to getLayoutStyle()
string | number
desired height ("undefined" by default)
DocumentViewWidget.getDesiredHeight
▸ getDesiredWidth(): string | number
Returns desired width of the group as a layoutable object. This method is a helper method to get access to getLayoutStyle()
string | number
desired width ("undefined" by default)
DocumentViewWidget.getDesiredWidth
▸ getDeviceLimits(): Rect
Return device limits
DocumentViewWidget.getDeviceLimits
▸ getDocument(): Document
Return current document
this
DocumentViewWidget.getDocument
▸ getDocumentInfo(): DocumentInfo
Returns Document information
default document information
DocumentViewWidget.getDocumentInfo
▸ getDomDocument(): Document
Returns DOM document
DocumentViewWidget.getDomDocument
▸ getFillStyle(): FillStyle
Return fill style
fillStyle current fill style
DocumentViewWidget.getFillStyle
▸ getFooterVisible(): boolean
Returns page header visible state, undefined in case if footer does not exist at all
boolean
▸ getGridsVisible(): boolean
Returns visibility of the pages grid
boolean
DocumentViewWidget.getGridsVisible
▸ getHeaderVisible(): boolean
Returns page header visible state, undefined in case if header does not exist at all
boolean
▸ getId(): string | number
Returns the associated identifier of the node
string | number
The node's id
▸ getInfiniteMode(): boolean
Return infinity mode flag
boolean
flag
DocumentViewWidget.getInfiniteMode
▸ Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>
Gets invalidate method
AttributeCallback<EventDispatcher>
method to invalidate this object
DocumentViewWidget.getInvalidateMethod
▸ getLayout(): Layout
Returns layout associated with the group
layout
▸ getLayoutStyle(): LayoutStyle<string | number>
return desired layout style
LayoutStyle<string | number>
DocumentViewWidget.getLayoutStyle
▸ getLineStyle(): LineStyle
Return border style
DocumentViewWidget.getLineStyle
▸ getLocalTransform(): Transformation
Retrieves the transformation of bounds to parent
transform the local transform.
DocumentViewWidget.getLocalTransform
▸ getMarginsStyle(): SpaceStyle<string | number>
Return margins style
SpaceStyle<string | number>
DocumentViewWidget.getMarginsStyle
▸ getModelLimits(): Rect
Gets model limits, the limits of this groups inside space
the current model limits
DocumentViewWidget.getModelLimits
▸ 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
DocumentViewWidget.getOpacityBlendMode
▸ getOptions(): Required<OptionsBase>
Returns widget options
Required<OptionsBase>
▸ getOverlay(index): Node
Return overlay at specified index
| Name | Type | Description |
|---|---|---|
index | number | index at which to get the overlay for |
track
▸ getOverlayAt(index): Node
Return overlay at specified index
Deprecated
since 4.2 use getOverlay instead
| Name | Type | Description |
|---|---|---|
index | number | index at which to get the overlay for |
track
DocumentViewWidget.getOverlayAt
▸ getOverlayLayer(): Layer<Node>
Returns manipulator overlay to draw shapes that should move with the model
DocumentViewWidget.getOverlayLayer
▸ getOverlays<S>(predicate, modify?): Iterator<Node>
Return iterator by overlays nodes
| Name | Type |
|---|---|
S | extends Node<S> |
| Name | Type | Description |
|---|---|---|
predicate | (value: Node) => value is S | a filter function |
Optional modify | boolean | An option to specify if the iterator supports adding/removing items from the collection. false by default. |
DocumentViewWidget.getOverlays
▸ getOverlays(filter?, modify?): Iterator<Node>
Returns an iterator for child overlays. The iterator does not support adding or deleting items from overlays by default. If it is necessary to modify a collection of overlays, pass true as the last parameter.
Example
// Gets a writable iterator
const it = node.getOverlays(null, true);| Name | Type | Description |
|---|---|---|
Optional filter | (node: Node) => boolean | A filter function. Returns all overlays if null. |
Optional modify | boolean | An option to specify if the iterator supports adding/removing items from the collection. false by default. |
An iterator for child overlays.
DocumentViewWidget.getOverlays
▸ getOverlaysCount(): number
Returns amount of overlays
number
DocumentViewWidget.getOverlaysCount
▸ getPaddingStyle(): SpaceStyle<string | number>
Return padding style
SpaceStyle<string | number>
padding
DocumentViewWidget.getPaddingStyle
▸ getPagesCount(): number
Return pages count
number
pages count
DocumentViewWidget.getPagesCount
▸ getPaperFormat(): AbstractPaperFormat
Return current paper format
DocumentViewWidget.getPaperFormat
▸ getParent(): Node
Return parent node
parent node
▸ getPreferredSize(): Rect
Return preferred size to layout children
DocumentViewWidget.getPreferredSize
▸ getProperties(context?): OptionsOut
Gets all the properties pertaining to this object See Group.getProperties for details Keep in mind that widgets does not return scene-graph information
| Name | Type | Description |
|---|---|---|
Optional context | ISerializationContext | serialization context |
properties
DocumentViewWidget.getProperties
▸ getProperty(name): any
Gets dynamic property by name. These properties can be used as a property bags
| Name | Type | Description |
|---|---|---|
name | string | property name |
any
DocumentViewWidget.getProperty
▸ getPropertyKeys(): string[]
Returns known properties keys
string[]
DocumentViewWidget.getPropertyKeys
▸ getRenderingFilter(): IFilter
Return filter to be used for rendering and picking
current filter
DocumentViewWidget.getRenderingFilter
▸ getResponsiveStyle(): ResponsiveStyle
Return responsive style
DocumentViewWidget.getResponsiveStyle
▸ getRoot(): Node
Returns root node.
If node doesn't have parent then it returns itself.
the root node
▸ getRulersVisible(): boolean
Returns visibility of the rulers
boolean
DocumentViewWidget.getRulersVisible
▸ getScaleScrollStrategy(): Delegate
Gets scale scroll strategy
scale scroll strategy
DocumentViewWidget.getScaleScrollStrategy
▸ getSceneTransform(): Transformation
Returns transformation from node to root scene
a transformation from node to root scene
DocumentViewWidget.getSceneTransform
▸ getSelectedDomElements(): AbstractElement[]
Returns selected dom elements
▸ getShapeByDomElement(domElement): Node
Find node for DOM element
| Name | Type | Description |
|---|---|---|
domElement | Element | dom element to find |
▸ getTag(): any
Returns the object associated with the node by user.
any
The node's user-object
▸ getTextArea(): ITextArea
Return active text area if any
▸ getTool(): CompositeTool
Returns root tool associated to this widget
▸ getToolByName<K>(toolName): AbstractTool
Returns the tool matching the given name.
This function also accepts tool 'path' instead of absolute name.
For example:
getToolByName("compositeTool.panningTools.trackPanning.TrackPanning")
Would return the same tool as
getToolByName("TrackPanning")
As long as there is only one tool named "TrackPanning" in this composite
See listToolsNames()
| Name | Type |
|---|---|
K | extends string |
| Name | Type | Description |
|---|---|---|
toolName | K | The tool name or path |
DocumentViewWidget.getToolByName
▸ getToolByType(toolType): AbstractTool
Returns the tool matching the given type. or null if nothing is matching the tool type
For example:
getToolByType(geotoolkit.controls.tools.Selection)
Would return the same tool as
getToolByName("pick")
| Name | Type | Description |
|---|---|---|
toolType | ClassType<any> | toolType of the tool |
DocumentViewWidget.getToolByType
▸ getViewScale(): number
Return current document view scale factor
number
current scale factor
DocumentViewWidget.getViewScale
▸ getVisible(): boolean
Return visibility of the node
boolean
true if node is visible
▸ getVisibleDeviceLimits(ignoreModelLimits?): Rect
Return visible device limits
| Name | Type | Description |
|---|---|---|
Optional ignoreModelLimits | boolean | flag defines whether to ignore ModelLimits or not |
DocumentViewWidget.getVisibleDeviceLimits
▸ getVisibleModelLimits(ignoreModelLimits?): Rect
Return visible model limits
| Name | Type | Description |
|---|---|---|
Optional ignoreModelLimits | boolean | flag defines whether to ignore ModelLimits or not |
DocumentViewWidget.getVisibleModelLimits
▸ getWireMode(): boolean
Return wire mode flag
boolean
▸ getWorldTransform(): Transformation
Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.
DocumentViewWidget.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
DocumentViewWidget.hasCssClass
▸ 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
DocumentViewWidget.hasEventListener
▸ indexOfBaseLayer(baseLayer): number
Return index of overlay ( index of the specified child or -1 if baseLayer is not found)
| Name | Type | Description |
|---|---|---|
baseLayer | Node | baseLayer to check index |
number
DocumentViewWidget.indexOfBaseLayer
▸ indexOfChild(node): number
Return index of child ( index of the specified child or -1 if node is not found)
| Name | Type | Description |
|---|---|---|
node | Node | node to check index |
number
DocumentViewWidget.indexOfChild
▸ indexOfOverlay(overlay): number
Return index of overlay ( index of the specified child or -1 if overlay is not found)
| Name | Type | Description |
|---|---|---|
overlay | Node | overlay to check index |
number
DocumentViewWidget.indexOfOverlay
▸ Protected initializeTools(options?): DocumentEditorWidget
| Name | Type | Description |
|---|---|---|
Optional options | ToolsOptions | tools options |
this
DocumentViewWidget.initializeTools
▸ insertBaseLayer(index, baseLayer): DocumentEditorWidget
Insert child baseLayer at specified index
| Name | Type | Description |
|---|---|---|
index | number | specified index |
baseLayer | Node | a baseLayer to add |
this
DocumentViewWidget.insertBaseLayer
▸ insertChild(index, node): DocumentEditorWidget
Insert child node at specified index
| Name | Type | Description |
|---|---|---|
index | number | specified index |
node | Node | a child node to add |
this
DocumentViewWidget.insertChild
▸ insertOverlay(index, overlay): DocumentEditorWidget
Insert child overlay at specified index
| Name | Type | Description |
|---|---|---|
index | number | specified index |
overlay | Node | a overlay to add |
this
DocumentViewWidget.insertOverlay
▸ invalidate(bounds?, force?): DocumentEditorWidget
Invalidate node
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | optional rectangular area to be invalidated, or force flag if rectangle is empty |
Optional force | boolean | optional boolean parameter that can force invalidation |
this
▸ invalidateLayout(propagate?): DocumentEditorWidget
Notify that layout is invalidated. Send event Events.LayoutInvalidated
| Name | Type | Description |
|---|---|---|
Optional propagate | boolean | propagate invalidate layout to parent |
this
DocumentViewWidget.invalidateLayout
▸ invalidateParent(bounds?, force?): DocumentEditorWidget
Invalidate parent area
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | area to invalidate |
Optional force | boolean | force |
this
DocumentViewWidget.invalidateParent
▸ isClippingEnabled(): boolean
Returns if clipping is enabled or not for this node.
boolean
DocumentViewWidget.isClippingEnabled
▸ isContentClippingEnabled(): boolean
Returns if page content clipping is enabled or not for this node.
boolean
DocumentViewWidget.isContentClippingEnabled
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isEventPropagationEnabled(): boolean
Return true if event propagation is enabled from child to parent
boolean
DocumentViewWidget.isEventPropagationEnabled
▸ isHorizontalFlip(): boolean
Return true if the representation is flipped horizontally
boolean
flip
DocumentViewWidget.isHorizontalFlip
▸ isLayoutInvalidated(): boolean
Return true if layout is invalid
boolean
DocumentViewWidget.isLayoutInvalidated
▸ isNotificationEnabled(): boolean
return state of notification
boolean
current notification state
DocumentViewWidget.isNotificationEnabled
▸ isPickingChildrenEnabled(): boolean
Returns if picking children is enabled or not for this node.
boolean
pickingChildren
DocumentViewWidget.isPickingChildrenEnabled
▸ isSelectable(): boolean
Returns true if node can be picked/selected.
boolean
The selectable flag
DocumentViewWidget.isSelectable
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ isVerticalFlip(): boolean
Return true if the representation is flipped vertically
boolean
flip
DocumentViewWidget.isVerticalFlip
▸ listToolsNames(): string[]
List all the tools contained in this composite. Prepend their parent tools parent using a '.'.
string[]
DocumentViewWidget.listToolsNames
▸ loadDocument(document, dispose?): DocumentEditorWidget
Load document
| Name | Type | Description |
|---|---|---|
document | Document | document to load |
Optional dispose | boolean | dispose active template |
DocumentViewWidget.loadDocument
▸ loadTemplate(template, registry?): void
Load template loads the saved visual properties of the current template. It is only a visual representation of the current widget. It does not contain any data
| Name | Type | Description |
|---|---|---|
template | string | template to be applied to current widget |
Optional registry | Registry | registry |
void
DocumentViewWidget.loadTemplate
▸ moveTo(area, vAlign?, hAlign?): DocumentEditorWidget
MoveTo position of node to specified area
| Name | Type | Description |
|---|---|---|
area | Rect | specified area |
Optional vAlign | string | vertical alignment. It can be "top", "bottom", "center". |
Optional hAlign | string | horizontal alignment It can be "left", "right", "center". |
this
▸ notify<E>(type, source, args?): DocumentEditorWidget
Notify listeners of the Node
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event |
source | DocumentEditorWidget | source who called the event |
Optional args | EventMap[E] | event arguments |
this
▸ Protected notifyRoot(event, source, args?): Node
Notify an even to root node
| Name | Type | Description |
|---|---|---|
event | string | type of event |
source | Node | source who called the event |
Optional args | any | event arguments |
this
▸ off<E>(type?, callback?): DocumentEditorWidget
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: DocumentEditorWidget, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): DocumentEditorWidget
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: DocumentEditorWidget, args: EventMap[E]) => void | to be called |
this
▸ Protected onBoundsChanged(bounds): DocumentEditorWidget
Occurs when bounds has been changed
| Name | Type | Description |
|---|---|---|
bounds | Rect | bound of the node in the parent coordinates |
this
DocumentViewWidget.onBoundsChanged
▸ Protected onChildAdded(child): void
This method is called it child or children are added
void
DocumentViewWidget.onChildAdded
▸ Protected onChildRemoved(child): void
This method is called it child or children are removed
| Name | Type | Description |
|---|---|---|
child | Node | removed child |
void
DocumentViewWidget.onChildRemoved
▸ Protected onDocumentRebuild(): void
void
DocumentViewWidget.onDocumentRebuild
▸ Protected onParentChanged(node): DocumentEditorWidget
This method is called when parent changes. Do not call it directly.
| Name | Type | Description |
|---|---|---|
node | Node | node to change parent |
this
DocumentViewWidget.onParentChanged
▸ Protected onVisibilityChanged(): void
This method is called if visibility is changed. Send event Events.VisibilityChanged
void
DocumentViewWidget.onVisibilityChanged
▸ parseDocument(document, registry?): Promise<Document>
Parse and Load document
| Name | Type | Description |
|---|---|---|
document | string | document to parse and load |
Optional registry | Registry | DOM elements registry |
Promise<Document>
DocumentViewWidget.parseDocument
▸ Protected postRendering(context, callback?): void
To be called after rendering, used for PDF output
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
Optional callback | () => void | callback to be called after rendering |
void
DocumentViewWidget.postRendering
▸ Protected preRendering(context, callback?): void
Occurs before child rendering
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
Optional callback | () => void | callback to be called after rendering of geometry |
void
DocumentViewWidget.preRendering
▸ rebuild(force?, changes?): DocumentEditorWidget
Rebuild node. This method resets state, cache, and invalidate node.
| Name | Type | Description |
|---|---|---|
Optional force | boolean | optional boolean parameter that can force invalidation |
Optional changes | StateChanges | optional parameter to specify a reason of changes |
this
▸ redo(): DocumentEditorWidget
ReDo
this
▸ registerAnimationStyle(root): void
Register animation style.
| Name | Type | Description |
|---|---|---|
root | Node | root node for node |
void
DocumentViewWidget.registerAnimationStyle
▸ removeBaseLayer(baseLayer): DocumentEditorWidget
Remove child baseLayer
this
DocumentViewWidget.removeBaseLayer
▸ removeChild(node, disposeChildren?): DocumentEditorWidget
Remove child node
| Name | Type | Description |
|---|---|---|
node | Node | Node[] | node or array of nodes to be removed |
Optional disposeChildren | boolean | automatically dispose children. If it is true then method dispose is called for each child. |
this
DocumentViewWidget.removeChild
▸ removeCssClass(cssclass): DocumentEditorWidget
Removes css class from node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
DocumentViewWidget.removeCssClass
▸ removeDomElement(domNode?): DocumentEditorWidget
Remove document element
| Name | Type | Description |
|---|---|---|
Optional domNode | Element | document element, otherwise active element will be deleted |
▸ removeInvalidateHandler(handler): DocumentEditorWidget
Remove invalidate handler
Deprecated
since 4.0, use Node.off instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
DocumentViewWidget.removeInvalidateHandler
▸ removeOverlay(overlay): DocumentEditorWidget
Remove child overlay
this
DocumentViewWidget.removeOverlay
▸ render(context): void
Render group
| Name | Type | Description |
|---|---|---|
context | RenderingContext | context to render group |
void
▸ renderAsync(context, callback): void
Render node in asynchronous mode. This implementation doesn't support cache for now.
| Name | Type | Description |
|---|---|---|
context | RenderingContext | The rendering context to be used to draw the node |
callback | () => void | callback function |
void
DocumentViewWidget.renderAsync
▸ Protected renderBackground(context, bounds): DocumentEditorWidget
Render background
| Name | Type | Description |
|---|---|---|
context | RenderingContext | context to render background |
bounds | Rect | group bounds |
this
DocumentViewWidget.renderBackground
▸ Protected renderBaseLayers(context): DocumentEditorWidget
Render baseLayers on bottom of cache. This method does nothing, but can be implemented to render graphics on bottom of cache and between borders
| Name | Type | Description |
|---|---|---|
context | RenderingContext | context to render baseLayers |
this
DocumentViewWidget.renderBaseLayers
▸ Protected renderBaseLayersAsync(context, callback): void
Render baseLayers on bottom of cache in asynchronous mode. This method calls renderBaseLayers
| Name | Type | Description |
|---|---|---|
context | RenderingContext | context to render overlays |
callback | () => void | callback function |
void
DocumentViewWidget.renderBaseLayersAsync
▸ Protected renderChildren(context): void
Render children
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
void
DocumentViewWidget.renderChildren
▸ Protected renderChildrenAsync(context, callback): void
Render children async
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
callback | () => void | callback function to be called then all children are rendered |
void
DocumentViewWidget.renderChildrenAsync
▸ Protected renderContent(context): void
render to specified context. This method calls preRendering, renderChildren, postRendering
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
void
DocumentViewWidget.renderContent
▸ Protected renderContentAsync(context, callback): void
Render children in asynchronous mode
| Name | Type | Description |
|---|---|---|
context | RenderingContext | The rendering context to be used to draw the node |
callback | () => void | callback function to be called then all children are rendered |
void
DocumentViewWidget.renderContentAsync
▸ Protected renderOverlays(context): DocumentEditorWidget
Render overlays on top of cache. This method does nothing, but can be implemented to render graphics on top of cache and between borders
| Name | Type | Description |
|---|---|---|
context | RenderingContext | context to render overlays |
this
DocumentViewWidget.renderOverlays
▸ Protected renderOverlaysAsync(context, callback): void
Render overlays on top of cache in asynchronous mode. This method calls renderOverlays
| Name | Type | Description |
|---|---|---|
context | RenderingContext | context to render overlays |
callback | () => void | callback function |
void
DocumentViewWidget.renderOverlaysAsync
▸ resumeUpdate(rebuild?, changes?): DocumentEditorWidget
Resume auto update
| Name | Type | Description |
|---|---|---|
Optional rebuild | boolean | force rebuild |
Optional changes | StateChanges | optional parameter to specify a reason of changes |
this
DocumentViewWidget.resumeUpdate
▸ rotate(theta, x, y): DocumentEditorWidget
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
▸ saveTemplate(registry?): string
Save template saves visual properties of the current template. It is only a visual representation of the current widget. It does not contain any data
| Name | Type | Description |
|---|---|---|
Optional registry | Registry | registry |
string
DocumentViewWidget.saveTemplate
▸ scale(xx, yy): DocumentEditorWidget
Scale node
| Name | Type | Description |
|---|---|---|
xx | number | x scale factor |
yy | number | y scale factor |
this
▸ scaleView(factor): DocumentEditorWidget
Scale document view
| Name | Type | Description |
|---|---|---|
factor | number | scale factor |
this
▸ scrollToPage(pageIndex): DocumentEditorWidget
Scroll to page
| Name | Type | Description |
|---|---|---|
pageIndex | number | page index |
DocumentViewWidget.scrollToPage
▸ selectDomElement(domElement): DocumentEditorWidget
Select Active dom element
| Name | Type | Description |
|---|---|---|
domElement | Element | dom element to select |
▸ selectDomElements(selection): DocumentEditorWidget
Select set of dom elements
| Name | Type | Description |
|---|---|---|
selection | AbstractElement[] | array of dom element to select |
▸ setAnimationStyle(animationStyle): DocumentEditorWidget
Sets animation style
| Name | Type | Description |
|---|---|---|
animationStyle | Type | animation style |
DocumentViewWidget.setAnimationStyle
▸ setAutoModelLimitsMode(mode): DocumentEditorWidget
Set Model Limits Logics to use when no Model Limits have been set set to true: will use parents width and height, starting at 0 set to false: will use parents bounds. This is convenient method. It creates AutoModelLimitsStrategy
| Name | Type | Description |
|---|---|---|
mode | boolean | Model Limits Logics to be used |
this
DocumentViewWidget.setAutoModelLimitsMode
▸ setAutoModelLimitsStrategy(strategy): DocumentEditorWidget
Set Model Limits Logics Strategy
| Name | Type | Description |
|---|---|---|
strategy | ModelLimitsStrategy | Model Limits logic strategy to use |
this
DocumentViewWidget.setAutoModelLimitsStrategy
▸ setBounds(bounds): DocumentEditorWidget
Sets bounds of the node in the parent coordinates
| Name | Type | Description |
|---|---|---|
bounds | object | Rect | bound of the node in the parent coordinates |
this
▸ setCache(cache, rebuild?): DocumentEditorWidget
Sets cache to be used to cache
| Name | Type | Description |
|---|---|---|
cache | Cache | cache to be used |
Optional rebuild | boolean | rebuild cache |
this
▸ setChild(index, node): DocumentEditorWidget
Replace child node by index
| Name | Type | Description |
|---|---|---|
index | number | index of the node |
node | Node | node |
this
▸ setClipStyle(style): DocumentEditorWidget
Sets a new clipping style
| Name | Type | Description |
|---|---|---|
style | GraphicsPath | ClipStyle | Options | a new clipping style |
this
DocumentViewWidget.setClipStyle
▸ setContentOrientation(orientation): DocumentEditorWidget
Set content orientation
| Name | Type | Description |
|---|---|---|
orientation | Orientation | content orientation |
this
DocumentViewWidget.setContentOrientation
▸ setCss(style, merge?): DocumentEditorWidget
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): DocumentEditorWidget
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
DocumentViewWidget.setCssClass
▸ setCssTransform(transform): DocumentEditorWidget
Set CSS transformation
| Name | Type | Description |
|---|---|---|
transform | string | Transformation | transformation css transformation instruction or Transformation instance |
this
DocumentViewWidget.setCssTransform
▸ setDesiredHeight(value, silent?): DocumentEditorWidget
Sets desired height of the group as a layoutable object
| Name | Type | Description |
|---|---|---|
value | string | number | desired height to set, use 'auto' for automatic desired height |
Optional silent | boolean | silent setting |
this
DocumentViewWidget.setDesiredHeight
▸ setDesiredWidth(value, silent?): DocumentEditorWidget
Sets desired width of the group as a layoutable object
| Name | Type | Description |
|---|---|---|
value | string | number | desired width to set |
Optional silent | boolean | silent setting |
this
DocumentViewWidget.setDesiredWidth
▸ setDocumentInfo(documentInfo): DocumentEditorWidget
Set Document information
| Name | Type | Description |
|---|---|---|
documentInfo | DocumentInfo | document info |
DocumentViewWidget.setDocumentInfo
▸ setFillStyle(fillStyle, merge?): DocumentEditorWidget
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
DocumentViewWidget.setFillStyle
▸ setFocus(): DocumentEditorWidget
Set focus
this
▸ setFooterVisible(visible, template?): DocumentEditorWidget
Set page footer visible state
| Name | Type | Description |
|---|---|---|
visible | boolean | visible state |
Optional template | string | footer template |
this
▸ setGridsVisible(visible): DocumentEditorWidget
Sets visibility of the pages grid
| Name | Type | Description |
|---|---|---|
visible | boolean | flag specifying visibility of the pages grid |
DocumentViewWidget.setGridsVisible
▸ setHeaderVisible(visible, template?): DocumentEditorWidget
Set page header visible state
| Name | Type | Description |
|---|---|---|
visible | boolean | visible state |
Optional template | string | header template |
this
▸ setHorizontalFlip(enable): DocumentEditorWidget
Set horizontal flip of the representation
| Name | Type | Description |
|---|---|---|
enable | boolean | enable flip |
this
DocumentViewWidget.setHorizontalFlip
▸ setId(id): DocumentEditorWidget
Allows the user to associate any identifier
| Name | Type | Description |
|---|---|---|
id | string | number | object id |
this
▸ setInfiniteMode(infinityMode): DocumentEditorWidget
Set infinity mode flag to draw composite without collision check
| Name | Type | Description |
|---|---|---|
infinityMode | boolean | infinity mode flag |
this
DocumentViewWidget.setInfiniteMode
▸ setLayout(layout): DocumentEditorWidget
Associate layout with a group.
| Name | Type | Description |
|---|---|---|
layout | Record<string, any> | Layout | layout instance to be set or layout properties to apply |
this
▸ Protected setLayoutInvalidated(invalidated): void
Set invalidation status
| Name | Type | Description |
|---|---|---|
invalidated | boolean | invalidated layout |
void
DocumentViewWidget.setLayoutInvalidated
▸ setLayoutStyle(layoutStyle, silent?, merge?): DocumentEditorWidget
specify desired layout style
| Name | Type | Description |
|---|---|---|
layoutStyle | LayoutStyle<string | number> | Options<string | number> | desired layout style |
Optional silent | boolean | silent setting |
Optional merge | boolean | true if you want to merge layoutStyle with existing attribute, false by default |
this
DocumentViewWidget.setLayoutStyle
▸ setLineStyle(lineStyle, merge?): DocumentEditorWidget
Sets border color Returns this
| 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
DocumentViewWidget.setLineStyle
▸ setLocalTransform(localTransform, force?): DocumentEditorWidget
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
DocumentViewWidget.setLocalTransform
▸ setMarginsStyle(margins, merge?): DocumentEditorWidget
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
DocumentViewWidget.setMarginsStyle
▸ setModelLimits(limits): DocumentEditorWidget
Sets inner model limits
| Name | Type | Description |
|---|---|---|
limits | Type | inner limits |
this
DocumentViewWidget.setModelLimits
▸ setName(name): DocumentEditorWidget
Sets name of the node
| Name | Type | Description |
|---|---|---|
name | string | The node name |
this
▸ setNotification(notify, force?): DocumentEditorWidget
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
DocumentViewWidget.setNotification
▸ setOpacity(opacity, blendMode?): DocumentEditorWidget
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
▸ setOptions(options?): DocumentEditorWidget
Sets widget options
Example
//call setOptions on widget after construction and change the default behavior.
widgets.setOptions({
'rulersvisible': false,
'gridsvisible': false
});| Name | Type | Description |
|---|---|---|
Optional options | OptionsBase | widget options |
▸ setPaddingStyle(paddingStyle, merge?): DocumentEditorWidget
Sets padding style
| Name | Type | Description |
|---|---|---|
paddingStyle | Type<string | number> | padding style |
Optional merge | boolean | true if you want to merge paddingStyle with existing attribute, false by default |
this
DocumentViewWidget.setPaddingStyle
▸ setPaperFormat(paperFormat): DocumentEditorWidget
Set paper format
| Name | Type | Description |
|---|---|---|
paperFormat | AbstractPaperFormat | paper format |
DocumentViewWidget.setPaperFormat
▸ setPaperSize(paperFormat, orientation?, margins?): DocumentEditorWidget
Set paper size
| Name | Type | Description |
|---|---|---|
paperFormat | string | PaperFormat | paper format |
Optional orientation | PaperOrientation | paper orientation |
Optional margins | PaperMargins | paper margins |
DocumentViewWidget.setPaperSize
▸ setProperties(properties?): DocumentEditorWidget
Sets all the properties pertaining to this object Keep in mind that widgets does not accept scene-graph information NOTE properties.children property will be ignored
| Name | Type | Description |
|---|---|---|
Optional properties | Options | properties |
this
DocumentViewWidget.setProperties
▸ setProperty(name, value): DocumentEditorWidget
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
DocumentViewWidget.setProperty
▸ setRenderingFilter(filter): DocumentEditorWidget
Sets filter to be applied before rendering and picking
| Name | Type | Description |
|---|---|---|
filter | IFilter | filter to set |
this
DocumentViewWidget.setRenderingFilter
▸ setResponsiveStyle(style): DocumentEditorWidget
Sets responsive style.
| Name | Type | Description |
|---|---|---|
style | Options | ResponsiveStyle | responsive style |
this
DocumentViewWidget.setResponsiveStyle
▸ setRulersVisible(visible): DocumentEditorWidget
Sets visibility of the rulers.
| Name | Type | Description |
|---|---|---|
visible | boolean | flag specifying visibility of the rulers |
DocumentViewWidget.setRulersVisible
▸ setScaleScrollStrategy(strategy?): DocumentEditorWidget
Sets scale scroll strategy
| Name | Type | Description |
|---|---|---|
Optional strategy | Delegate | scale scroll strategy |
this
DocumentViewWidget.setScaleScrollStrategy
▸ setSelectable(selectable): DocumentEditorWidget
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
DocumentViewWidget.setSelectable
▸ setSilent(bool): DocumentEditorWidget
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setTag(tag): DocumentEditorWidget
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
▸ Protected setTool(tool): DocumentEditorWidget
Set root tool associated to this widget
| Name | Type | Description |
|---|---|---|
tool | CompositeTool | tool to be set |
▸ setVerticalFlip(flip): DocumentEditorWidget
Set vertical flip of the representation
| Name | Type | Description |
|---|---|---|
flip | boolean | flag to set the vertical flip of the representation |
this
DocumentViewWidget.setVerticalFlip
▸ setViewScale(scaleFactor): DocumentEditorWidget
Set document view scale factor
| Name | Type | Description |
|---|---|---|
scaleFactor | number | new scale factor |
this
DocumentViewWidget.setViewScale
▸ setVisible(value): DocumentEditorWidget
Sets visibility of the node. Send event Events.VisibilityChanged
| Name | Type | Description |
|---|---|---|
value | boolean | flag specifying visibility of the node |
this
▸ setVisibleModelLimits(visibleModelBounds, deviceBounds?): DocumentEditorWidget
Set visible model limits
| Name | Type | Description |
|---|---|---|
visibleModelBounds | Rect | visible model limits or bounds |
Optional deviceBounds | Rect | device bounds |
this
DocumentViewWidget.setVisibleModelLimits
▸ setWireMode(enabled): DocumentEditorWidget
Set wire mode flag
| Name | Type | Description |
|---|---|---|
enabled | boolean | wire move flag |
this
▸ setZIndex(value): DocumentEditorWidget
Sets z-index for node (set null for default)
| Name | Type | Description |
|---|---|---|
value | number | index determining node z-position |
this
▸ shear(shx, shy): DocumentEditorWidget
Shear this node's bounds
| Name | Type | Description |
|---|---|---|
shx | number | x-axis shear |
shy | number | y-axis shear |
this
▸ suspendUpdate(): DocumentEditorWidget
Suspend auto update
this
DocumentViewWidget.suspendUpdate
▸ Protected syncRubberBandShape(): void
void
▸ toString(): string
Returns a string representation of this object (generally the classname)
string
A string representation
▸ translate(tx, ty): DocumentEditorWidget
Translate bounds
| Name | Type | Description |
|---|---|---|
tx | number | x translation |
ty | number | y translation |
this
▸ translateView(dx, dy): DocumentEditorWidget
Translate view
| Name | Type | Description |
|---|---|---|
dx | number | offset x |
dy | number | offset y |
this
DocumentViewWidget.translateView
▸ undo(): DocumentEditorWidget
UnDo
this
▸ unregisterAnimationStyle(root): void
Unregister animation style.
| Name | Type | Description |
|---|---|---|
root | AnimatedNode | root node for node |
void
DocumentViewWidget.unregisterAnimationStyle
▸ updateHandles(): DocumentEditorWidget
Update selection handles
▸ updateLayout(targets?): DocumentEditorWidget
Updates layout(s)
Fires
| Name | Type | Description |
|---|---|---|
Optional targets | ILayoutable[] | optional parameter about which element to layout |
this
DocumentViewWidget.updateLayout
▸ updateSceneTransformation(): DocumentEditorWidget
Update scene transformation
this
DocumentViewWidget.updateSceneTransformation
▸ updateScrollPositions(enableAnimation?): DocumentEditorWidget
update Scroll Positions using visible limits and model limits.
| Name | Type | Description |
|---|---|---|
Optional enableAnimation | boolean | show animation |
this
DocumentViewWidget.updateScrollPositions
▸ updateState(regions?, changes?): DocumentEditorWidget
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
DocumentViewWidget.updateState
▸ updateSuspended(): boolean
Return state of suspend state
boolean
state of update
DocumentViewWidget.updateSuspended
▸ Protected updateTimeStamp(): DocumentEditorWidget
Update time stamp to indicate that Node or Children has been changed.
this
DocumentViewWidget.updateTimeStamp
▸ zoomIn(): DocumentEditorWidget
Zoom out
▸ zoomOut(): DocumentEditorWidget
Zoom in
▸ Static enableSceneGraphNotification(enabled): void
Enable / disable all notifications
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets if this object sends notifications |
void
DocumentViewWidget.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
DocumentViewWidget.getClassName
▸ Static isSceneGraphNotificationEnabled(): boolean
Return status of the global notification for all nodes.
boolean