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 classMain.LogHandlerThe log handler for the application.
-
Field Summary
Fields Modifier and Type Field Description protected com.googlecode.lanterna.gui2.Buttonm_ButtonClearthe button for clearing the log.protected com.googlecode.lanterna.gui2.Panelm_MenuBarthe menu bar.protected com.googlecode.lanterna.gui2.Panelm_PanelMainthe main panel.protected LogTextBoxm_TextBoxLogthe 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 voidappendLog(String msg)Appends the log message.protected HandlercreateLogHandler()Returns the log handler to use.protected StringgetDefaultApplicationTitle()Returns the default title of the application.protected adams.db.AbstractDatabaseConnectiongetDefaultDatabaseConnection()Returns the default database connection.LogTextBoxgetLogTextBox()Returns the textbox to be used for logging.StringglobalInfo()Returns a string describing the object.protected voidinitTerminal()Initializes the terminal.static voidmain(String[] args)Starts the terminal application from commandline.protected voidsetTitle(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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
initTerminal
protected void initTerminal()
Initializes the terminal.- Overrides:
initTerminalin classAbstractLanternaTerminalApplication
-
getDefaultApplicationTitle
protected String getDefaultApplicationTitle()
Returns the default title of the application.- Specified by:
getDefaultApplicationTitlein classadams.terminal.application.AbstractTerminalApplication- Returns:
- the default title
-
setTitle
protected void setTitle(String value)
Sets the title to use.- Specified by:
setTitlein classadams.terminal.application.AbstractTerminalApplication- Parameters:
value- the title
-
getDefaultDatabaseConnection
protected adams.db.AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Specified by:
getDefaultDatabaseConnectionin classadams.terminal.application.AbstractTerminalApplication- Returns:
- the default database connection
-
getLogTextBox
public LogTextBox getLogTextBox()
Returns the textbox to be used for logging.- Overrides:
getLogTextBoxin classAbstractLanternaTerminalApplication- Returns:
- the textbox, null if not available
-
createLogHandler
protected Handler createLogHandler()
Returns the log handler to use.- Specified by:
createLogHandlerin classadams.terminal.application.AbstractTerminalApplication- Returns:
- the handler
-
appendLog
public void appendLog(String msg)
Appends the log message.- Parameters:
msg- the log message
-
-