Package mgui.interfaces
Class InterfaceSession
java.lang.Object
mgui.interfaces.InterfaceSession
public class InterfaceSession
extends java.lang.Object
This is the main entry point into the mgui application. The main method instantiates a
MainFrame with an optionally specified init file. If no file is specified,
InterfaceEnvironment uses its default init file.
This class represents a static session of modelGUI. It sets up the static
InterfaceEnvironment and then displays a corresponding SessionFrame
and InterfaceWorkspace instance.
See this wiki page for a description of init files.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
- See Also:
SessionFrame,InterfaceEnvironment
-
Constructor Summary
Constructors Constructor Description InterfaceSession() -
Method Summary
Modifier and Type Method Description static ClipboardgetClipboard()Returns the clipboard for the current session.static InterfaceDisplayPanelgetDisplayPanel()Returns the top display panel for the current session.static SessionFramegetSessionFrame()Returns the frame for the current session.static longgetUID()Returns a unique identifier for this session.static InterfaceWorkspacegetWorkspace()Returns the workspace for the current session.static voidhandleException(java.lang.Exception ex)Handles an exception, assuming theLoggingTypeisErrors.static voidhandleException(java.lang.Exception ex, LoggingType type)Handles an exception, based on the specifiedLoggingType.static booleanisInit()Specifies whether this session has been completely initialized yet.static booleanlog(java.lang.String message)Logs a message according the logging type ofInterfaceEnvironment.static booleanlog(java.lang.String _message, LoggingType type)Logs a message according the logging type ofInterfaceEnvironment.static booleanlog(java.lang.String _message, LoggingType type, boolean timestamp)Logs a message according the logging type ofInterfaceEnvironment.static booleanshowErrorsOnConsole()static booleanshowStackTraceOnConsole()static voidstart()Main entry point into ModelGUI application.static voidstart(boolean show_gui)Main entry point into ModelGUI application.static voidstart(java.lang.String init)Main entry point into modelGUI application.static voidstart(java.lang.String init, boolean show_gui)Main entry point into modelGUI application.static voidstart_no_gui()Main entry point into modelGUI application, without a frame being created.static voidstart_no_gui(java.lang.String init)Main entry point into modelGUI application.static voidterminate()Terminates this ModelGUI session and exits the JVM.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
InterfaceSession
public InterfaceSession()
-
-
Method Details
-
start_no_gui
public static void start_no_gui()Main entry point into modelGUI application, without a frame being created. InitializesInterfaceEnvironmentfrom the default init file. Constructs and displays an instance ofMainFrame, and sets the look and feel. -
start_no_gui
public static void start_no_gui(java.lang.String init)Main entry point into modelGUI application. InitializesInterfaceEnvironmentfrom the default init file. Constructs and displays an instance ofMainFrame, and sets the look and feel. -
start
public static void start()Main entry point into ModelGUI application. InitializesInterfaceEnvironmentfrom the default init file. Constructs and displays an instance ofMainFrame, and sets the look and feel. -
start
public static void start(boolean show_gui)Main entry point into ModelGUI application. InitializesInterfaceEnvironmentfrom the default init file. Constructs and displays an instance ofMainFrame, and sets the look and feel. -
start
public static void start(java.lang.String init)Main entry point into modelGUI application. InitializesInterfaceEnvironmentfrom the init fileinit, or a default init file ifinitisnull. Constructs and displays an instance ofMainFrame, and sets the look and feel.- Parameters:
init- the init file; ifnull, the environment loads from the default init file
-
start
public static void start(java.lang.String init, boolean show_gui)Main entry point into modelGUI application. InitializesInterfaceEnvironmentfrom the init fileinit, or a default init file ifinitisnull. Constructs and displays an instance ofMainFrame, and sets the look and feel.- Parameters:
init- the init file; ifnull, the environment loads from the default init filehow_gui- Whether to make the session frame visible
-
terminate
public static void terminate()Terminates this ModelGUI session and exits the JVM. -
getUID
public static long getUID()Returns a unique identifier for this session.- Returns:
-
getSessionFrame
Returns the frame for the current session.- Returns:
-
getWorkspace
Returns the workspace for the current session.- Returns:
-
getDisplayPanel
Returns the top display panel for the current session.- Returns:
-
isInit
public static boolean isInit()Specifies whether this session has been completely initialized yet.- Returns:
-
log
public static boolean log(java.lang.String message)Logs a message according the logging type ofInterfaceEnvironment.- Parameters:
message-- Returns:
-
log
Logs a message according the logging type ofInterfaceEnvironment. Whether the log occurs depends on the environment logging type for this session, and thetypeparameter:Errors: Will always be loggedConcise: Will always be logged unless environment logging type isErrorsVerbose: Will only be logged if environment logging type isVerboseorDebugDebug: Will only be logged is environment logging type isDebug
This method is thread safe, since it calls
invokeLater.- Parameters:
message-type-- Returns:
-
log
Logs a message according the logging type ofInterfaceEnvironment. Whether the log occurs depends on the environment logging type for this session, and thetypeparameter:Errors: Will always be loggedConcise: Will always be logged unless environment logging type isErrorsVerbose: Will only be logged if environment logging type isVerboseorDebugDebug: Will only be logged is environment logging type isDebug
- Parameters:
message- - message to logtype- - logging typetimestamp- - whether to log the timestamp- Returns:
-
showErrorsOnConsole
public static boolean showErrorsOnConsole() -
showStackTraceOnConsole
public static boolean showStackTraceOnConsole() -
handleException
public static void handleException(java.lang.Exception ex)Handles an exception, assuming theLoggingTypeisErrors.- Parameters:
ex-
-
handleException
Handles an exception, based on the specifiedLoggingType.- Parameters:
ex-type- The type of exception, determines how it will be displayed based on the current environment setting
-
getClipboard
Returns the clipboard for the current session. This can be used for simple copy/paste procedures.- Returns:
-