Class 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.
      • Fields inherited from class adams.terminal.application.AbstractTerminalApplication

        m_ApplicationTitle, m_DbConn, m_RemoteScriptingEngine, m_RemoteScriptingEngineCmdLine, m_RemoteScriptingEngineUpdateListeners
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • 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
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • 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.
    • Constructor Detail

      • AbstractLanternaTerminalApplication

        protected AbstractLanternaTerminalApplication()
        Default constructor.
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.terminal.application.AbstractTerminalApplication
      • initTerminal

        protected void initTerminal()
        Initializes the terminal.
        Specified by:
        initTerminal in class adams.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 class adams.terminal.application.AbstractTerminalApplication
        Parameters:
        msg - the message to log
      • logError

        public void logError​(String msg)
        Logs the error.
        Specified by:
        logError in class adams.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 class adams.terminal.application.AbstractTerminalApplication
        Parameters:
        msg - the error message to log
        t - the exception
      • finishTerminal

        protected void finishTerminal()
        Finishes the initialization.
        Specified by:
        finishTerminal in class adams.terminal.application.AbstractTerminalApplication
      • start

        public void start()
        Starts the application.
        Specified by:
        start in class adams.terminal.application.AbstractTerminalApplication
      • stop

        public void stop()
        Stops the application.
        Specified by:
        stop in class adams.terminal.application.AbstractTerminalApplication