Class SAGE2_App
Class defined in:public/src/SAGE2_App.js:27
Constructor for SAGE2 applications
addToAppsLaunchedList
( data
)
public/src/SAGE2_App.js:1176
Asks server to launch app with values. On the server this will add additional associations like which app launched which. Part of the launch process will include calling back to this app and stating the id of the newly launched app.
Parameters:-
data
<String>- name of app to launch. Has to correctly match.
applicationRPC
( query, funcName, broadcast
)
public/src/SAGE2_App.js:875
Support for the RPC call to the server
Parameters:broadcast
( funcName, data
)
public/src/SAGE2_App.js:864
RPC to every application client (client-side)
Parameters:callback
( func, data
)
public/src/SAGE2_App.js:887
Entry point for a RPC callback into the app. Needed to keep state consistant
Parameters:createLayer
( backgroundColor
)
public/src/SAGE2_App.js:583
Method to create a layered div ontop the application
Parameters:-
backgroundColor
<String>color in DOM-syntax for the div
getCallbackName
( callback
)
public/src/SAGE2_App.js:1204
Given a function, will attempt to determine the string name.
Parameters:-
callback
<Function>- The function to get name as a string.
getFullContextMenuAndUpdate
(
)
public/src/SAGE2_App.js:980
Performs full fill of app context menu and sends update to server. This provides one place(mostly) to change code for context menu.
isHidden
(
)
public/src/SAGE2_App.js:664
Calculate if the application is hidden in this display
Returns true if out of screen
isLayerHidden
(
)
public/src/SAGE2_App.js:651
Method returning the visibility of the layer
true if layer is hidden
isSharedWithRemoteSite
(
)
public/src/SAGE2_App.js:353
Used to check if display believes this app is shared with a remote site. This is done by checking if the sync icon is visible.
isVisible
(
)
public/src/SAGE2_App.js:689
Calculate if the application is visible in this display
Returns true if visible
launchAppWithValues
( appName, paramObj, x, y, funcToPassParams
)
public/src/SAGE2_App.js:1123
Asks server to launch app with values. On the server this will add additional associations like which app launched which. Part of the launch process will include calling back to this app and stating the id of the newly launched app.
Parameters:-
appName
<String>- name of app to launch. Has to correctly match.
-
paramObj
<Object>- optional. What to pass the launched app. Appears within init() as serverDataInitValues.
-
x
<Integer | Undefined | Null>- optional. X coordinate to start the app at.
-
y
<Integer | Undefined | Null>-optional. Y coordinate to start the app at.
-
funcToPassParams
<String | Undefined | Null>- optional. app which called this function. Could be a function and will convert to string.
loadSavedData
( filename, callback
)
public/src/SAGE2_App.js:1085
Loads a saved data file (from the saveFile function)
Parameters:log
( msg
)
public/src/SAGE2_App.js:923
Prints message to local browser console and send to server. Accept a string as parameter or multiple parameters
Parameters:-
msg
<Object>list of arguments to be printed
postDraw
( date
)
public/src/SAGE2_App.js:740
Method called after the draw function
Parameters:-
date
<Date>current time from the server
preDraw
( date
)
public/src/SAGE2_App.js:699
Method called before the draw function, calculates timing and frame rate
Parameters:-
date
<Date>current time from the server
refresh
( date
)
public/src/SAGE2_App.js:765
Internal method for an actual draw loop (predraw, draw, postdraw). draw is called as needed
Parameters:-
date
<Date>current time from the server
registerFileListHandler
( mth
)
public/src/SAGE2_App.js:903
Register a callback to be called when receiving a updated file list from server
Parameters:-
mth
<Method>method on object to be called back
requestFileBuffer
( fileName
)
public/src/SAGE2_App.js:943
Application request for fileBuffer
Parameters:-
fileName
<String>name of the file to which data will be saved.
requestNewTitle
( newTitle
)
public/src/SAGE2_App.js:964
Application request for a new title
Parameters:-
newTitle
<String>Text that will be set as the new title for this instance of the app.
SAGE2CopyState
( state
)
public/src/SAGE2_App.js:378
SAGE2CopyState method called on init or load to copy state of app instance
Parameters:-
state
<Object>contains state of app instance
SAGE2Init
( type, data
)
public/src/SAGE2_App.js:89
SAGE2Init method called right after the constructor
Parameters:saveFile
( filename, ext, data
)
public/src/SAGE2_App.js:1098
Uses WebSocket to send a request to the server to save a file from the app into the media folders as an asset (image, pdf, ...)
Parameters:saveFile
( subdir, filename, ext, data
)
public/src/SAGE2_App.js:1057
Uses WebSocket to send a request to the server to save a file from the app into the media folders. The file will be placed in a subdirectory of the media folders called savedFiles/appname/(subdir)?/ . The file name must not contains any directory characters ('/', '', etc.).
Parameters:sendDataToChildrenApps
( func, data
)
public/src/SAGE2_App.js:1148
Sends data to any apps that this one launched. This doesn't go through server.
Parameters:sendDataToClient
( clientDest, func, paramObj
)
public/src/SAGE2_App.js:1187
This is used to send data to a specific SAGE2 client. Usually UI clients.
Parameters:sendDataToParentApp
( func, data
)
public/src/SAGE2_App.js:1163
Sends data to app that launched this one if possible. This doesn't go through server.
Parameters:sendResize
( newWidth, newHeight
)
public/src/SAGE2_App.js:829
Application request for a new size
Parameters:serverDataBroadcastDestination
( nameSuffix, value, description, callback
)
public/src/SAGE2_App.js:1322
Helper function to tell server about a destination. In addition to creating the variable on the server, will also subscribe to the variable. Name will be of format: app_id:destination:givenName
Parameters:serverDataBroadcastSource
( nameSuffix, value, description
)
public/src/SAGE2_App.js:1302
Helper function to tell server about a source. This will add additional markers to the variable. Name will be of format: app_id:source:givenName
Parameters:serverDataGetAllTrackedDescriptions
( callback, unsubscribe
)
public/src/SAGE2_App.js:1395
Asks server for all variable names and their descriptions. Goes to callback as array. Contents of the array will be objects with two properties: nameOfValue and description.
Parameters:serverDataGetValue
( nameOfValue, callback
)
public/src/SAGE2_App.js:1232
Given the name of the variable, will ask server for the variable. The given callback will be activated with that variable's value. Current setup will not activate callback if there is no variable.
Parameters:serverDataRemoveAllValuesGivenToServer
(
)
public/src/SAGE2_App.js:1433
Will remove all source and destination variables submitted to server. Expectation is this is not called by user (but the option is there) instead as part of cleanup on quit().
serverDataRemoveValue
( namesOfValuesToRemove
)
public/src/SAGE2_App.js:1416
Given the name of the variable, remove variable from server. Expectation is this is not called by user (but the option is there) instead as part of cleanup on quit(). Sends an array of strings, which this function is just the specified value.
Parameters:serverDataSetSourceValue
( nameSuffix, value, description, shouldRemoveValueFromServerWhenAppCloses
)
public/src/SAGE2_App.js:1279
Helper function, given the variable name suffix, set value of variable on server. Checks in place to ensure value exists.
Parameters:serverDataSetValue
( nameOfValue, value, description, shouldRemoveValueFromServerWhenAppCloses
)
public/src/SAGE2_App.js:1255
Given the name of the variable, set value of variable on server. Will create if doesn't exist.
Parameters:serverDataSubscribeToNewValueNotification
( callback, unsubscribe
)
public/src/SAGE2_App.js:1371
Asks server for notifications of any new variables that are added to server. The callback will get one object with properties: nameOfValue and description.
Parameters:serverDataSubscribeToValue
( nameOfValue, callback, unsubscribe
)
public/src/SAGE2_App.js:1347
Given the name of a variable, will ask server to send its value each time it is assigned. Values will be sent to callback.
Parameters:terminate
(
)
public/src/SAGE2_App.js:801
Method called by SAGE2, and calls the application 'quit' method
toggleRemotePointerEventPassing
(
)
public/src/SAGE2_App.js:369
Used to set status of event sharing. Activated through context menu.
unregisterFileListHandler
( mth
)
public/src/SAGE2_App.js:913
Unregister a callback to be called when receiving a updated file list from server
Parameters:-
mth
<Method>method on object to be called back
updateTitle
( title
)
public/src/SAGE2_App.js:751
Change the title of the application window
Parameters:-
title
<String>new title string