RePast
v. 2.0

uchicago.src.sim.gui
Class Object2DHexaDisplay

java.lang.Object
  |
  +--uchicago.src.sim.gui.Display2D
        |
        +--uchicago.src.sim.gui.HexaDisplay2D
              |
              +--uchicago.src.sim.gui.Object2DHexaDisplay
All Implemented Interfaces:
Displayable, Probeable

public class Object2DHexaDisplay
extends HexaDisplay2D


Field Summary
protected  ArrayList objList
           
 
Fields inherited from class uchicago.src.sim.gui.HexaDisplay2D
frameColor, isFramed, polyClip, polyDraw, view, xTrans, xTrans1q, yTrans, yTransHalf
 
Fields inherited from class uchicago.src.sim.gui.Display2D
grid, size
 
Fields inherited from interface uchicago.src.sim.gui.Displayable
TOGGLE_LINKS, TOGGLE_NODES, TOGGLE_UPDATE_LAYOUT, TOGGLE_VIEW, TOGGLE_WRAP
 
Constructor Summary
Object2DHexaDisplay(Discrete2DSpace hexagrid)
          Creates an Object2DHexaDisplay for displaying the specified Discrete2DSpace.
 
Method Summary
 void drawDisplay(SimGraphics g)
          Draws the contained space, either by iterating over the entire space and calling draw(SimGraphics g) on the Drawables contained therein, or by iterating through a list of Drawables and calling draw(SimGraphics g) on them.
 ArrayList getObjectsAt(int x, int y)
          Gets the object at the specified screen coordinates for probing.
 void setObjectList(ArrayList objectList)
          Sets the list of objects to display.
 
Methods inherited from class uchicago.src.sim.gui.HexaDisplay2D
getCoordinates, getDisplayableInfo, getFrameColor, getSize, isFramed, selectPolygon, setFrameColor, setFramed, setHexagons, setMoveableXY, viewEventPerformed
 
Methods inherited from class uchicago.src.sim.gui.Display2D
getGrid, reSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objList

protected ArrayList objList
Constructor Detail

Object2DHexaDisplay

public Object2DHexaDisplay(Discrete2DSpace hexagrid)
Creates an Object2DHexaDisplay for displaying the specified Discrete2DSpace.

Parameters:
hexagrid - the space to display
Method Detail

setObjectList

public void setObjectList(ArrayList objectList)
Sets the list of objects to display. If a space is sparsely populated then rather than iterating over the entire space looking for objects to draw, this Object2DDisplay can iterate only over the specified list and draw those objects. This list is expected to contain objects implementing the drawable interface.

Parameters:
objectList - the list of objects to draw

getObjectsAt

public ArrayList getObjectsAt(int x,
                              int y)
Gets the object at the specified screen coordinates for probing.

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the list of objects at x,y

drawDisplay

public void drawDisplay(SimGraphics g)
Draws the contained space, either by iterating over the entire space and calling draw(SimGraphics g) on the Drawables contained therein, or by iterating through a list of Drawables and calling draw(SimGraphics g) on them. This method should never by called directly by a user.

Specified by:
drawDisplay in interface Displayable
Specified by:
drawDisplay in class Display2D
Parameters:
g - the graphics context on which to draw

RePast
v. 2.0

Bug reports and feature requests to RePast