MeVisLab Web Toolkit Reference
Loading...
Searching...
No Matches
MLAB.GUI.Application Class Reference

The application class manages the steps to create the web application. More...

Inheritance diagram for MLAB.GUI.Application:
MLAB.Core.Object

Public Member Functions

 closeBrowserWindow (windowName)
 Closes a window that was created by MLAB.GUI.Application.createBrowserWindow().
 createBrowserWindow (windowName, windowTitle, specs)
 Creates a new browser window with the given name, title, and specifications.
 createModule (moduleType, moduleName, moduleIsReadyCallback, connectionSettings)
 Creates a new module.
 destroyModule ()
 enableLeaveCurrentPageConfirmationDialog (message, conditionalCallback)
 Registers a handler for the beforeunload event that may cause a confirmation dialog to popup.
 getArguments ()
 Returns the application arguments, which may be specified as url arguments or as attributes of the arguments object that is passed to initialize().
 getBrowserWindow (windowName)
 Returns a window that was created by MLAB.GUI.Application.createBrowserWindow().
 initialize (args)
 Initializes the global application instance.
 module (moduleName)
 Returns the module by the given name.
 modules ()
 Returns all parent modules that are created.
 setClientSettings (clientSettings)
 Sets the settings from the client which should be passed to the remote worker process.
 setConnectedHandler (handler)
 Sets the connected handler.
 setConnectionErrorHandler (handler)
 Sets the connection error handler.
 setConnectionTimeoutHandler (handler)
 Sets the connection timeout handler.
 setDisconnectedHandler (handler)
 Sets the disconnected handler.
 setRequestTimeoutHandler (handler)
 Sets the request timeout handler.
 showError ()
 Displays an error as an alert.
 shutdown ()
 Shuts the application down by disconnecting all module contexts and closing all browser windows.
Signals

See MLAB.Core.Object about use.

#

 showLoadDialog ()
 Is emitted when a load dialog should be shown.
 hideLoadDialog ()
 Is emitted when a load dialog should be hidden again.
 moduleWindowCreated (windowControl)
 Is emitted when a module panel is created.
 creatingModuleContexts ()
 Is emitted immediately before the module contexts are created.
 allPluginsLoaded ()
 Is emitted when all plugins have been loaded.
 modulesAreReady ()
 Is emitted immediately when the module objects are fully initialized.
Public Member Functions inherited from MLAB.Core.Object
 __init__ ()
 Creates a new MLAB.Core.Object.
 blockSignals (blocked)
 Sets if signals are blocked, which means that signals are suppressed in situations where they would have been emitted.
 connect (signal, receiver, slot)
 Connects a signal of this object to the slot of the receiver.
 connectCallback (signal, callback)
 Connects a signal of this object to the given callback function.
 connectSignal (signal, receiver, targetSignal)
 Connects a signal of this object to the signal of the receiver, so that if this signal is emitted, the target signal on the receiver is also emitted.
 disconnect (signal, receiver, signal)
 Disconnects a signal of this object from the slot of the receiver.
 disconnectCallback (signal, callback)
 Disconnects a signal of this object from the given callback function.
 disconnectReceiver (signal, receiver)
 Disconnects a signal of this object from all slots of the receiver.
 emit (signal)
 Emits a signal.
 isSignalRegistered ()
 Returns true if the given signal is registered.
 registerSignal (signal)
 Registers a signal.
 signalsBlocked ()
 Returns true if signals are blocked.

Protected Member Functions

 _allPluginsLoaded ()
 This is called when all plugins have been loaded.
 _createModuleContextCreator ()
 _handleCoreModulesLoaded ()
 This is called after the core modules (core and gui) have been loaded.
 _notifyModulesAreReady (modules)

Detailed Description

The application class manages the steps to create the web application.

It evaluates the (url) arguments, loads the core resources, instantiates and loads plugins, notifies connected objects about certain states, and creates specified modules.

Signals

  • creatingModuleContexts

    is emitted when the application start creating module contexts.

  • modulesAreReady
  • moduleWindowCreated
  • hideLoadDialog
  • showLoadDialog

Definition at line 26 of file GUI.py.

Member Function Documentation

◆ _allPluginsLoaded()

MLAB.GUI.Application._allPluginsLoaded ( )
protected

This is called when all plugins have been loaded.

The application initialization is now finished, so it calls the callback that was provided in initialize().

Definition at line 144 of file GUI.py.

◆ _createModuleContextCreator()

MLAB.GUI.Application._createModuleContextCreator ( )
protected

Definition at line 60 of file GUI.py.

◆ _handleCoreModulesLoaded()

MLAB.GUI.Application._handleCoreModulesLoaded ( )
protected

This is called after the core modules (core and gui) have been loaded.

It creates singletons and starts loading the framework resources.

Definition at line 56 of file GUI.py.

◆ _notifyModulesAreReady()

MLAB.GUI.Application._notifyModulesAreReady ( modules)
protected
Parameters
modulesAn array of MLAB.Core.Module instances.

Definition at line 149 of file GUI.py.

◆ allPluginsLoaded()

MLAB.GUI.Application.allPluginsLoaded ( )

Is emitted when all plugins have been loaded.

Definition at line 253 of file GUI.py.

◆ closeBrowserWindow()

MLAB.GUI.Application.closeBrowserWindow ( windowName)

Closes a window that was created by MLAB.GUI.Application.createBrowserWindow().

Parameters
windowNameThe name of the window.
Returns
Returns true if the window was found and closed, false otherwise.

Definition at line 222 of file GUI.py.

◆ createBrowserWindow()

MLAB.GUI.Application.createBrowserWindow ( windowName,
windowTitle,
specs )

Creates a new browser window with the given name, title, and specifications.

See the documentation of window.open() for more information about the specifications, typically it includes the width and height. Note that the function may return null if the browser has blocked the window.

Parameters
windowNameThe name of the window.
windowTitleThe title for the new window.
specsA dictionary containing the specifications. See the documentation of window.open() for more information.
Returns
Returns the created window object.

Definition at line 206 of file GUI.py.

◆ createModule()

MLAB.GUI.Application.createModule ( moduleType,
moduleName,
moduleIsReadyCallback,
connectionSettings )

Creates a new module.

Parameters
moduleTypeThe module type.
moduleNameThe instance name of the module. This is optional. By default the module type is the instance name.
moduleIsReadyCallbackThis callback is optional. If given, it will be called when the module has finished its initialization.
connectionSettingsOptional dictionary to override global connection settings.

Definition at line 178 of file GUI.py.

◆ creatingModuleContexts()

MLAB.GUI.Application.creatingModuleContexts ( )

Is emitted immediately before the module contexts are created.

Definition at line 248 of file GUI.py.

◆ destroyModule()

MLAB.GUI.Application.destroyModule ( )

Definition at line 168 of file GUI.py.

◆ enableLeaveCurrentPageConfirmationDialog()

MLAB.GUI.Application.enableLeaveCurrentPageConfirmationDialog ( message,
conditionalCallback )

Registers a handler for the beforeunload event that may cause a confirmation dialog to popup.

If the conditionalCallback function is given and if it returns false, then the confirmation dialog is not shown.

Parameters
messageThe confirmation message that may be shown (e.g. Firefox >= 4 shows always the same message)
conditionalCallbackOptional function that prevents the confirmation dialog, if it returns false.

Definition at line 159 of file GUI.py.

◆ getArguments()

MLAB.GUI.Application.getArguments ( )

Returns the application arguments, which may be specified as url arguments or as attributes of the arguments object that is passed to initialize().

Definition at line 41 of file GUI.py.

◆ getBrowserWindow()

MLAB.GUI.Application.getBrowserWindow ( windowName)

Returns a window that was created by MLAB.GUI.Application.createBrowserWindow().

Parameters
windowNameThe name of the window.
Returns
Returns a window object.

Definition at line 214 of file GUI.py.

◆ hideLoadDialog()

MLAB.GUI.Application.hideLoadDialog ( )

Is emitted when a load dialog should be hidden again.

Definition at line 236 of file GUI.py.

◆ initialize()

MLAB.GUI.Application.initialize ( args)

Initializes the global application instance.

The initialization callback is called after all plugins have been loaded. The arguments is an optional map containing any of the arguments that may also be specified as url arguments. See also getArguments().

Parameters
argsAn optional object with attributes that are handled like page arguments.

Definition at line 50 of file GUI.py.

◆ module()

MLAB.GUI.Application.module ( moduleName)

Returns the module by the given name.

The name may include multiple names divided by dots to access sub modules.

Parameters
moduleNameThe module name.
Returns
Returns the MLAB.Core.Module or null if it was not found.

Definition at line 187 of file GUI.py.

◆ modules()

MLAB.GUI.Application.modules ( )

Returns all parent modules that are created.

Returns
Returns a list with MLAB.Core.Module entries.

Definition at line 193 of file GUI.py.

◆ modulesAreReady()

MLAB.GUI.Application.modulesAreReady ( )

Is emitted immediately when the module objects are fully initialized.

Definition at line 258 of file GUI.py.

◆ moduleWindowCreated()

MLAB.GUI.Application.moduleWindowCreated ( windowControl)

Is emitted when a module panel is created.

Parameters
windowControlthe created window, a MLAB.GUI.WidgetControl

Definition at line 243 of file GUI.py.

◆ setClientSettings()

MLAB.GUI.Application.setClientSettings ( clientSettings)

Sets the settings from the client which should be passed to the remote worker process.

This can be used to specify which locale the worker should use for translations: MLAB.GUI.Application.setClientSettings({"locale": "de_DE"})

Parameters
clientSettingsA JSON dictonary that contains the client settings.

Definition at line 31 of file GUI.py.

◆ setConnectedHandler()

MLAB.GUI.Application.setConnectedHandler ( handler)

Sets the connected handler.

It is called with the module context as argument when the web socket connection is established. Example:

// do something
})
setConnectedHandler(handler)
Sets the connected handler.
Definition GUI.py:105
Parameters
handler

Definition at line 105 of file GUI.py.

◆ setConnectionErrorHandler()

MLAB.GUI.Application.setConnectionErrorHandler ( handler)

Sets the connection error handler.

It is called with the module context and error event as arguments when an error in the web socket connection occurs. Example:

MLAB.GUI.Application.setConnectionErrorHandler(function(moduleContext, errorEvent) {
// do something
})
setConnectionErrorHandler(handler)
Sets the connection error handler.
Definition GUI.py:76
  • moduleContext is an instance of MLAB.Core.ModuleContext,
  • errorEvent the argument that is passed to websocket.onerror.
Parameters
handler

Definition at line 76 of file GUI.py.

◆ setConnectionTimeoutHandler()

MLAB.GUI.Application.setConnectionTimeoutHandler ( handler)

Sets the connection timeout handler.

It is called with the module context as argument when a timeout in the web socket connection occurs. Example:

// do something
})
setConnectionTimeoutHandler(handler)
Sets the connection timeout handler.
Definition GUI.py:91
Parameters
handler

Definition at line 91 of file GUI.py.

◆ setDisconnectedHandler()

MLAB.GUI.Application.setDisconnectedHandler ( handler)

Sets the disconnected handler.

It is called with the module context, the disconnect reason, and possible details when the web socket connections is unexpectedly closed. Example:

MLAB.GUI.Application.setDisconnectedHandler(function(moduleContext, reason, details) {
// do something
})
setDisconnectedHandler(handler)
Sets the disconnected handler.
Definition GUI.py:121
Parameters
handler

Definition at line 121 of file GUI.py.

◆ setRequestTimeoutHandler()

MLAB.GUI.Application.setRequestTimeoutHandler ( handler)

Sets the request timeout handler.

It is called with the module context and request details as arguments when a web socket request timeout occurs. Example:

MLAB.GUI.Application.setRequestTimeoutHandler(function(moduleContext, requestDetails) {
// do something
})
setRequestTimeoutHandler(handler)
Sets the request timeout handler.
Definition GUI.py:137
  • moduleContext is an instance of MLAB.Core.ModuleContext,
  • requestDetails an object containing requestID, functionName, and args; see MLAB.Core.ResponseHandler._requestTimedOut for details.
Parameters
handler

Definition at line 137 of file GUI.py.

◆ showError()

MLAB.GUI.Application.showError ( )

Displays an error as an alert.

Definition at line 35 of file GUI.py.

◆ showLoadDialog()

MLAB.GUI.Application.showLoadDialog ( )

Is emitted when a load dialog should be shown.

Definition at line 231 of file GUI.py.

◆ shutdown()

MLAB.GUI.Application.shutdown ( )

Shuts the application down by disconnecting all module contexts and closing all browser windows.

Definition at line 164 of file GUI.py.


The documentation for this class was generated from the following file:
  • C:/jh/mevislab/5.0_0/build/doc.gen/public/SDK/MeVisLabWebToolkitReference/source/MLAB/GUI.py