Skip to content
Last updated

API / geotoolkit / scene / exports / CompositeDocumentElement / CompositeDocumentElement

Class: CompositeDocumentElement

exports.CompositeDocumentElement.CompositeDocumentElement

CompositeDocumentElement class contains layouts as children for PDF rendering

Hierarchy

Implements

Table of contents

Constructors
  • [new CompositeDocumentElement(list, layout)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.scene.exports.compositedocumentelement.compositedocumentelement.md#new compositedocumentelement(list, layout))
Methods

Contents

Constructors

new CompositeDocumentElement(list, layout)

• new CompositeDocumentElement(list, layout?)

Parameters

Name Type Description
listany[]of DocumentElement
Optional layoutLayout | LinearLayout | AnnotatedLayout | FreeLayoutlayout of elements

Overrides

AbstractDocumentElement.constructor

Methods

addChild

▸ addChild(child): any

Add DocumentElement as child

Parameters

Name Type Description
childanyDocument Element

Returns

any


beginExport

▸ beginExport(): void

Used to prepare object before exporting

Returns

void

Inherited from

AbstractDocumentElement.beginExport


clearChild

▸ clearChild(): void

Clear all children

Returns

void


endExport

▸ endExport(): void

Used to restore object's state after exporting

Returns

void

Inherited from

AbstractDocumentElement.endExport


getBounds

▸ getBounds(): Rect

Return bounds

Returns

Rect


getChild

▸ getChild(index): any

Get child at index.

Parameters

Name Type Description
indexnumberindex where to get the child

Returns

any

child DocumentElement at index.


getChildrenCount

▸ getChildrenCount(): number

Get the number of children in the composite document element.

Returns

number

count


getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractDocumentElement.getClassName


getIndex

▸ getIndex(element): number

Get index of a specified element.

Parameters

Name Type Description
elementanydocument element

Returns

number

index


getLayoutStyle

▸ getLayoutStyle(): LayoutStyle<string | number&gt;

Return desired layout style

Returns

LayoutStyle<string | number&gt;


getLayoutedDimension

▸ getLayoutedDimension(): LayoutedDimension

Compute dimensions in the layout, this dimension is described by a fixed dimension and a scaled dimension.

Returns

LayoutedDimension

layoutedDimension object contains fixed and scaled dimensions

Overrides

AbstractDocumentElement.getLayoutedDimension


getList

▸ getList(): any[]

Gets the list of children.

Returns

any[]

list


getPreferredSize

▸ getPreferredSize(rect?): Rect

Return preferred size to layout children

Parameters

Name Type Description
Optional rectRectlayout area of document

Returns

Rect


insertChildAtIndex

▸ insertChildAtIndex(index, child): void

Add child at specific index

Parameters

Name Type Description
indexnumberindex where to insert the child
childanyDocument Element

Returns

void


render

▸ render(context, position?): void

Render the document in the context.

Parameters

Name Type Description
contextDocumentRenderingContextrendering context
Optional positionPointposition of the current document relative to the parent document

Returns

void

Overrides

AbstractDocumentElement.render


renderAsync

▸ renderAsync(context, position, callback): void

Render document in asynchronous mode. Default implementation creates call method "render" inside

Parameters

Name Type Description
contextDocumentRenderingContextrendering context
positionPointposition of current document element relative to the parent document
callback() => voidcallback function

Returns

void

Inherited from

AbstractDocumentElement.renderAsync


setBounds

▸ setBounds(bounds): CompositeDocumentElement

Sets bounds of the document if it is a part of layout

Parameters

Name Type Description
boundsRectbound of the node

Returns

CompositeDocumentElement

this


setChild

▸ setChild(index, child): CompositeDocumentElement

Set child at specific index

Parameters

Name Type Description
indexnumberindex where to set the child
childanyDocument Element

Returns

CompositeDocumentElement

this


setLayout

▸ setLayout(layout): CompositeDocumentElement

set the layout

Parameters

Name Type Description
layoutLayout | LinearLayout | AnnotatedLayout | FreeLayoutcurrent layout

Returns

CompositeDocumentElement

this


setLayoutStyle

▸ setLayoutStyle(layoutStyle): CompositeDocumentElement

Specify desired layout style

Parameters

Name Type Description
layoutStyleLayoutStyle<string | number&gt; | Options<string | number&gt;desired layout style

Returns

CompositeDocumentElement


setScale

▸ setScale(sx, sy): CompositeDocumentElement

set the document scale depending on the parameters isScaledVertically and isScaledHorizontally

Parameters

Name Type Description
sxnumberscale factor if scaledVertically
synumberscale factor if ScaledHorizontally

Returns

CompositeDocumentElement

this

Overrides

AbstractDocumentElement.setScale


setTranslation

▸ setTranslation(x, y): CompositeDocumentElement

set the document translation

Parameters

Name Type Description
xnumberoffset x coordinate
ynumberoffset y coordinate

Returns

CompositeDocumentElement

this

Overrides

AbstractDocumentElement.setTranslation


updateLayout

▸ updateLayout(rect?): void

update the layout of the document

Parameters

Name Type Description
Optional rectRectlayout area of document

Returns

void

Overrides

AbstractDocumentElement.updateLayout


updatePageLayout

▸ updatePageLayout(pageInfo): Rect

Return Layouted bounds

Parameters

Name Type Description
pageInfoPageSettingspage settings

Returns

Rect

Implementation of

IExportLayoutable.updatePageLayout


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractDocumentElement.getClassName