|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.gui.Display2D
uchicago.src.sim.gui.Object2DDisplay
public class 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 java.util.Collection |
objsToDraw
|
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. |
java.util.ArrayList |
getDisplayableInfo()
Gets a list of the DisplayInfo object associated with this Object2DDisplay. |
java.util.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(java.util.Collection objects)
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 java.util.Collection objsToDraw
protected boolean view
| Constructor Detail |
|---|
public Object2DDisplay(Discrete2DSpace grid)
grid - the space to display| Method Detail |
|---|
public void setObjectList(java.util.Collection objects)
objects - the collection of objects to draw
public java.util.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 java.util.ArrayList getDisplayableInfo()
getDisplayableInfo in interface DisplayableDisplayInfopublic void viewEventPerformed(ViewEvent evt)
viewEventPerformed in interface Displayable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||