logger
Class Logger

java.lang.Object
  extended by logger.Logger

public class Logger
extends java.lang.Object

Provides a method for logging mofications to a map. The methods are static allow any object to directly access these methods.


Field Summary
private static Log log
          the current log
private static boolean loggerEnabled
          specifies if events should be logged
static java.lang.String NEW_MAP
          default name for new maps
 
Constructor Summary
Logger()
           
 
Method Summary
static void addEvent(LogEvent event)
          Adds an event to the current log, if one exists.
static void exportLog(java.lang.String filename)
          Serializes the log to the specified file.
static Log getLog()
          Gets the current log.
static Log importLog(java.lang.String filename)
          Deserializes a log from the specified log file.
static void newMap()
          Displables logging, because a new map does not have a file location.
static void redo(InteractionHandler handler)
          Redoes the most recently undone action.
static void setMap(java.lang.String mapFile)
          Creates a new log object for the new map.
static void undo(InteractionHandler handler)
          Undoes the most recent event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static Log log
the current log


loggerEnabled

private static boolean loggerEnabled
specifies if events should be logged


NEW_MAP

public static java.lang.String NEW_MAP
default name for new maps

Constructor Detail

Logger

public Logger()
Method Detail

setMap

public static void setMap(java.lang.String mapFile)
Creates a new log object for the new map.

Parameters:
mapFile - - the location of the new map

newMap

public static void newMap()
Displables logging, because a new map does not have a file location. Logging can only be applied to maps loaded from a file.


getLog

public static Log getLog()
Gets the current log.


addEvent

public static void addEvent(LogEvent event)
Adds an event to the current log, if one exists.

Parameters:
event - - the modification event

importLog

public static Log importLog(java.lang.String filename)
Deserializes a log from the specified log file.

Parameters:
filename - - the file containing a serialized log
Returns:
- the log

exportLog

public static void exportLog(java.lang.String filename)
Serializes the log to the specified file.

Parameters:
filename - - the file to write

undo

public static void undo(InteractionHandler handler)
Undoes the most recent event.

Parameters:
handler - - the interaction handler

redo

public static void redo(InteractionHandler handler)
Redoes the most recently undone action.

Parameters:
handler - - the interaction handler