Package weka.gui

Class LogPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Logger, TaskLogger

public class LogPanel extends JPanel implements Logger, TaskLogger
This panel allows log and status messages to be posted. Log messages appear in a scrollable text area, and status messages appear as one-line transient messages.
Version:
$Revision: 15300 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)
See Also:
  • Constructor Details

    • LogPanel

      public LogPanel()
      Creates the log panel with no task monitor and the log always visible.
    • LogPanel

      public LogPanel(WekaTaskMonitor tm)
      Creates the log panel with a task monitor, where the log is hidden.
      Parameters:
      tm - the task monitor, or null for none
    • LogPanel

      public LogPanel(WekaTaskMonitor tm, boolean logHidden)
      Creates the log panel, possibly with task monitor, where the log is optionally hidden.
      Parameters:
      tm - the task monitor, or null for none
      logHidden - true if the log should be hidden and acessible via a button, or false if the log should always be visible.
    • LogPanel

      public LogPanel(WekaTaskMonitor tm, boolean logHidden, boolean statusHidden, boolean titledBorder)
      Creates the log panel, possibly with task monitor, where the either the log is optionally hidden or the status (having both hidden is not allowed).
      Parameters:
      tm - the task monitor, or null for none
      logHidden - true if the log should be hidden and acessible via a button, or false if the log should always be visible.
      statusHidden - true if the status bar should be hidden (i.e.
      titledBorder - true if the log should have a title you only want the log part).
  • Method Details

    • terminate

      public void terminate()
      Terminates this panel, which means, in the case of this panel, that it terminates the frame that it may have created.
    • setLoggingFontSize

      public void setLoggingFontSize(int size)
      Set the size of the font used in the log message area. <= 0 will use the default for JTextArea.
      Parameters:
      size - the size of the font to use in the log message area
    • taskStarted

      public void taskStarted()
      Record the starting of a new task
      Specified by:
      taskStarted in interface TaskLogger
    • taskFinished

      public void taskFinished()
      Record a task ending
      Specified by:
      taskFinished in interface TaskLogger
    • logMessage

      public void logMessage(String message)
      Sends the supplied message to the log area. The current timestamp will be prepended.
      Specified by:
      logMessage in interface Logger
      Parameters:
      message - a value of type 'String'
    • statusMessage

      public void statusMessage(String message)
      Sends the supplied message to the status line.
      Specified by:
      statusMessage in interface Logger
      Parameters:
      message - the status message
    • main

      public static void main(String[] args)
      Tests out the log panel from the command line.
      Parameters:
      args - ignored