Class LogTextBox

  • All Implemented Interfaces:
    com.googlecode.lanterna.gui2.Component, com.googlecode.lanterna.gui2.Interactable, com.googlecode.lanterna.gui2.TextGUIElement

    public class LogTextBox
    extends com.googlecode.lanterna.gui2.TextBox
    Simple log text box.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.googlecode.lanterna.gui2.TextBox

        com.googlecode.lanterna.gui2.TextBox.DefaultTextBoxRenderer, com.googlecode.lanterna.gui2.TextBox.Style, com.googlecode.lanterna.gui2.TextBox.TextBoxRenderer
      • Nested classes/interfaces inherited from interface com.googlecode.lanterna.gui2.Interactable

        com.googlecode.lanterna.gui2.Interactable.FocusChangeDirection, com.googlecode.lanterna.gui2.Interactable.Result
    • Constructor Summary

      Constructors 
      Constructor Description
      LogTextBox()
      Default constructor, this creates a single-line LogTextBox of size 10 which is initially empty
      LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize)
      Creates a new empty LogTextBox with a specific size
      LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize, com.googlecode.lanterna.gui2.TextBox.Style style)
      Creates a new empty LogTextBox with a specific size and style
      LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize, String initialContent)
      Creates a new empty LogTextBox with a specific size and initial content
      LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize, String initialContent, com.googlecode.lanterna.gui2.TextBox.Style style)
      Main constructor of the LogTextBox which decides size, initial content and style
      LogTextBox​(String initialContent)
      Constructor that creates a LogTextBox with an initial content and attempting to be big enough to display the whole text at once without scrollbars
      LogTextBox​(String initialContent, com.googlecode.lanterna.gui2.TextBox.Style style)
      Creates a LogTextBox that has an initial content and attempting to be big enough to display the whole text at once without scrollbars.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.googlecode.lanterna.gui2.TextBox addLine​(String line)
      Adds a single line to the TextBox at the end, this only works when in multi-line mode
      void append​(adams.core.logging.LoggingLevel level, String msg)
      Appends the given string.
      void clear()
      Clears the log.
      • Methods inherited from class com.googlecode.lanterna.gui2.TextBox

        createDefaultRenderer, getCaretPosition, getLine, getLineCount, getMask, getRenderer, getText, getTextOrDefault, handleKeyStroke, isCaretWarp, isHorizontalFocusSwitching, isReadOnly, isVerticalFocusSwitching, setCaretPosition, setCaretPosition, setCaretWarp, setHorizontalFocusSwitching, setMask, setReadOnly, setText, setValidationPattern, setVerticalFocusSwitching
      • Methods inherited from class com.googlecode.lanterna.gui2.AbstractInteractableComponent

        afterEnterFocus, afterLeaveFocus, getCursorLocation, getInputFilter, handleInput, isEnabled, isFocusable, isFocused, onEnterFocus, onLeaveFocus, setEnabled, setInputFilter, takeFocus
      • Methods inherited from class com.googlecode.lanterna.gui2.AbstractComponent

        addTo, calculatePreferredSize, draw, getBasePane, getLayoutData, getParent, getPosition, getPreferredSize, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, isInvalid, onAdded, onAfterDrawing, onBeforeDrawing, onRemoved, runOnGUIThreadIfExistsOtherwiseRunDirect, self, setLayoutData, setPosition, setPreferredSize, setRenderer, setSize, setTheme, toBasePane, toGlobal, withBorder
      • Methods inherited from interface com.googlecode.lanterna.gui2.Component

        addTo, getBasePane, getLayoutData, getParent, getPosition, getPreferredSize, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, onAdded, onRemoved, setLayoutData, setPosition, setPreferredSize, setSize, setTheme, toBasePane, toGlobal, withBorder
      • Methods inherited from interface com.googlecode.lanterna.gui2.TextGUIElement

        draw, isInvalid
    • Constructor Detail

      • LogTextBox

        public LogTextBox()
        Default constructor, this creates a single-line LogTextBox of size 10 which is initially empty
      • LogTextBox

        public LogTextBox​(String initialContent)
        Constructor that creates a LogTextBox with an initial content and attempting to be big enough to display the whole text at once without scrollbars
        Parameters:
        initialContent - Initial content of the LogTextBox
      • LogTextBox

        public LogTextBox​(String initialContent,
                          com.googlecode.lanterna.gui2.TextBox.Style style)
        Creates a LogTextBox that has an initial content and attempting to be big enough to display the whole text at once without scrollbars.
        Parameters:
        initialContent - Initial content of the LogTextBox
        style - Forced style instead of auto-detecting
      • LogTextBox

        public LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize)
        Creates a new empty LogTextBox with a specific size
        Parameters:
        preferredSize - Size of the LogTextBox
      • LogTextBox

        public LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize,
                          com.googlecode.lanterna.gui2.TextBox.Style style)
        Creates a new empty LogTextBox with a specific size and style
        Parameters:
        preferredSize - Size of the LogTextBox
        style - Style to use
      • LogTextBox

        public LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize,
                          String initialContent)
        Creates a new empty LogTextBox with a specific size and initial content
        Parameters:
        preferredSize - Size of the LogTextBox
        initialContent - Initial content of the LogTextBox
      • LogTextBox

        public LogTextBox​(com.googlecode.lanterna.TerminalSize preferredSize,
                          String initialContent,
                          com.googlecode.lanterna.gui2.TextBox.Style style)
        Main constructor of the LogTextBox which decides size, initial content and style
        Parameters:
        preferredSize - Size of the LogTextBox
        initialContent - Initial content of the LogTextBox
        style - Style to use for this LogTextBox, instead of auto-detecting
    • Method Detail

      • append

        public void append​(adams.core.logging.LoggingLevel level,
                           String msg)
        Appends the given string.
        Parameters:
        level - the logging level
        msg - the message to append
      • addLine

        public com.googlecode.lanterna.gui2.TextBox addLine​(String line)
        Adds a single line to the TextBox at the end, this only works when in multi-line mode
        Overrides:
        addLine in class com.googlecode.lanterna.gui2.TextBox
        Parameters:
        line - Line to add at the end of the content in this TextBox
        Returns:
        Itself
      • clear

        public void clear()
        Clears the log.