public interface NetLogoListener
A host application should implement this interface in order to be notified of events occurring within NetLogo. Its methods are called by NetLogoListenerManager when these events occur. The events are typically user actions, but may also be triggered programmatically by the model.
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 |
chooserChanged(String name,
Object value,
boolean valueChanged)
Called when the value of a chooser changes. |
void |
commandEntered(String owner,
String text,
char agentType,
CompilerException errorMsg)
Called when the user enters text into the command center (and presses return). |
void |
inputBoxChanged(String name,
Object value,
boolean valueChanged)
Called when the value of an input box changes. |
void |
modelOpened(String name)
Called when a model is opened. |
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. |
Method Detail |
---|
void modelOpened(String name)
name
- name of the model that was openedvoid buttonPressed(String buttonName)
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.
void buttonStopped(String buttonName)
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.)
void sliderChanged(String name, double value, double min, double increment, double max, boolean valueChanged, boolean buttonReleased)
void switchChanged(String name, boolean value, boolean valueChanged)
void chooserChanged(String name, Object value, boolean valueChanged)
void inputBoxChanged(String name, Object value, boolean valueChanged)
void commandEntered(String owner, String text, char agentType, CompilerException errorMsg)
owner
- name of the widget that owns the codetext
- the text the user enteredagentType
- O, T, or P depending whether the user was
addressing the observer, turtles, or patcheserrorMsg
- message the user receives if there is a compiler error