frog
Class Log

java.lang.Object
  extended by frog.Log

public final class Log
extends Object

Special class for logging all data to the command prompt, JTextAreas in a GUI, and a chosen plain-text log file.

Author:
Team Better Recognize

Field Summary
static boolean logClassifier
          Specifies whether to log any out requests from a Classifier object
static boolean logDevices
          Specifies whether to log any out requests from a Device object
static boolean logFilters
          Specifies whether to log any out requests from a Filter object
static boolean logFROG
          Specifies whether to log any out requests from the FROG class
static boolean logModel
          Specifies whether to log any out requests from an GestureModel object
static boolean logQuantizer
          Specifies whether to log any out requests from a Quantizer object
static boolean logSession
          Specifies whether to log any out requests from the Session class
static boolean logSystemOut
          Specifies whether messages should be logged to System.out.println
static boolean logXYZ
          Specifies whether the raw accelerations going through Devices should be logged
 
Method Summary
static void addTextArea(JTextArea txtArea)
          Gives the Log a JTextArea to append messages to
static void close()
          Free all system resources currently held by Log
static String getTimestamp()
          The current time as a String for the file writes
static void out(Classifier source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void out(Device source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void out(Filter source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void out(Frog source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void out(GestureModel source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void out(Object source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void out(Quantizer source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void out(Session source, String message)
          Attempts to log data to the text file and/or the JTextArea associated with this Log.
static void resetConsoles()
          Resets all JTextAreas associated with this log to be completely empty.
static void setLogFile(File file)
          Attempts to create and then write to the file specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logModel

public static boolean logModel
Specifies whether to log any out requests from an GestureModel object


logClassifier

public static boolean logClassifier
Specifies whether to log any out requests from a Classifier object


logQuantizer

public static boolean logQuantizer
Specifies whether to log any out requests from a Quantizer object


logFilters

public static boolean logFilters
Specifies whether to log any out requests from a Filter object


logDevices

public static boolean logDevices
Specifies whether to log any out requests from a Device object


logFROG

public static boolean logFROG
Specifies whether to log any out requests from the FROG class


logSession

public static boolean logSession
Specifies whether to log any out requests from the Session class


logSystemOut

public static boolean logSystemOut
Specifies whether messages should be logged to System.out.println


logXYZ

public static boolean logXYZ
Specifies whether the raw accelerations going through Devices should be logged

Method Detail

close

public static void close()
                  throws IOException
Free all system resources currently held by Log

Throws:
IOException

out

public static void out(Quantizer source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log. This is subject to the logModel boolean being true to prevent any unwanted Log entries.

Parameters:
source - the Quantizer object calling this method
message - the message to show the user

out

public static void out(GestureModel source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log. This is subject to the logModel boolean being true to prevent any unwanted Log entries.

Parameters:
source - the GestureModel object calling this method
message - the message to show the user

out

public static void out(Classifier source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log. This is subject to the logClassifier boolean being true to prevent any unwanted Log entries.

Parameters:
source - the Classifier object calling this method
message - the message to show the user

out

public static void out(Filter source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log. This is subject to the logFilter boolean being true to prevent any unwanted Log entries.

Parameters:
source - the Filter object calling this method
message - the message to show the user

out

public static void out(Frog source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log. This is subject to the logFROG boolean being true to prevent any unwanted Log entries.

Parameters:
source - the Filter object calling this method
message - the message to show the user

out

public static void out(Session source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log. This is subject to the logFROG boolean being true to prevent any unwanted Log entries.

Parameters:
source - the Filter object calling this method
message - the message to show the user

out

public static void out(Device source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log. This is subject to the logDevices boolean being true to prevent any unwanted Log entries.

Parameters:
source - the Device object calling this method
message - the message to show the user

out

public static void out(Object source,
                       String message)
Attempts to log data to the text file and/or the JTextArea associated with this Log.

Parameters:
source - the object calling this method
message - the message to show the user

setLogFile

public static void setLogFile(File file)
                       throws IOException
Attempts to create and then write to the file specified. Subsequent calls to "out(...)" will perform write operations on this file. If a file was already specified, that file is closed and a new writer created.

Parameters:
file - the file to write log data to
Throws:
IOException - If the file cannot be created or written to

addTextArea

public static void addTextArea(JTextArea txtArea)
Gives the Log a JTextArea to append messages to

Parameters:
txtArea - text area in your GUI that you want log messages sent to

getTimestamp

public static String getTimestamp()
The current time as a String for the file writes

Returns:
a short version of the current time

resetConsoles

public static void resetConsoles()
Resets all JTextAreas associated with this log to be completely empty.