Frontend API

export class TopbarComponent implements WorkspaceListener

Topbar of the workspace component. The idea behind this component is to provide the user with features close to a native app toolbar, as can be found in any app with the tabs File Edit View etc.

It implements the WorkspaceListener interface in order to update its displayed data when the user connects to another workspace.

It displays : - {Project name} - File - Show graph - Show components list - Show file explorer - Save flow - Run Graph - Server connexion : {state} Created by antoine on 19/06/2017.

runSimulation ()

Start the simulation

updateWorkspace (workspace: Workspace)

Update the information displaying the workspace’s and network’s state, such as the Run/Stop graph button label and color and the server connexion’s state

saveFlow ()

Save the workflow’s data. Need to be called in order to save the data of the flow, otherwise when the server restart, all modifications are deleted.

connectWS ()

Reconnect the socket to the workspace.

onClose ()

Method to call when the user wants to close the workspace. It saves the workflow and close the socket.