|
||||||||||
| 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
uchicago.src.sim.gui.Network2DGridDisplay
public class Network2DGridDisplay
Displays a 2D grid of Drawable2DNodes and DrawableEDges. Draws edges from and to the center of nodes.
Like all all the DiscreteDisplayables Network2DGridDisplay draws a Discrete2DSpace by getting the objects in each cell in the Grid and sending those objects a draw message. If the space being displayed implements the Torus marker interface, the edges will be displayed as wrapping around the torus by default. Note that for efficiency this only draws a Node's out edges (which must be some other Node's in edge and so they all get drawn). It is important then that any edge that is being drawn be added to some Nodes list of out edges. As a general rule an edge should be added to both its from Node and its to Node.
Drawable2DNode,
DrawableEdge| Field Summary |
|---|
| Fields inherited from class uchicago.src.sim.gui.Object2DDisplay |
|---|
objsToDraw, 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 | |
|---|---|
Network2DGridDisplay(Discrete2DSpace grid)
Creates a new Network2DGridDisplay for the specified grid. |
|
| Method Summary | |
|---|---|
void |
drawDisplay(SimGraphics g)
Draws the grid. |
java.util.ArrayList |
getDisplayableInfo()
Gets the DisplayableInfo |
void |
setLinksVisible(boolean isVisible)
Shows or hides links depending on the value of parameter isVisible. |
void |
setNodesVisible(boolean isVisible)
Shows or hids nodes depending on the value of the parameter isVisible. |
void |
viewEventPerformed(ViewEvent evt)
Invoked when a viewEvent for this display is fired by the DisplaySurface. |
void |
wrapLinks(boolean wrap)
Wraps the drawn links around the edges of the display, assuming the space to be drawn is a Torus, depending on the value of wrap parameter. |
| Methods inherited from class uchicago.src.sim.gui.Object2DDisplay |
|---|
getObjectsAt, setMoveableXY, setObjectList |
| 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 Network2DGridDisplay(Discrete2DSpace grid)
grid - the grid to display| Method Detail |
|---|
public void setLinksVisible(boolean isVisible)
isVisible - if true, shows the links, otherwise hide linkspublic void setNodesVisible(boolean isVisible)
isVisible - if true, shows the nodes, otherwise hide nodespublic void wrapLinks(boolean wrap)
wrap - if true, links will be drawn wrapped around the display,
otherwise not.public void drawDisplay(SimGraphics g)
drawDisplay in interface DisplayabledrawDisplay in class Object2DDisplayg - the graphics context on which to drawpublic java.util.ArrayList getDisplayableInfo()
getDisplayableInfo in interface DisplayablegetDisplayableInfo in class Object2DDisplayDisplayInfopublic void viewEventPerformed(ViewEvent evt)
viewEventPerformed in interface DisplayableviewEventPerformed in class Object2DDisplay
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||