|
||||||||||
| 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.Value2DDisplay
public class Value2DDisplay
Displays 2d arrays of values (Integers or ints). As a Displayable this class
iterates through a Discrete2DSpace, turns the integers into
colors according to a ColorMap, and
draws these colors in the appropriate cells.
| Field Summary |
|---|
| 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 | |
|---|---|
Value2DDisplay(Discrete2DSpace grid,
ColorMap map)
Creates a Value2DDisplay to display the specified Discrete2DSpace using the specified ColorMap. |
|
| Method Summary | |
|---|---|
void |
drawDisplay(SimGraphics g)
Draws the Discrete2DSpace converting the Numbers contained therein to Colors according to the ColorMap specified in the constructor |
java.util.ArrayList |
getDisplayableInfo()
Gets a list of the DisplayInfo objects associated with this Object2DDisplay. |
java.util.ArrayList |
getObjectsAt(int x,
int y)
Gets an ArrayList of Objects at an x, y screen (pixel) coordinate. |
boolean |
isZeroTransparent()
Returns whether a zero value in space drawn by this grid is transparent or drawn according to the color map. |
void |
setDisplayMapping(int m,
int c)
Linear transform of states (doubles, floats, integers etc.) to colors for drawing. color = state / m + c |
void |
setMoveableXY(Moveable moveable,
int x,
int y)
Sets the new coordinates for specified moveable. |
void |
setZeroTransparent(boolean val)
Sets whether or not a zero value in space drawn by this grid is transparent or drawn according to the color map. |
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 |
| Constructor Detail |
|---|
public Value2DDisplay(Discrete2DSpace grid,
ColorMap map)
| Method Detail |
|---|
public void setDisplayMapping(int m,
int c)
public void setZeroTransparent(boolean val)
val - if true, zero value will be drawn as transparent, otherwise
the value in the color map is drawn.public boolean isZeroTransparent()
public void drawDisplay(SimGraphics g)
drawDisplay in interface DisplayabledrawDisplay in class Display2Dpublic java.util.ArrayList getDisplayableInfo()
getDisplayableInfo in interface DisplayableDisplayInfopublic void viewEventPerformed(ViewEvent evt)
viewEventPerformed in interface Displayable
public java.util.ArrayList getObjectsAt(int x,
int y)
getObjectsAt in interface Probeablex - the x screen coordinate.y - the y screen 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 pixels
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||