[cooja] apps/mrm: Adapted MRM visualizer skin to show adequate

information for multi-selections
This commit is contained in:
Enrico Joerns 2014-04-10 18:33:26 +02:00
parent e69b08f5fd
commit 8e648bcece
1 changed files with 60 additions and 60 deletions

View File

@ -81,15 +81,14 @@ public class MRMVisualizerSkin implements VisualizerSkin {
public void paintBeforeMotes(Graphics g) {
Set<Mote> selectedMotes = visualizer.getSelectedMotes();
if (simulation == null || selectedMotes == null || selectedMotes.isEmpty()) {
if (simulation == null || selectedMotes == null) {
return;
}
final Mote selectedMote = visualizer.getSelectedMotes().iterator().next();
for (final Mote selectedMote : selectedMotes) {
if (selectedMote.getInterfaces().getRadio() == null) {
return;
continue;
}
final Position sPos = selectedMote.getInterfaces().getPosition();
/* Paint transmission and interference range for selected mote */
@ -110,12 +109,12 @@ public class MRMVisualizerSkin implements VisualizerSkin {
String msg = "No edges";
int msgWidth = fm.stringWidth(msg);
g.setColor(Color.BLACK);
g.drawString(msg, x - msgWidth/2, y + 2*Visualizer.MOTE_RADIUS + 3);
g.drawString(msg, x - msgWidth / 2, y + 2 * Visualizer.MOTE_RADIUS + 3);
return;
}
g.setColor(Color.BLACK);
int edges = 0;
for (Mote d: dests) {
for (Mote d : dests) {
if (d == selectedMote) {
continue;
}
@ -153,6 +152,7 @@ public class MRMVisualizerSkin implements VisualizerSkin {
g.setColor(Color.BLACK);
g.drawString(msg, x - msgWidth/2, y + 2*Visualizer.MOTE_RADIUS + 3);
}
}
public void paintAfterMotes(Graphics g) {
}