GUI didn't start under Windows 83/12283/1
Calixte DENIZET [Fri, 16 Aug 2013 09:40:51 +0000 (11:40 +0200)]
Change-Id: Ib2cb9c97e129bb5c590db597ea9f8e37fe1f3238

scilab/modules/core/src/java/org/scilab/modules/core/ConsoleTab.java
scilab/modules/core/src/java/org/scilab/modules/core/Scilab.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/window/SwingScilabWindow.java
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/WindowsConfigurationManager.java
scilab/modules/history_browser/src/java/org/scilab/modules/history_browser/CommandHistory.java

index 5f5dd27..c219daa 100644 (file)
@@ -20,6 +20,7 @@ import javax.swing.JTextArea;
 
 import org.scilab.modules.commons.ScilabCommonsUtils;
 import org.scilab.modules.commons.ScilabConstants;
+import org.scilab.modules.graphic_objects.utils.MenuBarBuilder;
 import org.scilab.modules.gui.ScilabTermination;
 import org.scilab.modules.gui.bridge.CallScilabBridge;
 import org.scilab.modules.gui.bridge.tab.SwingScilabTab;
@@ -138,7 +139,6 @@ public class ConsoleTab {
         ScilabConsole.getConsole().setMaxOutputSize(ConfigManager.getMaxOutputSize());
         consoleTab.addMember(ScilabConsole.getConsole());
         ((SwingScilabTab) consoleTab.getAsSimpleTab()).setAssociatedXMLIDForHelp("console");
-        WindowsConfigurationManager.restorationFinished((SwingScilabTab) consoleTab.getAsSimpleTab());
 
         MenuBar menuBar = ScilabMenuBar.createMenuBar();
         ((SwingScilabTab) consoleTab.getAsSimpleTab()).setMenuBar(menuBar);
index a9fb16e..bf4d574 100644 (file)
@@ -45,6 +45,7 @@ import org.scilab.modules.gui.toolbar.ToolBar;
 import org.scilab.modules.gui.utils.ClosingOperationsManager;
 import org.scilab.modules.gui.utils.ConfigManager;
 import org.scilab.modules.gui.utils.LookAndFeelManager;
+import org.scilab.modules.gui.utils.WindowsConfigurationManager;
 
 /**
  * Main Class for Scilab
@@ -189,6 +190,8 @@ public class Scilab {
             SwingScilabConsole sciConsole = ((SwingScilabConsole) ScilabConsole.getConsole().getAsSimpleConsole());
             SwingScilabTab consoleTab = (SwingScilabTab) sciConsole.getParent();
 
+            WindowsConfigurationManager.restorationFinished(consoleTab);
+
             mainView = SwingScilabWindow.allScilabWindows.get(consoleTab.getParentWindowId());
         } else {
             GraphicController.getController().askObject(Type.CONSOLE);
index c96e1e9..0c0b578 100644 (file)
@@ -494,13 +494,14 @@ public class SwingScilabWindow extends JFrame implements SimpleWindow {
         if (newMenuBar == null) {
             if (this.menuBar != null) {
                 this.menuBar = null;
-                super.setJMenuBar(null);
+                setJMenuBar(null);
             }
             // else nothing to do both are null
         } else {
             if (this.menuBar != newMenuBar.getAsSimpleMenuBar()) {
                 this.menuBar = newMenuBar.getAsSimpleMenuBar();
-                super.setJMenuBar((SwingScilabMenuBar) newMenuBar.getAsSimpleMenuBar());
+
+                setJMenuBar((SwingScilabMenuBar) newMenuBar.getAsSimpleMenuBar());
             }
             //  else nothing to do element alredy set
         }
index 493d6dc..3170170 100644 (file)
@@ -454,6 +454,8 @@ public class WindowsConfigurationManager implements XConfigurationListener {
                                         }
                                     }
                                 }
+
+                                window.pack();
                                 window.setVisible(true);
                                 window.requestFocus();
                                 window.toFront();
@@ -471,6 +473,7 @@ public class WindowsConfigurationManager implements XConfigurationListener {
                 });
             } else {
                 window.setIsRestoring(false);
+                window.pack();
                 window.setVisible(true);
             }
         }
index 34807ad..da895b6 100644 (file)
@@ -163,6 +163,7 @@ public final class CommandHistory extends SwingScilabTab implements SimpleTab {
      */
     public static SwingScilabTab createCommandHistoryTab() {
         browserTab = new CommandHistory();
+        WindowsConfigurationManager.restorationFinished(browserTab);
 
         return browserTab;
     }
@@ -248,7 +249,6 @@ public final class CommandHistory extends SwingScilabTab implements SimpleTab {
                     scilabHistoryTree.mustFire = true;
                     scilabHistoryTree.fireTreeExpanded(pathRoot);
 
-                    WindowsConfigurationManager.restorationFinished(getBrowserTab());
                     scrollAtBottom();
                 }
             });