Last updated

API / geotoolkit / report / dom / elements / TdElement / TdElement

Class: TdElement

elements.TdElement.TdElement

Td is a container element

Hierarchy

Implements

Table of contents

Constructors
Accessors
Methods
Css Properties
Name Type Description
backgroundstylestringBackground style
backgroundstyleFillStyleBackground style
backgroundstyle-colorstringColor in CSS form
backgroundstyle-evenoddmodebooleanEven-odd fill mode
backgroundstyle-fillpatternPatternPattern
backgroundstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
backgroundstyle-fillpattern-patternnamestringName of this pattern for indexing
backgroundstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
backgroundstyle-foregroundstringForeground color
backgroundstyle-patternPatternPattern
borderlinestylestringBorder linestyle
borderlinestyleLineStyleBorder linestyle
borderlinestyle-colorstringColor in CSS form
borderlinestyle-fillstringOptional fill style to be used to fill lines generated with this style
borderlinestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
borderlinestyle-linecapCapStyleThe line cap style
borderlinestyle-linedashoffsetnumberLine dash offset of dashed line
borderlinestyle-linejoinJoinStyleThe line join style
borderlinestyle-pixelsnapmodebooleanPixel Snap Mode, default(
borderlinestyle-scalablebooleanTrue if width should depend on transformation
borderlinestyle-unitstringOptional unit for the width
borderlinestyle-widthnumber | stringThe line thickness
bordersstringBorders
bordersLineStyleBorders
cssclassstringCss class
flipbooleanFlip
layoutstyleLayoutStyleLayout style
layoutstyle-constraintSizeConstraintLayout constrains
layoutstyle-flexgrownumberNumber specifying how much the item will grow relative to the rest of the items inside the same container
layoutstyle-flexshrinknumberNumber specifying how much the item will shrink relative to the rest of the items inside the same container
layoutstyle-floatstringFloat position
layoutstyle-positionstringLayout position
layoutstyle-sizenumber | stringLayout size
marginstylenumber | stringMargin style
orientationOrientationOrientation
paddingstylenumber | stringPadding style
pagebreakPageBreakPagebreak
textstyleTextStyleText style
textstyle-alignmentAlignmentStyleAlignment
textstyle-autosizebooleanAuto font size on high definition display
textstyle-backgroundstringBackground style
textstyle-backgroundFillStyleBackground style
textstyle-baselineBaseLineStyleBase line
textstyle-colorstringColor in CSS form
textstyle-fillFillStyleText fill style
textstyle-fontstringFont see
textstyle-fonturlstringThe place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword
textstyle-lineheightstring | numberLine height
textstyle-multilinebooleanAllow multi-line text
textstyle-outlinestringOutline style
textstyle-outlineLineStyleOutline style
textstyle-overflowwrapOverflowWrapStyleOverflow wrap
textstyle-strikethroughstringStrikethrough style
textstyle-strikethroughLineStyleStrikethrough style
textstyle-textoverflowTextOverflowStyleText overflow
textstyle-underlinestringUnderline style
textstyle-underlineLineStyleUnderline style
textstyle-underlineoffsetstring | numberUnderline offset distance
textstyle-whitespaceWhiteSpaceStyleWhite space
textstyle-wordbreakWordBreakStyleWord break
verticalalignVerticalAlignVertical alignment type

Contents

Constructors

new TdElement(options)

new TdElement(options)

Parameters

Name Type
optionsOptions

Overrides

ContainerElement.constructor

Accessors

attributes

get attributes(): NamedItemMap

Node attributes

Name

module:geotoolkit/report/dom/Node~Node#attributes

Returns

NamedItemMap

Inherited from

ContainerElement.attributes


childNodes

get childNodes(): NodeList<Node>

The element holding the item.

Name

module:geotoolkit/report/dom/Node~Node#childNodes

Returns

NodeList<Node>

Inherited from

ContainerElement.childNodes


children

get children(): NodeList<Element>

The children property returns a collection of an element's child elements, as an NodeList object.

Name

module:geotoolkit/report/dom/Element~Element#children

Returns

NodeList<Element>

Inherited from

ContainerElement.children


data

get data(): string

Node data

Name

module:geotoolkit/report/dom/Node~Node#data

Returns

string

Inherited from

ContainerElement.data

set data(data): void

Node data

Name

module:geotoolkit/report/dom/Node~Node#data

Parameters

Name Type
datastring

Returns

void

Inherited from

ContainerElement.data


firstChild

get firstChild(): Node

First child node

Name

module:geotoolkit/report/dom/Node~Node#firstChild

Returns

Node

Inherited from

ContainerElement.firstChild


lastChild

get lastChild(): Node

Last child node

Name

module:geotoolkit/report/dom/Node~Node#lastChild

Returns

Node

Inherited from

ContainerElement.lastChild


localName

get localName(): string

Node local name

Name

module:geotoolkit/report/dom/Node~Node#localName

Returns

string

Inherited from

ContainerElement.localName


nextSibling

get nextSibling(): Node

Next sibling node

Name

module:geotoolkit/report/dom/Node~Node#nextSibling

Returns

Node

Inherited from

ContainerElement.nextSibling


nodeName

get nodeName(): string

Node name

Name

module:geotoolkit/report/dom/Node~Node#nodeName

Returns

string

Inherited from

ContainerElement.nodeName


nodeType

get nodeType(): NodeType

Node type

Name

module:geotoolkit/report/dom/Node~Node#nodeType

Returns

NodeType

Inherited from

ContainerElement.nodeType


nodeValue

get nodeValue(): string

Node value

Name

module:geotoolkit/report/dom/Node~Node#nodeValue

Returns

string

Inherited from

ContainerElement.nodeValue

set nodeValue(value): void

Node value

Name

module:geotoolkit/report/dom/Node~Node#nodeValue

Parameters

Name Type
valuestring

Returns

void

Inherited from

ContainerElement.nodeValue


ownerDocument

get ownerDocument(): Document

Node owner document

Name

module:geotoolkit/report/dom/Node~Node#ownerDocument

Returns

Document

Inherited from

ContainerElement.ownerDocument


parentNode

get parentNode(): Node

Parent node

Name

module:geotoolkit/report/dom/Node~Node#parentNode

Returns

Node

Inherited from

ContainerElement.parentNode


previousSibling

get previousSibling(): Node

Previous sibling node

Name

module:geotoolkit/report/dom/Node~Node#previousSibling

Returns

Node

Inherited from

ContainerElement.previousSibling


rootNode

get rootNode(): Node

Return root node

Deprecated

since 2022 (3.4) use Node#getRootNode instead

Name

module:geotoolkit/report/dom/Node~Node#rootNode

Returns

Node

Inherited from

ContainerElement.rootNode


tagName

get tagName(): string

Node tag name

Name

module:geotoolkit/report/dom/Node~Node#tagName

Returns

string

Inherited from

ContainerElement.tagName

Methods

appendChild

appendChild(newChild): TdElement

Add child to the node

Parameters

Name Type Description
newChildNodechild to add

Returns

TdElement

Inherited from

ContainerElement.appendChild


clearAttributes

clearAttributes(): TdElement

Clear attributes

Returns

TdElement

Inherited from

ContainerElement.clearAttributes


clearNodes

clearNodes(): TdElement

Remove all child nodes from this node

Returns

TdElement

this

Inherited from

ContainerElement.clearNodes


connectStyle

connectStyle(style, type, callback): TdElement

Connects style.

This convenience method subscribes a listener to given style for the specified type.
And automatically un-subscribes listener if node is disposed to prevent memory leaks

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

TdElement

this

Inherited from

ContainerElement.connectStyle


disconnectStyle

disconnectStyle(style, type, callback): TdElement

Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

TdElement

this

Inherited from

ContainerElement.disconnectStyle


dispose

dispose(): void

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

Returns

void

Inherited from

ContainerElement.dispose


enumerateNodes

enumerateNodes(callback, target?): void

Enumerate children nodes

Parameters

Name Type Description
callbackCallback<Node>callback
Optional targetQueryBuilder<any>target

Returns

void

Inherited from

ContainerElement.enumerateNodes


flush

Protected flush(serializationContext?): TdElement

Flush all changes before saving

Parameters

Name Type Description
Optional serializationContextSerializationContextserialization Context

Returns

TdElement

Inherited from

ContainerElement.flush


getAttribute

getAttribute(name): string

Return attribute value

Parameters

Name Type Description
namestringattribute name

Returns

string

Inherited from

ContainerElement.getAttribute


getBackgroundStyle

getBackgroundStyle(): FillStyle

Return background style

Returns

FillStyle

background current background style

Inherited from

ContainerElement.getBackgroundStyle


getBorderLineStyle

getBorderLineStyle(): LineStyle

Return border line style

Returns

LineStyle

Inherited from

ContainerElement.getBorderLineStyle


getClassName

getClassName(): string

Returns

string

Inherited from

ContainerElement.getClassName


getContentTransform

getContentTransform(): string

Return content transformation angle or null if there is no content rotation specified

Returns

string

content transformation angle (90deg|180deg|270deg|-90deg)

Inherited from

ContainerElement.getContentTransform


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

ContainerElement.getCssClass


getElementRegistry

getElementRegistry(): IElementsRegistry

Returns elements Registry

Returns

IElementsRegistry

Inherited from

ContainerElement.getElementRegistry


getElementTransform

getElementTransform(): { name: string ; parameters: string[] }[]

Return array of transformation instructions

Returns

{ name: string ; parameters: string[] }[]

array of transformations

Inherited from

ContainerElement.getElementTransform


getFlip

getFlip(): boolean

Return element content flip flag

Returns

boolean

element layout orientation

Inherited from

ContainerElement.getFlip


getGuid

getGuid(): string

Returns element GUID

Returns

string

Inherited from

ContainerElement.getGuid


getId

getId(): string

Returns element id

Returns

string

Inherited from

ContainerElement.getId


getInnerCssStyle

getInnerCssStyle(): string

Return collected inner css style

Returns

string

inner css style

Inherited from

ContainerElement.getInnerCssStyle


getLayoutStyle

getLayoutStyle(): LayoutStyle<string | number>

Return layout style

Returns

LayoutStyle<string | number>

layout style

Inherited from

ContainerElement.getLayoutStyle


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

margins style

Inherited from

ContainerElement.getMarginsStyle


getNodeIndex

getNodeIndex(): number

Return node index

Returns

number

Inherited from

ContainerElement.getNodeIndex


getNodeValue

getNodeValue(): string

Returns node value

Returns

string

Inherited from

ContainerElement.getNodeValue


getOrientation

getOrientation(): Orientation

Return element layout orientation

Returns

Orientation

element layout orientation

Inherited from

ContainerElement.getOrientation


getPaddingStyle

getPaddingStyle(): SpaceStyle<string | number>

Return padding style

Returns

SpaceStyle<string | number>

padding style

Inherited from

ContainerElement.getPaddingStyle


getPageBreak

getPageBreak(): PageBreak

Returns element page break

Returns

PageBreak

page break

Inherited from

ContainerElement.getPageBreak


getParent

getParent(): Node

Returns parent node

Returns

Node

parent

Inherited from

ContainerElement.getParent


getProperties

getProperties(): OptionsOut

Gets element properties

Returns

OptionsOut

props

Overrides

ContainerElement.getProperties


getRootNode

getRootNode(): Node

Return root node

Returns

Node

node

Inherited from

ContainerElement.getRootNode


getTableElement

getTableElement(): TableElement

Return Table element

Returns

TableElement


getTagName

getTagName(): string

Returns node tag name

Returns

string

Inherited from

ContainerElement.getTagName


getText

getText(): string

Return text value

Returns

string

text value


getTextStyle

getTextStyle(): TextStyle

Return text style

Returns

TextStyle

text style

Inherited from

ContainerElement.getTextStyle


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

ContainerElement.getTimeStamp


getTrElement

getTrElement(): TrElement

Return Tr element

Returns

TrElement


getTransformOrigin

getTransformOrigin(): string

Return transform origin

Returns

string

Inherited from

ContainerElement.getTransformOrigin


getVerticalAlign

getVerticalAlign(): VerticalAlign

Return vertical alignment type

Returns

VerticalAlign

vertical alignment type


getVisible

getVisible(): boolean

Get element visible state

Returns

boolean

Inherited from

ContainerElement.getVisible


hasAttribute

hasAttribute(name): boolean

Check if attribute exists

Parameters

Name Type Description
namestringattribute name

Returns

boolean

Inherited from

ContainerElement.hasAttribute


hasChildNodes

hasChildNodes(): boolean

Return true if node has children

Returns

boolean

Inherited from

ContainerElement.hasChildNodes


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

ContainerElement.hasEventListener


indexOfNode

indexOfNode(node): number

Returns index of node.

Parameters

Name Type Description
nodeNodeitem to get index of

Returns

number

Inherited from

ContainerElement.indexOfNode


insertAfter

insertAfter(newChild, refChild): Node

Insert child

Parameters

Name Type Description
newChildNodechild to insert
refChildNoderef child

Returns

Node

Inherited from

ContainerElement.insertAfter


insertBefore

insertBefore(newChild, refChild): Node

Insert child

Parameters

Name Type Description
newChildNodechild to insert
refChildNoderef child

Returns

Node

Inherited from

ContainerElement.insertBefore


invalidate

Protected invalidate(): TdElement

Returns

TdElement

this

Inherited from

ContainerElement.invalidate


invalidateDocument

Protected invalidateDocument(eventArgs): TdElement

Invalidate root document

Parameters

Name Type Description
eventArgsNodeEventArgsevent args

Returns

TdElement

this

Inherited from

ContainerElement.invalidateDocument


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

ContainerElement.isDisposed


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

ContainerElement.isSilent


lock

lock(): TdElement

Lock node

Returns

TdElement

Inherited from

ContainerElement.lock


normalize

normalize(): TdElement

Puts the specified node and all of its subtree into a "normalized" form. In a normalized sub-tree, no text nodes in the sub-tree are empty and there are no adjacent text nodes.

Returns

TdElement

this

Inherited from

ContainerElement.normalize


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceElementof the event
Optional argsEventMap[E]arguments of the event

Returns

TdElement

this

Inherited from

ContainerElement.notify


off

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

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: TdElement, args: EventMap[E]) => voidfunction to be called

Returns

TdElement

this

Inherited from

ContainerElement.off


on

on<E>(type, callback): TdElement

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: TdElement, args: EventMap[E]) => voidto be called

Returns

TdElement

this

Inherited from

ContainerElement.on


onParentChanged

Protected onParentChanged(): TdElement

Returns

TdElement

this

Inherited from

ContainerElement.onParentChanged


onResetCssProperties

Protected onResetCssProperties(silent): TdElement

Clean up cached properties

Parameters

Name Type Description
silentbooleansilent reset

Returns

TdElement

this

Inherited from

ContainerElement.onResetCssProperties


removeAttribute

removeAttribute(name): TdElement

Remove attribute

Parameters

Name Type Description
namestringattribute name

Returns

TdElement

Inherited from

ContainerElement.removeAttribute


removeChild

removeChild(child): Node

Remove child from node

Parameters

Name Type Description
childNodeto remove

Returns

Node

Inherited from

ContainerElement.removeChild


replaceChild

replaceChild(newChild, oldChild): TdElement

Replace child

Parameters

Name Type Description
newChildNodechild to replace with
oldChildNodechild to replace

Returns

TdElement

Inherited from

ContainerElement.replaceChild


resetElementStyle

Protected resetElementStyle(): TdElement

Reset own styles

Returns

TdElement

Inherited from

ContainerElement.resetElementStyle


save

save(recursive?, serializationContext?): string

Serialize element to xml

Parameters

Name Type Description
Optional recursivebooleansave whole dom element structure
Optional serializationContextSerializationContextserialization Context

Returns

string

Inherited from

ContainerElement.save


setAttribute

setAttribute(name, value): TdElement

Set attribute value

Parameters

Name Type Description
namestringattribute name
valuestringattribute value

Returns

TdElement

Inherited from

ContainerElement.setAttribute


setAttributeNode

setAttributeNode(newAttr): TdElement

Adds a new Attribute node to the specified element.

Parameters

Name Type Description
newAttrAttributeattribute

Returns

TdElement

this

Inherited from

ContainerElement.setAttributeNode


setBackgroundStyle

setBackgroundStyle(backgroundStyle, merge?): TdElement

Set background style

Parameters

Name Type Description
backgroundStyleTypebackground style
Optional mergebooleanmerge flag

Returns

TdElement

this

Inherited from

ContainerElement.setBackgroundStyle


setBorderLineStyle

setBorderLineStyle(borderStyle, merge?): TdElement

Sets border line style Returns this

Parameters

Name Type Description
borderStyleType | BorderStyleline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

TdElement

this

Inherited from

ContainerElement.setBorderLineStyle


setContentTransform

setContentTransform(angle): TdElement

Set content transformation angle

Parameters

Name Type Description
anglestringcontent transformation angle (90deg|180deg|270deg|-90deg)

Returns

TdElement

Inherited from

ContainerElement.setContentTransform


setCssClass

setCssClass(cssClass): TdElement

Set css class

Parameters

Name Type Description
cssClassstringcss class

Returns

TdElement

Inherited from

ContainerElement.setCssClass


setElementRegistry

Protected setElementRegistry(registry): TdElement

Set shadow element registry

Parameters

Name Type Description
registryIElementsRegistryelements registry

Returns

TdElement

Inherited from

ContainerElement.setElementRegistry


setElementTransform

setElementTransform(transformOrigin, transformation?): void

Set element transform

Parameters

Name Type Description
transformOriginstringtransform origin
Optional transformation{ name: string ; parameters: string[] }[]transformations array

Returns

void

Inherited from

ContainerElement.setElementTransform


setFlip

setFlip(flip): TdElement

Set element content flip orientation

Parameters

Name Type Description
flipbooleanelement content flip

Returns

TdElement

Inherited from

ContainerElement.setFlip


setGuid

setGuid(guid): TdElement

Set node GUID

Parameters

Name Type Description
guidstringnode GUID

Returns

TdElement

Inherited from

ContainerElement.setGuid


setLayoutStyle

setLayoutStyle(layout?, merge?, silent?): TdElement

Sets layout style

Parameters

Name Type Description
Optional layoutLayoutStyle<string | number> | Options<string | number>layout style
Optional mergebooleantrue if you want to merge layoutStyle with existing attribute, false by default
Optional silentbooleansilent setting

Returns

TdElement

Inherited from

ContainerElement.setLayoutStyle


setMarginsStyle

setMarginsStyle(margins?, merge?): TdElement

Sets margins style

Parameters

Name Type Description
Optional marginsType<string | number>margins style
Optional mergebooleantrue if you want to merge marginsStyle with existing attribute, false by default

Returns

TdElement

Inherited from

ContainerElement.setMarginsStyle


setNodeValue

setNodeValue(nodeValue): TdElement

Set node value

Parameters

Name Type Description
nodeValuestringnode value

Returns

TdElement

Inherited from

ContainerElement.setNodeValue


setOrientation

setOrientation(orientation): TdElement

Set element layout orientation

Parameters

Name Type Description
orientationOrientationelement layout orientation

Returns

TdElement

Inherited from

ContainerElement.setOrientation


setPaddingStyle

setPaddingStyle(padding?, merge?): TdElement

Sets padding style

Parameters

Name Type Description
Optional paddingType<string | number>padding style
Optional mergebooleantrue if you want to merge paddingStyle with existing attribute, false by default

Returns

TdElement

Inherited from

ContainerElement.setPaddingStyle


setPageBreak

setPageBreak(pageBreak): TdElement

Set element page break

Parameters

Name Type Description
pageBreakPageBreakpage break style

Returns

TdElement

this

Inherited from

ContainerElement.setPageBreak


setProperties

setProperties(props): TdElement

Sets the element properties

Parameters

Name Type Description
propsOptionsprops

Returns

TdElement

this

Overrides

ContainerElement.setProperties


setSilent

setSilent(bool): TdElement

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

TdElement

this

Inherited from

ContainerElement.setSilent


setText

setText(text): TdElement

Set text value

Parameters

Name Type Description
textstringtext value

Returns

TdElement

this

Inherited from

ContainerElement.setText


setTextStyle

setTextStyle(textStyle, merge?): TdElement

Sets text style

Parameters

Name Type Description
textStyleTypea new shape text style
Optional mergebooleantrue if you want to merge textStyle with existing attribute, false by default

Returns

TdElement

Inherited from

ContainerElement.setTextStyle


setVerticalAlign

setVerticalAlign(verticalAlign): TdElement

Set vertical alignment type

Parameters

Name Type Description
verticalAlignVerticalAlignvertical alignment type

Returns

TdElement

this


setVisible

setVisible(visible): TdElement

Set element visible state

Parameters

Name Type Description
visiblebooleanelement visibility flag

Returns

TdElement

Inherited from

ContainerElement.setVisible


setXmlContent

setXmlContent(xmlValue): Promise<NodeList<Node>>

Set XML content

Parameters

Name Type Description
xmlValuestringxml to parse

Returns

Promise<NodeList<Node>>

promise

Inherited from

ContainerElement.setXmlContent


unlock

unlock(): TdElement

Unlock node

Returns

TdElement

Inherited from

ContainerElement.unlock


updateTimeStamp

updateTimeStamp(): TdElement

Update time stamp to indicate that style has been changed.

Returns

TdElement

this

Inherited from

ContainerElement.updateTimeStamp


findParentNode

Static findParentNode<T>(node, classType): InstanceType<T>

Find root of the node with specified type

Type parameters

NameType
Textends Constructable<any>

Parameters

Name Type Description
nodeNodenode to start search
classTypeTtype of the class to search for or short interface name

Returns

InstanceType<T>

Inherited from

ContainerElement.findParentNode

Static findParentNode(node, classType): Node

Find root of the node with specified type

Parameters

Name Type Description
nodeNodenode to start search
classTypestringinterface name to search for

Returns

Node

Inherited from

ContainerElement.findParentNode


getClassName

Static getClassName(): string

Returns

string

Inherited from

ContainerElement.getClassName