[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 a new issue