API / geotoolkit / controls / tools / ToolsContainer / 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.
Constructors
Methods
Methods
▸ add(tool): ToolsContainer
Add tool or array of tools to container
this
▸ dispose(disposeTool?): void
Dispose tool container
| Name | Type | Description |
|---|---|---|
Optional disposeTool | boolean | dispose tool flag |
void
▸ getClassName(): string
string
▸ getNode(): Node
▸ getTool(): CompositeTool
Get tool
instance of composite tool
▸ getToolByName(toolName): ITool
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 | Description |
|---|---|---|
toolName | string | The tool name or path |
▸ getToolByType(toolType): ITool
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 |
▸ insert(index, tool): ToolsContainer
Insert tool or array of tools to container at specified index.
| Name | Type | Description |
|---|---|---|
index | number | index to insert the tool or array of tools |
tool | AbstractTool | AbstractTool[] | tool or array of tools |
▸ isDisposed(): boolean
Returns whether this tool container has been disposed
boolean
▸ isEnabled(): boolean
returns enable state
boolean
state
▸ listToolsNames(): string[]
List all the tools contained in this composite. Prepend their parent tools parent using a '.'.
string[]
▸ remove(tool): ToolsContainer
Remove tool from container
| Name | Type | Description |
|---|---|---|
tool | ITool | tool to remove |
this
▸ setEnabled(enabled): ToolsContainer
set enable state
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets the enabled state |
▸ Static getClassName(): string
string