sam.ui.awt
Class LogInterface

java.lang.Object
  |
  +--sam.ui.LogInterface
        |
        +--sam.ui.awt.LogInterface

public class LogInterface
extends LogInterface

Pluggable AWT-based log interface


Nested Class Summary
protected  class LogInterface.LogLevelInput
          Simple log-level scroll bar.
 
Constructor Summary
LogInterface()
          Builds a new log interface
 
Method Summary
protected  void finalize()
           
 java.awt.Button getButton(java.awt.Component activator)
          Gets a proper switch button to activate/deactivate the log.
protected static java.awt.Point getLocation(java.awt.Component source, java.awt.Component target, java.lang.String direction)
          Gets the best location to display the log adjacent to another.
protected  void hide()
          Hides the log window.
protected  void log(java.lang.String logMessage)
          Actually handles a log message.
 void setLevel(int level)
          Sets the log level.
protected  void show(java.lang.String direction)
          Shows the log window.
 
Methods inherited from class sam.ui.LogInterface
disable, enable, flush, getLevel, log, post, start, stop, test
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogInterface

public LogInterface()
Builds a new log interface

Method Detail

setLevel

public void setLevel(int level)
Sets the log level. This also updates graphical components.

Overrides:
setLevel in class LogInterface
Parameters:
level - the desired log level for subsequent calls which can not be greater than Settings.Defaults.MAXIMUM_LOG_LEVEL

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

log

protected void log(java.lang.String logMessage)
Description copied from class: LogInterface
Actually handles a log message. This is the very method meant to be overridden and to do the logging job.

Specified by:
log in class LogInterface

getButton

public java.awt.Button getButton(java.awt.Component activator)
Gets a proper switch button to activate/deactivate the log.

Parameters:
activator - the component the button will be attached to

show

protected void show(java.lang.String direction)
Shows the log window.

Parameters:
direction - one of BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.WEST, BorderLayout.EAST.

hide

protected void hide()
Hides the log window.


getLocation

protected static java.awt.Point getLocation(java.awt.Component source,
                                            java.awt.Component target,
                                            java.lang.String direction)
Gets the best location to display the log adjacent to another.

Parameters:
direction - one of BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.WEST, BorderLayout.EAST, BorderLayout.CENTER.