dwv.gui. Stage

new Stage()

Stage: controls a list of layer groups and their synchronisation.

Methods

addLayerGroup(htmlElement) → {dwv.gui.LayerGroup}

Add a layer group to the list.

Parameters:
NameTypeDescription
htmlElementobject

The HTML element of the layer group.

Returns:

The newly created layer group.

Type: 
dwv.gui.LayerGroup

bindLayerGroups()

Bind the layer groups of the stage.

draw()

Draw the stage: calls draw on all layer groups.

empty()

Empty the layer group list.

getActiveLayerGroup() → {dwv.gui.LayerGroup}

Get the active layer group.

Returns:

The layer group.

Type: 
dwv.gui.LayerGroup

getDrawLayersByDataIndex(index) → {Array}

Get the draw layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array

getLayerGroup(index) → {dwv.gui.LayerGroup}

Get the layer group at the given index.

Parameters:
NameTypeDescription
indexnumber

The index.

Returns:

The layer group.

Type: 
dwv.gui.LayerGroup

getLayerGroupByDivId(id) → {dwv.gui.LayerGroup}

Get a layer group from an HTML element id.

Parameters:
NameTypeDescription
idstring

The element id to find.

Returns:

The layer group.

Type: 
dwv.gui.LayerGroup

getNumberOfLayerGroups() → {number}

Get the number of layer groups that form the stage.

Returns:

The number of layer groups.

Type: 
number

getViewLayersByDataIndex(index) → {Array}

Get the view layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array

reset()

Reset the stage: calls reset on all layer groups.

setBinders(list)

Set the layer groups binders.

Parameters:
NameTypeDescription
listArray

The list of binder objects.

syncLayerGroupScale()

Synchronise the fit scale of the group layers.

unbindLayerGroups()

Unbind the layer groups of the stage.

(inner) addEventListeners(index, binder)

Add event listeners for a given layer group index and binder.

Parameters:
NameTypeDescription
indexnumber

The index of the associated layer group.

binderobject

The layer binder.

(inner) getBinderCallback(binder, index) → {function}

Get the binder callback function for a given layer group index. The function is created if not yet stored.

Parameters:
NameTypeDescription
binderobject

The layer binder.

indexnumber

The index of the associated layer group.

Returns:

The binder function.

Type: 
function

(inner) removeEventListeners(index, binder)

Remove event listeners for a given layer group index and binder.

Parameters:
NameTypeDescription
indexnumber

The index of the associated layer group.

binderobject

The layer binder.