mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
[cooja] plugins/Visualizer: Enable multi-mote deletion in mote menu
This commit is contained in:
parent
963d2686f3
commit
6594684342
@ -1584,12 +1584,22 @@ public class Visualizer extends VisPlugin implements HasQuickHelp {
|
||||
|
||||
@Override
|
||||
public String getDescription(Visualizer visualizer, Mote mote) {
|
||||
return "Delete " + mote;
|
||||
if (visualizer.getSelectedMotes().size() == 1) {
|
||||
return "Delete " + mote;
|
||||
} else {
|
||||
return "Delete selected Motes";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAction(Visualizer visualizer, Mote mote) {
|
||||
mote.getSimulation().removeMote(mote);
|
||||
if (visualizer.getSelectedMotes().size() == 1) {
|
||||
mote.getSimulation().removeMote(mote);
|
||||
} else {
|
||||
for (Mote m: visualizer.getSelectedMotes()) {
|
||||
mote.getSimulation().removeMote(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user