Package adams.terminal.application
Class AbstractLanternaTerminalApplication
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.terminal.application.AbstractTerminalApplication
-
- adams.terminal.application.AbstractLanternaTerminalApplication
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,adams.db.DatabaseConnectionHandler
,adams.db.DatabaseConnectionProvider
,adams.db.DatabaseConnectionUser
,adams.event.DatabaseConnectionChangeListener
,adams.scripting.RemoteScriptingEngineHandler
,Serializable
- Direct Known Subclasses:
Main
public abstract class AbstractLanternaTerminalApplication extends adams.terminal.application.AbstractTerminalApplication
Ancestor for terminal-based applications.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected com.googlecode.lanterna.gui2.MultiWindowTextGUI
m_GUI
the GUI.protected com.googlecode.lanterna.gui2.Window
m_MainWindow
the main window.protected com.googlecode.lanterna.screen.Screen
m_Screen
the screen in use.protected com.googlecode.lanterna.terminal.Terminal
m_Terminal
the terminal in use.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLanternaTerminalApplication()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finishTerminal()
Finishes the initialization.LogTextBox
getLogTextBox()
Returns the textbox to be used for logging.protected void
initialize()
Initializes the members.protected void
initTerminal()
Initializes the terminal.void
logError(String msg)
Logs the error.void
logError(String msg, Throwable t)
Logs the error.void
logMessage(String msg)
Logs the message.void
start()
Starts the application.void
stop()
Stops the application.-
Methods inherited from class adams.terminal.application.AbstractTerminalApplication
addRemoteScriptingEngine, addRemoteScriptingEngineUpdateListener, applicationTitleTipText, createLogHandler, createTitle, databaseConnectionStateChanged, defineOptions, forCommandLine, forName, getApplicationTitle, getDatabaseConnection, getDefaultApplicationTitle, getDefaultDatabaseConnection, getRemoteScriptingEngine, getRemoteScriptingEngineCmdLine, notifyRemoteScriptingEngineUpdateListeners, remoteScriptingEngineCmdLineTipText, removeRemoteScriptingEngine, removeRemoteScriptingEngineUpdateListener, runApplication, setApplicationTitle, setDatabaseConnection, setLoggingLevel, setRemoteScriptingEngine, setRemoteScriptingEngineCmdLine, setTitle
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Terminal
protected com.googlecode.lanterna.terminal.Terminal m_Terminal
the terminal in use.
-
m_Screen
protected com.googlecode.lanterna.screen.Screen m_Screen
the screen in use.
-
m_GUI
protected com.googlecode.lanterna.gui2.MultiWindowTextGUI m_GUI
the GUI.
-
m_MainWindow
protected com.googlecode.lanterna.gui2.Window m_MainWindow
the main window.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classadams.terminal.application.AbstractTerminalApplication
-
initTerminal
protected void initTerminal()
Initializes the terminal.- Specified by:
initTerminal
in classadams.terminal.application.AbstractTerminalApplication
-
getLogTextBox
public LogTextBox getLogTextBox()
Returns the textbox to be used for logging.
Default implementation just returns null.- Returns:
- the textbox, null if not available
-
logMessage
public void logMessage(String msg)
Logs the message.- Specified by:
logMessage
in classadams.terminal.application.AbstractTerminalApplication
- Parameters:
msg
- the message to log
-
logError
public void logError(String msg)
Logs the error.- Specified by:
logError
in classadams.terminal.application.AbstractTerminalApplication
- Parameters:
msg
- the error message to log
-
logError
public void logError(String msg, Throwable t)
Logs the error.- Specified by:
logError
in classadams.terminal.application.AbstractTerminalApplication
- Parameters:
msg
- the error message to logt
- the exception
-
finishTerminal
protected void finishTerminal()
Finishes the initialization.- Specified by:
finishTerminal
in classadams.terminal.application.AbstractTerminalApplication
-
start
public void start()
Starts the application.- Specified by:
start
in classadams.terminal.application.AbstractTerminalApplication
-
stop
public void stop()
Stops the application.- Specified by:
stop
in classadams.terminal.application.AbstractTerminalApplication
-
-