Fix graphic editor event handler after https://codereview.scilab.org/#/c/15281/ 98/15298/1
Vincent COUVERT [Wed, 1 Oct 2014 09:31:17 +0000 (11:31 +0200)]
Change-Id: I4366c0241e4577fccfbc695f53de053f20f4fc41

scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabDockablePanel.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabStaticPanel.java

index 693b2dc..2634eb8 100644 (file)
@@ -635,6 +635,9 @@ 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();
index 3f9e698..41f9331 100644 (file)
@@ -69,7 +69,7 @@ public class SwingScilabStaticPanel extends SwingScilabScrollPane implements Swi
     private SwingScilabCanvas contentCanvas;
     protected boolean hasLayout;
     private Dimension deltaSize = null;
-    
+
     private CommonCallBack callback;
 
     public SwingScilabStaticPanel(String figureTitle, Integer figureId, Figure figure) {
@@ -264,6 +264,9 @@ public class SwingScilabStaticPanel extends SwingScilabScrollPane implements Swi
         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();
@@ -297,7 +300,7 @@ public class SwingScilabStaticPanel extends SwingScilabScrollPane implements Swi
     public CommonCallBack getCallback() {
         return callback;
     }
-    
+
     public Container getContentPane() {
         return this.getAsContainer();
     }