Home Reference Source Test Repository
public class | source

SidebarAlgorithm

Extends:

SidebarContent → SidebarAlgorithm

Sidebar that accompanies the AlgorithmTool.

Constructor Summary

Public Constructor
public

constructor(graph: Graph)

Constructor calls the super, creates a new stepper object and then assigns algorithm specific button listeners to the sidebar

Member Summary

Public Members
public
public

graph: *

public

stepper: *

Method Summary

Public Methods
public

Create a graph link element using the specified Node or Edge.

public

Called when the sidebar content is switched to this.

public

Called to check for hovering over a graph link (link that associates text with an object in the Graph).

public

Reset the graph.

public

run()

Runs the current algorithm and displays the results in the sidebar.

public

setAlgorithm(AlgorithmClass: Object)

Set the current algorithm to a new instance of the given algorithm class.

public

toggleHover(type: string, id: number, isHovering: boolean)

Toggle the hover state of the associated Node or Edge when a graph link is being hovered.

public

update()

Update does nothing now, at this point might not do anything ever since changing the algorithm type occurs in algorithm-tool and the top-bar.

public

Update the state of the buttons in the sidebar.

Inherited Summary

From class SidebarContent
public

graph: *

public

tabs: *

public

changeGraph(newGraph: Graph)

Change the Graph object reference stored to the new one.

public abstract

Display the sidebar.

public abstract

update()

Update the sidebar state.

Public Constructors

public constructor(graph: Graph) source

Constructor calls the super, creates a new stepper object and then assigns algorithm specific button listeners to the sidebar

Override:

SidebarContent#constructor

Params:

NameTypeAttributeDescription
graph Graph

Reference to the master graph object

Public Members

public curAlgorithm: * source

public graph: * source

Override:

SidebarContent#graph

public stepper: * source

Public Methods

public createLinkElement(obj: Node | Edge): string source

Create a graph link element using the specified Node or Edge.

Params:

NameTypeAttributeDescription
obj Node | Edge

Node or Edge object to create a graph link for.

Return:

string

String containing the HTML for the graph link to the specified Node or Edge.

public display() source

Called when the sidebar content is switched to this.

Override:

SidebarContent#display

public hoverEvent(bool: boolean) source

Called to check for hovering over a graph link (link that associates text with an object in the Graph).

Params:

NameTypeAttributeDescription
bool boolean

Whether or not the graph link is currently being hovered over.

public resetGraph() source

Reset the graph. Calls resetGraph() of the Stepper instance.

public run() source

Runs the current algorithm and displays the results in the sidebar.

public setAlgorithm(AlgorithmClass: Object) source

Set the current algorithm to a new instance of the given algorithm class.

Params:

NameTypeAttributeDescription
AlgorithmClass Object

The algorihtm class

public toggleHover(type: string, id: number, isHovering: boolean) source

Toggle the hover state of the associated Node or Edge when a graph link is being hovered.

Params:

NameTypeAttributeDescription
type string

String containing the type of the object.

id number

ID of the object.

isHovering boolean

Whether or not the mouse is hovering over the graph link.

public update() source

Update does nothing now, at this point might not do anything ever since changing the algorithm type occurs in algorithm-tool and the top-bar.

Override:

SidebarContent#update

public updateStepGUI() source

Update the state of the buttons in the sidebar.