Class Viewer2D
java.lang.Object
madkit.kernel.Agent
madkit.simulation.SimuAgent
madkit.kernel.Watcher
madkit.simulation.Viewer
madkit.simulation.viewer.Viewer2D
A viewer that displays a 2D environment. It uses a
CanvasDrawerGUI
to draw the
environment on a canvas.-
Nested Class Summary
Nested classes/interfaces inherited from class madkit.kernel.Agent
Agent.ReturnCode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected GraphicsContext
Gets the graphics context to draw on the canvas.getGUI()
Redefines to benefit from automatic casting.boolean
Returns the paint over mode.protected void
On activation.void
render()
Redefines so that the paint over mode is taken into account.void
setPaintOver
(boolean paintOver) Sets the paint over mode.Methods inherited from class madkit.simulation.Viewer
display, onEnd, onSimulationStart, setGUI
Methods inherited from class madkit.kernel.Watcher
addProbe, getProbes, removeAllProbes, removeProbe, toString
Methods inherited from class madkit.simulation.SimuAgent
createSimuGroup, getCommunity, getEngineGroup, getEnvironment, getLauncher, getModel, getModelGroup, getNextEventDate, getScheduler, getSimuTimer, getViewers, launchAgent, leaveRole, leaveSimuGroup, leaveSimuRole, playRole, prng, requestSimuRole
Methods inherited from class madkit.kernel.Agent
activate, broadcast, broadcastWithRole, broadcastWithRoleWaitForReplies, checkAgentAddress, createGroup, createGroup, createGroup, end, equals, executeThisAgent, executeThisAgent, exitOnKill, getAgentsWithRole, getAgentWithRole, getKernelAddress, getKernelConfig, getLogger, getMailbox, getName, getNetworkID, getOrganization, getReplyTo, handleRequestActionMessage, hashCode, isAlive, killAgent, killAgent, launchAgent, launchAgent, leaveGroup, leaveRole, live, nextMessage, onLive, pause, receiveMessage, reload, reply, replyWithRole, requestRole, requestRole, send, send, sendWaitReply, sendWaitReply, sendWithRole, sendWithRole, sendWithRoleWaitReply, sendWithRoleWaitReply, setupDefaultGUI, waitAnswer, waitAnswer, waitNextMessage, waitNextMessage
-
Constructor Details
-
Viewer2D
public Viewer2D()
-
-
Method Details
-
onActivation
-
getGraphics
Gets the graphics context to draw on the canvas.- Returns:
- the graphics context to draw on the canvas.
-
render
-
getGUI
Redefines to benefit from automatic casting. -
setPaintOver
public void setPaintOver(boolean paintOver) Sets the paint over mode. When paint over mode is enabled, the canvas is not cleared before rendering.- Parameters:
paintOver
- the paintOver to set
-
isPaintOver
public boolean isPaintOver()Returns the paint over mode.- Returns:
true
if the paint over mode is enabled
-