API / geotoolkit / scene / shapes / Text / Text
Defines simple text shape. Text shapes support various kinds of text strings in the model. Anchoring technique allows developer to specify location of the text relative to anchor point.
Other attributes like text size and style can also be set.
↳
Text↳↳
Callout↳↳
TextElement
Constructors
| [new Text(options)](/solutions/geotoolkit/apis/classes/geotoolkit.scene.shapes.text.text.md#new text(options)) | [new Text(text, ax, ay, width, height, textStyle, sizeIsInDeviceSpace, alignment)](/solutions/geotoolkit/apis/classes/geotoolkit.scene.shapes.text.text.md#new text(text, ax, ay, width, height, textstyle, sizeisindevicespace, alignment)) |
|---|
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
alignment | AnchorType | Alignment according to the anchor point |
autosize | boolean | Automatically fit shape bounds to text size, default is true Set it to false if you have more than one paragraph inside with different alignment |
ax | number | Anchor x position |
ay | number | Anchor y position |
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 |
ellipsisstring | string | String ellipsis that renders if ellipsis is true |
fillstyle | string | Style applied on fill |
fillstyle | FillStyle | Style applied on fill |
fillstyle-color | string | Color in CSS form |
fillstyle-evenoddmode | boolean | Even-odd fill mode |
fillstyle-fillpattern | Pattern | Pattern |
fillstyle-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 |
fillstyle-fillpattern-patternname | string | Name of this pattern for indexing |
fillstyle-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
fillstyle-foreground | string | Foreground color |
fillstyle-pattern | Pattern | Pattern |
height | number | Shape height |
id | string | number | Id of the node, its a unique identifier |
ispointingup | boolean | Defines whether the shape is always pointing up |
layoutstyle | LayoutStyle | Layout style to specify how to lay out shape |
layoutstyle-constraint | SizeConstraint | Layout constrains |
layoutstyle-flexgrow | number | Number specifying how much the item will grow relative to the rest of the items inside the same container |
layoutstyle-flexshrink | number | Number specifying how much the item will shrink relative to the rest of the items inside the same container |
layoutstyle-float | string | Float position |
layoutstyle-position | string | Layout position |
layoutstyle-size | number | string | Layout size |
linestyle | string | Style applied on outline |
linestyle | LineStyle | Style applied on outline |
linestyle-color | string | Color in CSS form |
linestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
linestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
linestyle-linecap | CapStyle | The line cap style |
linestyle-linedashoffset | number | Line dash offset of dashed line |
linestyle-linejoin | JoinStyle | The line join style |
linestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
linestyle-scalable | boolean | True if width should depend on transformation |
linestyle-unit | string | Optional unit for the width |
linestyle-width | number | string | The line thickness |
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 |
maxdimension | Dimension | Maximum size for rendering |
maxdimension-height | number | Height of dimension |
maxdimension-width | number | Width of dimension or properties |
mindimension | Dimension | Minimum size for rendering |
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 |
padding | number | |
paddingstyle | number | string | Inner padding style in device coordinates |
preserveaspectratio | boolean | Preserve aspect ratio of the anchored shape |
preservereadingorientation | boolean | Preserve reading orientation for local transform |
preserverightangle | boolean | Preserve right angle for local transformation |
radius | number | Border radius in device coordinates |
rotationangle | number | Rotation angle at anchor |
scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
scalescrollstrategy-enabled | boolean | Enable flag |
selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
showellipsis | boolean | Ellipsis flag |
sizeisindevicespace | boolean | Is coordinate in device space |
sizemode | SizeMode | Text size mode, default value depends on width and height settings |
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 |
text | string | Text to display |
textstyle | string | TextStyle to display |
textstyle | TextStyle | TextStyle to display |
textstyle-alignment | AlignmentStyle | Alignment |
textstyle-autosize | boolean | Auto font size on high definition display |
textstyle-background | string | Background style |
textstyle-background | FillStyle | Background style |
textstyle-baseline | BaseLineStyle | Base line |
textstyle-color | string | Color in CSS form |
textstyle-fill | FillStyle | Text fill style |
textstyle-font | string | Font see |
textstyle-fonturl | string | The place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword |
textstyle-lineheight | string | number | Line height |
textstyle-multiline | boolean | Allow multi-line text |
textstyle-outline | string | Outline style |
textstyle-outline | LineStyle | Outline style |
textstyle-overflowwrap | OverflowWrapStyle | Overflow wrap |
textstyle-strikethrough | string | Strikethrough style |
textstyle-strikethrough | LineStyle | Strikethrough style |
textstyle-textoverflow | TextOverflowStyle | Text overflow |
textstyle-underline | string | Underline style |
textstyle-underline | LineStyle | Underline style |
textstyle-underlineoffset | string | number | Underline offset distance |
textstyle-whitespace | WhiteSpaceStyle | White space |
textstyle-wordbreak | WordBreakStyle | Word break |
texttransform | Transform | Text-transform (uppercase, lowercase, capitalize) |
transform | string | Additional CSS transformation applied to node or 'none' |
transform | Transformation | Additional CSS transformation applied to node or 'none' |
useminmaxdimensions | boolean | Use the min max dimensions to limit visual size |
userheight | number | Height |
userwidth | number | Width |
visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
width | number | Shape width |
z-index | number | Define node z-index |
Constructors
• new Text(options?)
| Name | Type | Description |
|---|---|---|
Optional options | Options | shape properties |
AnchoredShape.constructor
• new Text(text?, ax?, ay?, width?, height?, textStyle?, sizeIsInDeviceSpace?, alignment?)
| Name | Type | Description |
|---|---|---|
Optional text | string | number | text to display |
Optional ax | number | x coordinate of anchor |
Optional ay | number | y coordinate of anchor |
Optional width | number | desired width |
Optional height | number | desired height |
Optional textStyle | Type | textStyle to display |
Optional sizeIsInDeviceSpace | boolean | size Is In Device Space |
Optional alignment | AnchorType | anchor type |
AnchoredShape.constructor
Methods
▸ addCssClass(cssclass): Text
Adds new css class to node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
▸ addInvalidateHandler(handler): Text
Add invalidate handler
Deprecated
since 4.0, use Node.on instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
AnchoredShape.addInvalidateHandler
▸ Protected applyOpacity(context): Text
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
AnchoredShape.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(): Text
All subclasses should override copyConstructor or provide custom implementation for this method
clone
▸ connectStyle(style, type, callback): Text
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
▸ Protected copyConstructor(src, deepCopy?): Text
Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.
| Name | Type | Description |
|---|---|---|
src | Text | Source to copy from |
Optional deepCopy | boolean | deep copy |
this
▸ disconnectStyle(style, type, callback): Text
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
▸ 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.
void
▸ enableEventPropagation(enable): Text
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
AnchoredShape.enableEventPropagation
▸ execute(delegate): Text
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: Text) => void | Function to execute |
The result if any or this
▸ execute<T>(delegate): T
| Name |
|---|
T |
| Name | Type |
|---|---|
delegate | (this: Text) => 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)
▸ getAnchor(tr?): Point
Gets the anchor
| Name | Type | Description |
|---|---|---|
Optional tr | Transformation | transformation to transform anchor |
▸ getAnchorType(): AnchorType
Returns the current anchor type.
current anchor type
▸ getAnchorX(): number
Return anchored x position
number
▸ getAnchorY(): number
Return anchored y position
number
▸ getAnimationStyle(): AnimationStyle
Return animation style
animationStyle current animation style
AnchoredShape.getAnimationStyle
▸ getAspectRatio(): number
Returns aspect ratio of the content of the shape Returns 1
number
▸ getAutoSize(): boolean
Return auto size mode
boolean
▸ getBounds(): Rect
Return bound in the parent coordinates
▸ getClassName(): string
string
▸ getClipStyle(): ClipStyle
Gets the current clipping style
clipping style
▸ getCornerRadius(): number
return corner radius
number
radius
▸ 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
▸ getDisplayableText(): string
Returns the text string that will be rendered depending on textStyle's wrapping value.
string
the text string that will be rendered
▸ getEllipsisOptions(): EllipsisOptions
ellipsis options
▸ getEllipsisString(): string
Get ellipsis text
string
▸ getFillStyle(): FillStyle
Return fill style
fillStyle current fill style
▸ getHeight(): number
Return height of the shape
number
▸ getId(): string | number
Returns the associated identifier of the node
string | number
The node's id
▸ Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>
Gets invalidate method
AttributeCallback<EventDispatcher>
method to invalidate this object
AnchoredShape.getInvalidateMethod
▸ getIsPointingUp(): boolean
Returns true if the shape is always pointing up
boolean
true if the shape is always pointing up
▸ getLayoutStyle(): LayoutStyle<string | number>
Return desired layout style
LayoutStyle<string | number>
▸ getLineStyle(): LineStyle
Return line style
lineStyle current line style
▸ getLocalTransform(): Transformation
Retrieves the transformation of bounds to parent
transform the local transform.
AnchoredShape.getLocalTransform
▸ getMarginsStyle(): SpaceStyle<string | number>
Return margins style
SpaceStyle<string | number>
▸ getMaxSize(): Dimension
returns the maximum device space rendering dimension only works when setUseMinMaxSize is enabled.
max size
▸ getMinSize(): Dimension
returns the minimum device space rendering dimension only works when setUseMinMaxSize is enabled.
min size
▸ 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
AnchoredShape.getOpacityBlendMode
▸ getPadding(): number
return inner padding
Deprecated
since 4.1 use getPaddingStyle instead
number
padding
▸ getPaddingStyle(): SpaceStyle<string | number>
Return padding style
SpaceStyle<string | number>
padding
▸ getParent(): Node
Return parent node
parent node
▸ getPreserveAspectRatio(): boolean
Returns true if aspect ratio is preserved
boolean
true if aspect ratio is preserved
AnchoredShape.getPreserveAspectRatio
▸ getPreserveReadingOrientation(): boolean
Returns true if the shape is always in a readable orientation
boolean
true if the shape is always in a readable orientation
AnchoredShape.getPreserveReadingOrientation
▸ getPreserveRightAngle(): boolean
Returns true if right angles are preserved
boolean
true if right angles are preserved
AnchoredShape.getPreserveRightAngle
▸ getProperties(context?): OptionsOut
Gets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional context | ISerializationContext | serialization context |
properties
▸ 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[]
▸ getRenderingFilter(): IFilter
Return filter to be used for rendering and picking
current filter
AnchoredShape.getRenderingFilter
▸ getResponsiveStyle(): ResponsiveStyle
Return responsive style
AnchoredShape.getResponsiveStyle
▸ getRoot(): Node
Returns root node.
If node doesn't have parent then it returns itself.
the root node
▸ getRotationAngle(): number
Returns rotation angle (in radians)
number
rotationAngle rotation angle at anchor
AnchoredShape.getRotationAngle
▸ getScaleScrollStrategy(): Delegate
Gets scale scroll strategy
scale scroll strategy
AnchoredShape.getScaleScrollStrategy
▸ getSceneTransform(): Transformation
Returns transformation from node to root scene
a transformation from node to root scene
AnchoredShape.getSceneTransform
▸ getShowEllipsis(): boolean
Returns ellipsis flag
boolean
ellipsis flag
▸ getSize(): Dimension
Returns the size as a dimension object.
size
▸ getSizeIsInDeviceSpace(): boolean
Returns true if the shape size is set in device space
boolean
true if size is defined in device space
AnchoredShape.getSizeIsInDeviceSpace
▸ getSizeMode(): SizeMode
Returns how the size is computed
size mode
▸ getTag(): any
Returns the object associated with the node by user.
any
The node's user-object
▸ getText(): string
Get this text's contents as a string.
string
text
▸ getTextStyle(): TextStyle
The style associated with this text.
text style
▸ getTextTransform(): string
Returns text transform type
string
▸ getUseMinMaxSize(): boolean
true if using the min max device space sizes
boolean
true if using the min max device space sizes
AnchoredShape.getUseMinMaxSize
▸ getUserHeight(): number
Returns user defined height (if exists)
number
▸ getUserWidth(): number
Returns user defined width (if exists)
number
▸ getVisible(): boolean
Return visibility of the node
boolean
true if node is visible
▸ getWidth(): number
Return width of the shape
number
▸ getWorldTransform(): Transformation
Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.
transform the world transform.
AnchoredShape.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
AnchoredShape.hasEventListener
▸ hitTest(area, radius?): Hits
Hit test in the device coordinate. This method checks if any point is intersects <html>node inside text
| Name | Type | Description |
|---|---|---|
area | Area | model area or position |
Optional radius | number | radius of selection |
properties
▸ invalidate(bounds?, force?): Text
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?): Text
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
AnchoredShape.invalidateParent
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isEventPropagationEnabled(): boolean
Return true if event propagation is enabled from child to parent
boolean
AnchoredShape.isEventPropagationEnabled
▸ isNotificationEnabled(): boolean
return state of notification
boolean
current notification state
AnchoredShape.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?): Text
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?): Text
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: Text, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): Text
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: Text, args: EventMap[E]) => void | to be called |
this
▸ Protected onParentChanged(node): Text
This method is called when parent changes. Do not call it directly.
| Name | Type | Description |
|---|---|---|
node | Node | node to change parent |
this
▸ Protected onVisibilityChanged(): void
This method is called if visibility is changed. Send event Events.VisibilityChanged
void
AnchoredShape.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
AnchoredShape.registerAnimationStyle
▸ removeCssClass(cssclass): Text
Removes css class from node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
▸ removeInvalidateHandler(handler): Text
Remove invalidate handler
Deprecated
since 4.0, use Node.off instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
AnchoredShape.removeInvalidateHandler
▸ 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
▸ rotate(theta, x?, y?): Text
Rotate bounds around a given coordinate or anchor point
| Name | Type | Description |
|---|---|---|
theta | number | angle to rotate node, in radians |
Optional x | number | x coordinate to rotate around, use anchor-x if not specified |
Optional y | number | y coordinate to rotate around, use anchor-y if not specified |
this
▸ scale(xx, yy): Text
Scale node
| Name | Type | Description |
|---|---|---|
xx | number | x scale factor |
yy | number | y scale factor |
this
▸ setAnchor(p): Text
Sets anchor point to given position
| Name | Type | Description |
|---|---|---|
p | Point | point |
this
▸ setAnchor(x, y): Text
Sets anchor point to given position
| Name | Type | Description |
|---|---|---|
x | number | x coordinate |
y | number | y coordinate |
this
▸ setAnchorType(alignment): Text
Sets the anchor type.
| Name | Type | Description |
|---|---|---|
alignment | AnchorType | anchor alignment |
this
▸ setAnchorX(ax): Text
Sets x anchor position
| Name | Type | Description |
|---|---|---|
ax | number | anchor x position |
this
▸ setAnchorY(ay): Text
Sets y anchor position
| Name | Type | Description |
|---|---|---|
ay | number | anchor x position |
this
▸ setAnimationStyle(animationStyle): Text
Sets animation style
| Name | Type | Description |
|---|---|---|
animationStyle | Type | animation style |
AnchoredShape.setAnimationStyle
▸ setAutoSize(autoSize): Text
Automatically fit shape bounds to text size, default is true Set it to false if you have more than one paragraph inside with different alignment
| Name | Type | Description |
|---|---|---|
autoSize | boolean | auto size mode |
this
▸ setBounds(bounds): Text
Sets bounds of the node in the parent coordinates. This method takes anchor position and width and height if size is not in device space. This method was added to support layout.
| Name | Type | Description |
|---|---|---|
bounds | Rect | bound of the node in the parent coordinates |
this
▸ setClipStyle(style): Text
Sets a new clipping style
| Name | Type | Description |
|---|---|---|
style | GraphicsPath | ClipStyle | Options | a new clipping style |
this
▸ setCornerRadius(radius): Text
Set border radius in device coordinates.
| Name | Type | Description |
|---|---|---|
radius | number | border radius in device coordinates |
this
▸ setCss(style, merge?): Text
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): Text
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): Text
Set CSS transformation
| Name | Type | Description |
|---|---|---|
transform | string | Transformation | transformation css transformation instruction or Transformation instance |
this
▸ setEllipsisOptions(options): Text
Sets text overflow ellipsis options
| Name | Type | Description |
|---|---|---|
options | EllipsisOptions | text-overflow ellipsis options |
this
▸ setEllipsisString(ellipsisValue): Text
Sets ellipsis text to string under 15 characters
| Name | Type | Description |
|---|---|---|
ellipsisValue | string | value in the current section |
▸ setFillStyle(fillStyle, merge?): Text
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
▸ setHeight(height): Text
Set text height. If height set to zero, text will get its height from font.
| Name | Type | Description |
|---|---|---|
height | number | text height |
this
▸ setId(id): Text
Allows the user to associate any identifier
| Name | Type | Description |
|---|---|---|
id | string | number | object id |
this
▸ setIsPointingUp(isPointingUp): Text
Sets whether the shape is always pointing up. Particularly useful for text.
| Name | Type | Description |
|---|---|---|
isPointingUp | boolean | flag setting whether the shape is always pointing up |
this
▸ setLayoutStyle(layoutStyle, merge?): Text
Specify desired layout style
| Name | Type | Description |
|---|---|---|
layoutStyle | LayoutStyle<string | number> | Options<string | number> | desired layout style |
Optional merge | boolean | true if you want to merge layoutStyle with existing attribute, false by default |
▸ setLineStyle(lineStyle, merge?): Text
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?): Text
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
AnchoredShape.setLocalTransform
▸ setMarginsStyle(margins, merge?): Text
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
▸ setMaxSize(maxSize): Text
sets the maximum device space rendering dimension
| Name | Type | Description |
|---|---|---|
maxSize | Dimension | maximum device space rendering dimension |
▸ setMinSize(minSize): Text
sets the minimum device space rendering dimension only works when setUseMinMaxSize is enabled.
| Name | Type | Description |
|---|---|---|
minSize | Dimension | minimum device space rendering dimension |
this
▸ setName(name): Text
Sets name of the node
| Name | Type | Description |
|---|---|---|
name | string | The node name |
this
▸ setNotification(notify, force?): Text
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
▸ setOpacity(opacity, blendMode?): Text
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
▸ setPadding(padding): Text
Set inner padding in device coordinates.
Deprecated
since 4.1 use setPaddingStyle instead
| Name | Type | Description |
|---|---|---|
padding | number | inner padding in device coordinates |
this
▸ setPaddingStyle(paddingStyle, merge?): Text
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
▸ setPreserveAspectRatio(preserveAspectRatio): Text
Sets whether aspect ratio is preserved
| Name | Type | Description |
|---|---|---|
preserveAspectRatio | boolean | flag Sets whether aspect ratio is preserved |
this
AnchoredShape.setPreserveAspectRatio
▸ setPreserveReadingOrientation(preserveReadingOrientation): Text
Sets whether the shape is always in a readable orientation. Particularly useful for text. Prevents mirror effects
| Name | Type | Description |
|---|---|---|
preserveReadingOrientation | boolean | sets flag whether the shape is always in a readable orientation |
this
AnchoredShape.setPreserveReadingOrientation
▸ setPreserveRightAngle(preserveRightAngle): Text
Sets whether right angles are preserved
| Name | Type | Description |
|---|---|---|
preserveRightAngle | boolean | flag setting if right angles are preserved |
this
AnchoredShape.setPreserveRightAngle
▸ setProperties(properties?): Text
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options | object containing the properties to set |
▸ setProperty(name, value): Text
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
▸ setRect(x1): Text
Sets rectangle geometry.
| Name | Type | Description |
|---|---|---|
x1 | Rect | rect |
this
▸ setRect(x1, y1, x2, y2): Text
Sets rectangle geometry.
| Name | Type | Description |
|---|---|---|
x1 | number | x coordinate of the top left corner |
y1 | number | y coordinate of the top left corner |
x2 | number | x coordinate of the bottom right corner |
y2 | number | y coordinate of the bottom right corner |
this
▸ setRenderingFilter(filter): Text
Sets filter to be applied before rendering and picking
| Name | Type | Description |
|---|---|---|
filter | IFilter | filter to set |
this
AnchoredShape.setRenderingFilter
▸ setResponsiveStyle(style): Text
Sets responsive style.
| Name | Type | Description |
|---|---|---|
style | Options | ResponsiveStyle | responsive style |
this
AnchoredShape.setResponsiveStyle
▸ setRotationAngle(rotationAngle): Text
Set rotation angle
| Name | Type | Description |
|---|---|---|
rotationAngle | number | rotation angle (in radians) at anchor |
this
AnchoredShape.setRotationAngle
▸ setScaleScrollStrategy(strategy?): Text
Sets scale scroll strategy
| Name | Type | Description |
|---|---|---|
Optional strategy | Delegate | scale scroll strategy |
this
AnchoredShape.setScaleScrollStrategy
▸ setSelectable(selectable): Text
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
▸ setShowEllipsis(showEllipsis): Text
Set show ellipsis
| Name | Type | Description |
|---|---|---|
showEllipsis | boolean | showEllipsis boolean flag that enables/disables ellipsis in case if text is too long |
this
▸ setSilent(bool): Text
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setSize(width, height): Text
Set size
| Name | Type | Description |
|---|---|---|
width | number | text width |
height | number | text height |
this
▸ setSizeIsInDeviceSpace(sizeIsInDeviceSpace): Text
Sets whether the shape size is set in device space.
| Name | Type | Description |
|---|---|---|
sizeIsInDeviceSpace | boolean | true if the shape size is fixed in device space; otherwise, false. |
this
AnchoredShape.setSizeIsInDeviceSpace
▸ setSizeMode(sizeMode): Text
Sets how text size is computed
| Name | Type | Description |
|---|---|---|
sizeMode | SizeMode | Enum of size modes |
this
▸ setTag(tag): Text
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
▸ setText(text): Text
Update the string this text displays.
Example
text.setText('Temperature <b style="font-color:red">110&deg;</b> (<i style="font-color:gray">Fahrenheit</i>')| Name | Type | Description |
|---|---|---|
text | string | new text for this shape * can contains text formatting tags, |
this
▸ setTextStyle(textStyle, merge?): Text
Set text style
| Name | Type | Description |
|---|---|---|
textStyle | Type | a new shape text style |
Optional merge | boolean | true if you want to merge textStyle with existing attribute, false by default |
this
▸ setTextTransform(textTransform): Text
Set text transformation
| Name | Type | Description |
|---|---|---|
textTransform | string | Text transformation type |
▸ setUseMinMaxSize(useMinMaxSize): Text
Sets whether to use the min max device space sizes
| Name | Type | Description |
|---|---|---|
useMinMaxSize | boolean | true if using the min max device space sizes otherwise, false. |
this
AnchoredShape.setUseMinMaxSize
▸ setUserSize(width, height): Text
Called internally to save user size.
| Name | Type | Description |
|---|---|---|
width | number | width |
height | number | height |
this
▸ setVisible(value): Text
Sets visibility of the node. Send event Events.VisibilityChanged
| Name | Type | Description |
|---|---|---|
value | boolean | flag specifying visibility of the node |
this
▸ setWidth(width): Text
Set text width. If width set to zero, text will accept size from font.
| Name | Type | Description |
|---|---|---|
width | number | text width |
this
▸ setZIndex(value): Text
Sets z-index for node (set null for default)
| Name | Type | Description |
|---|---|---|
value | number | index determining node z-position |
this
▸ shear(shx, shy): Text
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): Text
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
AnchoredShape.unregisterAnimationStyle
▸ Protected updateGeometry(context): Text
Update geometry
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
this
▸ updateSceneTransformation(): Text
Update scene transformation
this
AnchoredShape.updateSceneTransformation
▸ updateState(regions?, changes?): Text
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(): Text
Update time stamp to indicate that Node or Children has been changed.
this
▸ Static enableSceneGraphNotification(enabled): void
Enable / disable all notifications
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets if this object sends notifications |
void
AnchoredShape.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 getAnchorPosition(rect, anchorType): Point
Return anchor position
| Name | Type | Description |
|---|---|---|
rect | Rect | rectangle to get anchor position |
anchorType | AnchorType | anchor type |
anchor
AnchoredShape.getAnchorPosition
▸ 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
AnchoredShape.intersectsBounds
▸ Static isSceneGraphNotificationEnabled(): boolean
Return status of the global notification for all nodes.
boolean