changeset 1224:348de34f8273 2.2-b12

Merge
author igor
date Tue, 05 Jun 2012 16:41:13 -0700
parents d39767c34385 04cd43ba99ec
children 7be3c836bb43 0cbd6a3c74bb 6593c5847d5b
files
diffstat 60 files changed, 1217 insertions(+), 448 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Jun 01 00:03:57 2012 -0700
+++ b/.hgtags	Tue Jun 05 16:41:13 2012 -0700
@@ -29,3 +29,4 @@
 804bd3cdb04f7da0ba3c3797c71285d353030fd8 2.2-b08
 aeec67bbcaa2ad0050843915cb3e166556694ce7 2.2-b09
 72bd9ac175004058c2503ed21c975a583d399836 2.2-b10
+85b700eea97b1307cd043a4eac6ebb6dfd64f8f5 2.2-b11
--- a/javafx-concurrent/src/javafx/concurrent/Service.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-concurrent/src/javafx/concurrent/Service.java	Tue Jun 05 16:41:13 2012 -0700
@@ -495,13 +495,28 @@
 
     /**
      * Cancels any currently running Task, if any, and restarts this Service. The state
-     * will be reset to READY prior to execution.
+     * will be reset to READY prior to execution. This method should only be called on
+     * the FX application thread.
      */
     public void restart() {
+        checkThread();
+
         // Cancel the current task, if there is one
         if (task != null) {
             task.cancel();
             task = null;
+
+            // RT-20880: IllegalStateException thrown from Service#restart()
+            // The problem is that the reset method explodes if the state
+            // is SCHEDULED or RUNNING. Although we have cancelled the
+            // task above, it is possible that cancelling does not change
+            // state to the CANCELLED state. However we still need to
+            // succeed in resetting. I believe that although the old task is
+            // still running away, everything is about to be unbound so
+            // we really can just let the old task run and create a new
+            // task and the Service will be none the wiser.
+            state.unbind();
+            state.setValue(State.CANCELLED);
         }
 
         // Reset
@@ -513,9 +528,11 @@
 
     /**
      * Resets the Service. May only be called while in one of the finish states,
-     * that is, SUCCEEDED, FAILED, or CANCELLED, or when READY.
+     * that is, SUCCEEDED, FAILED, or CANCELLED, or when READY. This method should
+     * only be called on the FX application thread.
      */
     public void reset() {
+        checkThread();
         final State s = getState();
         if (s == State.SCHEDULED || s == State.RUNNING) {
             throw new IllegalStateException();
@@ -544,6 +561,7 @@
 
     /**
      * Starts this Service. The Service must be in the READY state to succeed in this call.
+     * This method should only be called on the FX application thread.
      */
     public void start() {
         checkThread();
--- a/javafx-concurrent/src/javafx/concurrent/Task.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-concurrent/src/javafx/concurrent/Task.java	Tue Jun 05 16:41:13 2012 -0700
@@ -928,8 +928,33 @@
      *                 done will be -1 (thus, indeterminate).
      * @param max A value from -1 to Long.MAX_VALUE. Any value outside this
      *            range results in an IllegalArgumentException.
+     * @see #updateProgress(double, double)
      */
     protected void updateProgress(long workDone, long max) {
+        updateProgress((double)workDone, (double)max);
+    }
+
+    /**
+     * Updates the <code>workDone</code>, <code>totalWork</code>,
+     * and <code>progress</code> properties. Calls to updateProgress
+     * are coalesced and run later on the FX application thread, and calls
+     * to updateProgress, even from the FX Application thread, may not
+     * necessarily result in immediate updates to these properties, and
+     * intermediate workDone values may be coalesced to save on event
+     * notifications. <code>max</code> becomes the new value for
+     * <code>totalWork</code>.
+     * <p>
+     *     <em>This method is safe to be called from any thread.</em>
+     * </p>
+     *
+     * @param workDone A value from -1 up to max. If the value is greater
+     *                 than max, an illegal argument exception is thrown.
+     *                 If the value passed is -1, then the resulting percent
+     *                 done will be -1 (thus, indeterminate).
+     * @param max A value from -1 to Double.MAX_VALUE. Any value outside this
+     *            range results in an IllegalArgumentException.
+     */
+    protected void updateProgress(double workDone, double max) {
         // Perform the argument sanity check that workDone is < max
         if (workDone > max) {
             throw new IllegalArgumentException("The workDone must be <= the max");
@@ -940,6 +965,10 @@
             throw new IllegalArgumentException("The workDone and max cannot be less than -1");
         }
 
+        if (Double.isInfinite(max) || Double.isNaN(max)) {
+            throw new IllegalArgumentException("The max value must not be infinite or NaN");
+        }
+
         if (isFxApplicationThread()) {
             _updateProgress(workDone, max);
         } else if (progressUpdate.getAndSet(new ProgressUpdate(workDone, max)) == null) {
--- a/javafx-concurrent/test/javafx/concurrent/ServiceLifecycleTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-concurrent/test/javafx/concurrent/ServiceLifecycleTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -96,6 +96,7 @@
     protected final class ManualTask extends AbstractTask {
         private AtomicBoolean finish = new AtomicBoolean(false);
         private AtomicReference<Exception> exception = new AtomicReference<Exception>();
+        private boolean failToCancel = false;
 
         @Override protected String call() throws Exception {
             runLater(new Sentinel());
@@ -127,6 +128,11 @@
             finish.set(true);
             handleEvents();
         }
+
+        @Override
+        public boolean cancel(boolean mayInterruptIfRunning) {
+            return failToCancel ? false : super.cancel(mayInterruptIfRunning);
+        }
     }
 
     /************************************************************************
@@ -191,6 +197,22 @@
         assertSame(Worker.State.SCHEDULED, service.stateProperty().get());
     }
 
+    /**
+     * This test differs from callingRestartInScheduledStateShouldCancelAndReschedule
+     * in that under some circumstances, the cancel operation on a task may yield
+     * a task which is not marked as CANCELLED, such as when it is already run
+     * or cancelled). In such a case, the bindings have not fired yet and the
+     * state of the service is off. At least, that is what is happening with
+     * RT-20880. The fix allows this test to pass.
+     */
+    @Test public void callingRestartInScheduledStateShouldCancelAndReschedule_RT_20880() {
+        service.start();
+        task.failToCancel = true;
+        service.restart();
+        assertSame(Worker.State.SCHEDULED, service.getState());
+        assertSame(Worker.State.SCHEDULED, service.stateProperty().get());
+    }
+
     @Test(expected = IllegalStateException.class)
     public void callingResetInScheduledStateThrowsISE() {
         service.start();
--- a/javafx-ui-common/src/com/sun/javafx/Utils.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/Utils.java	Tue Jun 05 16:41:13 2012 -0700
@@ -1009,7 +1009,60 @@
         return PlatformUtil.isUnix();
     }
 
-   /***************************************************************************
+    /**
+     * Utility for loading a class in a manner that will work with multiple
+     * class loaders, as is typically found in OSGI modular applications.
+     * In particular, this method will attempt to just load the class
+     * identified by className. If that fails, it attempts to load the
+     * class using the current thread's context class loader. If that fails,
+     * it attempts to use the class loader of the supplied "instance", and
+     * if it still fails it walks up the class hierarchy of the instance
+     * and attempts to use the class loader of each class in the super-type
+     * hierarchy.
+     *
+     * @param className The name of the class we want to load
+     * @param instance An optional instance used to help find the class to load
+     * @return The class. Cannot return null
+     * @throws ClassNotFoundException If the class cannot be found using any technique.
+     */
+    public static Class<?> loadClass(final String className, final Object instance)
+            throws ClassNotFoundException
+    {
+        try {
+            // Try just loading the class
+            return Class.forName(className);
+        } catch (ClassNotFoundException ex) {
+            // RT-17525 : Use context class loader only if Class.forName fails.
+            if (Thread.currentThread().getContextClassLoader() != null) {
+                try {
+                    return Thread.currentThread().getContextClassLoader().loadClass(className);
+                } catch (ClassNotFoundException ex2) {
+                    // Do nothing, just fall through
+                }
+            }
+
+            // RT-14177: Try looking up the class using the class loader of the
+            //           current class, walking up the list of superclasses
+            //           and checking each of them, before bailing and using
+            //           the context class loader.
+            if (instance != null) {
+                Class<?> currentType = instance.getClass();
+                while (currentType != null) {
+                    try {
+                        return currentType.getClassLoader().loadClass(className);
+                    } catch (ClassNotFoundException ex2) {
+                        currentType = currentType.getSuperclass();
+                    }
+                }
+            }
+
+            // We failed to find the class using any of the above means, so we're going
+            // to just throw the ClassNotFoundException that we caught earlier
+            throw ex;
+        }
+    }
+
+    /***************************************************************************
      *                                                                         *
      * Unicode-related utilities                                               *
      *                                                                         *
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java	Tue Jun 05 16:41:13 2012 -0700
@@ -25,6 +25,7 @@
 package com.sun.javafx.css;
 
 import com.sun.javafx.Logging;
+import com.sun.javafx.Utils;
 import com.sun.javafx.css.StyleHelper.StyleCacheKey;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -185,6 +186,11 @@
             return hash;
         }
         
+        public void clearCache() {
+            StyleCacheEntry entry = styleCache.get(this);
+            if (entry != null && entry.entries != null) entry.entries.clear();
+        }
+        
     }
     
     private static int[] getIndices(Node node, int count) {
@@ -1688,10 +1694,14 @@
                 // what did font shorthand specify? 
                 ParsedValue[] vals = 
                         (ParsedValue[])csShorthand.getParsedValue().getValue();
+                // Use family and size from converted font since the actual 
+                // values may have been resolved. The weight and posture, 
+                // however, are hard to get reliably from the font so use 
+                // the parsed value instead. 
                 if (vals[0] != null) family = f.getFamily();
                 if (vals[1] != null) size   = f.getSize();
-//                if (vals[3] != null) weight = f.??();
-//                if (vals[4] != null) style  = f.??();
+                if (vals[2] != null) weight = (FontWeight)vals[2].convert(null);
+                if (vals[3] != null) style  = (FontPosture)vals[3].convert(null);
                 
             }
             
@@ -1711,7 +1721,7 @@
 
             if (cv.isCacheable == false) cacheable.set(false);
             if (cv.value instanceof String) {
-                family = (String)cv.value;
+                family = Utils.stripQuotes((String)cv.value);
                 if (origin == null || origin.compareTo(cv.origin) < 0) {                        
                     origin = cv.origin;
                 }
@@ -1809,7 +1819,16 @@
             size = f.getSize();                
         }
 
-        Font val = Font.font(family, weight, style, size);
+        Font val = null;
+        if (weight != null && style != null) {
+            val = Font.font(family, weight, style, size);            
+        } else if (weight != null) {
+            val = Font.font(family, weight, size);
+        } else if (style != null) {
+            val = Font.font(family, style, size);
+        } else {
+            val = Font.font(family, size);            
+        }
 
         return new CalculatedValue(val, origin, cacheable.get());
     }    
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Tue Jun 05 16:41:13 2012 -0700
@@ -443,7 +443,7 @@
                 // parse only if the file is not a .bss
                 // and binary.css is set to false
                 return (!fname.endsWith(".bss") && bss != null) ?
-                    Boolean.valueOf(bss) : Boolean.FALSE;
+                    !Boolean.valueOf(bss) : Boolean.FALSE;
             }
         });
 
--- a/javafx-ui-common/src/com/sun/javafx/scene/KeyboardShortcutsHandler.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/scene/KeyboardShortcutsHandler.java	Tue Jun 05 16:41:13 2012 -0700
@@ -72,7 +72,7 @@
         ObservableList<Mnemonic> mnemonicsList = (ObservableList)getMnemonics().get(m.getKeyCombination());
         if (mnemonicsList != null) {
             for (int i = 0 ; i < mnemonicsList.size() ; i++) {
-                if (mnemonicsList.get(i) == m) {
+                if (mnemonicsList.get(i).getNode() == m.getNode()) {
                     mnemonicsList.remove(i);
                 }
             }
--- a/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Tue Jun 05 16:41:13 2012 -0700
@@ -144,6 +144,12 @@
             return TOOLKIT;
         }
 
+        final boolean verbose = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+            public Boolean run() {
+                return Boolean.getBoolean("javafx.verbose");
+            }
+        });
+
         // This loading of msvcr100.dll (VS2010) is required when run with Java 6
         // since it was build with VS2003 and doesn't include msvcr100.dll in it's JRE.
         // Note: See README-builds.html on MSVC requirement: VS2010 is required.
@@ -153,11 +159,9 @@
                     try {
                         com.sun.javafx.runtime.NativeLibLoader.loadLibrary("msvcr100");
                     } catch (Throwable t) {
-			// TODO: Suppress this message when we are ready for production
-			// release or guard it with a verbose flag.
-			// For now we want this message to be always on in our testing
-			// cycle.
-			System.err.println("Error: failed to msvcr100.dll " + t);
+			if (verbose) {
+                            System.err.println("Error: failed to load msvcr100.dll : " + t);
+                        }
                     }
                     return null;
                 }
@@ -195,12 +199,6 @@
             forcedToolkit = lookupToolkitClass(forcedToolkit);
         }
 
-        boolean verbose = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
-            public Boolean run() {
-                return Boolean.getBoolean("javafx.verbose");
-            }
-        });
-
         boolean printToolkit = verbose
                 || (userSpecifiedToolkit && !forcedToolkit.endsWith("StubToolkit"));
 
--- a/javafx-ui-common/src/javafx/scene/Node.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/Node.java	Tue Jun 05 16:41:13 2012 -0700
@@ -1723,6 +1723,7 @@
      * is ready. The SnapshotResult that is passed into the call method of
      * the callback will contain the rendered image, the source node
      * that was rendered, and a copy of the SnapshotParameters.
+     * The callback parameter must not be null.
      *
      * @param params the snapshot parameters containing attributes that
      * will control the rendering. If the SnapshotParameters object is null,
@@ -1739,11 +1740,15 @@
      * @throws IllegalStateException if this method is called on a thread
      *     other than the JavaFX Application Thread.
      *
+     * @throws NullPointerException if the callback parameter is null.
      */
     public void snapshot(Callback<SnapshotResult, Void> callback,
             SnapshotParameters params, WritableImage image) {
 
         Toolkit.getToolkit().checkFxUserThread();
+        if (callback == null) {
+            throw new NullPointerException("The callback must not be null");
+        }
 
         if (params == null) {
             params = new SnapshotParameters();
@@ -7381,6 +7386,9 @@
 
         // set the key to null here so the next call to impl_getStyleCacheKey
         // will cause a new key to be created
+        if (styleCacheKey != null) {
+            styleCacheKey.clearCache();
+        }
         styleCacheKey = null;
         
         styleHelper = StyleManager.getInstance().getStyleHelper(this);
--- a/javafx-ui-common/src/javafx/scene/Parent.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/Parent.java	Tue Jun 05 16:41:13 2012 -0700
@@ -968,7 +968,7 @@
      * @return the calculated min width
      */
     protected double computeMinWidth(double height) {
-        return super.prefWidth(height);
+        return prefWidth(height);
     }
 
     // PENDING_DOC_REVIEW
@@ -981,7 +981,7 @@
      * @return the calculated min height
      */
     protected double computeMinHeight(double width) {
-        return super.prefHeight(width);
+        return prefHeight(width);
     }
 
     /**
--- a/javafx-ui-common/src/javafx/scene/Scene.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/Scene.java	Tue Jun 05 16:41:13 2012 -0700
@@ -1116,7 +1116,7 @@
 
         impl_setAllowPGAccess(true);
         context.x = xMin;
-        context.y = xMin;
+        context.y = yMin;
         context.width = width;
         context.height = height;
         context.transform = transform;
@@ -1251,7 +1251,7 @@
      * @param callback a class whose call method will be called when the image
      * is ready. The SnapshotResult that is passed into the call method of
      * the callback will contain the rendered image and the source scene
-     * that was rendered.
+     * that was rendered. The callback parameter must not be null.
      *
      * @param image the writable image that will be used to hold the rendered scene.
      * It may be null in which case a new WritableImage will be constructed.
@@ -1262,9 +1262,14 @@
      *
      * @throws IllegalStateException if this method is called on a thread
      *     other than the JavaFX Application Thread.
+     *
+     * @throws NullPointerException if the callback parameter is null.
      */
     public void snapshot(Callback<SnapshotResult, Void> callback, WritableImage image) {
         Toolkit.getToolkit().checkFxUserThread();
+        if (callback == null) {
+            throw new NullPointerException("The callback must not be null");
+        }
 
         final Callback<SnapshotResult, Void> theCallback = callback;
         final WritableImage theImage = image;
--- a/javafx-ui-common/src/javafx/scene/input/GestureEvent.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/input/GestureEvent.java	Tue Jun 05 16:41:13 2012 -0700
@@ -100,7 +100,7 @@
     }
 
     /**
-     * @InheritDoc
+     * @inheritDoc
      */
     @Override
     public Event copyFor(Object newSource, EventTarget newTarget) {
--- a/javafx-ui-common/src/javafx/scene/input/KeyEvent.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/input/KeyEvent.java	Tue Jun 05 16:41:13 2012 -0700
@@ -76,6 +76,9 @@
  * generate character input (e.g., action keys, modifier keys, etc.). The key
  * being pressed or released is indicated by the code variable, which contains
  * a virtual key code.
+ *
+ * <p>
+ * For triggering context menus see the {@link ContextMenuEvent}.
  */
 public class KeyEvent extends InputEvent {
     /**
--- a/javafx-ui-common/src/javafx/scene/input/MouseEvent.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/input/MouseEvent.java	Tue Jun 05 16:41:13 2012 -0700
@@ -120,6 +120,11 @@
  * it affects both event variants. Thanks to the subtype-relationship, a
  * {@code MOUSE_ENTERED_TARGET} event handler will receive the
  * {@code MOUSE_ENTERED} event on target.
+ *
+ * <h4>Notes</h4>
+ * <ul>
+ *   <li>For triggering context menus see the {@link ContextMenuEvent}.</li>
+ * </ul>
  */
 public class MouseEvent extends InputEvent {
     /**
--- a/javafx-ui-common/src/javafx/scene/input/TouchEvent.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/input/TouchEvent.java	Tue Jun 05 16:41:13 2012 -0700
@@ -111,7 +111,7 @@
     /**
      * Returns number of touch points represented by this touch event set.
      * The returned number matches the size of the {@code touchPoints} list.
-     * @return
+     * @return The number of touch points represented by this touch event set.
      */
     public int getTouchCount() {
         return touchPoints.size();
@@ -133,7 +133,7 @@
 
 
     /**
-     * @InheritDoc
+     * @inheritDoc
      */
     @Override
     public Event copyFor(Object newSource, EventTarget newTarget) {
--- a/javafx-ui-common/src/javafx/scene/layout/GridPane.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/layout/GridPane.java	Tue Jun 05 16:41:13 2012 -0700
@@ -1247,10 +1247,17 @@
 
             }
             if (rowMinHeight[i] == USE_PREF_SIZE) {
-                rowMinHeight[i] = rowPrefHeight[i];
+                //RT-20573 Use the bounded size if the pref has not been set
+                rowMinHeight[i] = rowPrefHeight[i] == 0 ?
+                        boundedSize(rowPrefHeight[i], rowMinHeight[i], rowMaxHeight[i]) == USE_PREF_SIZE ?
+                            0 : boundedSize(rowPrefHeight[i], rowMinHeight[i], rowMaxHeight[i]) :
+                        rowPrefHeight[i];
             }
             if (rowMaxHeight[i] == USE_PREF_SIZE) {
-                rowMaxHeight[i] = rowPrefHeight[i];
+                rowMaxHeight[i] = rowPrefHeight[i] == 0 ?
+                        boundedSize(rowPrefHeight[i], rowMinHeight[i], rowMaxHeight[i]) == USE_PREF_SIZE ?
+                            0 : boundedSize(rowPrefHeight[i], rowMinHeight[i], rowMaxHeight[i]) :
+                        rowPrefHeight[i];
             }
             rowPrefHeight[i] = boundedSize(rowPrefHeight[i], rowMinHeight[i], rowMaxHeight[i]);
             //System.out.println("row "+i+": h="+rowHeights[i]+" percent="+rowPercentHeight[i]+" min="+rowMinHeight[i]+" pref="+rowPrefHeight[i]+" max="+rowMaxHeight[i]+" grow="+rowGrow[i]);
@@ -1309,7 +1316,7 @@
                     columnPercentWidth[i] = constraints.getPercentWidth();
                     computeGrow = false;
                 } else {
-                    double w = constraints.getPrefWidth();
+                    double w = constraints.getPrefWidth();          
                     if (w != USE_COMPUTED_SIZE) {
                         columnPrefWidth[i] = w;
                         computePref = false;
@@ -1332,7 +1339,7 @@
             }
 
             if (computeMin || computeMax || computePref || computeGrow) {
-                // compute from content
+                // compute from content                
                 for (int j = 0; j < endNodes.size(); j++) {
                     Node child = endNodes.get(j);
                     Insets margin = getMargin(child);
@@ -1384,12 +1391,19 @@
             }
 
             if (columnMinWidth[i] == USE_PREF_SIZE) {
-                columnMinWidth[i] = columnPrefWidth[i];
+                //RT-20573 Use the bounded size if the pref has not been set
+                columnMinWidth[i] = columnPrefWidth[i] == 0 ? 
+                    boundedSize(columnPrefWidth[i], columnMinWidth[i], columnMaxWidth[i]) == USE_PREF_SIZE ? 
+                        0 : boundedSize(columnPrefWidth[i], columnMinWidth[i], columnMaxWidth[i]) : 
+                    columnPrefWidth[i];
             }
             if (columnMaxWidth[i] == USE_PREF_SIZE) {
-                columnMaxWidth[i] = columnPrefWidth[i];
-            }
-            columnPrefWidth[i] = boundedSize(columnPrefWidth[i], columnMinWidth[i], columnMaxWidth[i]);
+                columnMaxWidth[i] = columnPrefWidth[i] == 0 ? 
+                    boundedSize(columnPrefWidth[i], columnMinWidth[i], columnMaxWidth[i]) == USE_PREF_SIZE ? 
+                        0 : boundedSize(columnPrefWidth[i], columnMinWidth[i], columnMaxWidth[i]) : 
+                    columnPrefWidth[i];
+            }                        
+            columnPrefWidth[i] = boundedSize(columnPrefWidth[i], columnMinWidth[i], columnMaxWidth[i]);            
             //System.out.println("column "+i+": h="+columnWidths[i]+" percent="+columnPercentWidth[i]+" min="+columnMinWidth[i]+" pref="+columnPrefWidth[i]+" max="+columnMaxWidth[i]+" grow="+columnGrow[i]);
         }
         // if percentages sum is bigger than 100, treat them as weights
@@ -1461,7 +1475,7 @@
         double rowTotal = 0;
         computeGridMetrics();
 
-        Orientation contentBias = getContentBias();
+        Orientation contentBias = getContentBias();        
         if (contentBias == null) {
             rowTotal = adjustRowHeights(rowPrefHeight, height);
             columnTotal = adjustColumnWidths(columnPrefWidth, width);
@@ -1649,7 +1663,7 @@
             }
         }
         double available = extraWidth; // will be negative in shrinking case
-        while (Math.abs(available) > 1.0 && adjusting.size() > 0) {
+        while (Math.abs(available) > 1.0 && adjusting.size() > 0) {            
             final double portion = available / adjusting.size(); // negative in shrinking case
             for (int i = 0; i < adjusting.size(); i++) {
                 final int index = adjusting.get(i);
--- a/javafx-ui-common/src/javafx/scene/paint/Color.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/paint/Color.java	Tue Jun 05 16:41:13 2012 -0700
@@ -385,7 +385,7 @@
         if (colorString.isEmpty()) {
             throw new IllegalArgumentException("Invalid color specification");
         }
-        
+
         String color = colorString.toLowerCase();
 
         if (color.startsWith("#")) {
@@ -525,8 +525,8 @@
                 return ((c < 0.0)
                         ? ((c % 360.0) + 360.0)
                         : ((c > 360.0)
-                           ? (c % 360.0)
-                           : c));
+                            ? (c % 360.0)
+                            : c));
         }
 
         throw new IllegalArgumentException("Invalid color specification");
@@ -649,7 +649,7 @@
 
         return web(value);
     }
-    
+
     private static int to32BitInteger(int red, int green, int blue, int alpha) {
         int i = red;
         i = i << 8;
@@ -696,7 +696,7 @@
      * very small source brightness instead of zero.
      */
     public Color deriveColor(double hueShift, double saturationFactor,
-            double brightnessFactor, double opacityFactor) {
+                             double brightnessFactor, double opacityFactor) {
 
         double[] hsb = Utils.RGBtoHSB(red, green, blue);
 
@@ -762,137 +762,137 @@
     /**
      * A fully transparent color with an ARGB value of #00000000.
      */
-    public static final Color TRANSPARENT          = color(0.0, 0.0, 0.0, 0.0);
+    public static final Color TRANSPARENT          = new Color(0f, 0f, 0f, 0f);
 
     /**
      * The color alice blue with an RGB value of #F0F8FF.
      */
-    public static final Color ALICEBLUE            = rgb(0xF0, 0xF8, 0xFF);
+    public static final Color ALICEBLUE = new Color(0.9411765f, 0.972549f, 1.0f);
 
     /**
      * The color antique white with an RGB value of #FAEBD7.
      */
-    public static final Color ANTIQUEWHITE         = rgb(0xFA, 0xEB, 0xD7);
+    public static final Color ANTIQUEWHITE = new Color(0.98039216f, 0.92156863f, 0.84313726f);
 
     /**
      * The color aqua with an RGB value of #00FFFF.
      */
-    public static final Color AQUA                 = rgb(0x00, 0xFF, 0xFF);
+    public static final Color AQUA = new Color(0.0f, 1.0f, 1.0f);
 
     /**
      * The color aquamarine with an RGB value of #7FFFD4.
      */
-    public static final Color AQUAMARINE           = rgb(0x7F, 0xFF, 0xD4);
+    public static final Color AQUAMARINE = new Color(0.49803922f, 1.0f, 0.83137256f);
 
     /**
      * The color azure with an RGB value of #F0FFFF.
      */
-    public static final Color AZURE                = rgb(0xF0, 0xFF, 0xFF);
+    public static final Color AZURE = new Color(0.9411765f, 1.0f, 1.0f);
 
     /**
      * The color beige with an RGB value of #F5F5DC.
      */
-    public static final Color BEIGE                = rgb(0xF5, 0xF5, 0xDC);
+    public static final Color BEIGE = new Color(0.9607843f, 0.9607843f, 0.8627451f);
 
     /**
      * The color bisque with an RGB value of #FFE4C4.
      */
-    public static final Color BISQUE               = rgb(0xFF, 0xE4, 0xC4);
+    public static final Color BISQUE = new Color(1.0f, 0.89411765f, 0.76862746f);
 
     /**
      * The color black with an RGB value of #000000.
      */
-    public static final Color BLACK                = rgb(0x00, 0x00, 0x00);
+    public static final Color BLACK = new Color(0.0f, 0.0f, 0.0f);
 
     /**
      * The color blanched almond with an RGB value of #FFEBCD.
      */
-    public static final Color BLANCHEDALMOND       = rgb(0xFF, 0xEB, 0xCD);
+    public static final Color BLANCHEDALMOND = new Color(1.0f, 0.92156863f, 0.8039216f);
 
     /**
      * The color blue with an RGB value of #0000FF.
      */
-    public static final Color BLUE                 = rgb(0x00, 0x00, 0xFF);
+    public static final Color BLUE = new Color(0.0f, 0.0f, 1.0f);
 
     /**
      * The color blue violet with an RGB value of #8A2BE2.
      */
-    public static final Color BLUEVIOLET           = rgb(0x8A, 0x2B, 0xE2);
+    public static final Color BLUEVIOLET = new Color(0.5411765f, 0.16862746f, 0.8862745f);
 
     /**
      * The color brown with an RGB value of #A52A2A.
      */
-    public static final Color BROWN                = rgb(0xA5, 0x2A, 0x2A);
+    public static final Color BROWN = new Color(0.64705884f, 0.16470589f, 0.16470589f);
 
     /**
      * The color burly wood with an RGB value of #DEB887.
      */
-    public static final Color BURLYWOOD            = rgb(0xDE, 0xB8, 0x87);
+    public static final Color BURLYWOOD = new Color(0.87058824f, 0.72156864f, 0.5294118f);
 
     /**
      * The color cadet blue with an RGB value of #5F9EA0.
      */
-    public static final Color CADETBLUE            = rgb(0x5F, 0x9E, 0xA0);
+    public static final Color CADETBLUE = new Color(0.37254903f, 0.61960787f, 0.627451f);
 
     /**
      * The color chartreuse with an RGB value of #7FFF00.
      */
-    public static final Color CHARTREUSE           = rgb(0x7F, 0xFF, 0x00);
+    public static final Color CHARTREUSE = new Color(0.49803922f, 1.0f, 0.0f);
 
     /**
      * The color chocolate with an RGB value of #D2691E.
      */
-    public static final Color CHOCOLATE            = rgb(0xD2, 0x69, 0x1E);
+    public static final Color CHOCOLATE = new Color(0.8235294f, 0.4117647f, 0.11764706f);
 
     /**
      * The color coral with an RGB value of #FF7F50.
      */
-    public static final Color CORAL                = rgb(0xFF, 0x7F, 0x50);
+    public static final Color CORAL = new Color(1.0f, 0.49803922f, 0.3137255f);
 
     /**
      * The color cornflower blue with an RGB value of #6495ED.
      */
-    public static final Color CORNFLOWERBLUE       = rgb(0x64, 0x95, 0xED);
+    public static final Color CORNFLOWERBLUE = new Color(0.39215687f, 0.58431375f, 0.92941177f);
 
     /**
      * The color cornsilk with an RGB value of #FFF8DC.
      */
-    public static final Color CORNSILK             = rgb(0xFF, 0xF8, 0xDC);
+    public static final Color CORNSILK = new Color(1.0f, 0.972549f, 0.8627451f);
 
     /**
      * The color crimson with an RGB value of #DC143C.
      */
-    public static final Color CRIMSON              = rgb(0xDC, 0x14, 0x3C);
+    public static final Color CRIMSON = new Color(0.8627451f, 0.078431375f, 0.23529412f);
 
     /**
      * The color cyan with an RGB value of #00FFFF.
      */
-    public static final Color CYAN                 = rgb(0x00, 0xFF, 0xFF);
+    public static final Color CYAN = new Color(0.0f, 1.0f, 1.0f);
 
     /**
      * The color dark blue with an RGB value of #00008B.
      */
-    public static final Color DARKBLUE             = rgb(0x00, 0x00, 0x8B);
+    public static final Color DARKBLUE = new Color(0.0f, 0.0f, 0.54509807f);
 
     /**
      * The color dark cyan with an RGB value of #008B8B.
      */
-    public static final Color DARKCYAN             = rgb(0x00, 0x8B, 0x8B);
+    public static final Color DARKCYAN = new Color(0.0f, 0.54509807f, 0.54509807f);
 
     /**
      * The color dark goldenrod with an RGB value of #B8860B.
      */
-    public static final Color DARKGOLDENROD        = rgb(0xB8, 0x86, 0x0B);
+    public static final Color DARKGOLDENROD = new Color(0.72156864f, 0.5254902f, 0.043137256f);
 
     /**
      * The color dark gray with an RGB value of #A9A9A9.
      */
-    public static final Color DARKGRAY             = rgb(0xA9, 0xA9, 0xA9);
+    public static final Color DARKGRAY = new Color(0.6627451f, 0.6627451f, 0.6627451f);
 
     /**
      * The color dark green with an RGB value of #006400.
      */
-    public static final Color DARKGREEN            = rgb(0x00, 0x64, 0x00);
+    public static final Color DARKGREEN = new Color(0.0f, 0.39215687f, 0.0f);
 
     /**
      * The color dark grey with an RGB value of #A9A9A9.
@@ -902,52 +902,52 @@
     /**
      * The color dark khaki with an RGB value of #BDB76B.
      */
-    public static final Color DARKKHAKI            = rgb(0xBD, 0xB7, 0x6B);
+    public static final Color DARKKHAKI = new Color(0.7411765f, 0.7176471f, 0.41960785f);
 
     /**
      * The color dark magenta with an RGB value of #8B008B.
      */
-    public static final Color DARKMAGENTA          = rgb(0x8B, 0x00, 0x8B);
+    public static final Color DARKMAGENTA = new Color(0.54509807f, 0.0f, 0.54509807f);
 
     /**
      * The color dark olive green with an RGB value of #556B2F.
      */
-    public static final Color DARKOLIVEGREEN       = rgb(0x55, 0x6B, 0x2F);
+    public static final Color DARKOLIVEGREEN = new Color(0.33333334f, 0.41960785f, 0.18431373f);
 
     /**
      * The color dark orange with an RGB value of #FF8C00.
      */
-    public static final Color DARKORANGE           = rgb(0xFF, 0x8C, 0x00);
+    public static final Color DARKORANGE = new Color(1.0f, 0.54901963f, 0.0f);
 
     /**
      * The color dark orchid with an RGB value of #9932CC.
      */
-    public static final Color DARKORCHID           = rgb(0x99, 0x32, 0xCC);
+    public static final Color DARKORCHID = new Color(0.6f, 0.19607843f, 0.8f);
 
     /**
      * The color dark red with an RGB value of #8B0000.
      */
-    public static final Color DARKRED              = rgb(0x8B, 0x00, 0x00);
+    public static final Color DARKRED = new Color(0.54509807f, 0.0f, 0.0f);
 
     /**
      * The color dark salmon with an RGB value of #E9967A.
      */
-    public static final Color DARKSALMON           = rgb(0xE9, 0x96, 0x7A);
+    public static final Color DARKSALMON = new Color(0.9137255f, 0.5882353f, 0.47843137f);
 
     /**
      * The color dark sea green with an RGB value of #8FBC8F.
      */
-    public static final Color DARKSEAGREEN         = rgb(0x8F, 0xBC, 0x8F);
+    public static final Color DARKSEAGREEN = new Color(0.56078434f, 0.7372549f, 0.56078434f);
 
     /**
      * The color dark slate blue with an RGB value of #483D8B.
      */
-    public static final Color DARKSLATEBLUE        = rgb(0x48, 0x3D, 0x8B);
+    public static final Color DARKSLATEBLUE = new Color(0.28235295f, 0.23921569f, 0.54509807f);
 
     /**
      * The color dark slate gray with an RGB value of #2F4F4F.
      */
-    public static final Color DARKSLATEGRAY        = rgb(0x2F, 0x4F, 0x4F);
+    public static final Color DARKSLATEGRAY = new Color(0.18431373f, 0.30980393f, 0.30980393f);
 
     /**
      * The color dark slate grey with an RGB value of #2F4F4F.
@@ -957,27 +957,27 @@
     /**
      * The color dark turquoise with an RGB value of #00CED1.
      */
-    public static final Color DARKTURQUOISE        = rgb(0x00, 0xCE, 0xD1);
+    public static final Color DARKTURQUOISE = new Color(0.0f, 0.80784315f, 0.81960785f);
 
     /**
      * The color dark violet with an RGB value of #9400D3.
      */
-    public static final Color DARKVIOLET           = rgb(0x94, 0x00, 0xD3);
+    public static final Color DARKVIOLET = new Color(0.5803922f, 0.0f, 0.827451f);
 
     /**
      * The color deep pink with an RGB value of #FF1493.
      */
-    public static final Color DEEPPINK             = rgb(0xFF, 0x14, 0x93);
+    public static final Color DEEPPINK = new Color(1.0f, 0.078431375f, 0.5764706f);
 
     /**
      * The color deep sky blue with an RGB value of #00BFFF.
      */
-    public static final Color DEEPSKYBLUE          = rgb(0x00, 0xBF, 0xFF);
+    public static final Color DEEPSKYBLUE = new Color(0.0f, 0.7490196f, 1.0f);
 
     /**
      * The color dim gray with an RGB value of #696969.
      */
-    public static final Color DIMGRAY              = rgb(0x69, 0x69, 0x69);
+    public static final Color DIMGRAY = new Color(0.4117647f, 0.4117647f, 0.4117647f);
 
     /**
      * The color dim grey with an RGB value of #696969.
@@ -987,62 +987,62 @@
     /**
      * The color dodger blue with an RGB value of #1E90FF.
      */
-    public static final Color DODGERBLUE           = rgb(0x1E, 0x90, 0xFF);
+    public static final Color DODGERBLUE = new Color(0.11764706f, 0.5647059f, 1.0f);
 
     /**
      * The color firebrick with an RGB value of #B22222.
      */
-    public static final Color FIREBRICK            = rgb(0xB2, 0x22, 0x22);
+    public static final Color FIREBRICK = new Color(0.69803923f, 0.13333334f, 0.13333334f);
 
     /**
      * The color floral white with an RGB value of #FFFAF0.
      */
-    public static final Color FLORALWHITE          = rgb(0xFF, 0xFA, 0xF0);
+    public static final Color FLORALWHITE = new Color(1.0f, 0.98039216f, 0.9411765f);
 
     /**
      * The color forest green with an RGB value of #228B22.
      */
-    public static final Color FORESTGREEN          = rgb(0x22, 0x8B, 0x22);
+    public static final Color FORESTGREEN = new Color(0.13333334f, 0.54509807f, 0.13333334f);
 
     /**
      * The color fuchsia with an RGB value of #FF00FF.
      */
-    public static final Color FUCHSIA              = rgb(0xFF, 0x00, 0xFF);
+    public static final Color FUCHSIA = new Color(1.0f, 0.0f, 1.0f);
 
     /**
      * The color gainsboro with an RGB value of #DCDCDC.
      */
-    public static final Color GAINSBORO            = rgb(0xDC, 0xDC, 0xDC);
+    public static final Color GAINSBORO = new Color(0.8627451f, 0.8627451f, 0.8627451f);
 
     /**
      * The color ghost white with an RGB value of #F8F8FF.
      */
-    public static final Color GHOSTWHITE           = rgb(0xF8, 0xF8, 0xFF);
+    public static final Color GHOSTWHITE = new Color(0.972549f, 0.972549f, 1.0f);
 
     /**
      * The color gold with an RGB value of #FFD700.
      */
-    public static final Color GOLD                 = rgb(0xFF, 0xD7, 0x00);
+    public static final Color GOLD = new Color(1.0f, 0.84313726f, 0.0f);
 
     /**
      * The color goldenrod with an RGB value of #DAA520.
      */
-    public static final Color GOLDENROD            = rgb(0xDA, 0xA5, 0x20);
+    public static final Color GOLDENROD = new Color(0.85490197f, 0.64705884f, 0.1254902f);
 
     /**
      * The color gray with an RGB value of #808080.
      */
-    public static final Color GRAY                 = rgb(0x80, 0x80, 0x80);
+    public static final Color GRAY = new Color(0.5019608f, 0.5019608f, 0.5019608f);
 
     /**
      * The color green with an RGB value of #008000.
      */
-    public static final Color GREEN                = rgb(0x00, 0x80, 0x00);
+    public static final Color GREEN = new Color(0.0f, 0.5019608f, 0.0f);
 
     /**
      * The color green yellow with an RGB value of #ADFF2F.
      */
-    public static final Color GREENYELLOW          = rgb(0xAD, 0xFF, 0x2F);
+    public static final Color GREENYELLOW = new Color(0.6784314f, 1.0f, 0.18431373f);
 
     /**
      * The color grey with an RGB value of #808080.
@@ -1052,82 +1052,82 @@
     /**
      * The color honeydew with an RGB value of #F0FFF0.
      */
-    public static final Color HONEYDEW             = rgb(0xF0, 0xFF, 0xF0);
+    public static final Color HONEYDEW = new Color(0.9411765f, 1.0f, 0.9411765f);
 
     /**
      * The color hot pink with an RGB value of #FF69B4.
      */
-    public static final Color HOTPINK              = rgb(0xFF, 0x69, 0xB4);
+    public static final Color HOTPINK = new Color(1.0f, 0.4117647f, 0.7058824f);
 
     /**
      * The color indian red with an RGB value of #CD5C5C.
      */
-    public static final Color INDIANRED            = rgb(0xCD, 0x5C, 0x5C);
+    public static final Color INDIANRED = new Color(0.8039216f, 0.36078432f, 0.36078432f);
 
     /**
      * The color indigo with an RGB value of #4B0082.
      */
-    public static final Color INDIGO               = rgb(0x4B, 0x00, 0x82);
+    public static final Color INDIGO = new Color(0.29411766f, 0.0f, 0.50980395f);
 
     /**
      * The color ivory with an RGB value of #FFFFF0.
      */
-    public static final Color IVORY                = rgb(0xFF, 0xFF, 0xF0);
+    public static final Color IVORY = new Color(1.0f, 1.0f, 0.9411765f);
 
     /**
      * The color khaki with an RGB value of #F0E68C.
      */
-    public static final Color KHAKI                = rgb(0xF0, 0xE6, 0x8C);
+    public static final Color KHAKI = new Color(0.9411765f, 0.9019608f, 0.54901963f);
 
     /**
      * The color lavender with an RGB value of #E6E6FA.
      */
-    public static final Color LAVENDER             = rgb(0xE6, 0xE6, 0xFA);
+    public static final Color LAVENDER = new Color(0.9019608f, 0.9019608f, 0.98039216f);
 
     /**
      * The color lavender blush with an RGB value of #FFF0F5.
      */
-    public static final Color LAVENDERBLUSH        = rgb(0xFF, 0xF0, 0xF5);
+    public static final Color LAVENDERBLUSH = new Color(1.0f, 0.9411765f, 0.9607843f);
 
     /**
      * The color lawn green with an RGB value of #7CFC00.
      */
-    public static final Color LAWNGREEN            = rgb(0x7C, 0xFC, 0x00);
+    public static final Color LAWNGREEN = new Color(0.4862745f, 0.9882353f, 0.0f);
 
     /**
      * The color lemon chiffon with an RGB value of #FFFACD.
      */
-    public static final Color LEMONCHIFFON         = rgb(0xFF, 0xFA, 0xCD);
+    public static final Color LEMONCHIFFON = new Color(1.0f, 0.98039216f, 0.8039216f);
 
     /**
      * The color light blue with an RGB value of #ADD8E6.
      */
-    public static final Color LIGHTBLUE            = rgb(0xAD, 0xD8, 0xE6);
+    public static final Color LIGHTBLUE = new Color(0.6784314f, 0.84705883f, 0.9019608f);
 
     /**
      * The color light coral with an RGB value of #F08080.
      */
-    public static final Color LIGHTCORAL           = rgb(0xF0, 0x80, 0x80);
+    public static final Color LIGHTCORAL = new Color(0.9411765f, 0.5019608f, 0.5019608f);
 
     /**
      * The color light cyan with an RGB value of #E0FFFF.
      */
-    public static final Color LIGHTCYAN            = rgb(0xE0, 0xFF, 0xFF);
+    public static final Color LIGHTCYAN = new Color(0.8784314f, 1.0f, 1.0f);
 
     /**
      * The color light goldenrod yellow with an RGB value of #FAFAD2.
      */
-    public static final Color LIGHTGOLDENRODYELLOW = rgb(0xFA, 0xFA, 0xD2);
+    public static final Color LIGHTGOLDENRODYELLOW = new Color(0.98039216f, 0.98039216f, 0.8235294f);
 
     /**
      * The color light gray with an RGB value of #D3D3D3.
      */
-    public static final Color LIGHTGRAY            = rgb(0xD3, 0xD3, 0xD3);
+    public static final Color LIGHTGRAY = new Color(0.827451f, 0.827451f, 0.827451f);
 
     /**
      * The color light green with an RGB value of #90EE90.
      */
-    public static final Color LIGHTGREEN           = rgb(0x90, 0xEE, 0x90);
+    public static final Color LIGHTGREEN = new Color(0.5647059f, 0.93333334f, 0.5647059f);
 
     /**
      * The color light grey with an RGB value of #D3D3D3.
@@ -1137,27 +1137,27 @@
     /**
      * The color light pink with an RGB value of #FFB6C1.
      */
-    public static final Color LIGHTPINK            = rgb(0xFF, 0xB6, 0xC1);
+    public static final Color LIGHTPINK = new Color(1.0f, 0.7137255f, 0.75686276f);
 
     /**
      * The color light salmon with an RGB value of #FFA07A.
      */
-    public static final Color LIGHTSALMON          = rgb(0xFF, 0xA0, 0x7A);
+    public static final Color LIGHTSALMON = new Color(1.0f, 0.627451f, 0.47843137f);
 
     /**
      * The color light sea green with an RGB value of #20B2AA.
      */
-    public static final Color LIGHTSEAGREEN        = rgb(0x20, 0xB2, 0xAA);
+    public static final Color LIGHTSEAGREEN = new Color(0.1254902f, 0.69803923f, 0.6666667f);
 
     /**
      * The color light sky blue with an RGB value of #87CEFA.
      */
-    public static final Color LIGHTSKYBLUE         = rgb(0x87, 0xCE, 0xFA);
+    public static final Color LIGHTSKYBLUE = new Color(0.5294118f, 0.80784315f, 0.98039216f);
 
     /**
      * The color light slate gray with an RGB value of #778899.
      */
-    public static final Color LIGHTSLATEGRAY       = rgb(0x77, 0x88, 0x99);
+    public static final Color LIGHTSLATEGRAY = new Color(0.46666667f, 0.53333336f, 0.6f);
 
     /**
      * The color light slate grey with an RGB value of #778899.
@@ -1167,262 +1167,262 @@
     /**
      * The color light steel blue with an RGB value of #B0C4DE.
      */
-    public static final Color LIGHTSTEELBLUE       = rgb(0xB0, 0xC4, 0xDE);
+    public static final Color LIGHTSTEELBLUE = new Color(0.6901961f, 0.76862746f, 0.87058824f);
 
     /**
      * The color light yellow with an RGB value of #FFFFE0.
      */
-    public static final Color LIGHTYELLOW          = rgb(0xFF, 0xFF, 0xE0);
+    public static final Color LIGHTYELLOW = new Color(1.0f, 1.0f, 0.8784314f);
 
     /**
      * The color lime with an RGB value of #00FF00.
      */
-    public static final Color LIME                 = rgb(0x00, 0xFF, 0x00);
+    public static final Color LIME = new Color(0.0f, 1.0f, 0.0f);
 
     /**
      * The color lime green with an RGB value of #32CD32.
      */
-    public static final Color LIMEGREEN            = rgb(0x32, 0xCD, 0x32);
+    public static final Color LIMEGREEN = new Color(0.19607843f, 0.8039216f, 0.19607843f);
 
     /**
      * The color linen with an RGB value of #FAF0E6.
      */
-    public static final Color LINEN                = rgb(0xFA, 0xF0, 0xE6);
+    public static final Color LINEN = new Color(0.98039216f, 0.9411765f, 0.9019608f);
 
     /**
      * The color magenta with an RGB value of #FF00FF.
      */
-    public static final Color MAGENTA              = rgb(0xFF, 0x00, 0xFF);
+    public static final Color MAGENTA = new Color(1.0f, 0.0f, 1.0f);
 
     /**
      * The color maroon with an RGB value of #800000.
      */
-    public static final Color MAROON               = rgb(0x80, 0x00, 0x00);
+    public static final Color MAROON = new Color(0.5019608f, 0.0f, 0.0f);
 
     /**
      * The color medium aquamarine with an RGB value of #66CDAA.
      */
-    public static final Color MEDIUMAQUAMARINE     = rgb(0x66, 0xCD, 0xAA);
+    public static final Color MEDIUMAQUAMARINE = new Color(0.4f, 0.8039216f, 0.6666667f);
 
     /**
      * The color medium blue with an RGB value of #0000CD.
      */
-    public static final Color MEDIUMBLUE           = rgb(0x00, 0x00, 0xCD);
+    public static final Color MEDIUMBLUE = new Color(0.0f, 0.0f, 0.8039216f);
 
     /**
      * The color medium orchid with an RGB value of #BA55D3.
      */
-    public static final Color MEDIUMORCHID         = rgb(0xBA, 0x55, 0xD3);
+    public static final Color MEDIUMORCHID = new Color(0.7294118f, 0.33333334f, 0.827451f);
 
     /**
      * The color medium purple with an RGB value of #9370DB.
      */
-    public static final Color MEDIUMPURPLE         = rgb(0x93, 0x70, 0xDB);
+    public static final Color MEDIUMPURPLE = new Color(0.5764706f, 0.4392157f, 0.85882354f);
 
     /**
      * The color medium sea green with an RGB value of #3CB371.
      */
-    public static final Color MEDIUMSEAGREEN       = rgb(0x3C, 0xB3, 0x71);
+    public static final Color MEDIUMSEAGREEN = new Color(0.23529412f, 0.7019608f, 0.44313726f);
 
     /**
      * The color medium slate blue with an RGB value of #7B68EE.
      */
-    public static final Color MEDIUMSLATEBLUE      = rgb(0x7B, 0x68, 0xEE);
+    public static final Color MEDIUMSLATEBLUE = new Color(0.48235294f, 0.40784314f, 0.93333334f);
 
     /**
      * The color medium spring green with an RGB value of #00FA9A.
      */
-    public static final Color MEDIUMSPRINGGREEN    = rgb(0x00, 0xFA, 0x9A);
+    public static final Color MEDIUMSPRINGGREEN = new Color(0.0f, 0.98039216f, 0.6039216f);
 
     /**
      * The color medium turquoise with an RGB value of #48D1CC.
      */
-    public static final Color MEDIUMTURQUOISE      = rgb(0x48, 0xD1, 0xCC);
+    public static final Color MEDIUMTURQUOISE = new Color(0.28235295f, 0.81960785f, 0.8f);
 
     /**
      * The color medium violet red with an RGB value of #C71585.
      */
-    public static final Color MEDIUMVIOLETRED      = rgb(0xC7, 0x15, 0x85);
+    public static final Color MEDIUMVIOLETRED = new Color(0.78039217f, 0.08235294f, 0.52156866f);
 
     /**
      * The color midnight blue with an RGB value of #191970.
      */
-    public static final Color MIDNIGHTBLUE         = rgb(0x19, 0x19, 0x70);
+    public static final Color MIDNIGHTBLUE = new Color(0.09803922f, 0.09803922f, 0.4392157f);
 
     /**
      * The color mint cream with an RGB value of #F5FFFA.
      */
-    public static final Color MINTCREAM            = rgb(0xF5, 0xFF, 0xFA);
+    public static final Color MINTCREAM = new Color(0.9607843f, 1.0f, 0.98039216f);
 
     /**
      * The color misty rose with an RGB value of #FFE4E1.
      */
-    public static final Color MISTYROSE            = rgb(0xFF, 0xE4, 0xE1);
+    public static final Color MISTYROSE = new Color(1.0f, 0.89411765f, 0.88235295f);
 
     /**
      * The color moccasin with an RGB value of #FFE4B5.
      */
-    public static final Color MOCCASIN             = rgb(0xFF, 0xE4, 0xB5);
+    public static final Color MOCCASIN = new Color(1.0f, 0.89411765f, 0.70980394f);
 
     /**
      * The color navajo white with an RGB value of #FFDEAD.
      */
-    public static final Color NAVAJOWHITE          = rgb(0xFF, 0xDE, 0xAD);
+    public static final Color NAVAJOWHITE = new Color(1.0f, 0.87058824f, 0.6784314f);
 
     /**
      * The color navy with an RGB value of #000080.
      */
-    public static final Color NAVY                 = rgb(0x00, 0x00, 0x80);
+    public static final Color NAVY = new Color(0.0f, 0.0f, 0.5019608f);
 
     /**
      * The color old lace with an RGB value of #FDF5E6.
      */
-    public static final Color OLDLACE              = rgb(0xFD, 0xF5, 0xE6);
+    public static final Color OLDLACE = new Color(0.99215686f, 0.9607843f, 0.9019608f);
 
     /**
      * The color olive with an RGB value of #808000.
      */
-    public static final Color OLIVE                = rgb(0x80, 0x80, 0x00);
+    public static final Color OLIVE = new Color(0.5019608f, 0.5019608f, 0.0f);
 
     /**
      * The color olive drab with an RGB value of #6B8E23.
      */
-    public static final Color OLIVEDRAB            = rgb(0x6B, 0x8E, 0x23);
+    public static final Color OLIVEDRAB = new Color(0.41960785f, 0.5568628f, 0.13725491f);
 
     /**
      * The color orange with an RGB value of #FFA500.
      */
-    public static final Color ORANGE               = rgb(0xFF, 0xA5, 0x00);
+    public static final Color ORANGE = new Color(1.0f, 0.64705884f, 0.0f);
 
     /**
      * The color orange red with an RGB value of #FF4500.
      */
-    public static final Color ORANGERED            = rgb(0xFF, 0x45, 0x00);
+    public static final Color ORANGERED = new Color(1.0f, 0.27058825f, 0.0f);
 
     /**
      * The color orchid with an RGB value of #DA70D6.
      */
-    public static final Color ORCHID               = rgb(0xDA, 0x70, 0xD6);
+    public static final Color ORCHID = new Color(0.85490197f, 0.4392157f, 0.8392157f);
 
     /**
      * The color pale goldenrod with an RGB value of #EEE8AA.
      */
-    public static final Color PALEGOLDENROD        = rgb(0xEE, 0xE8, 0xAA);
+    public static final Color PALEGOLDENROD = new Color(0.93333334f, 0.9098039f, 0.6666667f);
 
     /**
      * The color pale green with an RGB value of #98FB98.
      */
-    public static final Color PALEGREEN            = rgb(0x98, 0xFB, 0x98);
+    public static final Color PALEGREEN = new Color(0.59607846f, 0.9843137f, 0.59607846f);
 
     /**
      * The color pale turquoise with an RGB value of #AFEEEE.
      */
-    public static final Color PALETURQUOISE        = rgb(0xAF, 0xEE, 0xEE);
+    public static final Color PALETURQUOISE = new Color(0.6862745f, 0.93333334f, 0.93333334f);
 
     /**
      * The color pale violet red with an RGB value of #DB7093.
      */
-    public static final Color PALEVIOLETRED        = rgb(0xDB, 0x70, 0x93);
+    public static final Color PALEVIOLETRED = new Color(0.85882354f, 0.4392157f, 0.5764706f);
 
     /**
      * The color papaya whip with an RGB value of #FFEFD5.
      */
-    public static final Color PAPAYAWHIP           = rgb(0xFF, 0xEF, 0xD5);
+    public static final Color PAPAYAWHIP = new Color(1.0f, 0.9372549f, 0.8352941f);
 
     /**
      * The color peach puff with an RGB value of #FFDAB9.
      */
-    public static final Color PEACHPUFF            = rgb(0xFF, 0xDA, 0xB9);
+    public static final Color PEACHPUFF = new Color(1.0f, 0.85490197f, 0.7254902f);
 
     /**
      * The color peru with an RGB value of #CD853F.
      */
-    public static final Color PERU                 = rgb(0xCD, 0x85, 0x3F);
+    public static final Color PERU = new Color(0.8039216f, 0.52156866f, 0.24705882f);
 
     /**
      * The color pink with an RGB value of #FFC0CB.
      */
-    public static final Color PINK                 = rgb(0xFF, 0xC0, 0xCB);
+    public static final Color PINK = new Color(1.0f, 0.7529412f, 0.79607844f);
 
     /**
      * The color plum with an RGB value of #DDA0DD.
      */
-    public static final Color PLUM                 = rgb(0xDD, 0xA0, 0xDD);
+    public static final Color PLUM = new Color(0.8666667f, 0.627451f, 0.8666667f);
 
     /**
      * The color powder blue with an RGB value of #B0E0E6.
      */
-    public static final Color POWDERBLUE           = rgb(0xB0, 0xE0, 0xE6);
+    public static final Color POWDERBLUE = new Color(0.6901961f, 0.8784314f, 0.9019608f);
 
     /**
      * The color purple with an RGB value of #800080.
      */
-    public static final Color PURPLE               = rgb(0x80, 0x00, 0x80);
+    public static final Color PURPLE = new Color(0.5019608f, 0.0f, 0.5019608f);
 
     /**
      * The color red with an RGB value of #FF0000.
      */
-    public static final Color RED                  = rgb(0xFF, 0x00, 0x00);
+    public static final Color RED = new Color(1.0f, 0.0f, 0.0f);
 
     /**
      * The color rosy brown with an RGB value of #BC8F8F.
      */
-    public static final Color ROSYBROWN            = rgb(0xBC, 0x8F, 0x8F);
+    public static final Color ROSYBROWN = new Color(0.7372549f, 0.56078434f, 0.56078434f);
 
     /**
      * The color royal blue with an RGB value of #4169E1.
      */
-    public static final Color ROYALBLUE            = rgb(0x41, 0x69, 0xE1);
+    public static final Color ROYALBLUE = new Color(0.25490198f, 0.4117647f, 0.88235295f);
 
     /**
      * The color saddle brown with an RGB value of #8B4513.
      */
-    public static final Color SADDLEBROWN          = rgb(0x8B, 0x45, 0x13);
+    public static final Color SADDLEBROWN = new Color(0.54509807f, 0.27058825f, 0.07450981f);
 
     /**
      * The color salmon with an RGB value of #FA8072.
      */
-    public static final Color SALMON               = rgb(0xFA, 0x80, 0x72);
+    public static final Color SALMON = new Color(0.98039216f, 0.5019608f, 0.44705883f);
 
     /**
      * The color sandy brown with an RGB value of #F4A460.
      */
-    public static final Color SANDYBROWN           = rgb(0xF4, 0xA4, 0x60);
+    public static final Color SANDYBROWN = new Color(0.95686275f, 0.6431373f, 0.3764706f);
 
     /**
      * The color sea green with an RGB value of #2E8B57.
      */
-    public static final Color SEAGREEN             = rgb(0x2E, 0x8B, 0x57);
+    public static final Color SEAGREEN = new Color(0.18039216f, 0.54509807f, 0.34117648f);
 
     /**
      * The color sea shell with an RGB value of #FFF5EE.
      */
-    public static final Color SEASHELL             = rgb(0xFF, 0xF5, 0xEE);
+    public static final Color SEASHELL = new Color(1.0f, 0.9607843f, 0.93333334f);
 
     /**
      * The color sienna with an RGB value of #A0522D.
      */
-    public static final Color SIENNA               = rgb(0xA0, 0x52, 0x2D);
+    public static final Color SIENNA = new Color(0.627451f, 0.32156864f, 0.1764706f);
 
     /**
      * The color silver with an RGB value of #C0C0C0.
      */
-    public static final Color SILVER               = rgb(0xC0, 0xC0, 0xC0);
+    public static final Color SILVER = new Color(0.7529412f, 0.7529412f, 0.7529412f);
 
     /**
      * The color sky blue with an RGB value of #87CEEB.
      */
-    public static final Color SKYBLUE              = rgb(0x87, 0xCE, 0xEB);
+    public static final Color SKYBLUE = new Color(0.5294118f, 0.80784315f, 0.92156863f);
 
     /**
      * The color slate blue with an RGB value of #6A5ACD.
      */
-    public static final Color SLATEBLUE            = rgb(0x6A, 0x5A, 0xCD);
+    public static final Color SLATEBLUE = new Color(0.41568628f, 0.3529412f, 0.8039216f);
 
     /**
      * The color slate gray with an RGB value of #708090.
      */
-    public static final Color SLATEGRAY            = rgb(0x70, 0x80, 0x90);
+    public static final Color SLATEGRAY = new Color(0.4392157f, 0.5019608f, 0.5647059f);
 
     /**
      * The color slate grey with an RGB value of #708090.
@@ -1432,72 +1432,72 @@
     /**
      * The color snow with an RGB value of #FFFAFA.
      */
-    public static final Color SNOW                 = rgb(0xFF, 0xFA, 0xFA);
+    public static final Color SNOW = new Color(1.0f, 0.98039216f, 0.98039216f);
 
     /**
      * The color spring green with an RGB value of #00FF7F.
      */
-    public static final Color SPRINGGREEN          = rgb(0x00, 0xFF, 0x7F);
+    public static final Color SPRINGGREEN = new Color(0.0f, 1.0f, 0.49803922f);
 
     /**
      * The color steel blue with an RGB value of #4682B4.
      */
-    public static final Color STEELBLUE            = rgb(0x46, 0x82, 0xB4);
+    public static final Color STEELBLUE = new Color(0.27450982f, 0.50980395f, 0.7058824f);
 
     /**
      * The color tan with an RGB value of #D2B48C.
      */
-    public static final Color TAN                  = rgb(0xD2, 0xB4, 0x8C);
+    public static final Color TAN = new Color(0.8235294f, 0.7058824f, 0.54901963f);
 
     /**
      * The color teal with an RGB value of #008080.
      */
-    public static final Color TEAL                 = rgb(0x00, 0x80, 0x80);
+    public static final Color TEAL = new Color(0.0f, 0.5019608f, 0.5019608f);
 
     /**
      * The color thistle with an RGB value of #D8BFD8.
      */
-    public static final Color THISTLE              = rgb(0xD8, 0xBF, 0xD8);
+    public static final Color THISTLE = new Color(0.84705883f, 0.7490196f, 0.84705883f);
 
     /**
      * The color tomato with an RGB value of #FF6347.
      */
-    public static final Color TOMATO               = rgb(0xFF, 0x63, 0x47);
+    public static final Color TOMATO = new Color(1.0f, 0.3882353f, 0.2784314f);
 
     /**
      * The color turquoise with an RGB value of #40E0D0.
      */
-    public static final Color TURQUOISE            = rgb(0x40, 0xE0, 0xD0);
+    public static final Color TURQUOISE = new Color(0.2509804f, 0.8784314f, 0.8156863f);
 
     /**
      * The color violet with an RGB value of #EE82EE.
      */
-    public static final Color VIOLET               = rgb(0xEE, 0x82, 0xEE);
+    public static final Color VIOLET = new Color(0.93333334f, 0.50980395f, 0.93333334f);
 
     /**
      * The color wheat with an RGB value of #F5DEB3.
      */
-    public static final Color WHEAT                = rgb(0xF5, 0xDE, 0xB3);
+    public static final Color WHEAT = new Color(0.9607843f, 0.87058824f, 0.7019608f);
 
     /**
      * The color white with an RGB value of #FFFFFF.
      */
-    public static final Color WHITE                = rgb(0xFF, 0xFF, 0xFF);
+    public static final Color WHITE = new Color(1.0f, 1.0f, 1.0f);
 
     /**
      * The color white smoke with an RGB value of #F5F5F5.
      */
-    public static final Color WHITESMOKE           = rgb(0xF5, 0xF5, 0xF5);
+    public static final Color WHITESMOKE = new Color(0.9607843f, 0.9607843f, 0.9607843f);
 
     /**
      * The color yellow with an RGB value of #FFFF00.
      */
-    public static final Color YELLOW               = rgb(0xFF, 0xFF, 0x00);
+    public static final Color YELLOW = new Color(1.0f, 1.0f, 0.0f);
 
     /**
      * The color yellow green with an RGB value of #9ACD32.
      */
-    public static final Color YELLOWGREEN          = rgb(0x9A, 0xCD, 0x32);
+    public static final Color YELLOWGREEN = new Color(0.6039216f, 0.8039216f, 0.19607843f);
 
     /*
      * Named colors moved to nested class to initialize them only when they
@@ -1509,14 +1509,14 @@
 
         private NamedColors() {
         }
-        
+
         private static Color get(String name) {
             return namedColors.get(name);
         }
 
         private static Map<String, Color> createNamedColors() {
             Map<String, Color> colors = new HashMap<String,Color>(256);
-            
+
             colors.put("aliceblue",            ALICEBLUE);
             colors.put("antiquewhite",         ANTIQUEWHITE);
             colors.put("aqua",                 AQUA);
@@ -1669,7 +1669,7 @@
             return colors;
         }
     }
-    
+
     /**
      * The red component of the {@code Color}, in the range {@code 0.0-1.0}.
      *
@@ -1705,7 +1705,7 @@
     private Object platformPaint;
 
     /**
-     * Creates a new isntance of color
+     * Creates a new instance of color
      * @param red red component ranging from {@code 0} to {@code 1}
      * @param green green component ranging from {@code 0} to {@code 1}
      * @param blue blue component ranging from {@code 0} to {@code 1}
@@ -1732,6 +1732,22 @@
     }
 
     /**
+     * Creates a new instance of color. This constructor performs no integrity
+     * checks, and thus should ONLY be used by internal code in Color which
+     * knows that the hard-coded values are correct.
+     *
+     * @param red red component ranging from {@code 0} to {@code 1}
+     * @param green green component ranging from {@code 0} to {@code 1}
+     * @param blue blue component ranging from {@code 0} to {@code 1}
+     * @param opacity opacity ranging from {@code 0} to {@code 1}
+     */
+    private Color(float red, float green, float blue) {
+        this.red = red;
+        this.green = green;
+        this.blue = blue;
+    }
+
+    /**
      * @treatAsPrivate implementation detail
      * @deprecated This is an internal API that is not intended for use and will be removed in the next version
      */
@@ -1777,7 +1793,7 @@
     /**
      * Returns a hash code for this {@code Color} object.
      * @return a hash code for this {@code Color} object.
-     */ 
+     */
     @Override public int hashCode() {
         // construct the 32bit integer representation of this color
         int r = (int)Math.round(red * 255.0);
--- a/javafx-ui-common/test/unit/com/sun/javafx/css/FontTypeTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/test/unit/com/sun/javafx/css/FontTypeTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -64,6 +64,7 @@
 
 import com.sun.javafx.css.converters.FontConverter;
 import com.sun.javafx.css.converters.SizeConverter;
+import com.sun.javafx.css.parser.CSSParser;
 
 
 public class FontTypeTest {
@@ -138,19 +139,40 @@
         
     }
 
-    /**
-     * Test of convert method, of class FontType.
-     */
-//    @Test
-//    public void testConvert_KeyArr() {
-//        System.out.println("convert");
-//        Key[] keys = null;
-//        FontType instance = new FontType();
-//        Font expResult = null;
-//        Font result = instance.convert(keys);
-//        assertEquals(expResult, result);
-//        // TODO review the generated test code and remove the default call to fail.
-//        fail("The test case is a prototype.");
-//    }
+    @Test public void test_RT_21960_Bold_Italic() {
+        
+        ParsedValue pv = CSSParser.getInstance().parseExpr("-fx-font", "italic bold 24 Amble");
+        Font f = (Font)pv.convert(null);
+        assertEquals("Bold Italic", f.getStyle());
+        assertEquals("Amble", f.getFamily());
+        assertEquals(24, f.getSize(),0);
+    }
+    
+    @Test public void test_RT_21960_Bold() {
+        
+        ParsedValue pv = CSSParser.getInstance().parseExpr("-fx-font", "bold 24 Amble");
+        Font f = (Font)pv.convert(null);
+        assertEquals("Bold", f.getStyle());
+        assertEquals("Amble", f.getFamily());
+        assertEquals(24, f.getSize(),0);
+    }
+
+    @Test public void test_RT_21960_Italic() {
+        
+        ParsedValue pv = CSSParser.getInstance().parseExpr("-fx-font", "italic 24 Amble");
+        Font f = (Font)pv.convert(null);
+        assertEquals("Italic", f.getStyle());
+        assertEquals("Amble", f.getFamily());
+        assertEquals(24, f.getSize(),0);
+    }
+
+    @Test public void test_RT_21960_Neither_Bold_Nor_Italic() {
+        
+        ParsedValue pv = CSSParser.getInstance().parseExpr("-fx-font", "24 Amble");
+        Font f = (Font)pv.convert(null);
+        assertEquals("Regular", f.getStyle());
+        assertEquals("Amble", f.getFamily());
+        assertEquals(24, f.getSize(),0);
+    }    
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/test/unit/com/sun/javafx/scene/KeyboardShortcutsTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene;
+
+import javafx.collections.ObservableList;
+import javafx.scene.Group;
+import javafx.scene.Scene;
+import javafx.scene.input.KeyCode;
+import javafx.scene.input.KeyCodeCombination;
+import javafx.scene.input.KeyCombination;
+import javafx.scene.input.Mnemonic;
+import javafx.scene.text.Text;
+import javafx.stage.Stage;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+
+
+/*
+** Test keyboard shortcuts.
+*/
+public final class KeyboardShortcutsTest {
+
+    private Stage stage;
+    private Scene scene;
+
+    @Before
+    public void setUp() {
+        stage = new Stage();
+        scene = new Scene(new Group(), 500, 500);
+        stage.setScene(scene);
+
+        stage.show();
+    }
+
+    @After
+    public void tearDown() {
+        stage = null;
+        scene = null;
+    }
+
+
+    /*
+    ** Add a mnemonic
+    ** Make sure that it's there.
+    */
+    @Test
+    public void addMnemonicTest() {
+        boolean nodeFound = false;
+        final Text node = new Text("text");
+
+        ((Group)scene.getRoot()).getChildren().add(node);
+
+        KeyCodeCombination mnemonicKeyCombo =
+            new KeyCodeCombination(KeyCode.Q,KeyCombination.ALT_DOWN);
+
+        Mnemonic myMnemonic = new Mnemonic(node, mnemonicKeyCombo);
+        scene.addMnemonic(myMnemonic);
+
+        ObservableList<Mnemonic> mnemonicsList = scene.getMnemonics().get(mnemonicKeyCombo);
+        if (mnemonicsList != null) {
+            for (int i = 0 ; i < mnemonicsList.size() ; i++) {
+                if (mnemonicsList.get(i).getNode() == node) {
+                    nodeFound = true;
+                }
+            }
+        }
+        assertTrue(nodeFound);
+    }
+
+
+    /*
+    ** Add a mnemonic, then remove it.
+    ** Make sure that it's gone.
+    */
+    @Test
+    public void addAndRemoveMnemonicTest() {
+        boolean nodeFound = false;
+        final Text node = new Text("text");
+
+        ((Group)scene.getRoot()).getChildren().add(node);
+
+        KeyCodeCombination mnemonicKeyCombo =
+            new KeyCodeCombination(KeyCode.Q,KeyCombination.ALT_DOWN);
+
+        Mnemonic myMnemonic = new Mnemonic(node, mnemonicKeyCombo);
+        scene.addMnemonic(myMnemonic);
+
+        /*
+        ** remove it.....
+        */
+        scene.removeMnemonic(myMnemonic);
+
+        ObservableList<Mnemonic> mnemonicsList = scene.getMnemonics().get(mnemonicKeyCombo);
+        if (mnemonicsList != null) {
+            for (int i = 0 ; i < mnemonicsList.size() ; i++) {
+                if (mnemonicsList.get(i).getNode() == node) {
+                    nodeFound = true;
+                }
+            }
+        }
+        assertTrue(!nodeFound);
+    }
+}
--- a/javafx-ui-common/test/unit/javafx/scene/layout/GridPaneTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/test/unit/javafx/scene/layout/GridPaneTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -2216,4 +2216,27 @@
         assertEquals(200, gridpane.prefWidth(-1), 0);
         assertEquals(200, gridpane.prefHeight(-1), 0);
     }
+    
+    @Test public void test_RT20573_USE_PREF_SIZEisIgnored() {
+        ColumnConstraints cc = new ColumnConstraints();
+        cc.setMinWidth(100);
+        cc.setMaxWidth(Region.USE_PREF_SIZE);
+        
+        ColumnConstraints cc2 = new ColumnConstraints();
+        cc2.setMinWidth(50);
+        cc2.setMaxWidth(Region.USE_PREF_SIZE);        
+        
+        gridpane.getColumnConstraints().addAll(cc, cc2);
+
+        MockResizable child1_0 = new MockResizable(50,50);
+        GridPane.setConstraints(child1_0, 1, 0);        
+        gridpane.getChildren().add(child1_0);
+        
+        gridpane.resize(200,200);
+        gridpane.layout();        
+        double[] cw = gridpane.getColumnWidths();
+
+        assertEquals(100, cw[0], 1e-100);
+        assertEquals(50, cw[1], 1e-100);
+    }
 }
--- a/javafx-ui-common/test/unit/javafx/scene/layout/ResizabilityTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-common/test/unit/javafx/scene/layout/ResizabilityTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -111,13 +111,13 @@
                    text.getLayoutBounds().getHeight() == text.maxHeight(-1));
     }
 
-    @Ignore("Pending RT-19951") @Test public void testParentMinPrefMaxWidthAreEqual() {
+    @Test public void testParentMinPrefMaxWidthAreEqual() {
         Parent parent = new MockParent();
         assertTrue(parent.prefWidth(-1) == parent.minWidth(-1) &&
                    parent.prefWidth(-1) == parent.maxWidth(-1));
     }
     
-    @Ignore("Pending RT-19951") @Test public void testParentMinPrefMaxHeightAreEqual() {
+    @Test public void testParentMinPrefMaxHeightAreEqual() {
         Parent parent = new MockParent();
         assertTrue(parent.prefHeight(-1) == parent.minHeight(-1) &&
                    parent.prefHeight(-1) == parent.maxHeight(-1));
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ButtonBehavior.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ButtonBehavior.java	Tue Jun 05 16:41:13 2012 -0700
@@ -110,12 +110,14 @@
     }
 
     @Override protected void callAction(String name) {
-        if (PRESS_ACTION.equals(name)) {
-            keyPressed();
-        } else if (RELEASE_ACTION.equals(name)) {
-            keyReleased();
-        } else {
-            super.callAction(name);
+        if (!getControl().isDisabled()) {
+            if (PRESS_ACTION.equals(name)) {
+                keyPressed();
+            } else if (RELEASE_ACTION.equals(name)) {
+                keyReleased();
+            } else {
+                super.callAction(name);
+            }
         }
     }
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextFieldBehavior.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextFieldBehavior.java	Tue Jun 05 16:41:13 2012 -0700
@@ -145,8 +145,8 @@
 
         if (textField.getOnAction() != null) {
             textField.fireEvent(new ActionEvent(textField, null));
-        } else if (textField.getParent() != null) {
-            textField.getParent().fireEvent(event);
+        } else {
+            forwardToParent(event);
         }
     }
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java	Tue Jun 05 16:41:13 2012 -0700
@@ -155,6 +155,7 @@
             else if ("SelectEndExtend".equals(name)) selectEndExtend();
             else if ("Undo".equals(name)) undoManager.undo();
             else if ("Redo".equals(name)) undoManager.redo();
+            else if ("ToParent".equals(name)) forwardToParent(lastEvent);
             /*DEBUG*/else if ("UseVK".equals(name) && isEmbedded()) {
                 ((com.sun.javafx.scene.control.skin.TextInputControlSkin)textInputControl.getSkin()).toggleUseVK();
             } else {
@@ -349,6 +350,12 @@
 
     protected void fire(KeyEvent event) { } // TODO move to TextFieldBehavior
 
+    protected void forwardToParent(KeyEvent event) {
+        if (getControl().getParent() != null) {
+            getControl().getParent().fireEvent(event);
+        }
+    }
+
     private void selectHome() {
         getControl().selectHome();
     }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextInputControlBindings.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TextInputControlBindings.java	Tue Jun 05 16:41:13 2012 -0700
@@ -148,6 +148,9 @@
         // Traversal Bindings
         BINDINGS.add(new KeyBinding(TAB, "TraverseNext"));
         BINDINGS.add(new KeyBinding(TAB, "TraversePrevious").shift());
+        // The following keys are forwarded to the parent container
+        BINDINGS.add(new KeyBinding(ESCAPE, "ToParent"));
+        BINDINGS.add(new KeyBinding(F10, "ToParent"));
         // TODO XXX DEBUGGING ONLY
 //        BINDINGS.add(new KeyBinding(F4, "TraverseDebug").alt().ctrl().shift());
         /*DEBUG*/if (PlatformUtil.isEmbedded()) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ButtonSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ButtonSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -108,13 +108,17 @@
 
     Runnable defaultButtonRunnable = new Runnable() {
             public void run() {
-                getSkinnable().fire();
+                if (!getSkinnable().isDisabled()) {
+                    getSkinnable().fire();
+                }
             }
         };
 
     Runnable cancelButtonRunnable = new Runnable() {
-            public void run() {
-                getSkinnable().fire();
+            public void run() {                
+                if (!getSkinnable().isDisabled()) {
+                    getSkinnable().fire();
+                }
             }
         };
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ColorPalette.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ColorPalette.java	Tue Jun 05 16:41:13 2012 -0700
@@ -67,9 +67,18 @@
         owner = colorPicker.getScene().getWindow();
         colorPickerGrid = new ColorPickerGrid(initPaint);
         colorPickerGrid.requestFocus();
+        colorPickerGrid.setFocusTraversable(true);
         customColorLabel.setAlignment(Pos.CENTER_LEFT);
         customColorLink.setPrefWidth(colorPickerGrid.prefWidth(-1));
         customColorLink.setAlignment(Pos.CENTER);
+        customColorLink.setFocusTraversable(true);
+        customColorLink.setVisited(true); // so that it always appears blue 
+        // ColorPalette should hide when save or use button is pressed in CustomColorDialog.
+        final EventHandler<ActionEvent> actionListener = new EventHandler<ActionEvent>() {
+            @Override public void handle(ActionEvent t) {
+                colorPicker.hide();
+            }
+        };
         customColorLink.setOnAction(new EventHandler<ActionEvent>() {
             @Override public void handle(ActionEvent t) {
                 if (customColorDialog == null) {
@@ -91,11 +100,8 @@
                             colorPicker.setValue(customColor);
                         }
                     });
-                    customColorDialog.dialog.showingProperty().addListener(new ChangeListener<Boolean>() {
-                        @Override public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
-                            if (!t1) colorPicker.hide();
-                        }
-                    });
+                    customColorDialog.saveButton.addEventHandler(ActionEvent.ACTION, actionListener);
+                    customColorDialog.useButton.addEventHandler(ActionEvent.ACTION, actionListener);
                 }
                 customColorDialog.setCurrentColor(colorPicker.valueProperty().get());
                 if (popupControl != null) popupControl.setAutoHide(false);
@@ -103,13 +109,10 @@
                 if (popupControl != null) popupControl.setAutoHide(true);
             }
         });
-        colorPicker.addEventHandler(ActionEvent.ACTION, new EventHandler<ActionEvent>() {
-            @Override public void handle(ActionEvent t) {
-            }
-        });
         
         initNavigation();
         customColorGrid.setVisible(false);
+        customColorGrid.setFocusTraversable(true);
         for (Color c : colorPicker.getCustomColors()) {
             customSquares.add(new ColorSquare(c, true));
         }
@@ -379,7 +382,7 @@
         return getInsets().getTop() + totalHeight + getInsets().getBottom();
     }
    
-    public boolean isAddColorDialogShowing() {
+    public boolean isCustomColorDialogShowing() {
         if (customColorDialog != null) return customColorDialog.isVisible();
         return false;
     }
@@ -551,6 +554,10 @@
             setOnMouseDragged(new EventHandler<MouseEvent>() {
                 @Override
                 public void handle(MouseEvent t) {
+                    if (!dragDetected) {
+                        dragDetected = true;
+                        mouseDragColor = colorPicker.getValue();
+                    }
                     int xIndex = (int)(t.getX()/16.0);
                     int yIndex = (int)(t.getY()/16.0);
                         int index = xIndex + yIndex*12;
@@ -560,18 +567,12 @@
                     }
                 }
             });
-            addEventHandler(MouseDragEvent.DRAG_DETECTED, new EventHandler<Event>() {
-                @Override
-                public void handle(Event t) {
-                    dragDetected = true;
-                    mouseDragColor = colorPicker.getValue();
-                }
-            });
             addEventHandler(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {
                 @Override
                 public void handle(MouseEvent t) {
                     if(colorPickerGrid.getBoundsInLocal().contains(t.getX(), t.getY())) {
                         updateSelection(colorPicker.getValue());
+                        colorPicker.fireEvent(new ActionEvent());
                         colorPicker.hide();
                     } else {
                         // restore color as mouse release happened outside the grid.
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ColorPickerSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ColorPickerSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -24,6 +24,7 @@
  */
 package com.sun.javafx.scene.control.skin;
 
+import com.sun.javafx.css.StyleableBooleanProperty;
 import com.sun.javafx.css.StyleableProperty;
 import com.sun.javafx.css.converters.BooleanConverter;
 import java.util.ArrayList;
@@ -42,15 +43,11 @@
 import javafx.scene.shape.Rectangle;
 import com.sun.javafx.scene.control.behavior.ColorPickerBehavior;
 import javafx.scene.control.ColorPicker;
-import com.sun.javafx.scene.control.skin.ColorPalette;
 import javafx.beans.property.BooleanProperty;
-import javafx.beans.property.SimpleBooleanProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
 import javafx.beans.value.WritableValue;
-import javafx.geometry.HPos;
-import javafx.geometry.Point2D;
-import javafx.geometry.VPos;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventType;
 import javafx.scene.paint.Color;
 
 /**
@@ -64,9 +61,20 @@
     private Rectangle colorRect; 
     private ColorPalette popupContent;
 //    private ColorPickerPanel popup = new ColorPickerPanel(Color.WHITE);
-    BooleanProperty colorLabelVisible = new SimpleBooleanProperty(true) {
-        @Override protected void invalidated() {
-            super.invalidated();
+    BooleanProperty colorLabelVisible = new StyleableBooleanProperty(true) {
+        
+        @Override
+        public Object getBean() {
+            return ColorPickerSkin.this;
+        }
+
+        @Override
+        public String getName() {
+            return "colorLabelVisible";
+        }
+        
+        @Override public StyleableProperty getStyleableProperty() {
+            return StyleableProperties.COLOR_LABEL_VISIBLE;
         }
     };
     
@@ -92,7 +100,6 @@
                 });
             }
         }
-        getPopup().setAutoHide(false);
         registerChangeListener(colorPicker.valueProperty(), "VALUE");
     }
     
@@ -169,7 +176,7 @@
             if (getSkinnable().isShowing()) {
                 show();
             } else {
-                if (!popupContent.isAddColorDialogShowing()) hide();
+                if (!popupContent.isCustomColorDialogShowing()) hide();
             }
         } else if (p == "VALUE") {
            // Change the current selected color in the grid if ColorPicker value changes
@@ -183,17 +190,6 @@
         if (displayNode == null) {
             displayNode = new Label();
             displayNode.getStyleClass().add("color-picker-label");
-            // label text
-            if (colorLabelVisible.get()) {
-                displayNode.textProperty().bind(new StringBinding() {
-                    { bind(colorPicker.valueProperty()); }
-                    @Override protected String computeValue() {
-                        return colorValueToWeb(colorPicker.getValue());
-                    }
-                });
-            } else {
-                displayNode.setText("");
-            }
             if (getMode() == ComboBoxMode.BUTTON || getMode() == ComboBoxMode.COMBOBOX) {
                 if (displayNode.getOnMouseReleased() == null) {
                     displayNode.setOnMouseReleased(new EventHandler<MouseEvent>() {
@@ -217,12 +213,14 @@
             icon.getStyleClass().add("picker-color");
             colorRect = new Rectangle(16, 16);
             colorRect.getStyleClass().add("picker-color-rect");
-            colorRect.fillProperty().bind(new ObjectBinding<Color>() {
-                { bind(colorPicker.valueProperty()); }
-                @Override protected Color computeValue() {
-                    return colorPicker.getValue();
+            
+            updateColor();
+            colorPicker.addEventHandler(ActionEvent.ACTION, new EventHandler<ActionEvent>() {
+                @Override
+                public void handle(ActionEvent t) {
+                    updateColor();
                 }
-            });         
+            });
             
             icon.getChildren().add(colorRect);
             displayNode.setGraphic(icon);
@@ -239,6 +237,15 @@
         return displayNode;
     }
     
+    private void updateColor() {
+        final ColorPicker colorPicker = (ColorPicker)getSkinnable();
+        colorRect.setFill(colorPicker.getValue());
+        if (colorLabelVisible.get()) {
+            displayNode.setText(colorValueToWeb(colorPicker.getValue()));
+        } else {
+            displayNode.setText("");
+        }
+    }
     public void syncWithAutoUpdate() {
         if (!getPopup().isShowing() && getSkinnable().isShowing()) {
             // Popup was dismissed. Maybe user clicked outside or typed ESCAPE.
@@ -252,29 +259,55 @@
         super.layoutChildren();
     }
     
+    /***************************************************************************
+    *                                                                         *
+    *                         Stylesheet Handling                             *
+    *                                                                         *
+    **************************************************************************/
+    
      private static class StyleableProperties {
         private static final StyleableProperty<ColorPickerSkin,Boolean> COLOR_LABEL_VISIBLE = 
                 new StyleableProperty<ColorPickerSkin,Boolean>("-fx-color-label-visible",
-                BooleanConverter.getInstance(), false) {
+                BooleanConverter.getInstance(), Boolean.TRUE) {
+
+            @Override public WritableValue<Boolean> getWritableValue(ColorPickerSkin n) {
+                return n.colorLabelVisible;
+            }
 
             @Override
             public boolean isSettable(ColorPickerSkin n) {
                 return n.colorLabelVisible == null || !n.colorLabelVisible.isBound();
             }
-
-            @Override public WritableValue<Boolean> getWritableValue(ColorPickerSkin n) {
-                return n.colorLabelVisible;
-            }
         };
         private static final List<StyleableProperty> STYLEABLES;
         static {
             final List<StyleableProperty> styleables =
-                new ArrayList<StyleableProperty>(ComboBoxBase.impl_CSS_STYLEABLES());
+                new ArrayList<StyleableProperty>(ComboBoxBaseSkin.impl_CSS_STYLEABLES());
             Collections.addAll(styleables,
                 COLOR_LABEL_VISIBLE
             );
             STYLEABLES = Collections.unmodifiableList(styleables);
         }
     }
+     
+     /**
+     * @treatAsPrivate implementation detail
+     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     */
+    @Deprecated
+     public static List<StyleableProperty> impl_CSS_STYLEABLES() {
+         return StyleableProperties.STYLEABLES;
+     }
+
+    /**
+     * RT-19263
+     * @treatAsPrivate implementation detail
+     * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
+     */
+    @Deprecated
+    public List<StyleableProperty> impl_getStyleableProperties() {
+        return impl_CSS_STYLEABLES();
+    }
+
     
 }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/CustomColorDialog.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/CustomColorDialog.java	Tue Jun 05 16:41:13 2012 -0700
@@ -46,6 +46,7 @@
 import javafx.stage.Window;
 import com.sun.javafx.Utils;
 import javafx.geometry.Insets;
+import javafx.scene.input.KeyEvent;
 /**
  *
  * @author paru
@@ -73,8 +74,11 @@
     ObjectProperty<Color> customColorProperty = new SimpleObjectProperty<Color>(Color.TRANSPARENT);
     boolean saveCustomColor = false;
     boolean useCustomColor = false;
+    Button saveButton;
+    Button useButton;
     
     private WebColorField webField = null;
+    private Scene customScene;
     
     public CustomColorDialog(Window owner) {
         getStyleClass().add("custom-color-dialog");
@@ -85,12 +89,23 @@
         colorRectPane = new ColorRectPane();
         controlsPane = new ControlsPane();
         
-        Scene scene = new Scene(this);
+        customScene = new Scene(this);
         getChildren().addAll(colorRectPane, controlsPane);
         
-        dialog.setScene(scene);
+        dialog.setScene(customScene);
+        dialog.addEventHandler(KeyEvent.ANY, keyEventListener);
     }
     
+    private final EventHandler<KeyEvent> keyEventListener = new EventHandler<KeyEvent>() {
+        @Override public void handle(KeyEvent e) {
+            switch (e.getCode()) {
+                case ESCAPE :
+                    dialog.setScene(null);
+                    dialog.close();
+            }
+        }
+    };
+    
     public void setCurrentColor(Color currentColor) {
         this.currentColor = currentColor;
         controlsPane.currentColorRect.setFill(currentColor);
@@ -101,6 +116,7 @@
             dialog.setX(x);
             dialog.setY(y);
         }
+        if (dialog.getScene() == null) dialog.setScene(customScene);
         colorRectPane.updateValues();
         dialog.show();
     }
@@ -458,7 +474,7 @@
             Rectangle spacer = new Rectangle(0, 12);
             
             whiteBox = new StackPane();
-            whiteBox.getStyleClass().add("addcolor-controls-background");
+            whiteBox.getStyleClass().add("customcolor-controls-background");
             
             hsbButton = new ToggleButton("HSB");
             hsbButton.setId("toggle-button-left");
@@ -552,7 +568,7 @@
             
             buttonBox = new HBox(4);
             
-            Button saveButton = new Button("Save");
+            saveButton = new Button("Save");
             saveButton.setOnAction(new EventHandler<ActionEvent>() {
                 @Override public void handle(ActionEvent t) {
                     saveCustomColor = true;
@@ -568,7 +584,7 @@
                 }
             });
             
-            Button useButton = new Button("Use");
+            useButton = new Button("Use");
             useButton.setOnAction(new EventHandler<ActionEvent>() {
                 @Override public void handle(ActionEvent t) {
                     useCustomColor = true;
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -163,11 +163,14 @@
 
                         if (vkPopup == null) {
                             vkPopup = new Popup();
-                            vkPopup.focusedProperty().addListener(new InvalidationListener() {
-                                @Override public void invalidated(Observable ov) {
-                                    scene.getWindow().requestFocus();
-                                }
-                            });
+
+                            // RT-21860 - This is causing
+                            // IllegalStateException: The window must be focused when calling grabFocus()
+                            //vkPopup.focusedProperty().addListener(new InvalidationListener() {
+                            //    @Override public void invalidated(Observable ov) {
+                            //        scene.getWindow().requestFocus();
+                            //    }
+                            //});
 
                             double screenHeight =
                                 com.sun.javafx.Utils.getScreen(attachedNode).getBounds().getHeight();
@@ -547,6 +550,7 @@
             setContentDisplay(ContentDisplay.TOP);
             setGraphicTextGap(-16);
             setText(chars[0]);
+            setId(chars[0]);
             if (getText().length() > 1) {
                 getStyleClass().add("multi-char-key");
             }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Tue Jun 05 16:41:13 2012 -0700
@@ -36,6 +36,8 @@
 import javafx.geometry.Pos;
 import javafx.geometry.VPos;
 import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
 import javafx.scene.control.ContentDisplay;
 import javafx.scene.control.Label;
 import javafx.scene.control.Labeled;
@@ -151,6 +153,7 @@
         registerChangeListener(labeled.textOverrunProperty(), "TEXT_OVERRUN");
         registerChangeListener(labeled.wrapTextProperty(), "WRAP_TEXT");
         registerChangeListener(labeled.underlineProperty(), "UNDERLINE");
+        registerChangeListener(labeled.parentProperty(), "PARENT");
     }
 
     /***************************************************************************
@@ -219,6 +222,8 @@
             textMetricsChanged();
         } else if (p == "UNDERLINE") {
             textMetricsChanged();
+        } else if (p == "PARENT") {
+            parentChanged();
         }
     }
 
@@ -265,6 +270,57 @@
         requestLayout();
     }
 
+    /*
+    ** parent has changed,
+    ** if it's null then remove any mnemonics from the scene,
+    ** if it's valid then check to see if mnemonics should
+    ** be added
+    */
+    private void parentChanged() {
+        final Labeled labeled = getSkinnable();
+        Parent newParent = labeled.getParent();
+
+        if (newParent == null) {
+            /*
+            ** we're here because we lost our parent
+            ** tidy up any mnemonics that may have been
+            ** left on the scene
+            */
+            if (mnemonicScene != null) {
+                KeyCodeCombination mnemonicKeyCombo =
+                    new KeyCodeCombination(
+                                           mnemonicCode,
+                                           com.sun.javafx.PlatformUtil.isMac()
+                                           ? KeyCombination.META_DOWN
+                                           : KeyCombination.ALT_DOWN);
+
+                Mnemonic myMnemonic = new Mnemonic(labeledNode, mnemonicKeyCombo);
+                mnemonicScene.removeMnemonic(myMnemonic);
+                mnemonicScene = null;
+            }
+        }
+        else {
+            /*
+            ** we're here because we just got a parent,
+            ** add any mnemonics etc to the scene.
+            */
+            if (containsMnemonic == true) {
+                KeyCodeCombination mnemonicKeyCombo =
+                    new KeyCodeCombination(
+                                           mnemonicCode,
+                                           com.sun.javafx.PlatformUtil.isMac()
+                                           ? KeyCombination.META_DOWN
+                                           : KeyCombination.ALT_DOWN);
+
+                if (labeledNode != null) {
+                    Mnemonic myMnemonic = new Mnemonic(labeledNode, mnemonicKeyCombo);
+                    mnemonicScene = labeledNode.getParent().getScene();
+                    mnemonicScene.addMnemonic(myMnemonic);
+                }
+            }
+        }
+    }
+
     /**
      * Marks minWidth as being invalid and in need of recomputation.
      */
@@ -321,7 +377,6 @@
                 ** are we no longer a mnemonic, or have we changed code?
                 */
                 if (mnemonicIndex == -1 || (bindings != null && bindings.getMnemonic() != mnemonicCode)) {
-
                     KeyCodeCombination mnemonicKeyCombo =
                             new KeyCodeCombination(
                                     mnemonicCode,
@@ -329,18 +384,10 @@
                                             ? KeyCombination.META_DOWN
                                             : KeyCombination.ALT_DOWN);
 
-                    ObservableList<Mnemonic> mnemonicsList = (ObservableList)getSkinnable().getParent().getScene().getMnemonics().get(mnemonicKeyCombo);
-
-                    if (mnemonicsList != null) {
-                        for (int i = 0 ; i < mnemonicsList.size() ; i++) {
-
-                            if (mnemonicsList.get(i).getNode() == labeledNode) {
-                                mnemonicsList.remove(i);
-                            }
-                        }
-                    }
+                    Mnemonic myMnemonic = new Mnemonic(labeledNode, mnemonicKeyCombo);
+                    mnemonicScene.removeMnemonic(myMnemonic);
                     containsMnemonic = false;
-                    mnemonicCode = null;
+                    mnemonicScene = null;
                 }
             }
 
@@ -359,10 +406,12 @@
                                             ? KeyCombination.META_DOWN
                                             : KeyCombination.ALT_DOWN);
 
-
                     if (labeledNode != null) {
                         Mnemonic myMnemonic = new Mnemonic(labeledNode, mnemonicKeyCombo);
-                        labeledNode.getParent().getScene().addMnemonic(myMnemonic);
+                        if (labeledNode.getParent() != null) {
+                            mnemonicScene = labeledNode.getParent().getScene();
+                            mnemonicScene.addMnemonic(myMnemonic);
+                        }
                     }
                 }
             }
@@ -783,6 +832,7 @@
     Line mnemonic_underscore;
 
     private boolean containsMnemonic = false;
+    private Scene mnemonicScene = null;
     private KeyCode mnemonicCode;
     // needs to be an object, as MenuItem isn't a node
     private Node labeledNode = null;
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuBarSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuBarSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -167,6 +167,7 @@
                                 if (openMenu == null) return;
                                 if ( !openMenu.isShowing()) {
                                     selectPrevMenu(); // just move the selection bar
+                                    event.consume();
                                     return;
                                 }
                                 showPrevMenu();
@@ -180,6 +181,7 @@
                                 if (openMenu == null) return;
                                 if (! openMenu.isShowing()) {
                                     selectNextMenu(); // just move the selection bar
+                                    event.consume();
                                     return;
                                 }
                                 showNextMenu();
@@ -525,6 +527,7 @@
                         }
                         openMenuButton = menuButton;
                         openMenu = menu;
+                        if (!menu.isShowing())menu.show();
                     }
                 }
             });
@@ -753,6 +756,8 @@
         } else {
             focusedMenuIndex--;
         }
+        // RT-19359
+        if (getSkinnable().getMenus().get(focusedMenuIndex).isDisable()) return findPreviousSibling();
         clearMenuButtonHover();
         return getSkinnable().getMenus().get(focusedMenuIndex);
     }
@@ -764,6 +769,8 @@
         } else {
             focusedMenuIndex++;
         }
+        // RT_19359
+        if (getSkinnable().getMenus().get(focusedMenuIndex).isDisable()) return findNextSibling();
         clearMenuButtonHover();
         return getSkinnable().getMenus().get(focusedMenuIndex);
     }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Tue Jun 05 16:41:13 2012 -0700
@@ -59,21 +59,21 @@
      *                                                                         *
      **************************************************************************/
     
-    public NestedTableColumnHeader(TableView table, TableColumn tc) {
+    NestedTableColumnHeader(TableView table, TableColumn tc) {
         super(table, tc);
 
         getStyleClass().setAll("nested-column-header");
         setFocusTraversable(false);
 
         initUI();
-
+        
         // watching for changes to the view columns in either table or tableColumn.
         if (getTableColumn() == null && getTableView() != null) {
             setColumns(getTableView().getColumns());
         } else if (getTableColumn() != null) {
             setColumns(getTableColumn().getColumns());
         }
-        getColumns().addListener(weakColumnsListener);
+//        getColumns().addListener(weakColumnsListener);
     }
     
     
@@ -136,10 +136,18 @@
      * It does NOT include ANY of the children of these columns, if any exist.
      */
     private ObservableList<? extends TableColumn> columns;
-    public ObservableList<? extends TableColumn> getColumns() { return columns; }
-    public void setColumns(ObservableList<? extends TableColumn> newColumns) {
+    ObservableList<? extends TableColumn> getColumns() { return columns; }
+    void setColumns(ObservableList<? extends TableColumn> newColumns) {
+        if (this.columns != null) {
+            this.columns.removeListener(weakColumnsListener);
+        }
+        
         this.columns = newColumns;  
         
+        if (this.columns != null) {
+            this.columns.addListener(weakColumnsListener);
+        }
+        
         // update the column headers....
         
         // iterate through all current headers, telling them to clean up
@@ -370,7 +378,7 @@
     /* **************************/
 
     @Override protected void layoutChildren() {
-        double w = snapSize(getWidth()) - snapSpace(getInsets().getLeft()) - snapSpace(getInsets().getRight());
+        double w = getWidth() - getInsets().getLeft() - getInsets().getRight();
         double h = getHeight() - getInsets().getTop() - getInsets().getBottom();
         
         int labelHeight = (int) label.prefHeight(-1);
@@ -387,7 +395,7 @@
         for (TableColumnHeader n : getColumnHeaders()) {
             if (! n.isVisible()) continue;
             
-            double prefWidth = snapSize(n.prefWidth(-1));
+            double prefWidth = n.prefWidth(-1);
 //            double prefHeight = n.prefHeight(-1);
 
             // position the column header in the default location...
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/PaginationSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/PaginationSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -379,7 +379,7 @@
         // created and visible == true.
         if (!nextStackPane.isVisible()) {
             if (!createPage(nextStackPane, currentAnimatedIndex)) {
-                // The page does not exist just return without starting
+                // The next page does not exist just return without starting
                 // any animation.
                 return;
             }
@@ -628,6 +628,26 @@
     @Override protected void handleControlPropertyChanged(String p) {
         super.handleControlPropertyChanged(p);
         if (p == "PAGE_FACTORY") {
+            if (animate && timeline != null) {
+                // If we are in the middle of a page animation.
+                // Speedup and finish the animation then update the page factory.
+                timeline.setRate(8);
+                timeline.setOnFinished(new EventHandler<ActionEvent>() {
+                    @Override
+                    public void handle(ActionEvent arg0) {
+                        // Create a new page by removing the children.
+                        currentStackPane.getChildren().clear();
+                        nextStackPane.getChildren().clear();
+                        resetIndexes(false);
+                        navigation.initializePageIndicators();
+                        navigation.updatePageIndicators();
+                    }
+                });
+                return;
+            }
+            // Create a new page by removing the children.
+            currentStackPane.getChildren().clear();
+            nextStackPane.getChildren().clear();
             resetIndexes(false);
             navigation.initializePageIndicators();
             navigation.updatePageIndicators();
@@ -654,15 +674,15 @@
         double right = snapSpace(getInsets().getRight());
         double navigationWidth = navigation.isVisible() ? snapSize(navigation.minWidth(height)) : 0;
         return left + Math.max(currentStackPane.minWidth(height), navigationWidth) + right;
-    }   
-    
+    }
+
     @Override protected double computeMinHeight(double width) {
         double top = snapSpace(getInsets().getTop());
         double bottom = snapSpace(getInsets().getBottom());
         double navigationHeight = navigation.isVisible() ? snapSize(navigation.minHeight(width)) : 0;
         return top + currentStackPane.minHeight(width) + navigationHeight + bottom;
-    }    
-    
+    }
+
     @Override protected double computePrefWidth(double height) {
         double left = snapSpace(getInsets().getLeft());
         double right = snapSpace(getInsets().getRight());
@@ -788,6 +808,7 @@
         // Create the indicators using fromIndex and toIndex.
         private void initializePageIndicators() {
             if (!indicatorButtons.getToggles().isEmpty()) {
+                previousIndicatorCount = 0;
                 controlBox.getChildren().clear();
                 indicatorButtons.getToggles().clear();
             }
@@ -1162,9 +1183,12 @@
 
         private void setIndicatorType() {
             if (getSkinnable().getStyleClass().contains(Pagination.STYLE_CLASS_BULLET)) {
-                getStyleClass().addAll("bullet-button");
+                getStyleClass().remove("number-button");
+                getStyleClass().add("bullet-button");
+                setText(null);
             } else {
-                getStyleClass().addAll("number-button");
+                getStyleClass().remove("bullet-button");
+                getStyleClass().add("number-button");
                 setText(Integer.toString(this.pageNumber + 1));
             }
         }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/SplitPaneSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/SplitPaneSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -490,7 +490,7 @@
     private boolean resize = false;
 
     @Override protected void layoutChildren() {
-        if (!getSkinnable().isVisible()) {
+        if (!getSkinnable().isVisible() || (horizontal ? getWidth() == 0 : getHeight() == 0)) {
             return;
         }
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -100,8 +100,8 @@
     }
 
     /**
-     * VERY HACKY - this lets us 'duplicate' ImageView nodes to be used in a
-     * Tab and the tabs menu at the same time. Any other Node type is ignored.
+     * VERY HACKY - this lets us 'duplicate' Label and ImageView nodes to be used in a
+     * Tab and the tabs menu at the same time.
      */
     private static Node clone(Node n) {
         if (n == null) {
@@ -113,6 +113,11 @@
             imageview.setImage(iv.getImage());
             return imageview;
         }
+        if (n instanceof Label) {            
+            Label l = (Label)n;
+            Label label = new Label(l.getText(), l.getGraphic());
+            return label;
+        }
         return null;
     }
     private static final double ANIMATION_SPEED = 300;
@@ -1610,7 +1615,7 @@
             ToggleGroup group = new ToggleGroup();
             ObservableList<RadioMenuItem> menuitems = FXCollections.<RadioMenuItem>observableArrayList();
             for (final Tab tab : getSkinnable().getTabs()) {
-                TabMenuItem item = new TabMenuItem(tab);
+                TabMenuItem item = new TabMenuItem(tab);                
                 item.setToggleGroup(group);
                 item.setOnAction(new EventHandler<ActionEvent>() {
                     @Override public void handle(ActionEvent t) {
@@ -1636,9 +1641,16 @@
 
     class TabMenuItem extends RadioMenuItem {
         Tab tab;
-        public TabMenuItem(Tab tab) {
-            super(tab.getText(), TabPaneSkin.clone(tab.getGraphic()));
+        public TabMenuItem(final Tab tab) {
+            super(tab.getText(), TabPaneSkin.clone(tab.getGraphic()));                        
             this.tab = tab;
+            setDisable(tab.isDisable());
+            tab.disableProperty().addListener(new InvalidationListener() {
+                @Override
+                public void invalidated(Observable arg0) {
+                    setDisable(tab.isDisable());
+                }
+            });                   
         }
 
         public Tab getTab() {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Jun 05 16:41:13 2012 -0700
@@ -387,10 +387,9 @@
         // we do not support sorting in embedded devices
         if (! isSortingEnabled()) return;
         
+        isSortColumn = sortPos != -1;
         if (! isSortColumn) return;
         
-        isSortColumn = sortPos != -1;
-        
         final int sortColumnCount = getTableView().getSortOrder().size();
         boolean showSortOrderDots = sortPos <= 3 && sortColumnCount > 1;
         
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -749,18 +749,8 @@
         paragraphNodes.getChildren().add(i, paragraphNode);
 
         paragraphNode.fontProperty().bind(font);
-        paragraphNode.fillProperty().bind(new ObjectBinding<Paint>() {
-            { bind(textFill); }
-            @Override protected Paint computeValue() {
-                return textFill.get();
-            }
-        });
-        paragraphNode.impl_selectionFillProperty().bind(new ObjectBinding<Paint>() {
-            { bind(highlightTextFill, textFill, textArea.focusedProperty()); }
-            @Override protected Paint computeValue() {
-                return textArea.isFocused() ? highlightTextFill.get() : textFill.get();
-            }
-        });
+        paragraphNode.fillProperty().bind(textFill);
+        paragraphNode.impl_selectionFillProperty().bind(highlightTextFill);
     }
 
     @Override public void layoutChildren() {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Tue Jun 05 16:41:13 2012 -0700
@@ -253,12 +253,7 @@
             }
         });
         textNode.fillProperty().bind(textFill);
-        textNode.impl_selectionFillProperty().bind(new ObjectBinding<Paint>() {
-            { bind(highlightTextFill, textFill, textField.focusedProperty()); }
-            @Override protected Paint computeValue() {
-                return textField.isFocused() ? highlightTextFill.get() : textFill.get();
-            }
-        });
+        textNode.impl_selectionFillProperty().bind(highlightTextFill);
         // updated by listener on caretPosition to ensure order
         textNode.impl_caretPositionProperty().set(textField.getCaretPosition());
         textField.selectionProperty().addListener(new InvalidationListener() {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css	Tue Jun 05 16:41:13 2012 -0700
@@ -3243,23 +3243,23 @@
     -fx-background-color: -fx-background;
 }
 /* -------- Toggle Button ---------------- */
-.controls-pane .toggle-button {
+.custom-color-dialog .controls-pane .toggle-button {
     -fx-background-radius: 4, 4, 3, 2;
     -fx-padding: 3 6 3 6;
 }
 
-.controls-pane .toggle-button:focused {
+.custom-color-dialog .controls-pane .toggle-button:focused {
     -fx-background-color:
         rgba(23,134,248,0.2),
         -fx-focus-color,
         -fx-inner-border,
         -fx-body-color;
 }
-.controls-pane .toggle-button:selected Text {
+.custom-color-dialog .controls-pane .toggle-button:selected Text {
     -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.9) , 2, 0.0 , 0 , 1 );
 }
 
-.controls-pane .toggle-button:selected {
+.custom-color-dialog .controls-pane .toggle-button:selected {
     -fx-background-color:
         -fx-shadow-highlight-color,
         linear-gradient( to bottom, derive(-fx-color,-90%) 0%, derive(-fx-color,-60%) 100% ),        
@@ -3269,23 +3269,23 @@
     /* TODO: -fx-text-fill should be derived */
     -fx-text-fill: -fx-light-text-color;
 }
-.controls-pane #toggle-button-left {
+.custom-color-dialog .controls-pane #toggle-button-left {
     -fx-background-radius: 3 0 0 3;
     -fx-background-insets: 0 0 -1 0, 0, 1 0 1 1, 2 0 2 2;
     -fx-border-color: transparent -fx-outer-border transparent transparent;
     -fx-border-insets: 4 0 4 0;
     -fx-padding: -2 8 -2 8;
 }
-.controls-pane #toggle-button-left:focused {
+.custom-color-dialog .controls-pane #toggle-button-left:focused {
 	-fx-background-radius: 3 0 0 3;
 	-fx-background-insets: -1.4 0 -1.4 -1.4, 0 0 0 0, 1, 2;
 	-fx-border-color: transparent;
 }
-.controls-pane #toggle-button-left:selected, .controls-pane #toggle-button-left:selected:focused {
+.custom-color-dialog .controls-pane #toggle-button-left:selected, .controls-pane #toggle-button-left:selected:focused {
         -fx-background-insets: 0 0 -1 0, 0, 1 0 1 1, 1 0 1 1;
 	-fx-border-color: transparent;
 }
-.controls-pane #toggle-button-center {
+.custom-color-dialog .controls-pane #toggle-button-center {
 	-fx-background-radius: 0;
         -fx-background-insets: 0;
 	-fx-background-insets: 0 0 -1 0, 0, 1 0 1 0, 2 0 2 0;
@@ -3293,44 +3293,44 @@
         -fx-border-insets: 4 0 4 0;
 	-fx-padding: -2 8 -2 8;
 }
-.controls-pane #toggle-button-center:focused {
+.custom-color-dialog .controls-pane #toggle-button-center:focused {
 	-fx-background-radius: 0;
 	-fx-background-insets: -1.4 0 -1.4 -1, 0 0 0 -1, 1 1 1 0, 2 2 2 1;
 	-fx-border-color: transparent;
 }
-.controls-pane #toggle-button-center:selected, .controls-pane #toggle-button-center:selected:focused {
+.custom-color-dialog .controls-pane #toggle-button-center:selected, .controls-pane #toggle-button-center:selected:focused {
 	-fx-background-insets: -1.4 0 -1.4 -1, 0 0 0 -1, 1 1 1 0, 1 1 1 0;
 	-fx-border-color: transparent;
 }
 
-.controls-pane #toggle-button-right {
+.custom-color-dialog .controls-pane #toggle-button-right {
 	-fx-background-radius: 0 3 3 0;
     -fx-background-insets: 0 0 -1 0, 0, 1 1 1 0, 2 2 2 0;
 	-fx-padding: 3 8 3 8;
 }
-.controls-pane #toggle-button-right:focused {
+.custom-color-dialog .controls-pane #toggle-button-right:focused {
 	-fx-background-radius: 0 3 3 0;
 	-fx-background-insets: -1.4 -1.4 -1.4 -1, 0 0 0 -1, 1 1 1 0, 2 2 2 1;
 }
-.controls-pane #toggle-button-right:selected, .controls-pane #toggle-button-right:selected:focused {
+.custom-color-dialog .controls-pane #toggle-button-right:selected, .controls-pane #toggle-button-right:selected:focused {
 	-fx-background-insets: -1.4 -1.4 -1.4 -1, 0 0 0 -1, 1 1 1 0, 1 1 1 0;
 }
 
-.controls-pane .current-new-color-grid #transparent-current, .controls-pane .current-new-color-grid #transparent-new {
+.custom-color-dialog .controls-pane .current-new-color-grid #transparent-current, .controls-pane .current-new-color-grid #transparent-new {
     -fx-background-image: url("pattern-transparent.png"); 
     -fx-background-repeat: repeat;
     -fx-background-size: auto;
     -fx-padding: 9 64 9 64;
 }
 
-.controls-pane .addcolor-controls-background {
+.custom-color-dialog .controls-pane .customcolor-controls-background {
     -fx-background-color: -fx-text-box-border, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: 0, 1, 2;
     -fx-background-radius: 3, 2, 2;
     -fx-padding: 3 5 3 5;
 }
 
-.controls-pane .alpha-settings .text-field {
+.custom-color-dialog .controls-pane .alpha-settings .text-field {
 /*    -fx-background-color: -fx-shadow-highlight-color, -fx-text-box-border, -fx-control-inner-background;*/
     -fx-background-color: -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: 0, 1;
@@ -3341,15 +3341,15 @@
     -fx-cursor: text;
 }
 
-.controls-pane .current-new-color-grid .label {
+.custom-color-dialog .controls-pane .current-new-color-grid .label {
     -fx-padding: 0 0 0 5;
 }
 
-#input-text-field {
+.custom-color-dialog #input-text-field {
     -fx-skin: "com.sun.javafx.scene.control.skin.TextFieldSkin";
 }
 
-.input-field {
+.custom-color-dialog .input-field {
     -fx-skin: "com.sun.javafx.scene.control.skin.InputFieldSkin";
     -fx-background-color: -fx-shadow-highlight-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: 0, 1, 2;
@@ -3359,17 +3359,17 @@
     -fx-cursor: text;
 }
 
-.input-field:focused {
+.custom-color-dialog .input-field:focused {
     -fx-background-color: -fx-focus-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: -0.4, 1, 2;
     -fx-background-radius: 3.4, 2, 2;
 }
 
-.input-field:disabled {
+.custom-color-dialog .input-field:disabled {
     -fx-opacity: -fx-disabled-opacity;
 }
 
-.integer-field {
+.custom-color-dialog .integer-field {
     -fx-skin: "com.sun.javafx.scene.control.skin.IntegerFieldSkin";
     -fx-background-color: -fx-shadow-highlight-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: 0, 1, 2;
@@ -3379,7 +3379,7 @@
     -fx-cursor: text;
 }
 
-.integer-field:focused {
+.custom-color-dialog .integer-field:focused {
     -fx-background-color: -fx-focus-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: -0.4, 1, 2;
     -fx-background-radius: 3.4, 2, 2;
@@ -3389,7 +3389,7 @@
     -fx-opacity: -fx-disabled-opacity;
 }*/
 
-.double-field {
+.custom-color-dialog .double-field {
     -fx-skin: "com.sun.javafx.scene.control.skin.DoubleFieldSkin";
     -fx-background-color: -fx-shadow-highlight-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: 0, 1, 2;
@@ -3399,18 +3399,18 @@
     -fx-cursor: text;
 }
 
-.double-field:focused {
+.custom-color-dialog .double-field:focused {
     -fx-background-color: -fx-focus-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: -0.4, 1, 2;
     -fx-background-radius: 3.4, 2, 2;
 }
 
-.double-field:disabled {
+.custom-color-dialog .double-field:disabled {
     -fx-opacity: -fx-disabled-opacity;
 }
 
 
-.webcolor-field {
+.custom-color-dialog .webcolor-field {
     -fx-skin: "com.sun.javafx.scene.control.skin.WebColorFieldSkin";
     -fx-background-color: -fx-shadow-highlight-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: 0, 1, 2;
@@ -3420,13 +3420,13 @@
     -fx-cursor: text;
 }
 
-.webcolor-field:focused {
+.custom-color-dialog .webcolor-field:focused {
     -fx-background-color: -fx-focus-color, -fx-text-box-border, -fx-control-inner-background;
     -fx-background-insets: -0.4, 1, 2;
     -fx-background-radius: 3.4, 2, 2;
 }
 
-.webcolor-field:disabled {
+.custom-color-dialog .webcolor-field:disabled {
     -fx-opacity: -fx-disabled-opacity;
 }
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/resources/controls.properties	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/resources/controls.properties	Tue Jun 05 16:41:13 2012 -0700
@@ -1,7 +1,3 @@
-# Labeled
-# The ellipsis shown when truncating text.
-Labeled.defaultEllipsisString=...
-
 # ProgressIndicator, the string that's displayed at 100%
 ProgressIndicator.doneString=Done
 
--- a/javafx-ui-controls/src/javafx/scene/control/CheckBox.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/CheckBox.java	Tue Jun 05 16:41:13 2012 -0700
@@ -60,7 +60,7 @@
  * state.
  *
  * <p>Example:
- * <pre><code>Checkbox cb = new Checkbox("a checkbox");
+ * <pre><code>CheckBox cb = new CheckBox("a checkbox");
  * cb.setIndeterminate(false);</code></pre>
  *
  * <p>
--- a/javafx-ui-controls/src/javafx/scene/control/ColorPicker.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/ColorPicker.java	Tue Jun 05 16:41:13 2012 -0700
@@ -100,6 +100,10 @@
         setValue(color);
         getStyleClass().add(DEFAULT_STYLE_CLASS);
     }
+    
+    @Override void valueInvalidated() {
+        // do nothing - we dont want to fire action event when value changes.
+    }
     /***************************************************************************
      *                                                                         *
      * Stylesheet Handling                                                     *
--- a/javafx-ui-controls/src/javafx/scene/control/ComboBox.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/ComboBox.java	Tue Jun 05 16:41:13 2012 -0700
@@ -230,10 +230,6 @@
             @Override public void invalidated(Observable o) {
                 // when editable changes, we reset the selection / value states
                 getSelectionModel().clearSelection();
-                
-                // we also change the editor property so that it is null when
-                // editable is false, and non-null when it is true.
-                updateEditor();
             }
         });
     }
@@ -345,6 +341,7 @@
     
     
     // --- Editor
+    private FocusableTextField textField;
     /**
      * The editor for the ComboBox. The editor is null if the ComboBox is not
      * {@link #editableProperty() editable}.
@@ -354,8 +351,12 @@
         return editorProperty().get(); 
     }
     public final ReadOnlyObjectProperty<TextField> editorProperty() { 
-        if (editor == null || (editor.get() == null && isEditable())) {
-            updateEditor();
+        if (editor == null) {
+            editor = new ReadOnlyObjectWrapper<TextField>(this, "editor");
+            textField = new FocusableTextField();
+            textField.promptTextProperty().bindBidirectional(promptTextProperty());
+            textField.tooltipProperty().bind(tooltipProperty());
+            editor.set(textField);
         }
         return editor.getReadOnlyProperty(); 
     }
@@ -386,23 +387,8 @@
      *                                                                         *
      **************************************************************************/        
 
-    private FocusableTextField textField;
     
-    private void updateEditor() {
-        if (editor == null) {
-            editor = new ReadOnlyObjectWrapper<TextField>(this, "editor");
-        }
-        
-        if (isEditable()) {
-            textField = new FocusableTextField();
-            textField.promptTextProperty().bindBidirectional(promptTextProperty());
-            textField.tooltipProperty().bind(tooltipProperty());
-            editor.set(textField);
-        } else {
-            textField = null;
-            editor.set(null);
-        }
-    }
+    
 
     
     
--- a/javafx-ui-controls/src/javafx/scene/control/ComboBoxBase.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/ComboBoxBase.java	Tue Jun 05 16:41:13 2012 -0700
@@ -113,7 +113,9 @@
         getStyleClass().add(DEFAULT_STYLE_CLASS);
     }
     
-    
+    void valueInvalidated() {
+        fireEvent(new ActionEvent());
+    }
     
     /***************************************************************************
      *                                                                         *
@@ -137,7 +139,7 @@
             
             if ((oldValue == null && newValue != null) ||
                     oldValue != null && ! oldValue.equals(newValue)) {
-                fireEvent(new ActionEvent());
+                valueInvalidated();
             }
             
             oldValue = newValue;
--- a/javafx-ui-controls/src/javafx/scene/control/Control.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/Control.java	Tue Jun 05 16:41:13 2012 -0700
@@ -25,6 +25,7 @@
 
 package javafx.scene.control;
 
+import com.sun.javafx.Utils;
 import com.sun.javafx.css.*;
 import com.sun.javafx.css.converters.StringConverter;
 import java.lang.reflect.Constructor;
@@ -49,7 +50,6 @@
 
 import com.sun.javafx.logging.PlatformLogger;
 import com.sun.javafx.scene.control.Logging;
-import javafx.collections.ObservableList;
 
 /**
  * Base class for all user interface controls. A "Control" is a node in the
@@ -964,20 +964,9 @@
             Logging.getControlsLogger().severe(msg);
             return;
         }
-        
+
         try {
-            Class<?> skinClass;
-            // RT-17525 : Use context class loader only if Class.forName fails.
-            try {
-                skinClass = Class.forName(skinClassName.get());
-            } catch (ClassNotFoundException clne) {
-                if (Thread.currentThread().getContextClassLoader() != null) {
-                    skinClass = Thread.currentThread().getContextClassLoader().loadClass(skinClassName.get());
-                } else {
-                    throw clne;
-                }
-            }
-            
+            final Class<?> skinClass = Utils.loadClass(skinClassName.get(), this);
             Constructor<?>[] constructors = skinClass.getConstructors();
             Constructor<?> skinConstructor = null;
             for (Constructor<?> c : constructors) {
@@ -1038,8 +1027,6 @@
 
     }
 
-    
-    
     /***************************************************************************
      *                                                                         *
      * StyleSheet Handling                                                     *
--- a/javafx-ui-controls/src/javafx/scene/control/Labeled.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/Labeled.java	Tue Jun 05 16:41:13 2012 -0700
@@ -85,9 +85,7 @@
 @DefaultProperty("text")
 public abstract class Labeled extends Control {
 
-    // This is locale specific and may need to be non-static
-    // if and when instances can have different locales.
-    private final static String DEFAULT_ELLIPSIS_STRING = getString("Labeled.defaultEllipsisString");
+    private final static String DEFAULT_ELLIPSIS_STRING = "...";
 
 
     /***************************************************************************
@@ -320,7 +318,9 @@
                     // css might need to be reapplied since font size affects
                     // calculated values for styles with relative values
                     Stylesheet.Origin origin = StyleableProperty.getOrigin(font);
-                    if (origin == Stylesheet.Origin.USER) Labeled.this.impl_reapplyCSS();
+                    if (origin == null || origin == Stylesheet.Origin.USER) {
+                        Labeled.this.impl_reapplyCSS();
+                    }
                 }
                 
                 @Override 
--- a/javafx-ui-controls/src/javafx/scene/control/MenuItem.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/MenuItem.java	Tue Jun 05 16:41:13 2012 -0700
@@ -25,6 +25,7 @@
 
 package javafx.scene.control;
 
+import com.sun.javafx.beans.IDProperty;
 import com.sun.javafx.css.Styleable;
 import com.sun.javafx.css.StyleableProperty;
 import javafx.beans.property.BooleanProperty;
@@ -91,6 +92,7 @@
  *
  * @see Menu
  */
+@IDProperty("id")
 public class MenuItem implements EventTarget {
 
     /***************************************************************************
--- a/javafx-ui-controls/src/javafx/scene/control/Pagination.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/Pagination.java	Tue Jun 05 16:41:13 2012 -0700
@@ -223,8 +223,8 @@
         return maxPageIndicatorCount;
     }
 
-    private int oldPageCount = 1;
-    private IntegerProperty pageCount = new SimpleIntegerProperty(this, "pageCount", 1) {
+    private int oldPageCount = INDETERMINATE;
+    private IntegerProperty pageCount = new SimpleIntegerProperty(this, "pageCount", INDETERMINATE) {
         @Override protected void invalidated() {
             if (getPageCount() <= 0) {
                 setPageCount(oldPageCount);
@@ -250,7 +250,7 @@
      * value must be greater than or equal to 1.  {@link INDETERMINATE} 
      * should be used as the page count if the total number of pages is unknown.
      * 
-     * The default is 1 page.
+     * The default is an {@link INDETERMINATE} number of pages.
      */    
     public final IntegerProperty pageCountProperty() { return pageCount; }
 
--- a/javafx-ui-controls/src/javafx/scene/control/PopupControl.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/PopupControl.java	Tue Jun 05 16:41:13 2012 -0700
@@ -24,6 +24,7 @@
  */
 package javafx.scene.control;
 
+import com.sun.javafx.Utils;
 import javafx.beans.property.DoubleProperty;
 import javafx.beans.property.DoublePropertyBase;
 import javafx.beans.property.ObjectProperty;
@@ -1153,8 +1154,6 @@
         }
 
         private void loadSkinClass() {
-
-
             if (skinClassName == null
                 || skinClassName.get() == null 
                 || skinClassName.get().isEmpty()) {
@@ -1170,17 +1169,7 @@
             }
 
             try {
-                Class<?> skinClass;
-                // RT-17525 : Use context class loader only if Class.forName fails.
-                try {
-                    skinClass = Class.forName(skinClassName.get());
-                } catch (ClassNotFoundException clne) {
-                    if (Thread.currentThread().getContextClassLoader() != null) {
-                            skinClass = Thread.currentThread().getContextClassLoader().loadClass(skinClassName.get());
-                    } else {
-                        throw clne;
-                    }
-                }
+                final Class<?> skinClass = Utils.loadClass(skinClassName.get(), this);
                 Constructor<?>[] constructors = skinClass.getConstructors();
                 Constructor<?> skinConstructor = null;
                 for (Constructor<?> c : constructors) {
--- a/javafx-ui-controls/src/javafx/scene/control/TabPane.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/TabPane.java	Tue Jun 05 16:41:13 2012 -0700
@@ -666,7 +666,7 @@
 
         // API Implementation
         @Override public void select(int index) {
-            if (index < 0 || (getItemCount() > 0 && index >= getItemCount())) {
+            if (index < 0 || (getItemCount() > 0 && index >= getItemCount()) || getSelectedIndex() == index) {
                 return;
             }
 
--- a/javafx-ui-controls/src/javafx/scene/control/TableView.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/TableView.java	Tue Jun 05 16:41:13 2012 -0700
@@ -679,9 +679,6 @@
                     // set up listeners
                     removeTableColumnListener(c.getRemoved());
                     addTableColumnListener(c.getAddedSubList());
-
-                    removeColumnsListener(c.getRemoved(), weakColumnsObserver);
-                    addColumnsListener(c.getAddedSubList(), weakColumnsObserver);
                 }
                     
                 // We don't maintain a bind for leafColumns, we simply call this update
@@ -762,6 +759,9 @@
             // Fix for RT-15194: Need to remove removed columns from the 
             // sortOrder list.
             while (c.next()) {
+                removeColumnsListener(c.getRemoved(), weakColumnsObserver);
+                addColumnsListener(c.getAddedSubList(), weakColumnsObserver);
+                
                 if (c.wasRemoved()) {
                     for (int i = 0; i < c.getRemovedSize(); i++) {
                         getSortOrder().remove(c.getRemoved().get(i));
--- a/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/ButtonSkinTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/ButtonSkinTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -4,9 +4,19 @@
 package com.sun.javafx.scene.control.skin;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import javafx.geometry.Insets;
 import javafx.scene.control.Button;
 
+import javafx.scene.Group;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+import javafx.scene.input.Mnemonic;
+import javafx.collections.ObservableList;
+import javafx.scene.input.KeyCode;
+import javafx.scene.input.KeyCodeCombination;
+import javafx.scene.input.KeyCombination;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -35,7 +45,82 @@
         button.setPrefHeight(500);
         assertEquals(500, button.maxHeight(-1), 0);
     }
-    
+
+    @Test
+    public void testMnemonicAutoParseAddition() {
+        if(!com.sun.javafx.PlatformUtil.isMac()) {
+            boolean nodeFound = false;
+            Stage stage = new Stage();
+            Scene scene = new Scene(new Group(), 500, 500);
+            stage.setScene(scene);
+            
+            button.setMnemonicParsing(true);
+            button.setText("_Mnemonic");
+            
+            ((Group)scene.getRoot()).getChildren().add(button);
+        
+            stage.show();
+        
+            KeyCodeCombination mnemonicKeyCombo =
+                new KeyCodeCombination(KeyCode.M,KeyCombination.ALT_DOWN);
+
+            ObservableList<Mnemonic> mnemonicsList = scene.getMnemonics().get(mnemonicKeyCombo);
+            if (mnemonicsList != null) {
+                for (int i = 0 ; i < mnemonicsList.size() ; i++) {
+                    if (mnemonicsList.get(i).getNode() == button) {
+                        nodeFound = true;
+                    }
+                }
+            }
+            assertTrue(nodeFound);
+        }
+    }
+
+   
+    @Test
+    public void testMnemonicAutoParseAdditionRemovalOnParentChange() {
+        if(!com.sun.javafx.PlatformUtil.isMac()) {
+            boolean nodeFound = false;
+            Stage stage = new Stage();
+            Scene scene = new Scene(new Group(), 500, 500);
+            stage.setScene(scene);
+            
+            button.setMnemonicParsing(true);
+            button.setText("_AnotherMnemonic");
+            
+            ((Group)scene.getRoot()).getChildren().add(button);
+        
+            stage.show();
+        
+            KeyCodeCombination mnemonicKeyCombo =
+                new KeyCodeCombination(KeyCode.A,KeyCombination.ALT_DOWN);
+
+            ObservableList<Mnemonic> mnemonicsList = scene.getMnemonics().get(mnemonicKeyCombo);
+            if (mnemonicsList != null) {
+                for (int i = 0 ; i < mnemonicsList.size() ; i++) {
+                    if (mnemonicsList.get(i).getNode() == button) {
+                        nodeFound = true;
+                    }
+                }
+            }
+            assertTrue(nodeFound);
+
+            nodeFound = false;
+
+            ((Group)scene.getRoot()).getChildren().remove(button);
+  
+            mnemonicsList = scene.getMnemonics().get(mnemonicKeyCombo);
+            if (mnemonicsList != null) {
+                for (int i = 0 ; i < mnemonicsList.size() ; i++) {
+                    if (mnemonicsList.get(i).getNode() == button) {
+                        nodeFound = true;
+                    }
+                }
+            }
+            assertTrue(!nodeFound);
+        }
+    }
+
     public static final class ButtonSkinMock extends ButtonSkin {
         boolean propertyChanged = false;
         int propertyChangeCount = 0;
--- a/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/ColorPickerPaletteRetriever.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/ColorPickerPaletteRetriever.java	Tue Jun 05 16:41:13 2012 -0700
@@ -4,7 +4,9 @@
 package com.sun.javafx.scene.control.skin;
 
 import javafx.scene.control.ColorPicker;
+import javafx.scene.control.Hyperlink;
 import javafx.scene.control.PopupControl;
+import javafx.stage.Stage;
 
 
 /**
@@ -26,4 +28,13 @@
         ColorPickerSkin cpSkin = (ColorPickerSkin)cp.getSkin();
         return cpSkin.getPopup();
     }
+    
+    public static Hyperlink getCustomColorLink(ColorPalette cp) {
+        return cp.customColorLink;
+    }
+    
+    public static Stage getCustomColorDialog(ColorPalette cp) {
+        if (cp.customColorDialog != null) return cp.customColorDialog.dialog;
+        return null;
+    }
 }
--- a/javafx-ui-controls/test/javafx/scene/control/ButtonTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/test/javafx/scene/control/ButtonTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -4,6 +4,8 @@
 
 package javafx.scene.control;
 
+import com.sun.javafx.pgstub.StubToolkit;
+import com.sun.javafx.tk.Toolkit;
 import static javafx.scene.control.ControlTestUtils.*;
 import static org.junit.Assert.*;
 
@@ -13,7 +15,11 @@
 import javafx.beans.property.SimpleObjectProperty;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.input.KeyCode;
+import javafx.scene.layout.StackPane;
 import javafx.scene.shape.Rectangle;
+import javafx.stage.Stage;
 
 import org.junit.Before;
 import org.junit.Ignore;
@@ -25,12 +31,28 @@
  */
 public class ButtonTest {
     private Button btn;
+    private Toolkit tk;
+    private Scene scene;
+    private Stage stage;
+    private StackPane root;      
     
     @Before public void setup() {
         btn = new Button();
+        tk = (StubToolkit)Toolkit.getToolkit();//This step is not needed (Just to make sure StubToolkit is loaded into VM)
+        root = new StackPane();
+        scene = new Scene(root);
+        stage = new Stage();
+        stage.setScene(scene);         
     }
     
     /*********************************************************************
+     * Helper methods                                                    *
+     ********************************************************************/
+    private void show() {
+        stage.show();
+    }   
+    
+    /*********************************************************************
      * Tests for the constructors                                        *
      ********************************************************************/
     
@@ -146,6 +168,26 @@
     @Test public void defaultButtonPropertyHasName() {
         assertEquals("defaultButton", btn.defaultButtonProperty().getName());
     }
+    
+    @Test public void disabledDefaultButtonCannotGetInvoked_RT20929() {
+        root.getChildren().add(btn);        
+        
+        btn.setOnAction(new EventHandler<ActionEvent>() {
+            @Override
+            public void handle(ActionEvent actionEvent) {
+                fail();
+            }
+        });
+        
+        btn.setDefaultButton(true);
+        btn.setDisable(true);
+        show();
+        
+        KeyEventFirer keyboard = new KeyEventFirer(btn);        
+        keyboard.doKeyPress(KeyCode.ENTER);
+   
+        tk.firePulse();                
+    }
 
     /*********************************************************************
      * Tests for the cancelButton state                                 *
--- a/javafx-ui-controls/test/javafx/scene/control/ColorPickerTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/test/javafx/scene/control/ColorPickerTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -21,6 +21,7 @@
 import com.sun.javafx.tk.Toolkit;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
+import javafx.scene.input.KeyCode;
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.GridPane;
 
@@ -152,4 +153,40 @@
         
         assertEquals(colorPicker.getValue().toString(), "0x330033ff");
     }
+    
+    @Test public void testEscapeClosesCustomColorDialog() {
+        final MouseEventGenerator generator = new MouseEventGenerator();
+        ColorPickerSkin skin = (ColorPickerSkin)colorPicker.getSkin();
+        assertTrue(skin != null);
+        ColorPalette colorPalette = ColorPickerPaletteRetriever.getColorPalette(colorPicker);
+        colorPicker.show();
+        tk.firePulse();
+        assertTrue(colorPicker.isShowing());
+        Hyperlink link = ColorPickerPaletteRetriever.getCustomColorLink(colorPalette);
+        double xval = link.getBoundsInParent().getMinX();
+        double yval = link.getBoundsInParent().getMinY();
+         
+        Scene paletteScene = ColorPickerPaletteRetriever.getPopup(colorPicker).getScene();
+        paletteScene.getWindow().requestFocus();
+        //Click on CustomColor hyperlink to show the custom color dialog.
+        paletteScene.impl_processMouseEvent(
+                generator.generateMouseEvent(MouseEvent.MOUSE_PRESSED, xval+20, yval+10));
+        
+        paletteScene.impl_processMouseEvent(
+                generator.generateMouseEvent(MouseEvent.MOUSE_RELEASED, xval+20, yval+10));
+        tk.firePulse();
+        
+        Stage dialog = ColorPickerPaletteRetriever.getCustomColorDialog(colorPalette);
+        assertNotNull(dialog);
+        assertTrue(dialog.isShowing());
+        
+        dialog.requestFocus();
+        tk.firePulse();
+        
+        // fire KeyEvent (Escape) on custom color dialog to close it
+        KeyEventFirer keyboard = new KeyEventFirer(dialog);
+        keyboard.doKeyPress(KeyCode.ESCAPE);
+        tk.firePulse();   
+        assertTrue(!dialog.isShowing());
+    }
 }
--- a/javafx-ui-controls/test/javafx/scene/control/ComboBoxTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/test/javafx/scene/control/ComboBoxTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -581,8 +581,8 @@
         assertEquals(cf, comboBox.getCellFactory());
     }
     
-    @Test public void ensureEditorIsNullWhenComboBoxIsNotEditable() {
-        assertNull(comboBox.getEditor());
+    @Test public void ensureEditorIsNonNullWhenComboBoxIsNotEditable() {
+        assertNotNull(comboBox.getEditor());
     }
     
     @Test public void ensureEditorIsNonNullWhenComboBoxIsEditable() {
@@ -590,28 +590,15 @@
         assertNotNull(comboBox.getEditor());
     }
     
-    @Test public void ensureEditorChangesBetweenNullAndNonNull() {
+    @Test public void ensureEditorDoesNotChangeWhenEditableToggles() {
         comboBox.setEditable(true);
         assertNotNull(comboBox.getEditor());
         comboBox.setEditable(false);
-        assertNull(comboBox.getEditor());
+        assertNotNull(comboBox.getEditor());
         comboBox.setEditable(true);
         assertNotNull(comboBox.getEditor());
     }
     
-    boolean hit = false;
-    @Test public void ensureEditorPropertyFiresWhenEditableBecomesTrue() {
-        comboBox.editorProperty().addListener(new ChangeListener<TextField>() {
-            @Override
-            public void changed(ObservableValue<? extends TextField> arg0, TextField arg1, TextField arg2) {
-                hit = true;
-            }
-        });
-        assertFalse(hit);
-        comboBox.setEditable(true);
-        assertTrue(hit);
-    }
-    
     @Test public void ensureCanSetValueToNonNullStringAndBackAgain() {
         comboBox.setValue("Test 123");
         assertEquals("Test 123", comboBox.getValue());
--- a/javafx-ui-controls/test/javafx/scene/control/MenuBarTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/test/javafx/scene/control/MenuBarTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -11,16 +11,15 @@
 import com.sun.javafx.tk.Toolkit;
 import javafx.scene.Parent;
 import javafx.scene.Scene;
-import javafx.scene.input.MouseButton;
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.AnchorPane;
 import javafx.stage.Stage;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
-import javafx.event.EventType;
 import javafx.scene.Node;
 import javafx.scene.input.KeyCode;
+import javafx.scene.layout.VBox;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -236,8 +235,89 @@
         // check if focusedMenuIndex is reset to -1 so navigation happens.
         int focusedIndex = MenuBarMenuButtonRetriever.getFocusedIndex(skin);
         assertEquals(focusedIndex, -1);
+    }
+    
+    @Test public void testMenuOnShownEventFiringWithKeyNavigation() {
+        final MouseEventGenerator generator = new MouseEventGenerator();
+        VBox root = new VBox();
+        Menu menu = new Menu("Menu");
+
+        MenuItem menuItem1 = new MenuItem("MenuItem1");
+        MenuItem menuItem2 = new MenuItem("MenuItem2");
+        menu.getItems().addAll(menuItem1, menuItem2);
         
+        menuBar.getMenus().add(menu);
+        menuBar.setLayoutX(100);
+        menuBar.setLayoutY(100);
+        
+        final CheckBox cb = new CheckBox("showing");
+        
+        root.getChildren().addAll(cb,menuBar);
+        startApp(root);
+        tk.firePulse();
+        
+        MenuBarSkin skin = (MenuBarSkin)menuBar.getSkin();
+        assertTrue(skin != null);
+        
+        MenuButton mb = MenuBarMenuButtonRetriever.getNodeForMenu(skin, 0);
+        mb.getScene().getWindow().requestFocus();
+        assertTrue(mb.getScene().getWindow().isFocused());
+        
+
+        KeyEventFirer keyboard = new KeyEventFirer(mb.getScene());
+        keyboard.doKeyPress(KeyCode.TAB);
+        tk.firePulse(); 
+        mb.requestFocus();
+        assertTrue(mb.isFocused());
+        
+        keyboard = new KeyEventFirer(mb);
+        keyboard.doDownArrowPress();
+        tk.firePulse();
+        assertEquals(menu.showingProperty().get(), true);
     }
+    
+    @Test public void testKeyNavigationWithDisabledMenuItem() {
+        final MouseEventGenerator generator = new MouseEventGenerator();
+        VBox root = new VBox();
+        Menu menu1 = new Menu("Menu1");
+        Menu menu2 = new Menu("Menu2");
+        Menu menu3 = new Menu("Menu3");
+        
+        MenuItem menuItem1 = new MenuItem("MenuItem1");
+        MenuItem menuItem2 = new MenuItem("MenuItem2");
+        MenuItem menuItem3 = new MenuItem("MenuItem3");
+
+        menu1.getItems().add(menuItem1);
+        menu2.getItems().add(menuItem2);
+        menu3.getItems().add(menuItem3);
+        
+        menuBar.getMenus().addAll(menu1, menu2, menu3);
+        menu2.setDisable(true);
+        
+        root.getChildren().addAll(menuBar);
+        startApp(root);
+        tk.firePulse();
+        
+        MenuBarSkin skin = (MenuBarSkin)menuBar.getSkin();
+        assertTrue(skin != null);
+        
+        double xval = (menuBar.localToScene(menuBar.getLayoutBounds())).getMinX();
+        double yval = (menuBar.localToScene(menuBar.getLayoutBounds())).getMinY();
+   
+        MenuButton mb = MenuBarMenuButtonRetriever.getNodeForMenu(skin, 0);
+        mb.getScene().getWindow().requestFocus();
+        scene.impl_processMouseEvent(
+            generator.generateMouseEvent(MouseEvent.MOUSE_PRESSED, xval+20, yval+20));
+        scene.impl_processMouseEvent(
+            generator.generateMouseEvent(MouseEvent.MOUSE_RELEASED, xval+20, yval+20));
+        assertTrue(menu1.isShowing());
+        
+        KeyEventFirer keyboard = new KeyEventFirer(mb.getScene());
+        keyboard.doKeyPress(KeyCode.RIGHT);
+        tk.firePulse(); 
+        assertTrue(menu3.isShowing());
+    }
+    
 //    static final class MouseEventTracker {
 //        private Node node;
 //        
--- a/javafx-ui-controls/test/javafx/scene/control/TabPaneTest.java	Fri Jun 01 00:03:57 2012 -0700
+++ b/javafx-ui-controls/test/javafx/scene/control/TabPaneTest.java	Tue Jun 05 16:41:13 2012 -0700
@@ -15,6 +15,8 @@
 import javafx.beans.property.SimpleBooleanProperty;
 import javafx.beans.property.SimpleDoubleProperty;
 import javafx.beans.property.SimpleObjectProperty;
+import javafx.event.Event;
+import javafx.event.EventHandler;
 import javafx.geometry.Side;
 import javafx.scene.Scene;
 import javafx.scene.input.MouseEvent;
@@ -667,4 +669,43 @@
         assertEquals(1, tabPane.getSelectionModel().getSelectedIndex());
         assertEquals(tab2, tabPane.getSelectionModel().getSelectedItem());        
     }
+    
+    private int counter = 0;
+    @Test public void setOnSelectionChangedFiresTwice_RT21089() {
+        tabPane.getTabs().add(tab1);
+        tabPane.getTabs().add(tab2);
+        
+        tab1.setContent(new Button("TAB1"));
+        tab2.setContent(new Button("TAB2"));
+        
+        root.getChildren().add(tabPane);
+        show();
+
+        root.impl_reapplyCSS();
+        root.resize(300, 300);
+        root.layout();
+        
+        tk.firePulse();        
+        assertTrue(tabPane.isFocused());
+
+        tab2.setOnSelectionChanged(new EventHandler<Event>() {
+            @Override public void handle(Event event) {
+                assertEquals(0, counter++);
+            }
+        });
+
+        double xval = (tabPane.localToScene(tabPane.getLayoutBounds())).getMinX();
+        double yval = (tabPane.localToScene(tabPane.getLayoutBounds())).getMinY();
+   
+        scene.impl_processMouseEvent(
+            MouseEventGenerator.generateMouseEvent(MouseEvent.MOUSE_PRESSED, xval+75, yval+20));
+        tk.firePulse();
+        
+        assertEquals(tab2, tabPane.getSelectionModel().getSelectedItem());
+                
+        scene.impl_processMouseEvent(
+            MouseEventGenerator.generateMouseEvent(MouseEvent.MOUSE_PRESSED, xval+75, yval+20));
+        tk.firePulse();        
+        assertEquals(tab2, tabPane.getSelectionModel().getSelectedItem());
+    }
 }