Class: EmperorAttributeABC

EmperorAttributeABC

EmperorViewControllerABC

Initializes an abstract tab for attributes i.e. shape, color, size, etc. This has to be contained in a DOM object and will use the full size of that container.

Constructor

new EmperorAttributeABC(container, title, description, decompViewDict, options) → {EmperorAttributeABC}

Parameters:
Name Type Description
container Node

Container node to create the controller in.

title String

title of the tab.

description String

helper description.

decompViewDict Object

This is object is keyed by unique identifiers and the values are DecompositionView objects referring to a set of objects presented on screen. This dictionary will usually be shared by all the tabs in the application. This argument is passed by reference.

options Object

This is a dictionary of options used to build the view controller. Used to set attributes of the slick grid and the metadata category drop down. At the moment the constructor only expects the following attributes:

  • categorySelectionCallback: a function object that's called when a new metadata category is selected in the dropdown living in the header. See change.
  • valueUpdatedCallback: a function object that's called when a metadata visualization attribute is modified (i.e. a change of color). See onCellChange.
  • slickGridColumn: a dictionary specifying options to be passed into the slickGrid. For instance, the ColorFormatter and the ColorEditor would be passed here. For more information, refer to the Slick Grid documentation.
Source:
Returns:

Returns an instance of the EmperorAttributeABC class.

Type
EmperorAttributeABC

Extends

Members

$body :Node

jQuery element for the body, which contains the lowermost elementsdisplayed in tab. This goes below the header.

Type:
  • Node
Inherited From:
Source:

$canvas :Node

jQuery element for the canvas, which contains the header and the body.

Type:
  • Node
Inherited From:
Source:

$container :Node

jQuery element for the parent container.

Type:
  • Node
Inherited From:
Source:

$gridDiv :Node

jQuery element for the div containing the slickgrid of sample information

Type:
  • Node
Source:

$header :Node

jQuery element for the header which contains the uppermost elementsdisplayed in a tab.

Type:
  • Node
Inherited From:
Source:

active :Boolean

Indicates whether the tab is front most

Type:
  • Boolean
Inherited From:
Default Value:
  • false
Source:

activeViewKey :String

This is the key of the active decomposition view.

Type:
  • String
Source:

bodyGrid :Slick.Grid

Container that lists the metadata categories described under themetadataField column and the attribute that can be modified.

Type:
  • Slick.Grid
Source:

decompViewDict :Object

This is object is keyed by unique identifiers and the values areDecompositionView objects referring to a set of objects presented onscreen. This dictionary will usually be shared by all the tabs in theapplication. This argument is passed by reference.

Type:
  • Object
Source:

description :String

Human-readable description of the tab.

Type:
  • String
Inherited From:
Source:

enabled :Boolean

Indicates if tab can be accessed.

Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

identifier :String

Unique hash identifier for the tab instance.

Type:
  • String
Inherited From:
Default Value:
  • "EMPtab-xxxxxxx"
Source:

metadataField :String

Metadata column name.

Type:
  • String
Source:

title :String

Human-readable title of the tab.

Type:
  • String
Inherited From:
Source:

Methods

fromJSON(json)

Decodes JSON string and modifies its own instance variables accordingly.

Parameters:
Name Type Description
json Object

Parsed JSON string representation of self.

Overrides:
Source:

getActiveDecompViewKey() → {String}

Retrieves the metadata field currently being controlled

Source:
Returns:

A key corresponding to the active decomposition view.

Type
String

getSlickGridDataset() → {Array}

Retrieves the underlying data in the slick grid

Source:
Returns:

Returns an array of objects displayed by the body grid.

Type
Array

resize(width, height)

Resizes the container and the individual elements.

Note, the consumer of this class, likely the main controller should call the resize function any time a resizing event happens.

Parameters:
Name Type Description
width Float

the container width.

height Float

the container height.

Overrides:
Source:

setActive(trulse)

Sets whether or not the tab is visible.

Parameters:
Name Type Description
trulse Boolean

option to activate tab (i.e. move tab to foreground).

Inherited From:
Source:

setActiveDecompViewKey(k)

Changes the metadata column name to control.

Parameters:
Name Type Description
k String

Key corresponding to active decomposition view.

Source:

setEnabled(trulse)

Sets whether or not the tab can be modified or accessed.

Parameters:
Name Type Description
trulse Boolean

option to enable tab.

Inherited From:
Source:

setMetadataField(m)

Changes the metadata column name to control.

Parameters:
Name Type Description
m String

Metadata column name to control.

Source:

setSlickGridDataset(data)

Changes the underlying data in the slick grid

Parameters:
Name Type Description
data Array

data.

Source:

toJSON() → {Object}

Converts the current instance into a JSON object.

Overrides:
Source:
Returns:

base object ready for JSON conversion.

Type
Object