From cce3628440f8b469fa9c0c3351d0985562656273 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Tue, 5 Jun 2012 08:07:10 +0200 Subject: [PATCH] Bugfix: viewers were not correctly ticked off in the menu when a simulation was loaded from file. The current fix feels like a hack through. --- .../java/se/sics/cooja/plugins/Visualizer.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java b/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java index 6034e5ae1..a1d7e9c93 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java +++ b/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java @@ -572,7 +572,9 @@ public class Visualizer extends VisPlugin implements HasQuickHelp { simulation.getGUI().tryLoadClass(this, VisualizerSkin.class, skin); generateAndActivateSkin(skinClass); } + populateSkinMenu(viewMenu); + } public VisualizerSkin[] getCurrentSkins() { @@ -1338,6 +1340,18 @@ public class Visualizer extends VisPlugin implements HasQuickHelp { skinButton.setVisible(false); } } + + /* + * This is a hack: since the viewers are activated through an invokeLater + * mechanism (see above), we'll have to invoke the + * populateSkinMenu(viewMenu) later too. Lets just hope the invokation of + * populateSkinMenu() is done later than the activation of the viewers... + */ + SwingUtilities.invokeLater(new Runnable() { + public void run() { + populateSkinMenu(viewMenu); + } + }); return true; }