|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.gui.Network2DDisplay
public class Network2DDisplay
Displays nodes and links that inhabit a VectorSpace, that is, nodes (and their links) that do not inhabit a grid. This expects to be drawing a VectorSpace of DrawableNonGridNodes or a List of DrawableNonGridNodes. 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. In addition, these edges must implement DrawableEdge in order to be drawn.
DrawableNonGridNode,
DrawableEdge| Field Summary | |
|---|---|
protected java.util.ArrayList |
edges
|
protected int |
height
|
protected GraphLayout |
layout
|
protected java.util.Hashtable |
nodePoint
|
protected java.util.ArrayList |
tmpList
|
protected boolean |
viewLinks
|
protected boolean |
viewNodes
|
protected int |
width
|
protected java.util.HashMap |
zoomSet
|
| Fields inherited from interface uchicago.src.sim.gui.Displayable |
|---|
TOGGLE_LINKS, TOGGLE_NODES, TOGGLE_UPDATE_LAYOUT, TOGGLE_VIEW, TOGGLE_WRAP |
| Constructor Summary | |
|---|---|
Network2DDisplay(GraphLayout layout)
Creates a Network2DDisplay using the specified GraphLayout. |
|
Network2DDisplay(java.util.List list,
int width,
int height)
Creates a Network2DDisplay of the specified width and height for displaying the DrawableNonGridNodes in the list. |
|
Network2DDisplay(VectorSpace space,
int width,
int height)
Creates a Network2DDisplay of the specified width and height for displaying the DrawableNonGridNodes and DrawableEdges in the specified space. |
|
| Method Summary | |
|---|---|
void |
drawDisplay(SimGraphics g)
Draws this display |
void |
endZoom()
|
java.util.ArrayList |
getDisplayableInfo()
Gets the DisplayableInfo |
boolean |
getDrawEdgesFirst()
Gets whether or not this draws the edges first and then the nodes over them. |
java.util.ArrayList |
getObjectsAt(int x,
int y)
Gets a list of the objects that contain the specified screen coordinate. |
java.awt.Dimension |
getSize()
Gets the size of this VectorDisplay. |
void |
setDrawEdgesFirst(boolean drawEdgesFirst)
Sets whether or not this draws the edges first and then the nodes over them. |
void |
setLinksVisible(boolean isVisible)
Shows or hides links depending on the value of parameter isVisible. |
void |
setMoveableXY(Moveable moveable,
int x,
int y)
Sets the new coordinates for specified moveable. |
void |
setNodesVisible(boolean isVisible)
Shows or hids nodes depending on the value of the parameter isVisible. |
void |
startZoom(int x,
int y,
int zWidth,
int zHeight)
|
void |
viewEventPerformed(ViewEvent evt)
Invoked when a viewEvent for this display is fired by the DisplaySurface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GraphLayout layout
protected java.util.ArrayList edges
protected java.util.Hashtable nodePoint
protected boolean viewNodes
protected boolean viewLinks
protected java.util.ArrayList tmpList
protected int height
protected int width
protected java.util.HashMap zoomSet
| Constructor Detail |
|---|
public Network2DDisplay(VectorSpace space,
int width,
int height)
space - the space containing the DrawableNonGridNodes to displaywidth - the width of the display in pixelsheight - the height of the display in pixels
public Network2DDisplay(java.util.List list,
int width,
int height)
list - the list containing the DrawableNonGridNodes to displaywidth - the width of the display in pixelsheight - the height of the display in pixelspublic Network2DDisplay(GraphLayout layout)
layout - the GraphLayout for this Network2DDisplay.| Method Detail |
|---|
public boolean getDrawEdgesFirst()
public void setDrawEdgesFirst(boolean drawEdgesFirst)
drawEdgesFirst - whether or not this draws edges first then nodespublic java.awt.Dimension getSize()
getSize in interface Displayablepublic 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 drawDisplay(SimGraphics g)
drawDisplay in interface Displayablepublic java.util.ArrayList getDisplayableInfo()
getDisplayableInfo in interface DisplayableDisplayInfo
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 pixels
public void startZoom(int x,
int y,
int zWidth,
int zHeight)
startZoom in interface Zoomablepublic void endZoom()
endZoom in interface Zoomablepublic void viewEventPerformed(ViewEvent evt)
viewEventPerformed in interface Displayable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||