SceneControls

SceneControls

Scene controls navigation menu

Constructor

new SceneControls()

Source:

Extends

Members

(static) defaultOptions

Source:

Assign the default options which are supported by the SceneControls ui

_dragDrop :Array.<DragDrop>

Source:
Overrides:

DragDrop workflow handlers which are active for this Application

Type:

_element :jQuery

Source:
Overrides:

An internal reference to the HTML element this application renders

Type:
  • jQuery

_scrollPositions :Object|null

Source:
Overrides:

Track the most recent scroll positions for any vertically scrolling containers

Type:
  • Object | null

_tabs :Array.<TabsV2>

Source:
Overrides:

Tab navigation handlers which are active for this Application

Type:

activeControl :String

Source:

The name of the active Scene Control toolset

Type:

activeTool :String|null

Source:

Return the name of the active tool within the active control set

Type:

appId :Number

Source:
Overrides:

The application ID is a unique incrementing integer which is used to identify every application window drawn by the VTT

Type:

control :Object|null

Source:

Return the active control set

Type:
  • Object | null

controls :Array

Source:

The Array of Scene Control buttons which are currently rendered

Type:

element :jQuery|HTMLElement

Source:
Overrides:

Return the active application element, if it currently exists in the DOM

Type:
  • jQuery | HTMLElement

id

Source:
Overrides:

Return the CSS application ID which uniquely references this UI element

isRuler

Source:

A convenience reference for whether the currently active tool is a Ruler

options :Object

Source:
Overrides:

The options provided to this application upon initialization

Type:
  • Object

popOut :boolean

Source:
Overrides:

Control the rendering style of the application. If popOut is true, the application is rendered in its own wrapper window, otherwise only the inner app content is rendered

Type:
  • boolean

position :Object

Source:
Overrides:

Track the current position and dimensions of the Application UI

Type:
  • Object

rendered :boolean

Source:
Overrides:

Return a flag for whether the Application instance is currently rendered

Type:
  • boolean

template :string

Source:
Overrides:

The path to the HTML template file which should be used to render the inner content of the app

Type:
  • string

title :string

Source:
Overrides:

An Application window should define its own title definition logic which may be dynamic depending on its data

Type:
  • string

tool

Source:

Return the actively controled tool

Methods

activateListeners(html)

Source:
Overrides:

Once the HTML for an Application has been rendered, activate event listeners which provide interactivity for the application

Parameters:
Name Type Description
html jQuery

(async) close() → {Promise}

Source:
Overrides:

Close the application and un-register references to it within UI mappings This function returns a Promise which resolves once the window closing animation concludes

Returns:
Type
Promise

getData() → {Object}

Source:
Overrides:

Provide data to the HTML template for rendering

Returns:
Type
Object

initialize(control, layer)

Source:

Initialize the Scene Controls by obtaining the set of control buttons and rendering the HTML

Parameters:
Name Type Description
control String

An optional control set to set as active

layer String

An optional layer name to target as the active control

(async) maximize() → {Promise}

Source:
Overrides:

Maximize the pop-out window, expanding it to its original size Take no action for applications which are not of the pop-out variety or are already maximized

Returns:

A Promise which resolves to true once the maximization action has completed

Type
Promise

(async) minimize() → {Promise}

Source:
Overrides:

Minimize the pop-out window, collapsing it to a small tab Take no action for applications which are not of the pop-out variety or apps which are already minimized

Returns:

A Promise which resolves to true once the minimization action has completed

Type
Promise

render(force, options)

Source:
Overrides:

Render the Application by evaluating it's HTML template against the object of data provided by the getData method If the Application is rendered as a pop-out window, wrap the contained HTML in an outer frame with window controls

Parameters:
Name Type Default Description
force Boolean false

Add the rendered application to the DOM if it is not already present. If false, the Application will only be re-rendered if it is already present.

options Object

Additional rendering options which are applied to customize the way that the Application is rendered in the DOM.

Properties
Name Type Description
left Number

The left positioning attribute

top Number

The top positioning attribute

width Number

The rendered width

height Number

The rendered height

scale Number

The rendered transformation scale

log Boolean

Whether to display a log message that the Application was rendered

renderContext String

A context-providing string which suggests what event triggered the render

renderData *

The data change which motivated the render request

setPosition(left, top, width, height, scale) → {Object}

Source:
Overrides:

Set the application position and store it's new location.

Parameters:
Name Type Description
left number | null

The left offset position in pixels

top number | null

The top offset position in pixels

width number | null

The application width in pixels

height number | string | null

The application height in pixels

scale number | null

The application scale as a numeric factor where 1.0 is default

Returns:

The updated position object for the application containing the new values

Type
Object