java.lang.Object org.nlogo.workspace.AbstractWorkspace
public abstract class AbstractWorkspace
Nested Class Summary | |
---|---|
static interface |
AbstractWorkspace.HubNetManagerFactory
|
Field Summary | |
---|---|
AggregateManagerInterface |
aggregateManager
|
static String |
DEFAULT_PREVIEW_COMMANDS
previewCommands used by make-preview and model test |
JobManager |
jobManager
|
String |
previewCommands
|
static int |
TYPE_CONVERTED
type for models auto-converted from StarLogoT. |
static int |
TYPE_LIBRARY
type for "library" models (i.e., loaded from the Models Library). |
static int |
TYPE_NEW
type for new models. |
static int |
TYPE_NORMAL
type for "normal" models (i.e., loaded from File/Open). |
World |
world
|
WorldLoader |
worldLoader
|
Fields inherited from interface org.nlogo.nvm.Workspace |
---|
CONTINUOUS_UPDATES, OUTPUT_NORMAL, OUTPUT_TO_FILE, OUTPUT_TO_OUTPUT_AREA, TICK_BASED_UPDATES |
Method Summary | |
---|---|
void |
addJobFromJobThread(Job job)
|
String |
attachModelDir(String filePath)
attaches the current model directory to a relative path, if necessary. |
void |
clearAll()
|
abstract void |
clearDrawing()
|
Procedure |
compileCommands(String source)
|
Procedure |
compileForRun(String source,
Context context,
boolean reporter)
|
Procedure |
compileReporter(String source)
|
boolean |
computerHubNetRunning()
|
void |
computerHubNetRunning(boolean computerHubNetRunning)
|
void |
convertToNormal()
instantly converts the current model to TYPE_NORMAL. |
void |
currentPlot(String plot)
|
void |
dispose()
Shuts down the background thread associated with this workspace, allowing resources to be freed. |
void |
evaluateCommands(String source)
|
void |
evaluateCommands(String source,
Agent agent,
boolean waitForCompletion)
|
void |
evaluateCommands(String source,
Class agentClass,
boolean waitForCompletion)
|
Object |
evaluateReporter(String source)
|
Object |
evaluateReporter(String source,
Agent agent)
|
void |
exportAllPlots(String filename)
|
org.nlogo.util.File |
exportBehaviors(String filename,
String experimentName,
boolean includeHeader)
|
abstract void |
exportDrawingToCSV(PrintWriter writer)
|
abstract void |
exportOutputAreaToCSV(PrintWriter writer)
|
void |
exportPlot(org.nlogo.plot.Plot plot,
String filename)
|
void |
exportWorld(PrintWriter writer)
|
void |
exportWorld(String filename)
|
FileManager |
fileManager()
|
boolean |
forceSaveAs()
whether the user needs to enter a new filename to save this model. |
Shape |
getDefaultLinkShape()
|
Shape |
getDefaultShape()
|
org.nlogo.compiler.ExtensionManager |
getExtensionManager()
|
String |
getExternalFileSource(String filename)
|
HubNetInterface |
getHubNetManager()
|
boolean |
getIsApplet()
|
String |
getModelDir()
returns the full path to the directory from which the current model was loaded. |
String |
getModelFileName()
returns the name of the file from which the current model was loaded. |
String |
getModelPath()
returns the full pathname of the currently loaded model, if any. |
int |
getModelType()
|
PlotInterface |
getPlot(String plot)
|
String |
guessExportName(String defaultName)
|
void |
halt()
|
HubNetInterface |
hubnetManager()
|
void |
importDrawing(String filename)
|
void |
importWorld(String filename)
|
void |
init(Program program)
|
void |
initForTesting(WorldDimensions d)
Internal use only. |
static boolean |
isApp()
|
static void |
isApp(boolean isApp)
|
static boolean |
isApplet()
|
static void |
isApplet(boolean isApplet)
|
boolean |
isCompilerTestingMode()
Internal use only. |
boolean |
isConstant(String string)
|
abstract boolean |
isHeadless()
|
void |
joinForeverButtons(Agent agent)
|
abstract void |
magicOpen(String name)
|
Thunk |
makeThunk(String source,
Agent agent,
Object owner)
|
String |
modelNameForDisplay()
|
abstract void |
open(String path)
|
void |
outputObject(Object object,
Object owner,
boolean addNewline,
boolean readable,
int destination)
|
abstract void |
perhapsUpdateDisplay()
|
org.nlogo.plot.PlotManager |
plotManager()
|
Object |
readFromString(String string)
|
abstract void |
requestDisplayUpdate(boolean force)
|
void |
resetTimer()
|
boolean |
runCompiledCommands(Procedure procedure)
|
Object |
runCompiledReporter(Procedure procedure)
|
void |
setOutputAreaContents(String text)
|
abstract boolean |
shapesOn()
|
abstract void |
shapesOn(boolean shapesOn)
|
void |
updateChecksum()
|
boolean |
warningMessage(String message)
Displays a warning to the user, and determine whether to continue. |
World |
world()
|
abstract void |
writeGraphicsData(PrintWriter writer)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.nlogo.nvm.Workspace |
---|
changeTopology, clearOutput, deleteLogFiles, exportDrawing, exportGraphics, exportInterface, exportOutput, getAndCreateDrawing, getAutoConverterErrorHandler, getHSB, initModelForChecksumming, inspectAgent, makePreviews, openIndex, openNext, openPrevious, patchSize, startLogging, waitFor, waitForQueuedEvents, waitForResult, zipLogFiles |
Methods inherited from interface org.nlogo.agent.WorldResizer |
---|
patchSize, resizeWorld, setDimensions |
Methods inherited from interface org.nlogo.nvm.JobManagerOwner |
---|
ownerFinished, periodicUpdate, runtimeError, updateDisplay |
Field Detail |
---|
public final World world
public final JobManager jobManager
public AggregateManagerInterface aggregateManager
public static final int TYPE_NEW
public static final int TYPE_NORMAL
public static final int TYPE_LIBRARY
public static final int TYPE_CONVERTED
public static final String DEFAULT_PREVIEW_COMMANDS
public String previewCommands
public final WorldLoader worldLoader
Method Detail |
---|
public World world()
world
in interface Workspace
public FileManager fileManager()
fileManager
in interface Workspace
public org.nlogo.plot.PlotManager plotManager()
plotManager
in interface Workspace
public org.nlogo.compiler.ExtensionManager getExtensionManager()
getExtensionManager
in interface Workspace
public void initForTesting(WorldDimensions d)
public boolean isCompilerTestingMode()
public void dispose() throws InterruptedException
InterruptedException
public Shape getDefaultShape()
public Shape getDefaultLinkShape()
public abstract boolean isHeadless()
public boolean warningMessage(String message)
public static boolean isApp()
public static void isApp(boolean isApp)
public static boolean isApplet()
public static void isApplet(boolean isApplet)
public boolean getIsApplet()
getIsApplet
in interface Workspace
public HubNetInterface getHubNetManager()
getHubNetManager
in interface Workspace
public HubNetInterface hubnetManager()
public boolean computerHubNetRunning()
public void computerHubNetRunning(boolean computerHubNetRunning)
public String attachModelDir(String filePath) throws MalformedURLException
attachModelDir
in interface Workspace
MalformedURLException
public void convertToNormal() throws IOException
convertToNormal
in interface Workspace
IOException
public String getModelPath()
getModelPath
in interface Workspace
public String getModelFileName()
getModelFileName
in interface Workspace
public String getModelDir()
getModelDir
in interface Workspace
public int getModelType()
public boolean forceSaveAs()
public String modelNameForDisplay()
public void init(Program program)
public void clearAll() throws LogoException
clearAll
in interface Workspace
LogoException
public void resetTimer()
resetTimer
in interface Workspace
public void joinForeverButtons(Agent agent)
joinForeverButtons
in interface Workspace
public void addJobFromJobThread(Job job)
addJobFromJobThread
in interface Workspace
public abstract void magicOpen(String name)
magicOpen
in interface Workspace
public Procedure compileForRun(String source, Context context, boolean reporter) throws CompilerException
compileForRun
in interface Workspace
CompilerException
public abstract void open(String path) throws IOException, CompilerException, LogoException
IOException
CompilerException
LogoException
public void halt()
public abstract void requestDisplayUpdate(boolean force)
requestDisplayUpdate
in interface Workspace
public abstract void perhapsUpdateDisplay()
perhapsUpdateDisplay
in interface Workspace
public void outputObject(Object object, Object owner, boolean addNewline, boolean readable, int destination) throws LogoException
outputObject
in interface Workspace
LogoException
public void setOutputAreaContents(String text)
setOutputAreaContents
in interface ImporterUser
public abstract void clearDrawing()
clearDrawing
in interface Workspace
public void exportPlot(org.nlogo.plot.Plot plot, String filename) throws IOException
exportPlot
in interface Workspace
IOException
public void exportAllPlots(String filename) throws IOException
exportAllPlots
in interface Workspace
IOException
public void exportWorld(String filename) throws IOException
exportWorld
in interface Workspace
IOException
public void exportWorld(PrintWriter writer)
public abstract void exportDrawingToCSV(PrintWriter writer)
public abstract void exportOutputAreaToCSV(PrintWriter writer)
public abstract void writeGraphicsData(PrintWriter writer)
public void importWorld(String filename) throws IOException
importWorld
in interface Workspace
IOException
public void importDrawing(String filename) throws IOException
importDrawing
in interface Workspace
IOException
public void currentPlot(String plot)
currentPlot
in interface ImporterUser
public PlotInterface getPlot(String plot)
getPlot
in interface ImporterUser
public String guessExportName(String defaultName)
public org.nlogo.util.File exportBehaviors(String filename, String experimentName, boolean includeHeader) throws IOException
IOException
public Thunk makeThunk(String source, Agent agent, Object owner) throws CompilerException
makeThunk
in interface Evaluator
CompilerException
public void evaluateCommands(String source) throws CompilerException
evaluateCommands
in interface Workspace
CompilerException
public void evaluateCommands(String source, Agent agent, boolean waitForCompletion) throws CompilerException
evaluateCommands
in interface Workspace
CompilerException
public void evaluateCommands(String source, Class agentClass, boolean waitForCompletion) throws CompilerException
evaluateCommands
in interface Workspace
CompilerException
public Object evaluateReporter(String source) throws CompilerException
CompilerException
public Object evaluateReporter(String source, Agent agent) throws CompilerException
evaluateReporter
in interface Workspace
CompilerException
public Procedure compileCommands(String source) throws CompilerException
compileCommands
in interface Workspace
CompilerException
public Procedure compileReporter(String source) throws CompilerException
compileReporter
in interface Workspace
CompilerException
public boolean runCompiledCommands(Procedure procedure)
runCompiledCommands
in interface Workspace
public Object runCompiledReporter(Procedure procedure)
runCompiledReporter
in interface Workspace
public abstract boolean shapesOn()
public abstract void shapesOn(boolean shapesOn)
public void updateChecksum() throws LogoException, CompilerException, IOException
updateChecksum
in interface Workspace
LogoException
CompilerException
IOException
public boolean isConstant(String string)
isConstant
in interface Evaluator
public Object readFromString(String string)
readFromString
in interface Evaluator
public String getExternalFileSource(String filename) throws IOException
IOException