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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
objList
protected ArrayList objList
Object2DHexaDisplay
public Object2DHexaDisplay(Discrete2DSpace hexagrid)
- Creates an Object2DHexaDisplay for displaying the specified Discrete2DSpace.
- Parameters:
hexagrid - the space to display
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 coordinatey - 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
Bug reports and feature requests to RePast