edu.turtlekit2.tools.viewer2D
Class Viewer2D

java.lang.Object
  extended by madkit.kernel.AbstractAgent
      extended by madkit.kernel.Watcher
          extended by edu.turtlekit2.kernel.agents.Observer
              extended by edu.turtlekit2.kernel.agents.Viewer
                  extended by edu.turtlekit2.tools.viewer2D.Viewer2D
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, Serializable, EventListener, MouseInputListener, madkit.kernel.ReferenceableAgent

public class Viewer2D
extends Viewer

Titre : Viewer2D

Description : Viewer2D is a Viewer agent. It displays flavors/pheromones according to RGB canals and permits flavors observations and modifications in the environment in real time.

Use : To display a flavor on a RGB canal, click on the color then on the flavor name (mixing canals is allowed). To drop a flavor, click on drop then on the flavor name, then click within the environment. To modify the displaying scale, click on a color then roll mouse wheel over the environment. To display a flavor/pheromone quantity, do as drop and move the mouse cursor over the environment.

XML Attributes : None

Version:
0.9 - 4/2007
Author:
G. Beurier
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.turtlekit2.kernel.agents.Viewer
Viewer.GridCanvas
 
Field Summary
 
Fields inherited from class edu.turtlekit2.kernel.agents.Viewer
allTurtles, cellSize, clickedPoint, onScreen, redrawAll, xDecay, yDecay
 
Fields inherited from class edu.turtlekit2.kernel.agents.Observer
attrib, envHeight, envWidth, flavors, gridValues, patchGrid, probe1, probe2, simulationGroup
 
Constructor Summary
Viewer2D()
           
 
Method Summary
 void init()
          No usage
 void initGUI()
          MadKit usage, no redefinition
 void paintPatch(Graphics g, Patch p, int x, int y, int CellSize)
          The Paintpatch method has been overriden in order to achieve specific representation of flavors.
 void paintTurtle(Graphics g, Turtle t, int x, int y, int cellS)
          Standard graphical representation of turtle.
 void setDropedPheromones(String selectedValue)
           
 void setTurtlesViewable(boolean b)
           
 void setViewable(String phero2, boolean b)
           
 void updatePheromoneColor(String phero2, Color newColor)
           
 void updatePheromoneIntensity(String phero2, Float value)
           
 
Methods inherited from class edu.turtlekit2.kernel.agents.Viewer
display, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, paintInfo, readyToDisplay, setup
 
Methods inherited from class edu.turtlekit2.kernel.agents.Observer
activate, flavorsContains, getAllValues, getAttrib, getBooleanParam, getBooleanParam, getColorParam, getColorParam, getDoubleParam, getDoubleParam, getFlavor, getFlavorName, getFlavors, getFloatParam, getFloatParam, getIntParam, getIntParam, getParam, getParam, getSimulationGroup, getStringParam, getStringParam, setAttrib, setFlavors, watch
 
Methods inherited from class madkit.kernel.Watcher
addProbe, addProbe, end, getProbes, removeAllProbes, removeProbe, update
 
Methods inherited from class madkit.kernel.AbstractAgent
broadcastMessage, broadcastMessage, connectedWithCommunity, createGroup, createGroup, debug, disposeMyGUI, foundGroup, getAddress, getAgentInformation, getAgentsWithRole, getAgentsWithRole, getAgentWithRole, getAgentWithRole, getAvailableCommunities, getBean, getController, getCurrentKernelAddress, getDebug, getExistingGroups, getExistingGroups, getExistingRoles, getExistingRoles, getGroups, getGUIObject, getMessageBoxSize, getMyGroups, getMyGroups, getMyRoles, getMyRoles, getName, getRoles, hasGUI, hashCode, isBelongingToGroup, isBelongingToGroup, isCommunity, isGroup, isGroup, isMemberOf, isMemberOf, isMessageBoxEmpty, isRole, isRole, joinGroup, killAgent, launchAgent, launchAgent, leaveGroup, leaveGroup, leaveRole, leaveRole, nextMessage, print, println, receiveMessage, redisplayMyGUI, requestRole, requestRole, requestRole, restoreAgent, sendMessage, sendMessage, sendMessage, setBean, setController, setDebug, setGUIObject, setName, setOutput, setOutputWriter, toString, windowClosing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Viewer2D

public Viewer2D()
Method Detail

init

public void init()
No usage


initGUI

public void initGUI()
MadKit usage, no redefinition

Overrides:
initGUI in class Viewer

paintTurtle

public void paintTurtle(Graphics g,
                        Turtle t,
                        int x,
                        int y,
                        int cellS)
Standard graphical representation of turtle. Can be disabled/enabled in real time. You can override this method in order to give a special graphic representation of your turtles.

Overrides:
paintTurtle in class Viewer

paintPatch

public void paintPatch(Graphics g,
                       Patch p,
                       int x,
                       int y,
                       int CellSize)
The Paintpatch method has been overriden in order to achieve specific representation of flavors. Each flavor can be represented as a function of the Red/Blue/Green/Black canals.

Overrides:
paintPatch in class Viewer

updatePheromoneColor

public void updatePheromoneColor(String phero2,
                                 Color newColor)

updatePheromoneIntensity

public void updatePheromoneIntensity(String phero2,
                                     Float value)

setViewable

public void setViewable(String phero2,
                        boolean b)

setTurtlesViewable

public void setTurtlesViewable(boolean b)

setDropedPheromones

public void setDropedPheromones(String selectedValue)