The X Toolkit API

X.colortable

/**
* Create a container for a colortable.
*
* @constructor
* @extends X.base
* @mixin X.loadable
*/
var c = new X.colortable();
/**
* The className of this class.
*
* @type {string}
* @protected
*/
c._classname = $_CLASSNAME;
/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/
c._dirty = $_DIRTY;
/**
* The file of this loadable object.
*
* @type {?X.file}
* @protected
*/
c._file = $_FILE;
/**
* The file data.
*
* @type {?ArrayBuffer}
* @protected
*/
c._filedata = $_FILEDATA;
/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/
c._id = $_ID;
/**
* The internal hash map to store the value-color mapping.
*
* @type {!goog.structs.Map}
* @protected
*/
c._map = $_MAP;
/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/
var _classname = c.classname;
/**
* Get the associated X.file for this object.
*
* @return {string} The associated file path or null if no file is associated.
*/
var _file = c.file;
/**
* Load this object from a file path or reset the associated file path.
*
* @param {?string|Array} filepath The file path/URL to load. If null, reset the
*          associated file. If an array is given, load multiple files (this
*          only works for DICOM so far).
*/
c.file = $FILEPATH;
/**
* Get the possibly attached file data for this object.
*
* @return {?string} The associated file data or null if none is attached.
*/
var _filedata = c.filedata;
/**
* Set raw file data for this object. Doing so, skips any additional loading and
* just parses this raw data.
*
* @param {?string|Array} filedata The raw file data to parse.
*/
c.filedata = $FILEDATA;
/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/
var _id = c.id;
/**
* Add an entry to this color table.
*
* @param {!number} value The number to map to a color.
* @param {!string} label The label.
* @param {!number} r The red component.
* @param {!number} g The green component.
* @param {!number} b The blue component.
* @param {!number} a The alpha component.
* @throws {Error} An error, if the given values are invalid.
*/
c.add($VALUE, $LABEL, $R, $G, $B, $A);


CONSTRUCTORS
X.colortable

PROPERTIES
_classname
_dirty
_file
_filedata
_id
_map

GETTERS/SETTERS
classname
file
filedata
id

FUNCTIONS
add

STATIC



SOURCECODE