changeset 16825:c89cba3ceeec

8172489: [TESTBUG] Create test for SwingSet DialogDemo Reviewed-by: shurailine, prr, mrkam Contributed-by: Vikrant Agarwal <vikrant.v.agarwal@oracle.com>
author mrkam
date Wed, 15 Feb 2017 23:43:50 -0800
parents 460f7166ddc9
children 88cb99cf7c28
files test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/scrolling/JSliderAPIDriver.java
diffstat 1 files changed, 12 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/scrolling/JSliderAPIDriver.java	Wed Feb 15 23:37:49 2017 -0800
+++ b/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/scrolling/JSliderAPIDriver.java	Wed Feb 15 23:43:50 2017 -0800
@@ -66,20 +66,15 @@
         if (adj.getScrollDirection() == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() > scroll.getMinimum()
                     + getUnitIncrement(scroll))
-                    ? scroll.getValue() - getUnitIncrement(scroll)
-                    : scroll.getMinimum();
+                            ? scroll.getValue() - getUnitIncrement(scroll)
+                            : scroll.getMinimum();
+            scroll.setValue(newValue);
         } else if (adj.getScrollDirection() == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() < scroll.getMaximum()
                     - getUnitIncrement(scroll))
-                    ? scroll.getValue() + getUnitIncrement(scroll)
-                    : scroll.getMaximum();
-        }
-        setValue(oper, newValue);
-    }
-
-    private void setValue(ComponentOperator oper, int value) {
-        if (value != -1) {
-            ((JSliderOperator) oper).setValue(value);
+                            ? scroll.getValue() + getUnitIncrement(scroll)
+                            : scroll.getMaximum();
+            scroll.setValue(newValue);
         }
     }
 
@@ -96,15 +91,16 @@
         if (adj.getScrollDirection() == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() > scroll.getMinimum()
                     + getBlockIncrement(scroll))
-                    ? scroll.getValue() - getBlockIncrement(scroll)
-                    : scroll.getMinimum();
+                            ? scroll.getValue() - getBlockIncrement(scroll)
+                            : scroll.getMinimum();
+            scroll.setValue(newValue);
         } else if (adj.getScrollDirection() == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() < scroll.getMaximum()
                     - getBlockIncrement(scroll))
-                    ? scroll.getValue() + getBlockIncrement(scroll)
-                    : scroll.getMaximum();
+                            ? scroll.getValue() + getBlockIncrement(scroll)
+                            : scroll.getMaximum();
+            scroll.setValue(newValue);
         }
-        setValue(oper, newValue);
     }
 
     @Override