mote types are returned as array now

This commit is contained in:
fros4943 2009-03-10 21:20:30 +00:00
parent 230d580aae
commit fc57a7acc8
2 changed files with 7 additions and 7 deletions

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.plugins;
@ -155,7 +155,7 @@ public class SimInformation extends VisPlugin {
smallPane.add(Box.createHorizontalGlue()); smallPane.add(Box.createHorizontalGlue());
label = new JLabel(); label = new JLabel();
label.setText("" + simulation.getMoteTypes().size()); label.setText("" + simulation.getMoteTypes().length);
labelNrMoteTypes = label; labelNrMoteTypes = label;
smallPane.add(label); smallPane.add(label);
@ -203,7 +203,7 @@ public class SimInformation extends VisPlugin {
labelStatus.setText("STOPPED"); labelStatus.setText("STOPPED");
} }
labelNrMotes.setText("" + simulation.getMotesCount()); labelNrMotes.setText("" + simulation.getMotesCount());
labelNrMoteTypes.setText("" + simulation.getMoteTypes().size()); labelNrMoteTypes.setText("" + simulation.getMoteTypes().length);
} }
}); });

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.plugins;
@ -119,11 +119,11 @@ public class VisState extends Visualizer2D {
// Associate different colors with different mote types // Associate different colors with different mote types
Vector<MoteType> allTypes = simulation.getMoteTypes(); MoteType[] allTypes = simulation.getMoteTypes();
int numberOfTypes = allTypes.size(); int numberOfTypes = allTypes.length;
for (int colCounter=0; colCounter < numberOfTypes && colCounter < moteTypeColors.length; colCounter++) { 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]; returnColors[0] = moteTypeColors[colCounter];
return returnColors; return returnColors;
} }