[cooja] plugins/Visualizer: Fix: Always highlight selected motes.

Motes were highlighted only by the UDGMVisualizerSkin before.
Now highlighting moved from individual VisualizerSkin to Visualizer.

A selected mote is highlighted with a blue circle
and a semi-transparent gray overlay.
This commit is contained in:
Enrico Joerns 2014-07-11 00:26:00 +02:00
parent 01bd045570
commit 963d2686f3
2 changed files with 16 additions and 6 deletions

View file

@ -1209,9 +1209,22 @@ public class Visualizer extends VisPlugin implements HasQuickHelp {
2 * MOTE_RADIUS);
}
g.setColor(Color.BLACK);
g.drawOval(x - MOTE_RADIUS, y - MOTE_RADIUS, 2 * MOTE_RADIUS,
2 * MOTE_RADIUS);
if (getSelectedMotes().contains(mote)) {
/* If mote is selected, highlight with red circle
and semitransparent gray overlay */
g.setColor(new Color(51, 102, 255));
g.drawOval(x - MOTE_RADIUS, y - MOTE_RADIUS, 2 * MOTE_RADIUS,
2 * MOTE_RADIUS);
g.drawOval(x - MOTE_RADIUS - 1, y - MOTE_RADIUS - 1, 2 * MOTE_RADIUS + 2,
2 * MOTE_RADIUS + 2);
g.setColor(new Color(128, 128, 128, 128));
g.fillOval(x - MOTE_RADIUS, y - MOTE_RADIUS, 2 * MOTE_RADIUS,
2 * MOTE_RADIUS);
} else {
g.setColor(Color.BLACK);
g.drawOval(x - MOTE_RADIUS, y - MOTE_RADIUS, 2 * MOTE_RADIUS,
2 * MOTE_RADIUS);
}
}
}

View file

@ -263,9 +263,6 @@ public class UDGMVisualizerSkin implements VisualizerSkin {
@Override
public Color[] getColorOf(Mote mote) {
if (visualizer.getSelectedMotes().contains(mote)) {
return new Color[]{Color.CYAN};
}
return null;
}