From 8cd27a3edbed7f698657ac9569d74d174afd0b1c Mon Sep 17 00:00:00 2001 From: nifi Date: Fri, 22 Oct 2010 13:39:52 +0000 Subject: [PATCH] Paint links below nodes --- .../src/se/sics/contiki/collect/gui/MapPanel.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/sky-shell/src/se/sics/contiki/collect/gui/MapPanel.java b/examples/sky-shell/src/se/sics/contiki/collect/gui/MapPanel.java index f9c564eb6..eb729882e 100644 --- a/examples/sky-shell/src/se/sics/contiki/collect/gui/MapPanel.java +++ b/examples/sky-shell/src/se/sics/contiki/collect/gui/MapPanel.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: MapPanel.java,v 1.6 2010/10/22 11:04:04 nifi Exp $ + * $Id: MapPanel.java,v 1.7 2010/10/22 13:39:52 nifi Exp $ * * ----------------------------------------------------------------- * @@ -34,8 +34,8 @@ * * Authors : Joakim Eriksson, Niclas Finne * Created : 3 jul 2008 - * Updated : $Date: 2010/10/22 11:04:04 $ - * $Revision: 1.6 $ + * Updated : $Date: 2010/10/22 13:39:52 $ + * $Revision: 1.7 $ */ package se.sics.contiki.collect.gui; @@ -470,9 +470,10 @@ public class MapPanel extends JPanel implements Configurable, Visualizer, Action width - legendWidth - 15, 10 + fnHeight / 2); } - for (MapNode n : getNodeList()) { - if (!isMap || !hideNetwork) { - g.setColor(LINK_COLOR); + MapNode[] nodes = getNodeList(); + if (!isMap || !hideNetwork) { + g.setColor(LINK_COLOR); + for (MapNode n : nodes) { for (int j = 0, mu = n.node.getLinkCount(); j < mu; j++) { Link link = n.node.getLink(j); MapNode linkNode = addMapNode(link.node); @@ -499,7 +500,9 @@ public class MapPanel extends JPanel implements Configurable, Visualizer, Action } } } + } + for (MapNode n : nodes) { n.paint(g, n.x, n.y); g.setColor(Color.black);