Debug features available through jims 47/14347/1
Bruno JOFRET [Fri, 4 Apr 2014 14:49:39 +0000 (16:49 +0200)]
Change-Id: I4cbc8758642d4ea3006dff7811c64b3e35fd3acb

scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/MVCDebugView.java [deleted file]
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicController/GraphicController.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicView/FlattenTreeView.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicView/TreeView.java
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/DrawerVisitor.java

diff --git a/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/MVCDebugView.java b/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/MVCDebugView.java
deleted file mode 100644 (file)
index 37400cf..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
-package org.scilab.modules.graphic_objects;
-
-import org.scilab.modules.graphic_objects.graphicView.FlattenTreeView;
-import org.scilab.modules.graphic_objects.graphicView.GedTreeView;
-import org.scilab.modules.graphic_objects.graphicView.GuiLogView;
-
-public class MVCDebugView {
-
-    public static void showLogView() {
-        GuiLogView.createGuiLogView().show();
-    }
-
-    public static void showAllObjectsView() {
-        FlattenTreeView.create().show();
-    }
-
-    public static void showGedView() {
-        GedTreeView.create().show();
-    }
-}
index f2f03fa..d94a88b 100644 (file)
@@ -69,7 +69,6 @@ public class GraphicController {
         if (!GraphicsEnvironment.isHeadless() && MVCViewEnable) {
             register(GuiLogView.createGuiLogView());
             register(GedTreeView.create());
-            register(FlattenTreeView.create());
         }
     }
 
index 62ba5b9..5e6196c 100644 (file)
@@ -23,11 +23,20 @@ public class FlattenTreeView extends TreeView {
         super();
     }
 
-    public static FlattenTreeView create() {
+    public static void createView() {
         if (me == null) {
             me = new FlattenTreeView();
+            GraphicController.getController().register(me);
+            me.show();
+        }
+    }
+    
+    public static void deleteView() {
+        if (me != null) {
+            me.hide();
+            GraphicController.getController().unregister(me);
+            me = null;
         }
-        return me;
     }
 
     public void createObject(Integer id) {
@@ -41,7 +50,7 @@ public class FlattenTreeView extends TreeView {
             topModel.nodeStructureChanged(top);
             //}
         } catch (Exception e) {
-            e.printStackTrace();
+            //e.printStackTrace();
         }
     }
 
index 6da3263..c27087a 100644 (file)
@@ -45,6 +45,10 @@ public abstract class TreeView implements GraphicView, TreeSelectionListener {
     public void show() {
         frame.setVisible(true);
     }
+    
+    public void hide() {
+        frame.setVisible(false);
+    }
 
     protected TreeView() {
         frame = new JFrame("TreeView");
index 4ee58f4..6fe3364 100644 (file)
@@ -214,6 +214,10 @@ public final class SwingView implements GraphicView {
         return typedObject.getValue();
     }
 
+    public static int getSize() {
+        return me.allObjects.size();
+    }
+    
     private enum UielementType {
         Console, CheckBox, Edit, Spinner, Frame, Figure, Axes, Image, ListBox, PopupMenu, Progressbar, PushButton, RadioButton, Slider, Table, Text, Uimenu, UiParentMenu, UiChildMenu, UiCheckedMenu, UiContextMenu, Waitbar, Tab, Layer
     }
index 05b63dd..ad95dd0 100755 (executable)
@@ -156,6 +156,10 @@ public class DrawerVisitor implements Visitor, Drawer, GraphicView {
     private final List<PostRendered> postRenderedList = new LinkedList<PostRendered>();
     private final static Map<Integer, List<Integer>> openGLChildren = new HashMap<Integer, List<Integer>>();
 
+    public static int[] getSize() {
+        return new int[] {visitorMap.size(), openGLChildren.size()};
+    }
+    
     public DrawerVisitor(Component component, Canvas canvas, AxesContainer figure) {
         GraphicController.getController().register(this);
 
@@ -179,7 +183,6 @@ public class DrawerVisitor implements Visitor, Drawer, GraphicView {
         this.datatipTextDrawer = new DatatipTextDrawer(canvas.getTextureManager());
 
         visitorMap.put(figure.getIdentifier(), this);
-        //System.err.println("[VisitorMap] size="+visitorMap.size());
     }
 
     public static void changeVisitor(AxesContainer figure, DrawerVisitor visitor) {