From 65946843420a11c531820863c4f3383476e4f0f5 Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Thu, 5 Jun 2014 22:33:45 +0200 Subject: [PATCH] [cooja] plugins/Visualizer: Enable multi-mote deletion in mote menu --- .../org/contikios/cooja/plugins/Visualizer.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/org/contikios/cooja/plugins/Visualizer.java b/tools/cooja/java/org/contikios/cooja/plugins/Visualizer.java index 5d139eb7e..903183203 100644 --- a/tools/cooja/java/org/contikios/cooja/plugins/Visualizer.java +++ b/tools/cooja/java/org/contikios/cooja/plugins/Visualizer.java @@ -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); + } + } } };