]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Duplicated menu after a second study opening is fixed.
authorrkv <rkv@opencascade.com>
Wed, 17 Oct 2012 13:09:32 +0000 (13:09 +0000)
committerrkv <rkv@opencascade.com>
Wed, 17 Oct 2012 13:09:32 +0000 (13:09 +0000)
Workspace/Siman/src/org/splat/simer/NewScenarioMenu.java
Workspace/Siman/src/org/splat/simer/OpenStudy.java
Workspace/Siman/src/org/splat/simer/StudyMenu.java
Workspace/Siman/src/org/splat/wapp/Menu.java

index 7fcc9e473247e05d8cd340a2d75a3445f223d22f..41eb3b4df4efb1e9d87273b14a12ee469751e820 100644 (file)
@@ -31,6 +31,7 @@ public class NewScenarioMenu extends SlidMenu {
        public NewScenarioMenu init(Study context) {
                study = context;
                scopen = null;
+               init();
                return this;
        }
 
index 8f0b58fa8bd973ab60d5b22617d09431b310998b..42247c11943b68480b8165220e28c297279efd5c 100644 (file)
@@ -118,8 +118,6 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
 
 //RKV      menu = new StudyMenu(mystudy);
       menu = ((StudyMenu)getMenu()).init(mystudy); //RKV
-      ((StudyMenu)menu).setProjectElementService(getProjectElementService());
-      ((StudyMenu)menu).setScenarioService(getScenarioService());
       menu.selects(selection);                      // Initializes menu items to be displayed
       setupContents();                              // Initializes documents and knowledge at ustep
       return this;
index 55777901ebb889214d6f710b0c3c08895462edfe..b54f4c7ebbca469ab9e33b54b1df64c9070857a4 100644 (file)
@@ -32,6 +32,7 @@ public class StudyMenu extends SlidMenu {
        public StudyMenu init(Study context) {
                study = context;
                scopen = null;
+               init();
                return this;
        }
 
index fa43e402eec35c99e9824adf4cd1e42e253f1f79..d8b25ba225468a6be19e01c671f630e0bc49cbd1 100644 (file)
@@ -56,6 +56,14 @@ public abstract class Menu {
       disabled = new HashMap<String,String>();
     }
 
+    /**
+     * Initialize the menu.
+     */
+    protected void init() {
+       menu.clear();
+       indices.clear();
+       disabled.clear();
+    }
 //  ==============================================================================================================================
 //  Member functions
 //  ==============================================================================================================================