fr.lifl.jedi.gui.display.colorGrid
Class ColorGridModel

java.lang.Object
  extended by fr.lifl.jedi.gui.display.colorGrid.ColorGridModel

public class ColorGridModel
extends java.lang.Object

The model used by the GUI that displays the environment of the simulation as an image, where each agent is represented by a shape or an icon.

This model defines :

Version:
JEDI V 2.2
Created the 4th nov. 2008
Modified the 5th may 2009
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France

Constructor Summary
ColorGridModel(int scaleFactor)
          Default constructor of the simulation GUI's model.
 
Method Summary
 AgentDisplayer getHowToDisplay(java.lang.Class<? extends Agent> a)
          Gets how an agent from a particular agent class is displayed in the GUI.
 int getScaleFactor()
          Gets the scaling factor of the model.
 void setHowToDisplay(java.lang.Class<? extends Agent> a, AgentDisplayer das)
          Defines how an agent from a particular agent class is displayed in the GUI.
 void setScaleFactor(int factor)
          Sets the scaling factor of the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorGridModel

public ColorGridModel(int scaleFactor)
Default constructor of the simulation GUI's model.

Method Detail

getScaleFactor

public int getScaleFactor()
Gets the scaling factor of the model.

This value defines the number of pixels corresponding to a unit in the environment of the simulation.

Returns:
the scaling factor of the model.

setScaleFactor

public void setScaleFactor(int factor)
Sets the scaling factor of the model.

This value defines the number of pixels corresponding to a unit in the environment of the simulation.

Parameters:
factor - the new scaling factor of the model.

setHowToDisplay

public void setHowToDisplay(java.lang.Class<? extends Agent> a,
                            AgentDisplayer das)
Defines how an agent from a particular agent class is displayed in the GUI.

Parameters:
a - The class of the displayed agent. It has to be the class the agent was instanciated with.
das - The instance that describes how agents of this class are displayed.
See Also:
AgentDisplayer

getHowToDisplay

public AgentDisplayer getHowToDisplay(java.lang.Class<? extends Agent> a)
Gets how an agent from a particular agent class is displayed in the GUI.

Parameters:
a - The class of the displayed agent
Returns:
The instance that describes how agents of this class are displayed.
See Also:
AgentDisplayer