org.nlogo.workspace
Class DummyAbstractWorkspace
java.lang.Object
org.nlogo.workspace.AbstractWorkspace
org.nlogo.workspace.DummyAbstractWorkspace
- All Implemented Interfaces:
- Evaluator, org.nlogo.api.CompilerServices, HubNetWorkspaceInterface, ImporterUser, RandomServices, WorldResizer, JobManagerOwner, Workspace
public class DummyAbstractWorkspace
- extends AbstractWorkspace
handy for use in unit tests
Method Summary |
void |
addJobFromJobThread(Job job)
|
org.nlogo.api.AggregateManagerInterface |
aggregateManager()
|
String |
attachPrefix(String filename)
|
void |
changeTopology(boolean wrapX,
boolean wrapY)
|
void |
clearDrawing()
|
void |
clearOutput()
|
void |
closeCurrentFile()
|
CompilerInterface |
compiler()
|
void |
deleteFile(String filename)
|
void |
deleteLogFiles()
|
boolean |
eof()
|
void |
exportDrawing(String filename,
String format)
|
void |
exportDrawingToCSV(PrintWriter writer)
|
void |
exportInterface(String filename)
|
void |
exportOutput(String filename)
|
void |
exportOutputAreaToCSV(PrintWriter writer)
|
BufferedImage |
exportView()
|
void |
exportView(String filename,
String format)
|
BufferedImage |
getAndCreateDrawing()
|
Shape |
getDefaultLinkShape()
|
Shape |
getDefaultShape()
|
float[] |
getHSB(int[] rgb)
|
String |
getPrefix()
|
boolean |
hasCurrentFile()
|
void |
importDrawing(File file)
|
void |
inspectAgent(Agent agent,
double radius)
|
void |
inspectAgent(Class<? extends Agent> agentClass,
Agent agent,
double radius)
|
boolean |
isHeadless()
|
void |
magicOpen(String name)
|
void |
open(String path)
|
void |
openIndex()
|
void |
openNext()
|
void |
openPrevious()
|
void |
openString(String modelContents)
|
void |
ownerFinished(JobOwner owner)
|
double |
patchSize()
|
void |
patchSize(double patchSize)
|
void |
perhapsUpdateDisplay()
|
void |
periodicUpdate()
|
void |
requestDisplayUpdate(boolean force)
|
void |
resizeView()
|
void |
runtimeError(JobOwner owner,
Context context,
Instruction instruction,
Exception ex)
|
void |
setDimensions(WorldDimensions d)
|
void |
setDimensions(WorldDimensions d,
double patchSize)
|
void |
setOutputAreaContents(String text)
|
void |
stamp(Turtle turtle,
boolean erase)
|
void |
startLogging(String properties)
|
void |
updateDisplay(boolean haveWorldLockAlready)
|
void |
waitFor(CommandRunnable runnable)
|
void |
waitForQueuedEvents()
|
|
waitForResult(ReporterRunnable<T> runnable)
|
void |
writeGraphicsData(PrintWriter writer)
|
void |
zipLogFiles(String filename)
|
Methods inherited from class org.nlogo.workspace.AbstractWorkspace |
attachModelDir, autoConvert, auxRNG, behaviorSpaceRunNumber, behaviorSpaceRunNumber, checkCommandSyntax, checkReporterSyntax, clearAll, clearLastLogoException, compileCommands, compileCommands, compileForRun, compileReporter, computerHubNetRunning, computerHubNetRunning, convertToNormal, currentPlot, dispose, evaluateCommands, evaluateCommands, evaluateCommands, evaluateReporter, evaluateReporter, exportAllPlots, exportBehaviors, exportPlot, exportWorld, exportWorld, fileManager, findProcedurePositions, forceSaveAs, getExtensionManager, getHubNetManager, getIsApplet, getModelDir, getModelFileName, getModelPath, getModelType, getPlot, getProcedures, getPropertiesInterface, getSource, getTokenAtPosition, guessExportName, halt, hubnetManager, importDrawing, importExtensionData, importWorld, init, isApp, isApp, isApplet, isApplet, isCompilerTestingMode, isConstant, isExtensionName, isValidIdentifier, joinForeverButtons, lastLogoException, lastRunTimes, loadWorld, mainRNG, makeThunk, modelNameForDisplay, outputObject, plotManager, readFromString, readNumberFromString, runCompiledCommands, runCompiledReporter, runCompiledReporter, setModelPath, setProcedures, tokenizeForColorization, updateMode, updateMode, warningMessage, world |
DummyAbstractWorkspace
public DummyAbstractWorkspace()
isHeadless
public boolean isHeadless()
- Specified by:
isHeadless
in interface Workspace
- Specified by:
isHeadless
in class AbstractWorkspace
aggregateManager
public org.nlogo.api.AggregateManagerInterface aggregateManager()
getDefaultShape
public Shape getDefaultShape()
getDefaultLinkShape
public Shape getDefaultLinkShape()
waitFor
public void waitFor(CommandRunnable runnable)
waitForResult
public <T> T waitForResult(ReporterRunnable<T> runnable)
waitForQueuedEvents
public void waitForQueuedEvents()
inspectAgent
public void inspectAgent(Agent agent,
double radius)
inspectAgent
public void inspectAgent(Class<? extends Agent> agentClass,
Agent agent,
double radius)
stamp
public void stamp(Turtle turtle,
boolean erase)
clearDrawing
public void clearDrawing()
- Specified by:
clearDrawing
in interface Workspace
- Specified by:
clearDrawing
in class AbstractWorkspace
getAndCreateDrawing
public BufferedImage getAndCreateDrawing()
open
public void open(String path)
- Specified by:
open
in interface Workspace
- Specified by:
open
in class AbstractWorkspace
openString
public void openString(String modelContents)
- Specified by:
openString
in interface Workspace
- Specified by:
openString
in class AbstractWorkspace
magicOpen
public void magicOpen(String name)
- Specified by:
magicOpen
in interface Workspace
- Specified by:
magicOpen
in class AbstractWorkspace
openIndex
public void openIndex()
openNext
public void openNext()
openPrevious
public void openPrevious()
clearOutput
public void clearOutput()
importDrawing
public void importDrawing(File file)
exportOutput
public void exportOutput(String filename)
exportDrawing
public void exportDrawing(String filename,
String format)
exportDrawingToCSV
public void exportDrawingToCSV(PrintWriter writer)
- Specified by:
exportDrawingToCSV
in class AbstractWorkspace
exportOutputAreaToCSV
public void exportOutputAreaToCSV(PrintWriter writer)
- Specified by:
exportOutputAreaToCSV
in class AbstractWorkspace
exportView
public void exportView(String filename,
String format)
exportView
public BufferedImage exportView()
exportInterface
public void exportInterface(String filename)
writeGraphicsData
public void writeGraphicsData(PrintWriter writer)
- Specified by:
writeGraphicsData
in class AbstractWorkspace
patchSize
public void patchSize(double patchSize)
patchSize
public double patchSize()
changeTopology
public void changeTopology(boolean wrapX,
boolean wrapY)
setOutputAreaContents
public void setOutputAreaContents(String text)
- Specified by:
setOutputAreaContents
in interface ImporterUser
- Overrides:
setOutputAreaContents
in class AbstractWorkspace
setDimensions
public void setDimensions(WorldDimensions d)
setDimensions
public void setDimensions(WorldDimensions d,
double patchSize)
resizeView
public void resizeView()
runtimeError
public void runtimeError(JobOwner owner,
Context context,
Instruction instruction,
Exception ex)
ownerFinished
public void ownerFinished(JobOwner owner)
updateDisplay
public void updateDisplay(boolean haveWorldLockAlready)
requestDisplayUpdate
public void requestDisplayUpdate(boolean force)
- Specified by:
requestDisplayUpdate
in interface Workspace
- Specified by:
requestDisplayUpdate
in class AbstractWorkspace
perhapsUpdateDisplay
public void perhapsUpdateDisplay()
- Specified by:
perhapsUpdateDisplay
in interface Workspace
- Specified by:
perhapsUpdateDisplay
in class AbstractWorkspace
periodicUpdate
public void periodicUpdate()
addJobFromJobThread
public void addJobFromJobThread(Job job)
- Specified by:
addJobFromJobThread
in interface Workspace
- Overrides:
addJobFromJobThread
in class AbstractWorkspace
getPrefix
public String getPrefix()
attachPrefix
public String attachPrefix(String filename)
eof
public boolean eof()
hasCurrentFile
public boolean hasCurrentFile()
closeCurrentFile
public void closeCurrentFile()
deleteFile
public void deleteFile(String filename)
startLogging
public void startLogging(String properties)
zipLogFiles
public void zipLogFiles(String filename)
deleteLogFiles
public void deleteLogFiles()
getHSB
public float[] getHSB(int[] rgb)
compiler
public CompilerInterface compiler()
- Specified by:
compiler
in interface Workspace
- Specified by:
compiler
in class AbstractWorkspace