* Bug #13588 fixed - Default values of "event_handler" and "event_handler_enable...
[scilab.git] / scilab / modules / gui / src / java / org / scilab / modules / gui / bridge / tab / SwingScilabDockablePanel.java
index 863195b..693b2dc 100644 (file)
@@ -78,8 +78,6 @@ import org.scilab.modules.gui.bridge.popupmenu.SwingScilabPopupMenu;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
 import org.scilab.modules.gui.bridge.radiobutton.SwingScilabRadioButton;
 import org.scilab.modules.gui.bridge.slider.SwingScilabScroll;
-import org.scilab.modules.gui.bridge.textbox.SwingScilabTextBox;
-import org.scilab.modules.gui.bridge.toolbar.SwingScilabToolBar;
 import org.scilab.modules.gui.bridge.tree.SwingScilabTree;
 import org.scilab.modules.gui.bridge.uidisplaytree.SwingScilabUiDisplayTree;
 import org.scilab.modules.gui.bridge.uitable.SwingScilabUiTable;
@@ -637,9 +635,10 @@ public class SwingScilabDockablePanel extends View implements SimpleTab, FocusLi
         if (member instanceof SwingScilabAxes) {
             if (contentCanvas == null) {
                 contentCanvas = new SwingScilabCanvas((Figure) GraphicController.getController().getObjectFromId(((SwingScilabAxes) member).getFigureId()));
-                contentCanvas.addEventHandlerKeyListener(editorEventHandler);
-                contentCanvas.addEventHandlerMouseListener(editorEventHandler);
-                contentCanvas.addEventHandlerMouseMotionListener(editorEventHandler);
+                if (eventEnabled) {
+                    editorEventHandler.setEnable(false);
+                    enableEventHandler();
+                }
 
                 layeredPane.add(contentCanvas, JLayeredPane.FRAME_CONTENT_LAYER);