dwv.ctrl. LoadController

new LoadController(defaultCharacterSet)

Load controller.

Parameters:
NameTypeDescription
defaultCharacterSetstring

The default character set.

Methods

abort()

Abort the current loaders.

loadFiles(files)

Load a list of files. Can be image files or a state file.

Parameters:
NameTypeDescription
filesArray

The list of files to load.

loadImageObject(data)

Load a list of ArrayBuffers.

Parameters:
NameTypeDescription
dataArray

The list of ArrayBuffers to load in the form of [{name: "", filename: "", data: data}].

loadURLs(urls, options)

Load a list of URLs. Can be image files or a state file.

Parameters:
NameTypeDescription
urlsArray

The list of urls to load.

optionsobject

The load options:

  • requestHeaders: an array of {name, value} to use as request headers.
  • withCredentials: credentials flag to pass to the request.

onabort(_event)

Handle an abort event. Default does nothing.

Parameters:
NameTypeDescription
_eventobject

The abort event.

onerror(_event)

Handle an error event. Default does nothing.

Parameters:
NameTypeDescription
_eventobject

The error event.

onload(_event)

Handle a load event. Default does nothing.

Parameters:
NameTypeDescription
_eventobject

The load event fired when a file has been loaded successfully.

onloadend(_event)

Handle a load end event. Default does nothing.

Parameters:
NameTypeDescription
_eventobject

The load end event fired when a file load has completed, successfully or not.

onloadstart(_event)

Handle a load start event. Default does nothing.

Parameters:
NameTypeDescription
_eventobject

The load start event.

onprogress(_event)

Handle a load progress event. Default does nothing.

Parameters:
NameTypeDescription
_eventobject

The progress event.

(inner) augmentCallbackEvent(callback, info) → {object}

Augment a callback event: adds loadtype to the event passed to a callback.

Parameters:
NameTypeDescription
callbackobject

The callback to update.

infoobject

Info object to append to the event.

Returns:

A function representing the modified callback.

Type: 
object

(inner) getNextLoadId() → {number}

Get the next load id.

Returns:

The next id.

Type: 
number