From fc57a7acc891474ecbf8570fdfcd403a2a0b0f50 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 10 Mar 2009 21:20:30 +0000 Subject: [PATCH] mote types are returned as array now --- .../cooja/java/se/sics/cooja/plugins/SimInformation.java | 6 +++--- tools/cooja/java/se/sics/cooja/plugins/VisState.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/SimInformation.java b/tools/cooja/java/se/sics/cooja/plugins/SimInformation.java index 750085b47..0c80c96d0 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/SimInformation.java +++ b/tools/cooja/java/se/sics/cooja/plugins/SimInformation.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: SimInformation.java,v 1.4 2007/11/23 06:21:24 fros4943 Exp $ + * $Id: SimInformation.java,v 1.5 2009/03/10 21:20:30 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -155,7 +155,7 @@ public class SimInformation extends VisPlugin { smallPane.add(Box.createHorizontalGlue()); label = new JLabel(); - label.setText("" + simulation.getMoteTypes().size()); + label.setText("" + simulation.getMoteTypes().length); labelNrMoteTypes = label; smallPane.add(label); @@ -203,7 +203,7 @@ public class SimInformation extends VisPlugin { labelStatus.setText("STOPPED"); } labelNrMotes.setText("" + simulation.getMotesCount()); - labelNrMoteTypes.setText("" + simulation.getMoteTypes().size()); + labelNrMoteTypes.setText("" + simulation.getMoteTypes().length); } }); diff --git a/tools/cooja/java/se/sics/cooja/plugins/VisState.java b/tools/cooja/java/se/sics/cooja/plugins/VisState.java index 77c4118dc..999f1ae1f 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/VisState.java +++ b/tools/cooja/java/se/sics/cooja/plugins/VisState.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: VisState.java,v 1.5 2008/10/03 14:30:51 fros4943 Exp $ + * $Id: VisState.java,v 1.6 2009/03/10 21:20:39 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -119,11 +119,11 @@ public class VisState extends Visualizer2D { // Associate different colors with different mote types - Vector allTypes = simulation.getMoteTypes(); - int numberOfTypes = allTypes.size(); + MoteType[] allTypes = simulation.getMoteTypes(); + int numberOfTypes = allTypes.length; for (int colCounter=0; colCounter < numberOfTypes && colCounter < moteTypeColors.length; colCounter++) { - if (mote.getType() == allTypes.get(colCounter)) { + if (mote.getType() == allTypes[colCounter]) { returnColors[0] = moteTypeColors[colCounter]; return returnColors; }