java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.nlogo.lite.AppletPanel
public abstract class AppletPanel
The superclass of org.nlogo.lite.InterfaceComponent. Also used by org.nlogo.lite.Applet.
See the "Controlling" section of the NetLogo User Manual for example code.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.BaselineResizeBehavior |
Field Summary | |
---|---|
org.nlogo.api.AggregateManagerInterface |
aggregateManager
|
org.nlogo.window.InterfacePanelLite |
iP
|
List<Object> |
linkComponents
|
org.nlogo.window.NetLogoListenerManager |
listenerManager
The NetLogoListenerManager stored in this field can be used to add and remove org.nlogo.api.NetLogoListeners, so the embedding environment can receive notifications of events happening within NetLogo. |
org.nlogo.window.AppletAdPanel |
panel
|
org.nlogo.window.ProceduresLite |
procedures
|
org.nlogo.window.GUIWorkspace |
workspace
|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AppletPanel(Frame frame,
MouseListener iconListener,
boolean isApplet)
|
Method Summary | |
---|---|
void |
addLinkComponent(Object c)
internal use only |
void |
command(String source)
Runs NetLogo commands and waits for them to complete. |
void |
commandLater(String source)
Runs NetLogo commands in the background. |
abstract URL |
getFileURL(String filename)
internal use only |
Object[] |
getLinkChildren()
internal use only |
String |
getProcedures()
Returns the contents of the Procedures tab. |
void |
handle(Throwable throwable)
internal use only |
static void |
main(String[] args)
|
void |
openFromSource(String name,
String path,
String source)
Opens a model stored in a string. |
Object |
report(String source)
Runs a NetLogo reporter. |
void |
requestFocus()
AppletPanel passes the focus request to the InterfacePanel |
void |
setAdVisible(boolean visible)
internal use only |
void |
setPrefix(URL url)
sets the current working directory |
void |
setProcedures(String source)
Replaces the contents of the Procedures tab. |
static URL |
toURL(File file)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final org.nlogo.window.InterfacePanelLite iP
public final org.nlogo.window.GUIWorkspace workspace
public final org.nlogo.window.ProceduresLite procedures
public final org.nlogo.window.AppletAdPanel panel
public final org.nlogo.api.AggregateManagerInterface aggregateManager
public final org.nlogo.window.NetLogoListenerManager listenerManager
public final List<Object> linkComponents
Constructor Detail |
---|
public AppletPanel(Frame frame, MouseListener iconListener, boolean isApplet)
Method Detail |
---|
public abstract URL getFileURL(String filename) throws MalformedURLException
MalformedURLException
public void requestFocus()
requestFocus
in class JComponent
public void setAdVisible(boolean visible)
public void setPrefix(URL url)
url
- the directory as java.net.URLpublic void handle(Throwable throwable)
handle
in interface org.nlogo.util.Exceptions.Handler
public void addLinkComponent(Object c)
public Object[] getLinkChildren()
getLinkChildren
in interface org.nlogo.window.Event.LinkParent
public void command(String source) throws CompilerException
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.
source
- The command or commands to run
CompilerException
- if the code fails to compile
IllegalStateException
- if called from the AWT event queue threadcommandLater(java.lang.String)
public void commandLater(String source) throws CompilerException
This method may be called from any thread.
source
- The command or commands to run
CompilerException
- if the code fails to compilecommand(java.lang.String)
public Object report(String source) throws CompilerException
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.
source
- The reporter to run
LogoList
,
Agent
, AgentSet, or Nobody
CompilerException
- if the code fails to compile
IllegalStateException
- if called from the AWT event queue threadpublic String getProcedures()
public void setProcedures(String source)
source
- new contentspublic void openFromSource(String name, String path, String source) throws org.nlogo.window.InvalidVersionException
name
- Model name (will appear in the main window's title bar)source
- The complete model, including widgets and so forth,
in the same format as it would be stored in a file.
org.nlogo.window.InvalidVersionException
public static void main(String[] args)
public static URL toURL(File file) throws MalformedURLException
MalformedURLException