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 GraphicsContextGets the graphics context to draw on the canvas.getGUI()Redefines to benefit from automatic casting.booleanReturns the paint over mode.protected voidOn activation.voidrender()Redefines so that the paint over mode is taken into account.voidsetPaintOver(boolean paintOver) Sets the paint over mode.Methods inherited from class madkit.simulation.Viewer
display, onEnd, onSimulationStart, setGUIMethods inherited from class madkit.kernel.Watcher
addProbe, getProbes, removeAllProbes, removeProbe, toStringMethods inherited from class madkit.simulation.SimuAgent
createSimuGroup, getCommunity, getEngineGroup, getEnvironment, getLauncher, getModel, getModelGroup, getNextEventDate, getScheduler, getSimuTimer, getViewers, launchAgent, leaveRole, leaveSimuGroup, leaveSimuRole, playRole, prng, requestSimuRoleMethods 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:
trueif the paint over mode is enabled
-