|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cfpm.caves.za.MultiLayerNetwork2DDisplay
public class MultiLayerNetwork2DDisplay
Displays only a specified layer of a multi-layer network. Unfortunately, Repast's Network2DDisplay is not meant to be sub-classed outside of Repast's class hierarchy, that's why this implementation is a copy of Network2DDisplay with the necessary changes put in. This is mainly overwriting the inner classes ZoomDrawer and NormalDrawer to "remove" all edges of the wrong type. All changes are marked in the code with comments.
Nested Class Summary | |
---|---|
(package private) static interface |
MultiLayerNetwork2DDisplay.Drawer
|
(package private) class |
MultiLayerNetwork2DDisplay.NodePoint
|
(package private) class |
MultiLayerNetwork2DDisplay.NormalDrawer
|
(package private) class |
MultiLayerNetwork2DDisplay.ZoomDrawer
|
Field Summary | |
---|---|
private boolean |
drawEdgesFirst
|
private MultiLayerNetwork2DDisplay.Drawer |
drawer
|
protected java.util.ArrayList |
edges
|
protected int |
height
|
protected uchicago.src.sim.gui.GraphLayout |
layout
|
protected java.lang.String |
linkType
addition: the type of link to be displayed |
protected java.util.Hashtable |
nodePoint
|
protected java.util.ArrayList |
tmpList
|
private static int |
TOGGLE_EDGE_ON_TOP
|
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 | |
---|---|
MultiLayerNetwork2DDisplay(uchicago.src.sim.gui.GraphLayout layout,
java.lang.String linkType)
Creates a MultiLayerNetwork2DDisplay using the specified GraphLayout. |
|
MultiLayerNetwork2DDisplay(java.util.List list,
int width,
int height,
java.lang.String linkType)
Creates a MultiLayerNetwork2DDisplay of the specified width and height for displaying the DrawableNonGridNodes in the list. |
|
MultiLayerNetwork2DDisplay(uchicago.src.sim.space.VectorSpace space,
int width,
int height,
java.lang.String linkType)
Creates a MultiLayerNetwork2DDisplay of the specified width and height for displaying the DrawableNonGridNodes and DrawableEdges in the specified space. |
Method Summary | |
---|---|
void |
addNode(uchicago.src.sim.gui.DrawableNonGridNode node)
addition: necessary to be able to add nodes during the simulation |
void |
drawDisplay(uchicago.src.sim.gui.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 |
removeNode(uchicago.src.sim.gui.DrawableNonGridNode node)
addition: necessary to be able to remove nodes during the simulation |
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(uchicago.src.sim.gui.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(uchicago.src.sim.gui.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 java.lang.String linkType
protected uchicago.src.sim.gui.GraphLayout layout
private static final int TOGGLE_EDGE_ON_TOP
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
private boolean drawEdgesFirst
private MultiLayerNetwork2DDisplay.Drawer drawer
Constructor Detail |
---|
public MultiLayerNetwork2DDisplay(uchicago.src.sim.space.VectorSpace space, int width, int height, java.lang.String linkType)
space
- the space containing the DrawableNonGridNodes to displaywidth
- the width of the display in pixelsheight
- the height of the display in pixelslinkType
- the type of edges to be displayedpublic MultiLayerNetwork2DDisplay(java.util.List list, int width, int height, java.lang.String linkType)
list
- the list containing the DrawableNonGridNodes to displaywidth
- the width of the display in pixelsheight
- the height of the display in pixelslinkType
- the type of edges to be displayedpublic MultiLayerNetwork2DDisplay(uchicago.src.sim.gui.GraphLayout layout, java.lang.String linkType)
layout
- the GraphLayout for this Network2DDisplay.linkType
- the type of edges to be displayedMethod 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 uchicago.src.sim.gui.Displayable
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 drawDisplay(uchicago.src.sim.gui.SimGraphics g)
drawDisplay
in interface uchicago.src.sim.gui.Displayable
public java.util.ArrayList getDisplayableInfo()
getDisplayableInfo
in interface uchicago.src.sim.gui.Displayable
DisplayInfo
public java.util.ArrayList getObjectsAt(int x, int y)
getObjectsAt
in interface uchicago.src.sim.gui.Probeable
x
- the x coordinatey
- the y coordinatepublic void setMoveableXY(uchicago.src.sim.gui.Moveable moveable, int x, int y)
setMoveableXY
in interface uchicago.src.sim.gui.Probeable
moveable
- the moveable whose coordinates are changedx
- the x coordinate in pixelsy
- the y coordinate in pixelspublic void startZoom(int x, int y, int zWidth, int zHeight)
startZoom
in interface uchicago.src.sim.gui.Zoomable
public void endZoom()
endZoom
in interface uchicago.src.sim.gui.Zoomable
public void viewEventPerformed(uchicago.src.sim.gui.ViewEvent evt)
viewEventPerformed
in interface uchicago.src.sim.gui.Displayable
public void addNode(uchicago.src.sim.gui.DrawableNonGridNode node)
public void removeNode(uchicago.src.sim.gui.DrawableNonGridNode node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |