[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:
parent
01bd045570
commit
963d2686f3
|
@ -1209,9 +1209,22 @@ public class Visualizer extends VisPlugin implements HasQuickHelp {
|
||||||
2 * MOTE_RADIUS);
|
2 * MOTE_RADIUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
g.setColor(Color.BLACK);
|
if (getSelectedMotes().contains(mote)) {
|
||||||
g.drawOval(x - MOTE_RADIUS, y - MOTE_RADIUS, 2 * MOTE_RADIUS,
|
/* If mote is selected, highlight with red circle
|
||||||
2 * MOTE_RADIUS);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -263,9 +263,6 @@ public class UDGMVisualizerSkin implements VisualizerSkin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Color[] getColorOf(Mote mote) {
|
public Color[] getColorOf(Mote mote) {
|
||||||
if (visualizer.getSelectedMotes().contains(mote)) {
|
|
||||||
return new Color[]{Color.CYAN};
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue