internal use only
internal use only
Runs NetLogo commands and waits for them to complete.
Runs NetLogo commands and waits for them to complete.
This method must not be called from the AWT event queue thread or while that thread is blocked. It is an error to do so.
The command or commands to run
if the code fails to compile
IllegalStateExceptionif called from the AWT event queue thread
#commandLater
Runs NetLogo commands in the background.
Runs NetLogo commands in the background. Returns immediately, without waiting for the commands to finish.
This method may be called from any thread.
The command or commands to run
if the code fails to compile
#command
Recompiles the model.
Recompiles the model. Useful after calling setProcedures()
.
#setProcedures
to writer the contents of the export world feature
internal use only
internal use only
internal use only
internal use only
internal use only
internal use only
returns a graphical image of the current contents of the plot with the given name.
returns a graphical image of the current contents of the plot with the given name. This image can be saved to disk, displayed to the user later, etc.
the display name of the widget to reveal.
Returns the contents of the Code tab.
returns the current contents of the 2D view.
returns the current contents of the 2D view. This image can be saved to disk, displayed to the user later, etc.
internal use only
internal use only
hides a particular widget.
hides a particular widget. This method makes the specified widget invisible in the NetLogo
interface panel. It does not completely remove the widget, which can later be brought back with
showWidget()
. This method uses the "display name" to identify the widget. Display
names are not necessarily unique within a particular model. It is only safe to use this method
on widgets with unique display names. Otherwise the behavior is unspecified.
the display name of the widget to hide.
#hideWidget
The NetLogoListenerManager stored in this field can be used to add and remove NetLogoListeners, so the embedding environment can receive notifications of events happening within NetLogo.
The NetLogoListenerManager stored in this field can be used to add and remove NetLogoListeners, so the embedding environment can receive notifications of events happening within NetLogo. Relevant methods on NetLogoListenerManager are addListener(), removeListener(), and clearListeners(). The first two take a NetLogoListener as input.
Adds new widget to Interface tab given its specification, in the same format found in a saved model.
Adds new widget to Interface tab given its specification, in the same format found in a saved model.
the widget specification
Opens a model stored in a file.
Opens a model stored in a file.
the path (absolute or relative) of the NetLogo model to open.
Opens a model stored in a string.
Opens a model stored in a string.
Model name (will appear in the main window's title bar)
The complete model, including widgets and so forth, in the same format as it would be stored in a file.
Simulates a button press in the current model, exactly as if the user had pressed the button.
Simulates a button press in the current model, exactly as if the user had pressed the button. If the button is a "once" button, this method does not return until the button has popped back up. (For "forever" buttons, it returns immediately.)
Runs a NetLogo reporter.
Runs a NetLogo reporter.
This method must not be called from the AWT event queue thread or while that thread is blocked. It is an error to do so.
The reporter to run
the result reported; may be of type java.lang.Integer, java.lang.Double,
java.lang.Boolean, java.lang.String, org.nlogo.api.LogoList
,
org.nlogo.api.Agent
, AgentSet, or Nobody
if the code fails to compile
IllegalStateExceptionif called from the AWT event queue thread
evaluates a reporter and return the value to continuation object.
evaluates a reporter and return the value to continuation object.
This is a convenience method for evaluating reporters on the event
thread. Since it is an error to call report()
from the event
thread, this method creates a new thread to call report()
and
then passes the result to the given InvocationListener
.
This method may be called from any thread, including the AWT Event Thread.
AppletPanel passes the focus request to the InterfacePanel
AppletPanel passes the focus request to the InterfacePanel
internal use only
internal use only
sets the current working directory
Replaces the contents of the Code tab.
Replaces the contents of the Code tab. Does not recompile the model.
new contents
reveals a particular widget.
reveals a particular widget. This method makes the specified widget visible in the NetLogo
interface panel, if it has previously been hidden by a call to hideWidget()
. This
method uses the "display name" to identify the widget. Display names are not necessarily unique
within a particular model. It is only safe to use this method on widgets with unique display
names. Otherwise the behavior is unspecified.
the display name of the widget to reveal.
#hideWidget
Starts NetLogo logging using the given file and username
Starts NetLogo logging using the given file and username
a reader that contains an XML properties file as defined by the log4j dtd
user defined username, this should be a unique identifier
Starts NetLogo logging using the given file and username
Starts NetLogo logging using the given file and username
path to the XML properties file as defined by the log4j dtd
user defined username, this should be a unique identifier
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
This component is a wrapper around the contents of the interface panel that can be embedded in another application.
Once created, an InterfaceComponent can't be garbage collected, so you should open successive models in the same InterfaceComponent, rather than making new instances.
See the "Controlling" section of the NetLogo User Manual for example code.