From 0c4dc6fc6b1262db875ba70e86265dceb9cc2ff0 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Fri, 18 Sep 2009 16:13:31 +0000 Subject: [PATCH] start plugins in non-dispatcher thread --- tools/cooja/java/se/sics/cooja/GUI.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index 8193b2339..d9ad950f7 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.143 2009/08/27 12:25:12 nvt-se Exp $ + * $Id: GUI.java,v 1.144 2009/09/18 16:13:31 fros4943 Exp $ */ package se.sics.cooja; @@ -4093,11 +4093,15 @@ public class GUI extends Observable { public StartPluginGUIAction(String name) { super(name); } - public void actionPerformed(ActionEvent e) { - Class pluginClass = - (Class) ((JMenuItem) e.getSource()).getClientProperty("class"); - Mote mote = (Mote) ((JMenuItem) e.getSource()).getClientProperty("mote"); - tryStartPlugin(pluginClass, myGUI, mySimulation, mote); + public void actionPerformed(final ActionEvent e) { + new Thread(new Runnable() { + public void run() { + Class pluginClass = + (Class) ((JMenuItem) e.getSource()).getClientProperty("class"); + Mote mote = (Mote) ((JMenuItem) e.getSource()).getClientProperty("mote"); + tryStartPlugin(pluginClass, myGUI, mySimulation, mote); + } + }).start(); } public boolean shouldBeEnabled() { return getSimulation() != null;