java.lang.Objectorg.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 Workspacepublic FileManager fileManager()
fileManager in interface Workspacepublic org.nlogo.plot.PlotManager plotManager()
plotManager in interface Workspacepublic org.nlogo.compiler.ExtensionManager getExtensionManager()
getExtensionManager in interface Workspacepublic void initForTesting(WorldDimensions d)
public boolean isCompilerTestingMode()
public void dispose()
throws InterruptedException
InterruptedExceptionpublic 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 Workspacepublic HubNetInterface getHubNetManager()
getHubNetManager in interface Workspacepublic HubNetInterface hubnetManager()
public boolean computerHubNetRunning()
public void computerHubNetRunning(boolean computerHubNetRunning)
public String attachModelDir(String filePath)
throws MalformedURLException
attachModelDir in interface WorkspaceMalformedURLException
public void convertToNormal()
throws IOException
convertToNormal in interface WorkspaceIOExceptionpublic String getModelPath()
getModelPath in interface Workspacepublic String getModelFileName()
getModelFileName in interface Workspacepublic String getModelDir()
getModelDir in interface Workspacepublic int getModelType()
public boolean forceSaveAs()
public String modelNameForDisplay()
public void init(Program program)
public void clearAll()
throws LogoException
clearAll in interface WorkspaceLogoExceptionpublic void resetTimer()
resetTimer in interface Workspacepublic void joinForeverButtons(Agent agent)
joinForeverButtons in interface Workspacepublic void addJobFromJobThread(Job job)
addJobFromJobThread in interface Workspacepublic abstract void magicOpen(String name)
magicOpen in interface Workspace
public Procedure compileForRun(String source,
Context context,
boolean reporter)
throws CompilerException
compileForRun in interface WorkspaceCompilerException
public abstract void open(String path)
throws IOException,
CompilerException,
LogoException
IOException
CompilerException
LogoExceptionpublic void halt()
public abstract void requestDisplayUpdate(boolean force)
requestDisplayUpdate in interface Workspacepublic 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 WorkspaceLogoExceptionpublic void setOutputAreaContents(String text)
setOutputAreaContents in interface ImporterUserpublic abstract void clearDrawing()
clearDrawing in interface Workspace
public void exportPlot(org.nlogo.plot.Plot plot,
String filename)
throws IOException
exportPlot in interface WorkspaceIOException
public void exportAllPlots(String filename)
throws IOException
exportAllPlots in interface WorkspaceIOException
public void exportWorld(String filename)
throws IOException
exportWorld in interface WorkspaceIOExceptionpublic 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 WorkspaceIOException
public void importDrawing(String filename)
throws IOException
importDrawing in interface WorkspaceIOExceptionpublic void currentPlot(String plot)
currentPlot in interface ImporterUserpublic PlotInterface getPlot(String plot)
getPlot in interface ImporterUserpublic 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 EvaluatorCompilerException
public void evaluateCommands(String source)
throws CompilerException
evaluateCommands in interface WorkspaceCompilerException
public void evaluateCommands(String source,
Agent agent,
boolean waitForCompletion)
throws CompilerException
evaluateCommands in interface WorkspaceCompilerException
public void evaluateCommands(String source,
Class agentClass,
boolean waitForCompletion)
throws CompilerException
evaluateCommands in interface WorkspaceCompilerException
public Object evaluateReporter(String source)
throws CompilerException
CompilerException
public Object evaluateReporter(String source,
Agent agent)
throws CompilerException
evaluateReporter in interface WorkspaceCompilerException
public Procedure compileCommands(String source)
throws CompilerException
compileCommands in interface WorkspaceCompilerException
public Procedure compileReporter(String source)
throws CompilerException
compileReporter in interface WorkspaceCompilerExceptionpublic boolean runCompiledCommands(Procedure procedure)
runCompiledCommands in interface Workspacepublic Object runCompiledReporter(Procedure procedure)
runCompiledReporter in interface Workspacepublic abstract boolean shapesOn()
public abstract void shapesOn(boolean shapesOn)
public void updateChecksum()
throws LogoException,
CompilerException,
IOException
updateChecksum in interface WorkspaceLogoException
CompilerException
IOExceptionpublic boolean isConstant(String string)
isConstant in interface Evaluatorpublic Object readFromString(String string)
readFromString in interface Evaluator
public String getExternalFileSource(String filename)
throws IOException
IOException