org.nlogo.api
Class Logger

java.lang.Object
  extended by org.nlogo.api.Logger
All Implemented Interfaces:
EventListener, NetLogoListener

public class Logger
extends Object
implements NetLogoListener


Field Summary
static org.apache.log4j.Logger BUTTONS
           
static org.apache.log4j.Logger CODE
           
static org.apache.log4j.Logger GLOBALS
           
static org.apache.log4j.Logger GREENS
           
static org.apache.log4j.Logger LINKS
           
static org.apache.log4j.Logger SPEED
           
static org.apache.log4j.Logger TURTLES
           
static org.apache.log4j.Logger WIDGETS
           
 
Constructor Summary
Logger(String name)
           
 
Method Summary
 void buttonPressed(String buttonName)
          Called when the user presses a button in the NetLogo model.
 void buttonStopped(String buttonName)
          Called when a button in the NetLogo model has finished running and pops back up.
 void changeLogDirectory(String path)
           
 void chooserChanged(String name, Object value, boolean valueChanged)
          Called when the value of a chooser changes.
 void close()
           
 void commandEntered(String owner, String text, char agentType, CompilerException error)
          Called when the user enters text into the command center (and presses return).
 void deleteSessionFiles()
           
static void deleteSessionFiles(String path)
           
 String getIPAddress()
           
 void inputBoxChanged(String name, Object value, boolean valueChanged)
          Called when the value of an input box changes.
static void logAddWidget(String type, String name)
           
static void logButtonPressed(String name)
           
static void logButtonStopped(String name, boolean onceButton, boolean stopping)
           
static void logGlobal(String name, Object value, boolean changed)
           
static void logLinkBirth(String name, String breed)
           
static void logLinkDeath(String name, String breed)
           
static void logSpeedSlider(double value)
           
static void logTurtleBirth(String name, String breed)
           
static void logTurtleDeath(String name, String breed)
           
static void logWidgetRemoved(String type, String name)
           
 void newFiles(Enumeration e, String name)
           
 void openModel(String name)
           
 void sliderChanged(String name, double value, double min, double increment, double max, boolean valueChanged, boolean buttonReleased)
          Called when the value of a slider changes.
 void switchChanged(String name, boolean value, boolean valueChanged)
          Called when the value of a switch changes.
 void zipSessionFiles(String filename)
           
static void zipSessionFiles(String path, String filename)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUTTONS

public static final org.apache.log4j.Logger BUTTONS

GREENS

public static final org.apache.log4j.Logger GREENS

CODE

public static final org.apache.log4j.Logger CODE

WIDGETS

public static final org.apache.log4j.Logger WIDGETS

GLOBALS

public static final org.apache.log4j.Logger GLOBALS

SPEED

public static final org.apache.log4j.Logger SPEED

TURTLES

public static final org.apache.log4j.Logger TURTLES

LINKS

public static final org.apache.log4j.Logger LINKS
Constructor Detail

Logger

public Logger(String name)
Method Detail

changeLogDirectory

public void changeLogDirectory(String path)

openModel

public void openModel(String name)
Specified by:
openModel in interface NetLogoListener

newFiles

public void newFiles(Enumeration e,
                     String name)

close

public void close()

logAddWidget

public static void logAddWidget(String type,
                                String name)

logWidgetRemoved

public static void logWidgetRemoved(String type,
                                    String name)

logSpeedSlider

public static void logSpeedSlider(double value)

logTurtleBirth

public static void logTurtleBirth(String name,
                                  String breed)

logTurtleDeath

public static void logTurtleDeath(String name,
                                  String breed)

logLinkBirth

public static void logLinkBirth(String name,
                                String breed)

logLinkDeath

public static void logLinkDeath(String name,
                                String breed)

logButtonStopped

public static void logButtonStopped(String name,
                                    boolean onceButton,
                                    boolean stopping)

logButtonPressed

public static void logButtonPressed(String name)

buttonPressed

public void buttonPressed(String buttonName)
Description copied from interface: NetLogoListener
Called when the user presses a button in the NetLogo model.

Note that the button may take some time to run and therefore may not pop back up until some later. Use buttonStopped() if you need to know when the button's action has completed.

Specified by:
buttonPressed in interface NetLogoListener

buttonStopped

public void buttonStopped(String buttonName)
Description copied from interface: NetLogoListener
Called when a button in the NetLogo model has finished running and pops back up.

The button may be a "once" button or a "forever" button. If it is a "once" button, it pops back up automatically when its action is completed. If it is a "forever" button, it will pop back up when clicked for a second time by the user. (Some forever buttons may also pop back up automatically, if the model is written that way.)

Specified by:
buttonStopped in interface NetLogoListener

sliderChanged

public void sliderChanged(String name,
                          double value,
                          double min,
                          double increment,
                          double max,
                          boolean valueChanged,
                          boolean buttonReleased)
Description copied from interface: NetLogoListener
Called when the value of a slider changes. Usually if the slider changes it is because the user has changed it using the mouse, but the change may also be the result of code in the model or code typed into the command center.

Specified by:
sliderChanged in interface NetLogoListener

switchChanged

public void switchChanged(String name,
                          boolean value,
                          boolean valueChanged)
Description copied from interface: NetLogoListener
Called when the value of a switch changes. Usually if the switch changes it is because the user has changed it using the mouse, but the change may also be the result of code in the model or code typed into the command center.

Specified by:
switchChanged in interface NetLogoListener

chooserChanged

public void chooserChanged(String name,
                           Object value,
                           boolean valueChanged)
Description copied from interface: NetLogoListener
Called when the value of a chooser changes. Usually if the chooser changes it is because the user has changed it using the mouse, but the change may also be the result of code in the model or code typed into the command center.

Specified by:
chooserChanged in interface NetLogoListener

inputBoxChanged

public void inputBoxChanged(String name,
                            Object value,
                            boolean valueChanged)
Description copied from interface: NetLogoListener
Called when the value of an input box changes. Usually if the input box changes it is because the user has changed it using the mouse, but the change may also be the result of code in the model or code typed into the command center.

Specified by:
inputBoxChanged in interface NetLogoListener

commandEntered

public void commandEntered(String owner,
                           String text,
                           char agentType,
                           CompilerException error)
Description copied from interface: NetLogoListener
Called when the user enters text into the command center (and presses return). Note that at the time this method is called, the command may not have finished executing yet.

Specified by:
commandEntered in interface NetLogoListener
Parameters:
owner - name of the widget that owns the code
text - the text the user entered
agentType - O, T, or P depending whether the user was addressing the observer, turtles, or patches
error - message the user receives if there is a compiler error

logGlobal

public static void logGlobal(String name,
                             Object value,
                             boolean changed)

getIPAddress

public String getIPAddress()

deleteSessionFiles

public void deleteSessionFiles()

deleteSessionFiles

public static void deleteSessionFiles(String path)

zipSessionFiles

public void zipSessionFiles(String filename)

zipSessionFiles

public static void zipSessionFiles(String path,
                                   String filename)