ToolboxController

dwv.ctrl. ToolboxController

new ToolboxController(toolList)

Source:

Toolbox controller.

Parameters:
Name Type Description
toolList Array

The list of tool objects.

Methods

bindLayer(layer)

Source:

Listen to layer interaction events.

Parameters:
Name Type Description
layer object

The layer to listen to.

getSelectedTool() → {object}

Source:

Get the selected tool.

Returns:

The selected tool.

Type
object

getSelectedToolEventHandler(eventType) → {function}

Source:

Get the selected tool event handler.

Parameters:
Name Type Description
eventType string

The event type, for example mousedown, touchstart...

Returns:

The event handler.

Type
function

getToolList() → {Array}

Source:

Get the tool list.

Returns:

The list of tool objects.

Type
Array

hasTool(name) → {string}

Source:

Check if a tool is in the tool list.

Parameters:
Name Type Description
name string

The name to check.

Returns:

The tool list element for the given name.

Type
string

init()

Source:

Initialise.

runSelectedFilter()

Source:

Run the selected filter.

setLineColour(colour)

Source:

Set the tool line colour.

Parameters:
Name Type Description
colour string

The colour.

setRange(range)

Source:

Set the tool range.

Parameters:
Name Type Description
range object

The new range of the data.

setSelectedFilter(name)

Source:

Set the selected filter.

Parameters:
Name Type Description
name string

The name of the filter.

setSelectedShape(name)

Source:

Set the selected shape.

Parameters:
Name Type Description
name string

The name of the shape.

setSelectedTool(name)

Source:

Set the selected tool.

Parameters:
Name Type Description
name string

The name of the tool.

unbindLayer(layer)

Source:

Remove canvas mouse and touch listeners.

Parameters:
Name Type Description
layer object

The layer to stop listening to.