org.jdesktop.wonderland.client.jme
Enum LogViewer

java.lang.Object
  extended by java.lang.Enum<LogViewer>
      extended by org.jdesktop.wonderland.client.jme.LogViewer
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<LogViewer>

public enum LogViewer
extends java.lang.Enum<LogViewer>

Singleton data store for viewing logs

Author:
Jonathan Kaplan

Nested Class Summary
 class LogViewer.LogEntry
           
static interface LogViewer.LogViewerButton
          An extension of the log viewer that adds a button to the frame.
 
Enum Constant Summary
INSTANCE
           
 
Method Summary
 void addButton(LogViewer.LogViewerButton button)
          Add a new button to the log viewer
protected  void addRecord(java.util.logging.LogRecord record)
          Called by the handler to add a new record to the log.
static int format(java.util.logging.LogRecord record, java.lang.StringBuilder builder)
          Format the given record, and add it to the given string builder.
static java.lang.String formatThrowable(java.lang.Throwable t)
           
protected  java.util.List<LogViewer.LogViewerButton> getButtons()
          Get all buttons
 java.util.List<LogViewer.LogEntry> getEntries()
          Get an unmodifiable copy of the list of entries
protected  LogViewerFrame getFrame(boolean create)
          Get the frame associated with this viewer.
 LogViewerHandler getHandler()
           
 int getMaxEntries()
           
 java.util.logging.Level getRootLogLevel()
           
 boolean isVisibleOnStartup()
           
protected  void processRecords()
          Called on the AWT event thread to process all outstanding records
 void removeButton(LogViewer.LogViewerButton button)
          Remove a button from the log viewer
 void setHandler(LogViewerHandler handler)
           
 void setMaxEntries(int maxEntries)
           
 void setRootLogLevel(java.util.logging.Level rootLevel)
           
 void setVisible(boolean visible)
           
 void setVisibleOnStartup(boolean visibleOnStartup)
           
static LogViewer valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static LogViewer[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final LogViewer INSTANCE
Method Detail

values

public static LogViewer[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (LogViewer c : LogViewer.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LogViewer valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

setVisible

public void setVisible(boolean visible)

getHandler

public LogViewerHandler getHandler()

setHandler

public void setHandler(LogViewerHandler handler)

getMaxEntries

public int getMaxEntries()

setMaxEntries

public void setMaxEntries(int maxEntries)

getRootLogLevel

public java.util.logging.Level getRootLogLevel()

setRootLogLevel

public void setRootLogLevel(java.util.logging.Level rootLevel)

isVisibleOnStartup

public boolean isVisibleOnStartup()

setVisibleOnStartup

public void setVisibleOnStartup(boolean visibleOnStartup)

addButton

public void addButton(LogViewer.LogViewerButton button)
Add a new button to the log viewer


removeButton

public void removeButton(LogViewer.LogViewerButton button)
Remove a button from the log viewer


getButtons

protected java.util.List<LogViewer.LogViewerButton> getButtons()
Get all buttons


getFrame

protected LogViewerFrame getFrame(boolean create)
Get the frame associated with this viewer. Must be called on AWT event thread, since the frame is created if it doesn't exist.

Parameters:
create - if true, create the frame if it doesn't exist
Returns:
the frame, or null if the frame doesn't exist and create is false

addRecord

protected void addRecord(java.util.logging.LogRecord record)
Called by the handler to add a new record to the log. This method queues the record and schedules the actual update to happen on the AWT event thread.

Parameters:
record - the record to process

processRecords

protected void processRecords()
Called on the AWT event thread to process all outstanding records


getEntries

public java.util.List<LogViewer.LogEntry> getEntries()
Get an unmodifiable copy of the list of entries

Returns:
the list of log entries

format

public static int format(java.util.logging.LogRecord record,
                         java.lang.StringBuilder builder)
Format the given record, and add it to the given string builder. Return the length of text added to the builder.


formatThrowable

public static java.lang.String formatThrowable(java.lang.Throwable t)


Open Wonderland - http://openwonderland.org