changeset 6664:8ad840a50b6a

RT-36284: Controls skins should not call setOnMouseXXX to add mouse handlers in skins.
author jgiles
date Wed, 09 Apr 2014 15:31:21 +1200
parents 008dfbf691bb
children 5f30288517da
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerContent.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollBarSkin.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TabPaneSkin.java
diffstat 5 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerContent.java	Wed Apr 09 14:54:30 2014 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerContent.java	Wed Apr 09 15:31:21 2014 +1200
@@ -716,7 +716,7 @@
         for (int row = 0; row < 6; row++) {
             for (int col = 0; col < daysPerWeek; col++) {
                 DateCell dayCell = createDayCell();
-                dayCell.setOnMouseClicked(dayCellActionHandler);
+                dayCell.addEventHandler(MouseEvent.MOUSE_CLICKED, dayCellActionHandler);
                 dayCells.add(dayCell);
             }
         }
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java	Wed Apr 09 14:54:30 2014 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java	Wed Apr 09 15:31:21 2014 +1200
@@ -89,13 +89,13 @@
         super(control, behavior);
 
         if (control.getOnMousePressed() == null) {
-            control.setOnMousePressed(e -> {
+            control.addEventHandler(MouseEvent.MOUSE_PRESSED, e -> {
                 getBehavior().mousePressed(e, behaveLikeButton);
             });
         }
 
         if (control.getOnMouseReleased() == null) {
-            control.setOnMouseReleased(e -> {
+            control.addEventHandler(MouseEvent.MOUSE_RELEASED, e -> {
                 getBehavior().mouseReleased(e, behaveLikeButton);
             });
         }
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java	Wed Apr 09 14:54:30 2014 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java	Wed Apr 09 15:31:21 2014 +1200
@@ -152,7 +152,7 @@
     private void initializeSwipeAndTouchHandlers() {
         final Pagination control = getSkinnable();
 
-        getSkinnable().setOnTouchPressed(e -> {
+        getSkinnable().addEventHandler(TouchEvent.TOUCH_PRESSED, e -> {
             if (touchEventId == -1) {
                 touchEventId = e.getTouchPoint().getId();
             }
@@ -165,7 +165,7 @@
             e.consume();
         });
 
-        getSkinnable().setOnTouchMoved(e -> {
+        getSkinnable().addEventHandler(TouchEvent.TOUCH_MOVED, e -> {
             if (touchEventId != e.getTouchPoint().getId()) {
                 return;
             }
@@ -243,7 +243,7 @@
             e.consume();
         });
 
-        getSkinnable().setOnTouchReleased(e -> {
+        getSkinnable().addEventHandler(TouchEvent.TOUCH_RELEASED, e -> {
             if (touchEventId != e.getTouchPoint().getId()) {
                 return;
             } else {
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollBarSkin.java	Wed Apr 09 14:54:30 2014 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollBarSkin.java	Wed Apr 09 15:31:21 2014 +1200
@@ -313,7 +313,7 @@
         });
 
 
-        getSkinnable().setOnScroll(event -> {
+        getSkinnable().addEventHandler(ScrollEvent.SCROLL, event -> {
             /*
             ** if the tracklength isn't greater then do nothing....
             */
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Wed Apr 09 14:54:30 2014 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Wed Apr 09 15:31:21 2014 +1200
@@ -430,11 +430,11 @@
 
     private void initializeSwipeHandlers() {
         if (IS_TOUCH_SUPPORTED) {
-            getSkinnable().setOnSwipeLeft(t -> {
+            getSkinnable().addEventHandler(SwipeEvent.SWIPE_LEFT, t -> {
                 getBehavior().selectNextTab();
             });
 
-            getSkinnable().setOnSwipeRight(t -> {
+            getSkinnable().addEventHandler(SwipeEvent.SWIPE_RIGHT, t -> {
                 getBehavior().selectPreviousTab();
             });
         }