Home Reference Source Test Repository
public class | source

Canvas

Front end canvas frame which reacts to mouse-clicks upon it

Constructor Summary

Public Constructor
public

Constructor for the Canvas object

Member Summary

Public Members
public

canvas: *

public

context: *

public
public
public
public
public get

scale: *

public set

scale: *

public
public

ui: *

Method Summary

Public Methods
public

clear()

public

getCanvasX(event: HTMLEvent): Number

Functions gets the x-position of the click event on the full canvas

public

getCanvasY(event: HTMLEvent): Number

Functions gets the y-position of the click event on the full canvas

public

init(graph: Graph)

Initializes the mouse handler, context menu, and other listeners

public

Creates all the listeners for every event which happens upon the canvas Based on the event it calls the relevant function

public

reset()

public

resetGraph(newGraph: *)

public

resize(event: *)

public

update()

Public Constructors

public constructor(ui: UI) source

Constructor for the Canvas object

Params:

NameTypeAttributeDescription
ui UI

refers to the master ui object

Public Members

public canvas: * source

public context: * source

public contextMenu: * source

public dx: number source

public dy: number source

public mouseHandler: * source

public get scale: * source

public set scale: * source

public scaleValue: * source

public ui: * source

Public Methods

public clear() source

public getCanvasX(event: HTMLEvent): Number source

Functions gets the x-position of the click event on the full canvas

Params:

NameTypeAttributeDescription
event HTMLEvent

the click event which triggered this call

Return:

Number

x - The x-position of the click event on the full canvas

public getCanvasY(event: HTMLEvent): Number source

Functions gets the y-position of the click event on the full canvas

Params:

NameTypeAttributeDescription
event HTMLEvent

the click event which triggered this call

Return:

Number

y - The y-position of the click event on the full canvas

public init(graph: Graph) source

Initializes the mouse handler, context menu, and other listeners

Params:

NameTypeAttributeDescription
graph Graph

refers to the master graph object

public initListeners() source

Creates all the listeners for every event which happens upon the canvas Based on the event it calls the relevant function

public reset() source

public resetGraph(newGraph: *) source

Params:

NameTypeAttributeDescription
newGraph *

public resize(event: *) source

Params:

NameTypeAttributeDescription
event *

public update() source