fr.lifl.jedi.gui.display.colorGrid.view.agentDisplay
Class StaticColorTriangleDisplayer

java.lang.Object
  extended by fr.lifl.jedi.gui.display.colorGrid.view.agentDisplay.ColorTriangleDisplayer
      extended by fr.lifl.jedi.gui.display.colorGrid.view.agentDisplay.StaticColorTriangleDisplayer
All Implemented Interfaces:
AgentDisplayer

public class StaticColorTriangleDisplayer
extends ColorTriangleDisplayer

This class defines a tool used to display agents in the environment.

It displays agents as a triangle filled with a color. The size of the triangle is independent from the width and height of the agent. Nevertheless, it scales with the scaling factor of the simulation.

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
See Also:
ColorGridModel.getScaleFactor()

Field Summary
protected  double height
          The height, in environment units, of this triangle.
protected  double width
          The width, in environment units, of this triangle.
 
Fields inherited from class fr.lifl.jedi.gui.display.colorGrid.view.agentDisplay.ColorTriangleDisplayer
color, inBackground
 
Constructor Summary
StaticColorTriangleDisplayer(java.awt.Color color, double size, boolean inBg)
          Constructor of the displayer.
StaticColorTriangleDisplayer(java.awt.Color color, double width, double height, boolean inBg)
          Constructor of the displayer.
 
Method Summary
protected  double getTriangleHeightInEnvironmentUnits(Agent a)
          Gets the width of the triangle, in environment units.
protected  double getTriangleWidthInEnvironmentUnits(Agent a)
          Gets the width of the triangle, in environment units.
 
Methods inherited from class fr.lifl.jedi.gui.display.colorGrid.view.agentDisplay.ColorTriangleDisplayer
drawAgent, isDisplayable, isDisplayedInBackground
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected double width
The width, in environment units, of this triangle.


height

protected double height
The height, in environment units, of this triangle.

Constructor Detail

StaticColorTriangleDisplayer

public StaticColorTriangleDisplayer(java.awt.Color color,
                                    double size,
                                    boolean inBg)
Constructor of the displayer. The width and height of this triangle are equal.

Parameters:
color - The color used to fill the triangle displaying the agent.
size - The width of the triangle displaying the agent, in environment units.
inBg - true if this displayer displays agents in the background of the frame rather than in the foreground.

StaticColorTriangleDisplayer

public StaticColorTriangleDisplayer(java.awt.Color color,
                                    double width,
                                    double height,
                                    boolean inBg)
Constructor of the displayer.

Parameters:
color - The color used to fill the triangle displaying the agent.
width - The width of the triangle displaying the agent, in environment units.
height - The height of the triangle displaying the agent, in environment units.
inBg - true if this displayer displays agents in the background of the frame rather than in the foreground.
Method Detail

getTriangleWidthInEnvironmentUnits

protected double getTriangleWidthInEnvironmentUnits(Agent a)
Gets the width of the triangle, in environment units.

Overrides:
getTriangleWidthInEnvironmentUnits in class ColorTriangleDisplayer
Parameters:
a - The displayed agent.
Returns:
the width of the triangle that will display this agent.

getTriangleHeightInEnvironmentUnits

protected double getTriangleHeightInEnvironmentUnits(Agent a)
Gets the width of the triangle, in environment units.

Overrides:
getTriangleHeightInEnvironmentUnits in class ColorTriangleDisplayer
Parameters:
a - The displayed agent.
Returns:
the width of the triangle that will display this agent.