Home Reference Source Test Repository
public class | source

TopBar

Class for controlling the state of the top bar. Used for displaying tool-related UI elements.

Constructor Summary

Public Constructor
public

Constructs a TopBar instance.

Member Summary

Public Members
public
public
public
public
public

topBar: *

public

ui: *

Method Summary

Public Methods
public

Initialize the event listeners.

public

Toggle graph object selection.

public

Displays the tool inputs in the inputForm element.

public

Displays the mode-specific tool inputs in the modeInputForm element.

public

Displays the tool modes in the Dropdown.

public

Handles mode-specific tool input submission.

public

Update the stored values of all mode-specific tool inputs.

public

updateGraphInput(input: Element, obj: Node | Edge | Label, hasError: boolean)

Update the graph input after object selection.

public

Handles a change in tool inputs.

public

Handles a change in mode-specific tool inputs.

Public Constructors

public constructor(ui: UI) source

Constructs a TopBar instance.

Params:

NameTypeAttributeDescription
ui UI

Reference to the UI instance.

Public Members

public dropdown: * source

public inputForm: * source

public modeInputForm: * source

public modeSelect: * source

public topBar: * source

public ui: * source

Public Methods

public initListeners() source

Initialize the event listeners.

public selectGraphObject(event: Event) source

Toggle graph object selection. This is used for tool inputs that request a graph object.

Params:

NameTypeAttributeDescription
event Event

Event object from the event listener.

public showInputs() source

Displays the tool inputs in the inputForm element.

public showModeInputs() source

Displays the mode-specific tool inputs in the modeInputForm element.

public showModes() source

Displays the tool modes in the Dropdown.

public submitModeInputValues(event: Event) source

Handles mode-specific tool input submission.

Params:

NameTypeAttributeDescription
event Event

Event object from the event listener.

public updateAllModeInputValues(inputData: Object<string, *>) source

Update the stored values of all mode-specific tool inputs.

Params:

NameTypeAttributeDescription
inputData Object<string, *>

Object containing names of inputs mapped to their values.

public updateGraphInput(input: Element, obj: Node | Edge | Label, hasError: boolean) source

Update the graph input after object selection.

Params:

NameTypeAttributeDescription
input Element

The input element.

obj Node | Edge | Label

The selected graph object.

hasError boolean

Whether or not the input has an error.

public updateInputValues(event: Event) source

Handles a change in tool inputs.

Params:

NameTypeAttributeDescription
event Event

Event object from the event listener.

public updateModeInputValues(event: Event) source

Handles a change in mode-specific tool inputs.

Params:

NameTypeAttributeDescription
event Event

Event object from the event listener.