added menu option for removing all motes from simulation
This commit is contained in:
parent
d28069411d
commit
e44657d05d
1 changed files with 16 additions and 1 deletions
|
@ -24,7 +24,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: GUI.java,v 1.39 2007/04/02 13:42:05 fros4943 Exp $
|
* $Id: GUI.java,v 1.40 2007/04/02 16:50:07 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja;
|
package se.sics.cooja;
|
||||||
|
@ -501,6 +501,12 @@ public class GUI {
|
||||||
});
|
});
|
||||||
menu.add(menuMoteTypes);
|
menu.add(menuMoteTypes);
|
||||||
|
|
||||||
|
menuItem = new JMenuItem("Remove all motes");
|
||||||
|
menuItem.setActionCommand("remove all motes");
|
||||||
|
menuItem.addActionListener(guiEventHandler);
|
||||||
|
|
||||||
|
menu.add(menuItem);
|
||||||
|
|
||||||
// Plugins menu
|
// Plugins menu
|
||||||
menuPlugins = new JMenu("Plugins");
|
menuPlugins = new JMenu("Plugins");
|
||||||
menuPlugins.setMnemonic(KeyEvent.VK_P);
|
menuPlugins.setMnemonic(KeyEvent.VK_P);
|
||||||
|
@ -2373,6 +2379,15 @@ public class GUI {
|
||||||
Object[] plugins = startedPlugins.toArray();
|
Object[] plugins = startedPlugins.toArray();
|
||||||
for (Object plugin : plugins)
|
for (Object plugin : plugins)
|
||||||
removePlugin((Plugin) plugin, false);
|
removePlugin((Plugin) plugin, false);
|
||||||
|
} else if (e.getActionCommand().equals("remove all motes")) {
|
||||||
|
if (getSimulation() != null) {
|
||||||
|
if (getSimulation().isRunning())
|
||||||
|
getSimulation().stopSimulation();
|
||||||
|
|
||||||
|
while (getSimulation().getMotesCount() > 0) {
|
||||||
|
getSimulation().removeMote(getSimulation().getMote(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (e.getActionCommand().equals("manage projects")) {
|
} else if (e.getActionCommand().equals("manage projects")) {
|
||||||
Vector<File> newProjects = ProjectDirectoriesDialog.showDialog(frame,
|
Vector<File> newProjects = ProjectDirectoriesDialog.showDialog(frame,
|
||||||
currentProjectDirs, null);
|
currentProjectDirs, null);
|
||||||
|
|
Loading…
Add table
Reference in a new issue