|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uchicago.src.sim.gui.Display2D
|
+--uchicago.src.sim.gui.Object2DDisplay
Displays Discrete2DSpaces and the objects contained within them. Implements probeable so that the objects within the Discrete2DSpace can be probed. All the objects within the space are expected to have implemented Drawable. Objects are displayed on a grid, a Discrete2DSpace.
| Field Summary | |
protected ArrayList |
objList
|
protected boolean |
view
|
| 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 | |
Object2DDisplay(Discrete2DSpace grid)
Creates an Object2DDisplay 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 |
getDisplayableInfo()
Gets a list of the DisplayInfo object associated with this Object2DDisplay. |
ArrayList |
getObjectsAt(int x,
int y)
Gets the object at the specified screen coordinates for probing. |
void |
setMoveableXY(Moveable moveable,
int x,
int y)
Sets the new coordinates for specified moveable. |
void |
setObjectList(ArrayList objectList)
Sets the list of objects to display. |
void |
viewEventPerformed(ViewEvent evt)
Invoked when a viewEvent for this display is fired by the DisplaySurface. |
| Methods inherited from class uchicago.src.sim.gui.Display2D |
getGrid, getSize, reSize |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ArrayList objList
protected boolean view
| Constructor Detail |
public Object2DDisplay(Discrete2DSpace grid)
grid - the space to display| Method Detail |
public void setObjectList(ArrayList objectList)
objectList - the list of objects to draw
public ArrayList getObjectsAt(int x,
int y)
getObjectsAt in interface Probeablex - the x coordinatey - the y coordinate
public void setMoveableXY(Moveable moveable,
int x,
int y)
setMoveableXY in interface Probeablemoveable - the moveable whose coordinates are changedx - the x coordinate in pixelsy - the y coordinate in pixelspublic void drawDisplay(SimGraphics g)
drawDisplay in interface DisplayabledrawDisplay in class Display2Dg - the graphics context on which to drawpublic ArrayList getDisplayableInfo()
getDisplayableInfo in interface DisplayableDisplayInfopublic void viewEventPerformed(ViewEvent evt)
viewEventPerformed in interface Displayable
|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||