Skip to content
Last updated

API / geotoolkit / controls / tools / ToolsContainer / ToolsContainer

Class: ToolsContainer

tools.ToolsContainer.ToolsContainer

The tools container class is a container of tools AbstractTool connecting tools to their plot. It can hold several tools using a composite tool as a root.

Implements

Table of contents

Constructors
  • [new ToolsContainer(plot)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tools.toolscontainer.toolscontainer.md#new toolscontainer(plot))
Methods

Contents

Constructors

new ToolsContainer(plot)

• new ToolsContainer(plot)

Parameters

Name Type Description
plotPlotplot which renders nodes
Methods

add

▸ add(tool): ToolsContainer

Add tool or array of tools to container

Parameters

Name Type Description
toolITool | ITool[]tool or array of tools

Returns

ToolsContainer

this

Implementation of

IToolContainer.add


dispose

▸ dispose(disposeTool?): void

Dispose tool container

Parameters

Name Type Description
Optional disposeToolbooleandispose tool flag

Returns

void

Implementation of

IToolContainer.dispose


getClassName

▸ getClassName(): string

Returns

string


getNode

▸ getNode(): Node

Returns

Node


getTool

▸ getTool(): CompositeTool

Get tool

Returns

CompositeTool

instance of composite tool


getToolByName

▸ getToolByName(toolName): ITool

Returns the tool matching the given name.<br> This function also accepts tool 'path' instead of absolute name.<br> For example:<br> getToolByName("compositeTool.panningTools.trackPanning.TrackPanning")<br> Would return the same tool as <br> getToolByName("TrackPanning")<br> As long as there is only one tool named "TrackPanning" in this composite<br> See listToolsNames()<br>

Parameters

Name Type Description
toolNamestringThe tool name or path

Returns

ITool

Implementation of

IToolContainer.getToolByName


getToolByType

▸ getToolByType(toolType): ITool

Returns the tool matching the given type. or null if nothing is matching the tool type<br> For example:<br> getToolByType(geotoolkit.controls.tools.Selection)<br> Would return the same tool as<br> getToolByName("pick")<br>

Parameters

Name Type Description
toolTypeClassType<any&gt;toolType of the tool

Returns

ITool

Implementation of

IToolContainer.getToolByType


insert

▸ insert(index, tool): ToolsContainer

Insert tool or array of tools to container at specified index.

Parameters

Name Type Description
indexnumberindex to insert the tool or array of tools
toolAbstractTool | AbstractTool[]tool or array of tools

Returns

ToolsContainer


isDisposed

▸ isDisposed(): boolean

Returns whether this tool container has been disposed

Returns

boolean


isEnabled

▸ isEnabled(): boolean

returns enable state

Returns

boolean

state


listToolsNames

▸ listToolsNames(): string[]

List all the tools contained in this composite. Prepend their parent tools parent using a '.'.

Returns

string[]

Implementation of

IToolContainer.listToolsNames


remove

▸ remove(tool): ToolsContainer

Remove tool from container

Parameters

Name Type Description
toolITooltool to remove

Returns

ToolsContainer

this

Implementation of

IToolContainer.remove


setEnabled

▸ setEnabled(enabled): ToolsContainer

set enable state

Parameters

Name Type Description
enabledbooleansets the enabled state

Returns

ToolsContainer


getClassName

▸ Static getClassName(): string

Returns

string