Global

Methods

closeControlWindow() → {undefined}

Closes the control element
Source:
Returns:
Type
undefined

connectionDataReceived(event) → {undefined}

Handles data received from the websocket connection.
Parameters:
Name Type Description
event type The event received from the server side.
Source:
Returns:
Type
undefined

connectionError(error) → {undefined}

Prints a message to the console when a connection error occurs.
Parameters:
Name Type Description
error type The error message.
Source:
Returns:
Type
undefined

debugOff() → {undefined}

Disables debug capabilities.
Source:
Returns:
Type
undefined

debugSelector() → {undefined}

Flashes a shape when it is selected in the debugger.
Source:
Returns:
Type
undefined

enableEventHandlers(shape, message) → {undefined}

Adds event handlers for events the server is interested in.
Parameters:
Name Type Description
shape type The shape on which the event handler is set.
message type The message from the server.
Source:
Returns:
Type
undefined

hideDebugConsole() → {undefined}

Hides or unhides the debug console.
Source:
Returns:
Type
undefined

initCanvas(container, width, height) → {undefined}

Initializes the canvas.
Parameters:
Name Type Description
container type
width Number The width of the canvas.
height Number The height of the canvas.
Source:
Returns:
Type
undefined

initDebug() → {undefined}

Initializes debug capabilities.
Source:
Returns:
Type
undefined

mouseDragEndEventHandler(id, event) → {undefined}

Handles mouse drag events.
Parameters:
Name Type Description
id type The id of the shape the event handler listens on.
event type
Source:
Returns:
Type
undefined

mouseDragEventHandler(id, event) → {undefined}

Sends information belonging to a mouse drag event.
Parameters:
Name Type Description
id type The id of the shape the drag occurs on.
event type
Source:
Returns:
Type
undefined

mouseDragStartEventHandler(id, event) → {undefined}

Starts the mouse drag event handler.
Parameters:
Name Type Description
id type The id of the shape the event handler will listen on.
event type
Source:
Returns:
Type
undefined

mouseEvent(eventName, id, event) → {undefined}

Sends information about mouse events.
Parameters:
Name Type Description
eventName type The name of the event as send to the server.
id type The id of the shape as send to the server.
event type
Source:
Returns:
Type
undefined

newDefaultLayer() → {undefined}

Makes a new layer to draw on.
Source:
Returns:
Type
undefined

openControlWindow(title, message) → {undefined}

Opens a control element with a title and a message
Parameters:
Name Type Description
title type The title of the message (required)
message type The contents of the message (optional)
Source:
Returns:
Type
undefined

parseActionData(data) → {undefined}

Parses action data and execute the actions.
Parameters:
Name Type Description
data type
Source:
Returns:
Type
undefined

parseShapeData(shape) → {Kinetic.Group|shapeFromData.shape|Kinetic.Circle|Kinetic.Line|Kinetic.Polygon|Kinetic.Text|Kinetic.Rect}

Parses shape data and returns an object kinetic accepts. Also coupling to event handlers is done.
Parameters:
Name Type Description
shape type data
Source:
Returns:
Type
Kinetic.Group | shapeFromData.shape | Kinetic.Circle | Kinetic.Line | Kinetic.Polygon | Kinetic.Text | Kinetic.Rect

printDebugMessage(message, type) → {undefined}

Prints debug messages to the console if debug is enabled.
Parameters:
Name Type Description
message type The message that is printed to the console.
type Number The severity of the debug message.
Source:
Returns:
Type
undefined

promptFileBrowser() → {undefined}

Opens a file browser in which you can select a file. This function should be called directly through user input and not through a websocket for example. Browsers have built in protection to prevent this, the prompt will not show.
Source:
Returns:
Type
undefined

requestFullscreen(attempt) → {undefined}

Asks the user to go fullscreen.
Parameters:
Name Type Description
attempt type
Source:
Returns:
Type
undefined

requestUpload() → {undefined}

Opens a prompt to ask if a file should be uploaded. When clicked on "Yes" a file selection browser will be opened.
Source:
Returns:
Type
undefined

resizeCanvas(event) → {undefined}

Resizes the canvas.
Parameters:
Name Type Description
event type
Source:
Returns:
Type
undefined

rgbaDictToColor(dict) → {String}

Converts rgba values to colors.
Parameters:
Name Type Description
dict type
Source:
Returns:
Type
String

sendKeyEvent(eventName, event) → {undefined}

Sends information about key events to the server.
Parameters:
Name Type Description
eventName String The name of the key event as send to the server.
event type
Source:
Returns:
Type
undefined

sendScrollEvent(deltaX, deltaY) → {undefined}

Sends a scroll event to the server.
Parameters:
Name Type Description
deltaX Number How far is scrolled in horizontal direction.
deltaY Number How far is scrolled in vertical direction.
Source:
Returns:
Type
undefined

sendWindowResizeEvent(width, height) → {undefined}

Sends a window resize event to the server.
Parameters:
Name Type Description
width Number How wide the window has become.
height Number How high the window has become.
Source:
Returns:
Type
undefined

setFixedProportions(container, width, height) → {undefined}

Sets fixed proportions for the container.
Parameters:
Name Type Description
container type
width type The new fixed width of the container.
height type The new fixed height of the container.
Source:
Returns:
Type
undefined

setFluidProportions(container) → {undefined}

Sets fluid proportions for the container.
Parameters:
Name Type Description
container type
Source:
Returns:
Type
undefined

setWindowDisplayType(displayType, attempt) → {undefined}

Type is an enumeration where 0 is FizedSize 1 is FullWindow and 2 is FullScreen. Width and height are required with FixedSize and are ignored with the other types.
Parameters:
Name Type Description
displayType type
attempt type
Source:
Returns:
Type
undefined

shapeFromData(message) → {Kinetic.Group|shapeFromData.shape|Kinetic.Circle|Kinetic.Line|Kinetic.Polygon|Kinetic.Text|Kinetic.Rect}

Draws shapes from a JSON message.
Parameters:
Name Type Description
message type The message out of which a shape is constructed.
Source:
Returns:
Type
Kinetic.Group | shapeFromData.shape | Kinetic.Circle | Kinetic.Line | Kinetic.Polygon | Kinetic.Text | Kinetic.Rect