changeset 1807:a49900764c1d

Automated merge with ssh://jpgodine@jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx//rt
author jpgodine@JPGODINE-LAP.st-users.us.oracle.com
date Tue, 16 Oct 2012 09:40:28 -0700
parents 7f6a99c842fd 4dd0ce0f750e
children 97d1312344e8 609ede4dbba0
files
diffstat 3 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/scene/paint/GradientUtils.java	Thu Oct 11 14:22:28 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/scene/paint/GradientUtils.java	Tue Oct 16 09:40:28 2012 -0700
@@ -39,8 +39,8 @@
 
     public static class Point {
 
-        public static Point MIN = new Point(0, true);
-        public static Point MAX = new Point(1, true);
+        public static final Point MIN = new Point(0, true);
+        public static final Point MAX = new Point(1, true);
         public double value;
         public boolean proportional;
 
--- a/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Thu Oct 11 14:22:28 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Tue Oct 16 09:40:28 2012 -0700
@@ -116,7 +116,7 @@
     private static final String QUANTUM_TOOLKIT     = "com.sun.javafx.tk.quantum.QuantumToolkit";
     private static final String DEFAULT_TOOLKIT     = QUANTUM_TOOLKIT;
     
-    protected static Map gradientMap = new WeakHashMap();
+    private static final Map gradientMap = new WeakHashMap();
 
     private static String lookupToolkitClass(String name) {
         if ("prism".equalsIgnoreCase(name)) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Thu Oct 11 14:22:28 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Oct 16 09:40:28 2012 -0700
@@ -757,6 +757,7 @@
             maxPrefBreadth = -1;
             lastWidth = -1;
             lastHeight = -1;
+            numCellsVisibleOnScreen = -1;
             releaseCell(accumCell);
 //            accumCell = null;
 //            accumCellParent.getChildren().clear();
@@ -769,6 +770,7 @@
             maxPrefBreadth = -1;
             lastWidth = -1;
             lastHeight = -1;
+            numCellsVisibleOnScreen = -1;
             needsReconfigureCells = false;
         }
         
@@ -1261,19 +1263,21 @@
         // Toggle visibility on the corner
         corner.setVisible(breadthBar.isVisible() && lengthBar.isVisible());
 
-        numCellsVisibleOnScreen = 0;
         double sumCellLength = 0;
         double flowLength = (isVertical ? getHeight() : getWidth()) -
             (breadthBar.isVisible() ? breadthBar.prefHeight(-1) : 0);
-        for (int i = 0, max = cells.size(); i < max; i++) {
-            IndexedCell cell = cells.get(i);
-            if (cell != null && ! cell.isEmpty()) {
-                sumCellLength += (isVertical ? cell.getHeight() : cell.getWidth());
-                if (sumCellLength > flowLength) {
-                    break;
+        if (numCellsVisibleOnScreen == -1) {
+            numCellsVisibleOnScreen = 0;
+            for (int i = 0, max = cells.size(); i < max; i++) {
+                IndexedCell cell = cells.get(i);
+                if (cell != null && ! cell.isEmpty()) {
+                    sumCellLength += (isVertical ? cell.getHeight() : cell.getWidth());
+                    if (sumCellLength > flowLength) {
+                        break;
+                    }
+
+                    numCellsVisibleOnScreen++;
                 }
-
-                numCellsVisibleOnScreen++;
             }
         }
 
@@ -1315,7 +1319,7 @@
                 // only a single row and it is bigger than the viewport
                 lengthBar.setVisibleAmount(flowLength / sumCellLength);
             } else {
-                lengthBar.setVisibleAmount(cellCount / viewportLength);
+                lengthBar.setVisibleAmount(numCellsVisibleOnScreen / (float) cellCount);
             }
 
             // Fix for RT-11873. If this isn't here, we can have a situation where