Package adams.terminal
Class Main
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.terminal.application.AbstractTerminalApplication
-
- adams.terminal.application.AbstractLanternaTerminalApplication
-
- adams.terminal.Main
-
- 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
public class Main extends AbstractLanternaTerminalApplication
Main ADAMS application - terminal-based.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Main.LogHandler
The log handler for the application.
-
Field Summary
Fields Modifier and Type Field Description protected com.googlecode.lanterna.gui2.Button
m_ButtonClear
the button for clearing the log.protected com.googlecode.lanterna.gui2.Panel
m_MenuBar
the menu bar.protected com.googlecode.lanterna.gui2.Panel
m_PanelMain
the main panel.protected LogTextBox
m_TextBoxLog
the textbox for the logging.-
Fields inherited from class adams.terminal.application.AbstractLanternaTerminalApplication
m_GUI, m_MainWindow, m_Screen, m_Terminal
-
-
Constructor Summary
Constructors Constructor Description Main()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendLog(String msg)
Appends the log message.protected Handler
createLogHandler()
Returns the log handler to use.protected String
getDefaultApplicationTitle()
Returns the default title of the application.protected adams.db.AbstractDatabaseConnection
getDefaultDatabaseConnection()
Returns the default database connection.LogTextBox
getLogTextBox()
Returns the textbox to be used for logging.String
globalInfo()
Returns a string describing the object.protected void
initTerminal()
Initializes the terminal.static void
main(String[] args)
Starts the terminal application from commandline.protected void
setTitle(String value)
Sets the title to use.-
Methods inherited from class adams.terminal.application.AbstractLanternaTerminalApplication
finishTerminal, initialize, logError, logError, logMessage, start, stop
-
Methods inherited from class adams.terminal.application.AbstractTerminalApplication
addRemoteScriptingEngine, addRemoteScriptingEngineUpdateListener, applicationTitleTipText, createTitle, databaseConnectionStateChanged, defineOptions, forCommandLine, forName, getApplicationTitle, getDatabaseConnection, getRemoteScriptingEngine, getRemoteScriptingEngineCmdLine, notifyRemoteScriptingEngineUpdateListeners, remoteScriptingEngineCmdLineTipText, removeRemoteScriptingEngine, removeRemoteScriptingEngineUpdateListener, runApplication, setApplicationTitle, setDatabaseConnection, setLoggingLevel, setRemoteScriptingEngine, setRemoteScriptingEngineCmdLine
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_PanelMain
protected com.googlecode.lanterna.gui2.Panel m_PanelMain
the main panel.
-
m_MenuBar
protected com.googlecode.lanterna.gui2.Panel m_MenuBar
the menu bar.
-
m_TextBoxLog
protected LogTextBox m_TextBoxLog
the textbox for the logging.
-
m_ButtonClear
protected com.googlecode.lanterna.gui2.Button m_ButtonClear
the button for clearing the log.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
initTerminal
protected void initTerminal()
Initializes the terminal.- Overrides:
initTerminal
in classAbstractLanternaTerminalApplication
-
getDefaultApplicationTitle
protected String getDefaultApplicationTitle()
Returns the default title of the application.- Specified by:
getDefaultApplicationTitle
in classadams.terminal.application.AbstractTerminalApplication
- Returns:
- the default title
-
setTitle
protected void setTitle(String value)
Sets the title to use.- Specified by:
setTitle
in classadams.terminal.application.AbstractTerminalApplication
- Parameters:
value
- the title
-
getDefaultDatabaseConnection
protected adams.db.AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Specified by:
getDefaultDatabaseConnection
in classadams.terminal.application.AbstractTerminalApplication
- Returns:
- the default database connection
-
getLogTextBox
public LogTextBox getLogTextBox()
Returns the textbox to be used for logging.- Overrides:
getLogTextBox
in classAbstractLanternaTerminalApplication
- Returns:
- the textbox, null if not available
-
createLogHandler
protected Handler createLogHandler()
Returns the log handler to use.- Specified by:
createLogHandler
in classadams.terminal.application.AbstractTerminalApplication
- Returns:
- the handler
-
appendLog
public void appendLog(String msg)
Appends the log message.- Parameters:
msg
- the log message
-
-