changeset 7261:169d6b8b6386

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8u/master/jfx/rt
author kcr
date Thu, 12 Jun 2014 09:52:47 -0700
parents ec2c900e6037 286217918102
children 5e7640e45127
files
diffstat 157 files changed, 4011 insertions(+), 2896 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/AirportApp.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="EclipseModuleManager">
+    <libelement value="file://dist/AirportApp.jar" />
+    <src_description expected_position="0">
+      <src_folder value="file://$MODULE_DIR$/apps/scenebuilder/samples/AirportApp/src" expected_position="0" />
+    </src_description>
+  </component>
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/scenebuilder/samples/AirportApp">
+      <sourceFolder url="file://$MODULE_DIR$/apps/scenebuilder/samples/AirportApp/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/HelloI18N.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/scenebuilder/samples/HelloI18N">
+      <sourceFolder url="file://$MODULE_DIR$/apps/scenebuilder/samples/HelloI18N/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/HelloSwingNode.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/scenebuilder/samples/HelloSwingNode">
+      <sourceFolder url="file://$MODULE_DIR$/apps/scenebuilder/samples/HelloSwingNode/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/IssueTrackingBiDi.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/scenebuilder/samples/IssueTrackingBiDi">
+      <sourceFolder url="file://$MODULE_DIR$/apps/scenebuilder/samples/IssueTrackingBiDi/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/IssueTrackingLite.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/scenebuilder/samples/IssueTrackingLite">
+      <sourceFolder url="file://$MODULE_DIR$/apps/scenebuilder/samples/IssueTrackingLite/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/Login.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/scenebuilder/samples/Login">
+      <sourceFolder url="file://$MODULE_DIR$/apps/scenebuilder/samples/Login/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/UnlockCustom.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/scenebuilder/samples/UnlockCustom">
+      <sourceFolder url="file://$MODULE_DIR$/apps/scenebuilder/samples/UnlockCustom/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- a/.idea/modules.xml	Tue Jun 10 21:34:57 2014 -0700
+++ b/.idea/modules.xml	Thu Jun 12 09:52:47 2014 -0700
@@ -3,18 +3,24 @@
   <component name="ProjectModuleManager">
     <modules>
       <module fileurl="file://$PROJECT_DIR$/.idea/3DViewer.iml" filepath="$PROJECT_DIR$/.idea/3DViewer.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/AirportApp.iml" filepath="$PROJECT_DIR$/.idea/AirportApp.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/Ensemble8.iml" filepath="$PROJECT_DIR$/.idea/Ensemble8.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/FX8-3DFeatures.iml" filepath="$PROJECT_DIR$/.idea/FX8-3DFeatures.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/FXSlideShow.iml" filepath="$PROJECT_DIR$/.idea/FXSlideShow.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/GraphicsPerformance.iml" filepath="$PROJECT_DIR$/.idea/GraphicsPerformance.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/Hello.iml" filepath="$PROJECT_DIR$/.idea/Hello.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/HelloI18N.iml" filepath="$PROJECT_DIR$/.idea/HelloI18N.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/HelloSwingNode.iml" filepath="$PROJECT_DIR$/.idea/HelloSwingNode.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/IssueTrackingBiDi.iml" filepath="$PROJECT_DIR$/.idea/IssueTrackingBiDi.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/IssueTrackingLite.iml" filepath="$PROJECT_DIR$/.idea/IssueTrackingLite.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/Login.iml" filepath="$PROJECT_DIR$/.idea/Login.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/MandelbrotSet.iml" filepath="$PROJECT_DIR$/.idea/MandelbrotSet.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/Modena.iml" filepath="$PROJECT_DIR$/.idea/Modena.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/SceneBuilderApp.iml" filepath="$PROJECT_DIR$/.idea/SceneBuilderApp.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/SceneBuilderKit.iml" filepath="$PROJECT_DIR$/.idea/SceneBuilderKit.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/Shape3DToy.iml" filepath="$PROJECT_DIR$/.idea/Shape3DToy.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/StretchyGrid.iml" filepath="$PROJECT_DIR$/.idea/StretchyGrid.iml" />
-      <module fileurl="file://$PROJECT_DIR$/.idea/SystemTests.iml" filepath="$PROJECT_DIR$/.idea/SystemTests.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/UnlockCustom.iml" filepath="$PROJECT_DIR$/.idea/UnlockCustom.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/base.iml" filepath="$PROJECT_DIR$/.idea/base.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/buildSrc.iml" filepath="$PROJECT_DIR$/.idea/buildSrc.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/builders.iml" filepath="$PROJECT_DIR$/.idea/builders.iml" />
@@ -27,6 +33,7 @@
       <module fileurl="file://$PROJECT_DIR$/.idea/media.iml" filepath="$PROJECT_DIR$/.idea/media.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/rt.iml" filepath="$PROJECT_DIR$/.idea/rt.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/rt-closed.iml" filepath="$PROJECT_DIR$/.idea/rt-closed.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/rt-tests.iml" filepath="$PROJECT_DIR$/.idea/rt-tests.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/swing.iml" filepath="$PROJECT_DIR$/.idea/swing.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/swt.iml" filepath="$PROJECT_DIR$/.idea/swt.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/web.iml" filepath="$PROJECT_DIR$/.idea/web.iml" />
--- a/.idea/rt-closed.iml	Tue Jun 10 21:34:57 2014 -0700
+++ b/.idea/rt-closed.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -85,7 +85,6 @@
     </src_description>
   </component>
   <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <output url="file://$MODULE_DIR$/../rt-closed/bin" />
     <exclude-output />
     <content url="file://$MODULE_DIR$/../rt-closed">
       <sourceFolder url="file://$MODULE_DIR$/../rt-closed/glass/UseCases/src" isTestSource="false" />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/rt-tests.iml	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/tests/bin" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/tests">
+      <sourceFolder url="file://$MODULE_DIR$/tests/app-lifecycle/ClassLoaderApp/src" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/tests/manual/printing" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/tests/performance/VMPerformance/src" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/tests/system/src/test/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/tests/app-lifecycle/ClassLoaderTest/test" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/tests/system/src/test/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/tests/golden-image-suite/src" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="module-library">
+      <library name="junit4">
+        <CLASSES>
+          <root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.11.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+</module>
+
--- a/apps/samples/3DViewer/nbproject/project.properties	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/samples/3DViewer/nbproject/project.properties	Thu Jun 12 09:52:47 2014 -0700
@@ -66,7 +66,7 @@
 # Space-separated list of JVM arguments used when running the project.
 # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
 # To set system properties for unit tests define test-sys-prop.name=value:
-run.jvmargs=-Djava.ext.dirs= 
+run.jvmargs=
 run.test.classpath=\
     ${javac.test.classpath}:\
     ${build.test.classes.dir}
--- a/apps/samples/Ensemble8/build.xml	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/samples/Ensemble8/build.xml	Thu Jun 12 09:52:47 2014 -0700
@@ -77,9 +77,9 @@
             <isset property="JFX_CORE_ONLY"/>
         </condition>
     </target>
-    
+
     <!-- COPY SAMPLE SRC TO BUILD DIR -->
-    <target name="-pre-compile">
+    <target name="-pre-compile" depends="-copy-cssref">
         <echo>Copying all sample source files to build dir</echo>
          <copy todir="${build.classes.dir}">
             <fileset dir="${basedir}/src/samples/java">
@@ -87,9 +87,17 @@
                 <include name="**/*.js"/> <!-- include javascript files -->
             </fileset>
         </copy>
+    </target>
+
+    <property name="javafx.scene.doc-files.dir" location="${basedir}/../../../modules/graphics/src/main/docs/javafx/scene/doc-files"/>
+    <condition property="javafx.scene.doc-files.exists">
+        <available file="${javafx.scene.doc-files.dir}" type="dir"/>
+    </condition>
+
+    <target name="-copy-cssref" if="javafx.scene.doc-files.exists">
     	<mkdir dir="${build.cssref.dir}"/>
     	<copy todir="${build.cssref.dir}">
-    		<fileset dir="${basedir}/../../../modules/graphics/src/main/docs/javafx/scene/doc-files">
+    		<fileset dir="${javafx.scene.doc-files.dir}">
     			<include name="cssref.html"/>
     			<include name="cssexample1.png"/>
     			<include name="cssexample2.png"/>
@@ -102,7 +110,7 @@
     		replace="http://www.oracle.com/technetwork/java/javase/terms/license/oraclebsd-1603217.txt"
     		byline="true"/>
     </target>
-    
+
     <!-- DON'T INCLUDE COMPILE TIME CODE IN APP JAR -->
     <target name="-pre-jar">
         <delete dir="${build.classes.dir}/ensemble/compiletime"/>
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/brickbreaker/BrickBreakerApp.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/brickbreaker/BrickBreakerApp.java	Thu Jun 12 09:52:47 2014 -0700
@@ -86,6 +86,11 @@
         currentMainFrame.endGame();
     }
 
+    public void play() {
+        MainFrame currentMainFrame = getMainFrame();
+        currentMainFrame.restartGame();
+    }
+
     public static void main(String[] args) {
         Application.launch(args);
     }
@@ -154,6 +159,15 @@
             }
         }
 
+        public void restartGame() {
+            if (splash != null) {
+                splash.start();
+            }
+            if (level != null) {
+                level.restart();
+            }
+        }
+
         // Current state of the game. The next values are available
         // 0 - Splash
         public static final int SPLASH = 0;
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/brickbreaker/Level.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/brickbreaker/Level.java	Thu Jun 12 09:52:47 2014 -0700
@@ -329,10 +329,17 @@
     }
 
     public void stop() {
-        startingTimeline.stop();
+        startingTimeline.pause();
         animationTimer.stop();
     }
 
+    public void restart() {
+        if (message.isVisible()) {
+            startingTimeline.play();
+        }
+        animationTimer.start();
+    }
+
     private void initLevel() {
         String[] level = LevelData.getLevelData(levelNumber);
         for (int row = 0; row < level.length; row++) {
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/gauge/SpeedGaugeApp.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/graphics2d/gauge/SpeedGaugeApp.java	Thu Jun 12 09:52:47 2014 -0700
@@ -119,6 +119,10 @@
         timer.stop();
     }
 
+    public void play() {
+        timer.start();
+    }
+
     /**
      * @param args the command line arguments
      */
--- a/apps/scenebuilder/.classpath	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/scenebuilder/.classpath	Thu Jun 12 09:52:47 2014 -0700
@@ -2,6 +2,13 @@
 <classpath>
     <classpathentry kind="src" path="SceneBuilderApp/src"/>
     <classpathentry kind="src" path="SceneBuilderKit/src"/>
+    <classpathentry kind="src" path="samples/AirportApp/src"/>
+    <classpathentry kind="src" path="samples/HelloI18N/src"/>
+    <classpathentry kind="src" path="samples/HelloSwingNode/src"/>
+    <classpathentry kind="src" path="samples/IssueTrackingBiDi/src"/>
+    <classpathentry kind="src" path="samples/IssueTrackingLite/src"/>
+    <classpathentry kind="src" path="samples/Login/src"/>
+    <classpathentry kind="src" path="samples/UnlockCustom/src"/>
     <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
     <classpathentry combineaccessrules="false" kind="src" exported="true" path="/rt">
     <attributes>
--- a/apps/toys/Hello/src/main/java/hello/HelloSanity.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/toys/Hello/src/main/java/hello/HelloSanity.java	Thu Jun 12 09:52:47 2014 -0700
@@ -81,14 +81,14 @@
         Button bRobot = new Button("Robot");
         bRobot.setOnAction(e -> builder.robotTest(globalScene, mainBox, primaryStage));
 
-        Button bswipe = new Button("Swipe");
-        bswipe.setOnAction(e -> builder.swipeTest(globalScene, mainBox));
+        Button bgestures = new Button("Gesture Actions");
+        bgestures.setOnAction(e -> builder.GestureTest(globalScene, mainBox));
         
         Button bquit = new Button("Quit");
         bquit.setOnAction(e -> primaryStage.close());
         
         mainBox.getChildren().addAll(welcome, bControls, bTabs, bWins, bRobot,
-                                     bAnim, bEffs, bswipe, bquit);
+                                     bAnim, bEffs, bgestures, bquit);
         globalScene.setRoot(mainBox);
         globalScene.getStylesheets().add("hello/HelloSanityStyles.css");
         primaryStage.setScene(globalScene);
--- a/apps/toys/Hello/src/main/java/hello/TestBuilder.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/apps/toys/Hello/src/main/java/hello/TestBuilder.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1870,49 +1870,55 @@
 
     /**
      * The method updates globalScene with rectangle that should be 
-     * swiped (touch only)
+     * swiped, scrolled, zoomed or rotated (touch only)
      * @param globalScene the global Scene
      * @param mainBox the Box to insert into
      */
-    public void swipeTest(final Scene globalScene, final VBox mainBox){
+    public void GestureTest(final Scene globalScene, final VBox mainBox){
 
         final Rectangle rect;
         final boolean playing = false;
 
-        Label l = new Label("Swipe demo");
+        Label l = new Label("Gesture demo: Swipe, Scroll, Rotate and Zoom");
 
         Button btn = new Button("Back");
-        btn.setOnAction(new EventHandler<ActionEvent>() {
-            @Override public void handle(ActionEvent e) {
+        btn.setOnAction(event -> {
                 globalScene.setRoot(mainBox);
-            }
         });
         
         rect = new Rectangle(200, 200, 200, 200);
         rect.setFill(Color.RED);
-        rect.setOnSwipeLeft(new EventHandler<SwipeEvent>() {
-            @Override public void handle(SwipeEvent event) {
-                rotate(-event.getTouchCount(), Rotate.Z_AXIS, rect, playing);
-                event.consume();
-            }
+        rect.setOnSwipeLeft(event -> {
+            rotate(event.getTouchCount(), Rotate.Z_AXIS, rect, playing);
+            event.consume();
         });
-        rect.setOnSwipeRight(new EventHandler<SwipeEvent>() {
-            @Override public void handle(SwipeEvent event) {                
-                rotate(event.getTouchCount(), Rotate.Z_AXIS, rect, playing);
-                event.consume();
-            }
+        rect.setOnSwipeRight(event -> {
+            rotate(event.getTouchCount(), Rotate.Z_AXIS, rect, playing);
+            event.consume();
         });
-        rect.setOnSwipeUp(new EventHandler<SwipeEvent>() {
-            @Override public void handle(SwipeEvent event) {
-                yTranslate(event.getTouchCount(), 0f, -100f, rect, playing);
-                event.consume();
-            }
+        rect.setOnSwipeUp(event -> {
+            yTranslate(event.getTouchCount(), 0f, -100f, rect, playing);
+            event.consume();
         });
-        rect.setOnSwipeDown(new EventHandler<SwipeEvent>() {
-            @Override public void handle(SwipeEvent event) {
-                yTranslate(event.getTouchCount(), 0f, 100f, rect, playing);
-                event.consume();
-            }
+        rect.setOnSwipeDown(event -> {
+            yTranslate(event.getTouchCount(), 0f, 100f, rect, playing);
+            event.consume();
+        });
+        rect.setOnRotate(event -> {
+            rect.setRotate(rect.getRotate() + event.getAngle());
+            event.consume();
+        });
+
+        rect.setOnScroll(event -> {
+            rect.setTranslateX(rect.getTranslateX() + event.getDeltaX());
+            rect.setTranslateY(rect.getTranslateY() + event.getDeltaY());
+            event.consume();
+        });
+
+        rect.setOnZoom(event -> {
+            rect.setScaleX(rect.getScaleX() * event.getZoomFactor());
+            rect.setScaleY(rect.getScaleY() * event.getZoomFactor());
+            event.consume();
         });
 		VBox vb = new VBox(40);
         vb.setAlignment(Pos.CENTER);
--- a/modules/base/src/main/java/com/sun/javafx/property/adapter/JavaBeanPropertyBuilderHelper.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/base/src/main/java/com/sun/javafx/property/adapter/JavaBeanPropertyBuilderHelper.java	Thu Jun 12 09:52:47 2014 -0700
@@ -114,26 +114,28 @@
                 throw new IllegalArgumentException("Property name cannot be empty");
             }
             final String capitalizedName = ReadOnlyPropertyDescriptor.capitalizedName(propertyName);
-            if (getter == null) {
+            Method getterMethod = getter;
+            if (getterMethod == null) {
                 if ((getterName != null) && !getterName.isEmpty()) {
-                    getter = beanClass.getMethod(getterName);
+                    getterMethod = beanClass.getMethod(getterName);
                 } else {
                     try {
-                        getter = beanClass.getMethod(IS_PREFIX + capitalizedName);
+                        getterMethod = beanClass.getMethod(IS_PREFIX + capitalizedName);
                     } catch (NoSuchMethodException e) {
-                        getter = beanClass.getMethod(GET_PREFIX + capitalizedName);
+                        getterMethod = beanClass.getMethod(GET_PREFIX + capitalizedName);
                     }
                 }
             }
-            if (setter == null) {
-                final Class<?> type = getter.getReturnType();
+            Method setterMethod = setter;
+            if (setterMethod == null) {
+                final Class<?> type = getterMethod.getReturnType();
                 if ((setterName != null) && !setterName.isEmpty()) {
-                    setter = beanClass.getMethod(setterName, type);
+                    setterMethod = beanClass.getMethod(setterName, type);
                 } else {
-                    setter = beanClass.getMethod(SET_PREFIX + capitalizedName, type);
+                    setterMethod = beanClass.getMethod(SET_PREFIX + capitalizedName, type);
                 }
             }
-            descriptor = new PropertyDescriptor(propertyName, beanClass, getter, setter);
+            descriptor = new PropertyDescriptor(propertyName, beanClass, getterMethod, setterMethod);
         }
         return descriptor;
     }
--- a/modules/base/src/test/java/com/sun/javafx/property/adapter/JavaBeanPropertyBuilderHelperTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/base/src/test/java/com/sun/javafx/property/adapter/JavaBeanPropertyBuilderHelperTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -28,8 +28,10 @@
 import org.junit.Before;
 import org.junit.Test;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 /**
@@ -200,6 +202,21 @@
         helperPOJOBeanWithNonStandardNames.getDescriptor();
     }
 
+    @Test
+    public void testReusabilityWhenChangeOfBeanClass() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+        Object x = new Object();
+
+        PropertyDescriptor descriptor = helperPOJOBean.getDescriptor();
+        assertEquals(x, descriptor.getGetter().invoke(new POJOBean(x)));
+        descriptor.getSetter().invoke(new POJOBean(x), new Object());
+
+        helperPOJOBean.beanClass(POJOBean2.class);
+
+        descriptor = helperPOJOBean.getDescriptor();
+        assertEquals(x, descriptor.getGetter().invoke(new POJOBean2(x)));
+        descriptor.getSetter().invoke(new POJOBean2(x), new Object());
+    }
+
     public static class POJOBean {
         private Object x;
 
@@ -209,6 +226,16 @@
         public void setX(Object x) {this.x = x;}
     }
 
+    public static class POJOBean2 {
+        private Object x;
+
+        public POJOBean2(Object x) {this.x = x;}
+
+        public Object getX() {return x;}
+        public void setX(Object x) {this.x = x;}
+
+    }
+
     public static class POJOBeanWithNonStandardNames {
         private Object x;
 
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableViewBehaviorBase.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableViewBehaviorBase.java	Thu Jun 12 09:52:47 2014 -0700
@@ -225,6 +225,10 @@
 
     protected final ListChangeListener<TablePositionBase> selectedCellsListener = c -> {
         while (c.next()) {
+            if (! c.wasAdded()) {
+                continue;
+            }
+
             TableSelectionModel sm = getSelectionModel();
             if (sm == null) return;
 
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TreeTableCellBehavior.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TreeTableCellBehavior.java	Thu Jun 12 09:52:47 2014 -0700
@@ -121,7 +121,7 @@
         if (column == treeColumn) {
             final Node disclosureNode = getControl().getTreeTableRow().getDisclosureNode();
             if (disclosureNode != null) {
-                if (disclosureNode.getBoundsInLocal().contains(x, y)) {
+                if (disclosureNode.getBoundsInParent().contains(x, y)) {
                     if (treeItem != null) {
                         treeItem.setExpanded(!treeItem.isExpanded());
                     }
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxPopupControl.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxPopupControl.java	Thu Jun 12 09:52:47 2014 -0700
@@ -93,7 +93,9 @@
         _popup.getScene().setNodeOrientation(getSkinnable().getEffectiveNodeOrientation());
 
 
-        getPopupContent().autosize();
+        final Node popupContent = getPopupContent();
+        popupContent.applyCss();
+        popupContent.autosize();
         Point2D p = getPrefPopupPosition();
 
         popupNeedsReconfiguring = true;
@@ -102,7 +104,7 @@
         final ComboBoxBase<T> comboBoxBase = getSkinnable();
         _popup.show(comboBoxBase.getScene().getWindow(), p.getX(), p.getY());
 
-        getPopupContent().requestFocus();
+        popupContent.requestFocus();
     }
     
     private void createPopup() {
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1488,12 +1488,24 @@
                     return false;
                 case ACCELERATOR: return item.getAccelerator();
                 case TITLE: {
+                    String title = "";
+                    if (graphic != null) {
+                        String t = (String)graphic.accGetAttribute(Attribute.TITLE);
+                        if (t != null) title += t;
+                    }                  
                     final Label label = getLabel();
                     if (label != null) {
-                        String title = (String)label.accGetAttribute(Attribute.TITLE);
-                        if (title != null) return title;
+                        String t = (String)label.accGetAttribute(Attribute.TITLE);
+                        if (t != null) title += t;
                     }
-                    return item.getText();
+                    if (item instanceof CustomMenuItem) {
+                        Node content = ((CustomMenuItem) item).getContent();
+                        if (content != null) {
+                            String t = (String)content.accGetAttribute(Attribute.TITLE);
+                            if (t != null) title += t;
+                        }
+                    }
+                    return title;
                 }
                 case MNEMONIC: {
                     final Label label = getLabel();
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java	Thu Jun 12 09:52:47 2014 -0700
@@ -205,7 +205,6 @@
     }
 
     @Override protected void handleControlPropertyChanged(String p) {
-        super.handleControlPropertyChanged(p);
 
         if ("CHRONOLOGY".equals(p) ||
             "DAY_CELL_FACTORY".equals(p)) {
@@ -243,6 +242,8 @@
                 datePickerContent.displayedYearMonthProperty().set((date != null) ? YearMonth.from(date) : YearMonth.now());
                 datePickerContent.updateValues();
             }
+        } else {
+            super.handleControlPropertyChanged(p);
         }
     }
 
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Thu Jun 12 09:52:47 2014 -0700
@@ -581,7 +581,12 @@
             } else {
                 getChildren().setAll(graphic, text);
             }
+
+            // RT-37420
+            graphic.impl_processCSS(false);
+
         }
+
     }
 
     /**
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java	Thu Jun 12 09:52:47 2014 -0700
@@ -854,6 +854,7 @@
                     break;
                 }
             }
+            getSkinnable().accSendNotification(Attribute.SELECTED_PAGE);
         }
 
         // Update the page index using the currentIndex and updates the page set
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ProgressBarSkin.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ProgressBarSkin.java	Thu Jun 12 09:52:47 2014 -0700
@@ -366,6 +366,8 @@
 
             // remove clip
             bar.setClip(null);
+            bar.setScaleX(1);
+            bar.setTranslateX(0);
             clipRegion.translateXProperty().unbind();
         }
     }
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Thu Jun 12 09:52:47 2014 -0700
@@ -513,13 +513,6 @@
         label.setGraphic(column.getGraphic());
         label.setVisible(column.isVisible());
 
-        label.fontProperty().addListener((o, old, newValue) -> {
-            // The font has changed (probably due to CSS being applied), so we
-            // need to re-run the column resizing algorithm to ensure columns
-            // fit nicely based on their content and their header
-            doColumnAutoSize(column, 30);
-        });
-
         // ---- container for the sort arrow (which is not supported on embedded
         // platforms)
         if (isSortingEnabled()) {
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1296,6 +1296,11 @@
 
         final double viewportLength = getViewportLength();
 
+        // Fix for RT-37421, which was a regression caused by RT-36556
+        if (offset < 0 && !fillEmptyCells) {
+            return false;
+        }
+
         //
         // RT-36507: viewportLength - offset gives the maximum number of
         // additional cells that should ever be able to fit in the viewport if
@@ -2297,10 +2302,6 @@
                 positionCell(cell, getCellPosition(cell) - delta);
             }
 
-            // Now throw away any cells that don't fit
-            // (take one - this resolves RT-36556)
-            cull();
-
             // Fix for RT-32908
             T firstCell = cells.getFirst();
             double layoutY = firstCell == null ? 0 : getCellPosition(firstCell);
@@ -2361,7 +2362,7 @@
             }
         }
 
-        // Now throw away any cells that don't fit (take two)
+        // Now throw away any cells that don't fit
         cull();
 
         // Finally, update the scroll bars
--- a/modules/controls/src/main/java/javafx/scene/chart/StackedAreaChart.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/StackedAreaChart.java	Thu Jun 12 09:52:47 2014 -0700
@@ -698,8 +698,10 @@
             } // end of inner for loop 
             
             // Draw the SeriesLine and Series fill
-            seriesLine.getElements().add(new MoveTo(currentSeriesData.get(0).displayX, currentSeriesData.get(0).displayY));
-            fillPath.getElements().add(new MoveTo(currentSeriesData.get(0).displayX, currentSeriesData.get(0).displayY));
+            if (!currentSeriesData.isEmpty()) {
+                seriesLine.getElements().add(new MoveTo(currentSeriesData.get(0).displayX, currentSeriesData.get(0).displayY));
+                fillPath.getElements().add(new MoveTo(currentSeriesData.get(0).displayX, currentSeriesData.get(0).displayY));
+            }
             for (DataPointInfo<X,Y> point : currentSeriesData) {
                 if (!point.lineTo) {
                     seriesLine.getElements().add(new MoveTo(point.displayX, point.displayY));
@@ -723,7 +725,9 @@
                     fillPath.getElements().add(new  LineTo(point.displayX, point.displayY));
                 }
             }
-            fillPath.getElements().add(new ClosePath());
+            if (!fillPath.getElements().isEmpty()) {
+                fillPath.getElements().add(new ClosePath());
+            }
              
         }  // end of out for loop
      }
--- a/modules/controls/src/main/java/javafx/scene/control/ListView.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/ListView.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1337,9 +1337,9 @@
                         } else if (index < getItemCount() && index >= 0) {
                             // Fix for RT-18969: the list had setAll called on it
                             // Use of makeAtomic is a fix for RT-20945
-                            makeAtomic = true;
+                            startAtomic();
                             clearSelection(index);
-                            makeAtomic = false;
+                            stopAtomic();
                             select(index);
                         } else {
                             // Fix for RT-22079
--- a/modules/controls/src/main/java/javafx/scene/control/MultipleSelectionModelBase.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/MultipleSelectionModelBase.java	Thu Jun 12 09:52:47 2014 -0700
@@ -160,8 +160,17 @@
      *                                                                     *
      **********************************************************************/
 
-    // Fix for RT-20945
-    boolean makeAtomic = false;
+    // Fix for RT-20945 (and numerous other issues!)
+    private int atomicityCount = 0;
+    boolean isAtomic() {
+        return atomicityCount > 0;
+    }
+    void startAtomic() {
+        atomicityCount++;
+    }
+    void stopAtomic() {
+        atomicityCount = Math.max(0, --atomicityCount);
+    }
 
 
     /***********************************************************************
@@ -301,7 +310,7 @@
         // resulted in the selectedItems and selectedIndices lists never
         // reporting that they were empty.
         // makeAtomic toggle added to resolve RT-32618
-        makeAtomic = true;
+        startAtomic();
 
         // firstly we make a copy of the selection, so that we can send out
         // the correct details in the selection change event
@@ -314,7 +323,7 @@
 
         // and select the new row
         select(row);
-        makeAtomic = false;
+        stopAtomic();
 
         // fire off a single add/remove/replace notification (rather than
         // individual remove and add notifications) - see RT-33324
@@ -348,7 +357,7 @@
         setSelectedIndex(row);
         focus(row);
 
-        if (! makeAtomic) {
+        if (! isAtomic()) {
             int changeIndex = selectedIndicesSeq.indexOf(row);
             selectedIndicesSeq.callObservers(new NonIterableChange.SimpleAddChange<Integer>(changeIndex, changeIndex+1, selectedIndicesSeq));
         }
@@ -612,7 +621,7 @@
     }
 
     @Override public void clearSelection() {
-        if (! makeAtomic) {
+        if (! isAtomic()) {
             setSelectedIndex(-1);
             focus(-1);
         }
@@ -632,7 +641,7 @@
 
             quietClearSelection();
 
-            if (! makeAtomic) {
+            if (! isAtomic()) {
                 selectedIndicesSeq.callObservers(
                         new NonIterableChange.GenericAddRemoveChange<Integer>(0, 0,
                         removed, selectedIndicesSeq));
--- a/modules/controls/src/main/java/javafx/scene/control/Pagination.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/Pagination.java	Thu Jun 12 09:52:47 2014 -0700
@@ -254,8 +254,6 @@
                     setCurrentPageIndex(getPageCount() - 1);
                 }
             }
-
-            accSendNotification(Attribute.SELECTED_PAGE);
         }
 
         @Override
--- a/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Thu Jun 12 09:52:47 2014 -0700
@@ -119,7 +119,11 @@
      * storeTableView method.
      */
     private ListChangeListener<TablePosition> selectedListener = c -> {
-        updateSelection();
+        while (c.next()) {
+            if (c.wasAdded() || c.wasRemoved()) {
+                updateSelection();
+            }
+        }
     };
 
     // same as above, but for focus
--- a/modules/controls/src/main/java/javafx/scene/control/TablePosition.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TablePosition.java	Thu Jun 12 09:52:47 2014 -0700
@@ -66,7 +66,9 @@
      */
     public TablePosition(@NamedArg("tableView") TableView<S> tableView, @NamedArg("row") int row, @NamedArg("tableColumn") TableColumn<S,T> tableColumn) {
         super(row, tableColumn);
-        this.controlRef = new WeakReference<TableView<S>>(tableView);
+        this.controlRef = new WeakReference<>(tableView);
+        this.itemRef = new WeakReference<>(
+                row >= 0 && row < tableView.getItems().size() ? tableView.getItems().get(row) : null);
     }
     
     
@@ -78,6 +80,7 @@
      **************************************************************************/
 
     private final WeakReference<TableView<S>> controlRef;
+    private final WeakReference<S> itemRef;
 
 
     /***************************************************************************
@@ -109,7 +112,15 @@
         // Forcing the return type to be TableColumn<S,T>, not TableColumnBase<S,T>
         return super.getTableColumn();
     }
-    
+
+    /**
+     * Returns the item that backs the {@link #getRow()} row}, at the point
+     * in time when this TablePosition was created.
+     */
+    final S getItem() {
+        return itemRef == null ? null : itemRef.get();
+    }
+
     /**
      * Returns a string representation of this {@code TablePosition} object.
      * @return a string representation of this {@code TablePosition} object.
--- a/modules/controls/src/main/java/javafx/scene/control/TableView.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TableView.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1423,7 +1423,6 @@
         
         // update the Comparator property
         final Comparator<S> oldComparator = getComparator();
-
         setComparator(sortOrder.isEmpty() ? null : new TableColumnComparator(sortOrder));
 
         // fire the onSort event and check if it is consumed, if
@@ -1441,10 +1440,20 @@
             return;
         }
 
+        final List<TablePosition> prevState = new ArrayList<>(getSelectionModel().getSelectedCells());
+        final int itemCount = prevState.size();
+
+        // we set makeAtomic to true here, so that we don't fire intermediate
+        // sort events - instead we send a single permutation event at the end
+        // of this method.
+        getSelectionModel().startAtomic();
+
         // get the sort policy and run it
         Callback<TableView<S>, Boolean> sortPolicy = getSortPolicy();
         if (sortPolicy == null) return;
         Boolean success = sortPolicy.call(this);
+
+        getSelectionModel().stopAtomic();
         
         if (success == null || ! success) {
             // the sort was a failure. Need to backout if possible
@@ -1452,6 +1461,33 @@
             TableUtil.handleSortFailure(sortOrder, lastSortEventType, lastSortEventSupportInfo);
             setComparator(oldComparator);
             sortLock = false;
+        } else {
+            // sorting was a success, now we possibly fire an event on the
+            // selection model that the items list has 'permutated' to a new ordering
+
+            // FIXME we should support alternative selection model implementations!
+            if (getSelectionModel() instanceof TableViewArrayListSelectionModel) {
+                final TableViewArrayListSelectionModel<S> sm = (TableViewArrayListSelectionModel<S>) getSelectionModel();
+                final ObservableList<TablePosition<S,?>> newState = (ObservableList<TablePosition<S,?>>)(Object)sm.getSelectedCells();
+
+                List<TablePosition<S, ?>> removed = new ArrayList<>();
+                for (int i = 0; i < itemCount; i++) {
+                    TablePosition<S, ?> prevItem = prevState.get(i);
+                    if (!newState.contains(prevItem)) {
+                        removed.add(prevItem);
+                    }
+                }
+
+                if (!removed.isEmpty()) {
+                    // the sort operation effectively permutates the selectedCells list,
+                    // but we cannot fire a permutation event as we are talking about
+                    // TablePosition's changing (which may reside in the same list
+                    // position before and after the sort). Therefore, we need to fire
+                    // a single add/remove event to cover the added and removed positions.
+                    ListChangeListener.Change<TablePosition<S, ?>> c = new NonIterableChange.GenericAddRemoveChange<>(0, itemCount, removed, newState);
+                    sm.handleSelectedCellsListChangeEvent(c);
+                }
+            }
         }
     }
     
@@ -1945,9 +1981,7 @@
                 clearSelection();
             });
 
-            selectedCellsMap = new SelectedCellsMap<>(c -> {
-                handleSelectedCellsListChangeEvent(c);
-            });
+            selectedCellsMap = new SelectedCellsMap<>(c -> handleSelectedCellsListChangeEvent(c));
 
             selectedItems = new ReadOnlyUnbackedObservableList<S>() {
                 @Override public S get(int i) {
@@ -2106,9 +2140,9 @@
                         } else if (index < getItemCount() && index >= 0) {
                             // Fix for RT-18969: the list had setAll called on it
                             // Use of makeAtomic is a fix for RT-20945
-                            makeAtomic = true;
+                            startAtomic();
                             clearSelection(index);
-                            makeAtomic = false;
+                            stopAtomic();
                             select(index);
                         } else {
                             // Fix for RT-22079
@@ -2161,55 +2195,58 @@
                     //   -- detected a sort has happened
                     //   -- Create a permutation lookup map (1)
                     //   -- dump all the selected indices into a list (2)
-                    //   -- clear the selected items / indexes (3)
-                    //   -- create a list containing the new indices (4)
-                    //   -- for each previously-selected index (5)
+                    //   -- create a list containing the new indices (3)
+                    //   -- for each previously-selected index (4)
                     //     -- if index is in the permutation lookup map
                     //       -- add the new index to the new indices list
-                    //   -- Perform batch selection (6)
+                    //   -- Perform batch selection (5)
 
-                    makeAtomic = true;
+                    startAtomic();
 
                     final int oldSelectedIndex = getSelectedIndex();
 
                     // (1)
                     int length = c.getTo() - c.getFrom();
-                    HashMap<Integer, Integer> pMap = new HashMap<Integer, Integer> (length);
+                    HashMap<Integer, Integer> pMap = new HashMap<> (length);
                     for (int i = c.getFrom(); i < c.getTo(); i++) {
                         pMap.put(i, c.getPermutation(i));
                     }
 
                     // (2)
-                    List<TablePosition<S,?>> selectedIndices =
-                            new ArrayList<TablePosition<S,?>>((ObservableList<TablePosition<S,?>>)(Object)getSelectedCells());
-
+                    List<TablePosition<S,?>> selectedIndices = new ArrayList<>((ObservableList<TablePosition<S,?>>)(Object)getSelectedCells());
 
                     // (3)
-                    clearSelection();
+                    List<TablePosition<S,?>> newIndices = new ArrayList<>(selectedIndices.size());
 
                     // (4)
-                    List<TablePosition<S,?>> newIndices = new ArrayList<TablePosition<S,?>>(getSelectedIndices().size());
+                    boolean selectionIndicesChanged = false;
+                    for (int i = 0; i < selectedIndices.size(); i++) {
+                        final TablePosition<S,?> oldIndex = selectedIndices.get(i);
+                        final int oldRow = oldIndex.getRow();
 
-                    // (5)
-                    for (int i = 0; i < selectedIndices.size(); i++) {
-                        TablePosition<S,?> oldIndex = selectedIndices.get(i);
+                        if (pMap.containsKey(oldRow)) {
+                            int newIndex = pMap.get(oldRow);
 
-                        if (pMap.containsKey(oldIndex.getRow())) {
-                            Integer newIndex = pMap.get(oldIndex.getRow());
+                            selectionIndicesChanged = selectionIndicesChanged || newIndex != oldRow;
+
                             newIndices.add(new TablePosition<>(oldIndex.getTableView(), newIndex, oldIndex.getTableColumn()));
                         }
                     }
 
-                    // (6)
-                    quietClearSelection();
-                    makeAtomic = false;
-                    selectedCellsMap.setAll(newIndices);
-                    selectedCellsSeq.callObservers(new NonIterableChange.SimpleAddChange<>(0, newIndices.size(), selectedCellsSeq));
+                    if (selectionIndicesChanged) {
+                        // (5)
+                        quietClearSelection();
+                        stopAtomic();
 
-                    if (oldSelectedIndex >= 0 && oldSelectedIndex < itemCount) {
-                        int newIndex = c.getPermutation(oldSelectedIndex);
-                        setSelectedIndex(newIndex);
-                        focus(newIndex);
+                        selectedCellsMap.setAll(newIndices);
+
+                        if (oldSelectedIndex >= 0 && oldSelectedIndex < itemCount) {
+                            int newIndex = c.getPermutation(oldSelectedIndex);
+                            setSelectedIndex(newIndex);
+                            focus(newIndex);
+                        }
+                    } else {
+                        stopAtomic();
                     }
                 }
             }
@@ -2247,7 +2284,7 @@
             // resulted in the selectedItems and selectedIndices lists never
             // reporting that they were empty.
             // makeAtomic toggle added to resolve RT-32618
-            makeAtomic = true;
+            startAtomic();
 
             // firstly we make a copy of the selection, so that we can send out
             // the correct details in the selection change event
@@ -2259,7 +2296,7 @@
             // and select the new cell
             select(row, column);
 
-            makeAtomic = false;
+            stopAtomic();
 
             // fire off a single add/remove/replace notification (rather than
             // individual remove and add notifications) - see RT-33324
@@ -2280,10 +2317,6 @@
             // if I'm in cell selection mode but the column is null, I don't want
             // to select the whole row instead...
             if (isCellSelectionEnabled() && column == null) return;
-//            
-//            // If I am not in cell selection mode (so I want to select rows only),
-//            // if a column is given, I return
-//            if (! isCellSelectionEnabled() && column != null) return;
 
             TablePosition<S,?> pos = new TablePosition<>(getTableView(), row, column);
             
@@ -2440,7 +2473,7 @@
 
         @Override public void selectRange(int minRow, TableColumnBase<S,?> minColumn,
                                           int maxRow, TableColumnBase<S,?> maxColumn) {
-            makeAtomic = true;
+            startAtomic();
 
             if (getSelectionMode() == SelectionMode.SINGLE) {
                 quietClearSelection();
@@ -2477,7 +2510,7 @@
                     // end copy/paste
                 }
             }
-            makeAtomic = false;
+            stopAtomic();
 
             // fire off events.
             // Note that focus and selection always goes to maxRow, not _maxRow.
@@ -2516,7 +2549,7 @@
         }
 
         @Override public void clearSelection() {
-            if (! makeAtomic) {
+            if (! isAtomic()) {
                 updateSelectedIndex(-1);
                 focus(-1);
             }
@@ -2733,8 +2766,8 @@
             // }
             //
             // A more efficient solution:
-            final List<Integer> newlySelectedRows = new ArrayList<Integer>();
-            final List<Integer> newlyUnselectedRows = new ArrayList<Integer>();
+            final List<Integer> newlySelectedRows = new ArrayList<>();
+            final List<Integer> newlyUnselectedRows = new ArrayList<>();
 
             while (c.next()) {
                 if (c.wasRemoved()) {
@@ -2764,7 +2797,7 @@
             }
             c.reset();
 
-            if (makeAtomic) {
+            if (isAtomic()) {
                 return;
             }
 
@@ -2772,9 +2805,49 @@
             // the observers of the selectedItems, selectedIndices and
             // selectedCells lists.
 
-            // create an on-demand list of the removed objects contained in the
-            // given rows
-            selectedItems.callObservers(new MappingChange<TablePosition<S,?>, S>(c, cellToItemsMap, selectedItems));
+            // here we are considering whether to notify the observers of the
+            // selectedItems list. However, we can't just blindly do that, as
+            // noted below. This is a part of the fix for RT-37429.
+            while (c.next()) {
+                boolean fireChangeEvent;
+                outer: if (c.wasReplaced()) {
+                    // if a replace happened, we need to check to see if the
+                    // change actually impacts on the selected items - it may
+                    // be that the index changed to the new location of the same
+                    // item (i.e. if a sort occurred). Only if the item has changed
+                    // should we fire an event to the observers of the selectedItems
+                    // list
+                    for (int i = 0; i < c.getRemovedSize(); i++) {
+                        TablePosition<S,?> removed = c.getRemoved().get(i);
+                        S removedItem = removed.getItem();
+
+                        boolean matchFound = false;
+                        for (int j = 0; j < c.getAddedSize(); j++) {
+                            TablePosition<S,?> added = c.getAddedSubList().get(j);
+                            S addedItem = added.getItem();
+
+                            if (removedItem.equals(addedItem)) {
+                                matchFound = true;
+                                break;
+                            }
+                        }
+
+                        if (! matchFound) {
+                            fireChangeEvent = true;
+                            break outer;
+                        }
+                    }
+                    fireChangeEvent = false;
+                } else {
+                    fireChangeEvent = true;
+                }
+
+                if (fireChangeEvent) {
+                    // create an on-demand list of the removed objects contained in the
+                    // given rows.
+                    selectedItems.callObservers(new MappingChange<>(c, cellToItemsMap, selectedItems));
+                }
+            }
             c.reset();
 
             // Fix for RT-31577 - the selectedItems list was going to
@@ -2801,11 +2874,11 @@
                 ListChangeListener.Change<Integer> change = createRangeChange(selectedIndicesSeq, newlySelectedRows);
                 selectedIndicesSeq.callObservers(change);
             } else {
-                selectedIndicesSeq.callObservers(new MappingChange<TablePosition<S,?>, Integer>(c, cellToIndicesMap, selectedIndicesSeq));
+                selectedIndicesSeq.callObservers(new MappingChange<>(c, cellToIndicesMap, selectedIndicesSeq));
                 c.reset();
             }
 
-            selectedCellsSeq.callObservers(new MappingChange<TablePosition<S,?>, TablePosition<S,?>>(c, MappingChange.NOOP_MAP, selectedCellsSeq));
+            selectedCellsSeq.callObservers(new MappingChange<>(c, MappingChange.NOOP_MAP, selectedCellsSeq));
             c.reset();
         }
     }
--- a/modules/controls/src/main/java/javafx/scene/control/TreeItem.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeItem.java	Thu Jun 12 09:52:47 2014 -0700
@@ -369,7 +369,7 @@
     // It is important that interactions with this list go directly into the
     // children property, rather than via getChildren(), as this may be 
     // a very expensive call.
-    private ObservableList<TreeItem<T>> children;
+    ObservableList<TreeItem<T>> children;
 
     // Made static based on findings of RT-18344 - EventHandlerManager is an
     // expensive class and should be reused amongst classes if at all possible.
--- a/modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java	Thu Jun 12 09:52:47 2014 -0700
@@ -116,7 +116,11 @@
      * storeTableView method.
      */
     private ListChangeListener<TreeTablePosition<S,?>> selectedListener = c -> {
-        updateSelection();
+        while (c.next()) {
+            if (c.wasAdded() || c.wasRemoved()) {
+                updateSelection();
+            }
+        }
     };
 
     // same as above, but for focus
--- a/modules/controls/src/main/java/javafx/scene/control/TreeTablePosition.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeTablePosition.java	Thu Jun 12 09:52:47 2014 -0700
@@ -66,8 +66,8 @@
      */
     public TreeTablePosition(@NamedArg("treeTableView") TreeTableView<S> treeTableView, @NamedArg("row") int row, @NamedArg("tableColumn") TreeTableColumn<S,T> tableColumn) {
         super(row, tableColumn);
-        this.controlRef = new WeakReference<TreeTableView<S>>(treeTableView);
-        this.treeItemRef = new WeakReference<TreeItem<S>>(treeTableView.getTreeItem(row));
+        this.controlRef = new WeakReference<>(treeTableView);
+        this.treeItemRef = new WeakReference<>(treeTableView.getTreeItem(row));
     }
     
     
--- a/modules/controls/src/main/java/javafx/scene/control/TreeTableView.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeTableView.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1659,16 +1659,11 @@
         
         // update the Comparator property
         final Comparator<TreeItem<S>> oldComparator = getComparator();
-        if (sortOrder.isEmpty()) {
-            setComparator(null);
-        } else {
-            Comparator<TreeItem<S>> newComparator = new TableColumnComparatorBase.TreeTableColumnComparator(sortOrder);
-            setComparator(newComparator);
-        }
+        setComparator(sortOrder.isEmpty() ? null : new TableColumnComparatorBase.TreeTableColumnComparator(sortOrder));
         
         // fire the onSort event and check if it is consumed, if
         // so, don't run the sort
-        SortEvent<TreeTableView<S>> sortEvent = new SortEvent<TreeTableView<S>>(TreeTableView.this, TreeTableView.this);
+        SortEvent<TreeTableView<S>> sortEvent = new SortEvent<>(TreeTableView.this, TreeTableView.this);
         fireEvent(sortEvent);
         if (sortEvent.isConsumed()) {
             // if the sort is consumed we could back out the last action (the code
@@ -1681,10 +1676,20 @@
             return;
         }
 
+        final List<TreeTablePosition<S,?>> prevState = new ArrayList<>(getSelectionModel().getSelectedCells());
+        final int itemCount = prevState.size();
+
+        // we set makeAtomic to true here, so that we don't fire intermediate
+        // sort events - instead we send a single permutation event at the end
+        // of this method.
+        getSelectionModel().startAtomic();
+
         // get the sort policy and run it
         Callback<TreeTableView<S>, Boolean> sortPolicy = getSortPolicy();
         if (sortPolicy == null) return;
         Boolean success = sortPolicy.call(this);
+
+        getSelectionModel().stopAtomic();
         
         if (success == null || ! success) {
             // the sort was a failure. Need to backout if possible
@@ -1692,6 +1697,33 @@
             TableUtil.handleSortFailure(sortOrder, lastSortEventType, lastSortEventSupportInfo);
             setComparator(oldComparator);
             sortLock = false;
+        } else {
+            // sorting was a success, now we possibly fire an event on the
+            // selection model that the items list has 'permutated' to a new ordering
+
+            // FIXME we should support alternative selection model implementations!
+            if (getSelectionModel() instanceof TreeTableViewArrayListSelectionModel) {
+                final TreeTableViewArrayListSelectionModel<S> sm = (TreeTableViewArrayListSelectionModel<S>) getSelectionModel();
+                final ObservableList<TreeTablePosition<S, ?>> newState = sm.getSelectedCells();
+
+                List<TreeTablePosition<S, ?>> removed = new ArrayList<>();
+                for (int i = 0; i < itemCount; i++) {
+                    TreeTablePosition<S, ?> prevItem = prevState.get(i);
+                    if (!newState.contains(prevItem)) {
+                        removed.add(prevItem);
+                    }
+                }
+
+                if (!removed.isEmpty()) {
+                    // the sort operation effectively permutates the selectedCells list,
+                    // but we cannot fire a permutation event as we are talking about
+                    // TreeTablePosition's changing (which may reside in the same list
+                    // position before and after the sort). Therefore, we need to fire
+                    // a single add/remove event to cover the added and removed positions.
+                    ListChangeListener.Change<TreeTablePosition<S, ?>> c = new NonIterableChange.GenericAddRemoveChange<>(0, itemCount, removed, newState);
+                    sm.handleSelectedCellsListChangeEvent(c);
+                }
+            }
         }
     }
     
@@ -2206,9 +2238,7 @@
             this.treeTableView.rootProperty().addListener(weakRootPropertyListener);
             updateTreeEventListener(null, treeTableView.getRoot());
 
-            selectedCellsMap = new SelectedCellsMap<>(c -> {
-                handleSelectedCellsListChangeEvent(c);
-            });
+            selectedCellsMap = new SelectedCellsMap<>(c -> handleSelectedCellsListChangeEvent(c));
 
             selectedItems = new ReadOnlyUnbackedObservableList<TreeItem<S>>() {
                 @Override public TreeItem<S> get(int i) {
@@ -2378,7 +2408,7 @@
                         // the items / indices lists get a lot of intermediate
                         // noise. They eventually get the summary event fired
                         // from within shiftSelection, so this is ok.
-                        makeAtomic = true;
+                        startAtomic();
 
                         final int clearIndex = param.getClearIndex();
                         TreeTablePosition<S,?> oldTP = null;
@@ -2400,7 +2430,7 @@
                             selectedCellsMap.add(newTP);
                         }
 
-                        makeAtomic = false;
+                        stopAtomic();
 
                         return null;
                     }
@@ -2475,7 +2505,7 @@
             // resulted in the selectedItems and selectedIndices lists never
             // reporting that they were empty.
             // makeAtomic toggle added to resolve RT-32618
-            makeAtomic = true;
+            startAtomic();
 
             // firstly we make a copy of the selection, so that we can send out
             // the correct details in the selection change event
@@ -2487,7 +2517,7 @@
             // and select the new cell
             select(row, column);
 
-            makeAtomic = false;
+            stopAtomic();
 
             // fire off a single add/remove/replace notification (rather than
             // individual remove and add notifications) - see RT-33324
@@ -2508,24 +2538,17 @@
             // if I'm in cell selection mode but the column is null, I don't want
             // to select the whole row instead...
             if (isCellSelectionEnabled() && column == null) return;
-//            
-//            // If I am not in cell selection mode (so I want to select rows only),
-//            // if a column is given, I return
-//            if (! isCellSelectionEnabled() && column != null) return;
 
             TreeTablePosition<S,?> pos = new TreeTablePosition<>(getTreeTableView(), row, (TreeTableColumn<S,?>)column);
             
             if (getSelectionMode() == SelectionMode.SINGLE) {
                 quietClearSelection();
             }
+
             selectedCellsMap.add(pos);
 
-//            setSelectedIndex(row);
             updateSelectedIndex(row);
-            focus(row, (TreeTableColumn<S,?>)column);
-            
-            int changeIndex = selectedCellsSeq.indexOf(pos);
-            selectedCellsSeq.callObservers(new NonIterableChange.SimpleAddChange<TreeTablePosition<S,?>>(changeIndex, changeIndex+1, selectedCellsSeq));
+            focus(row, (TreeTableColumn<S, ?>) column);
         }
 
         @Override public void select(TreeItem<S> obj) {
@@ -2672,7 +2695,7 @@
 
         @Override public void selectRange(int minRow, TableColumnBase<TreeItem<S>,?> minColumn,
                                           int maxRow, TableColumnBase<TreeItem<S>,?> maxColumn) {
-            makeAtomic = true;
+            startAtomic();
 
             if (getSelectionMode() == SelectionMode.SINGLE) {
                 quietClearSelection();
@@ -2709,7 +2732,7 @@
                     // end copy/paste
                 }
             }
-            makeAtomic = false;
+            stopAtomic();
 
             // fire off events
             // Note that focus and selection always goes to maxRow, not _maxRow.
@@ -2746,7 +2769,7 @@
         }
 
         @Override public void clearSelection() {
-            if (! makeAtomic) {
+            if (! isAtomic()) {
                 updateSelectedIndex(-1);
                 focus(-1);
             }
@@ -2970,8 +2993,8 @@
             // }
             //
             // A more efficient solution:
-            final List<Integer> newlySelectedRows = new ArrayList<Integer>();
-            final List<Integer> newlyUnselectedRows = new ArrayList<Integer>();
+            final List<Integer> newlySelectedRows = new ArrayList<>();
+            final List<Integer> newlyUnselectedRows = new ArrayList<>();
 
             while (c.next()) {
                 if (c.wasRemoved()) {
@@ -3001,7 +3024,7 @@
             }
             c.reset();
 
-            if (makeAtomic) {
+            if (isAtomic()) {
                 return;
             }
 
@@ -3009,9 +3032,49 @@
             // the observers of the selectedItems, selectedIndices and
             // selectedCells lists.
 
-            // create an on-demand list of the removed objects contained in the
-            // given rows
-            selectedItems.callObservers(new MappingChange<TreeTablePosition<S,?>, TreeItem<S>>(c, cellToItemsMap, selectedItems));
+            // here we are considering whether to notify the observers of the
+            // selectedItems list. However, we can't just blindly do that, as
+            // noted below. This is a part of the fix for RT-37429.
+            while (c.next()) {
+                boolean fireChangeEvent;
+                outer: if (c.wasReplaced()) {
+                    // if a replace happened, we need to check to see if the
+                    // change actually impacts on the selected items - it may
+                    // be that the index changed to the new location of the same
+                    // item (i.e. if a sort occurred). Only if the item has changed
+                    // should we fire an event to the observers of the selectedItems
+                    // list
+                    for (int i = 0; i < c.getRemovedSize(); i++) {
+                        TreeTablePosition<S,?> removed = c.getRemoved().get(i);
+                        TreeItem<S> removedTreeItem = removed.getTreeItem();
+
+                        boolean matchFound = false;
+                        for (int j = 0; j < c.getAddedSize(); j++) {
+                            TreeTablePosition<S,?> added = c.getAddedSubList().get(j);
+                            TreeItem<S> addedTreeItem = added.getTreeItem();
+
+                            if (removedTreeItem.equals(addedTreeItem)) {
+                                matchFound = true;
+                                break;
+                            }
+                        }
+
+                        if (! matchFound) {
+                            fireChangeEvent = true;
+                            break outer;
+                        }
+                    }
+                    fireChangeEvent = false;
+                } else {
+                    fireChangeEvent = true;
+                }
+
+                if (fireChangeEvent) {
+                    // create an on-demand list of the removed objects contained in the
+                    // given rows.
+                    selectedItems.callObservers(new MappingChange<>(c, cellToItemsMap, selectedItems));
+                }
+            }
             c.reset();
 
             // Fix for RT-31577 - the selectedItems list was going to
@@ -3038,11 +3101,11 @@
                 ListChangeListener.Change<Integer> change = createRangeChange(selectedIndicesSeq, newlySelectedRows);
                 selectedIndicesSeq.callObservers(change);
             } else {
-                selectedIndicesSeq.callObservers(new MappingChange<TreeTablePosition<S,?>, Integer>(c, cellToIndicesMap, selectedIndicesSeq));
+                selectedIndicesSeq.callObservers(new MappingChange<>(c, cellToIndicesMap, selectedIndicesSeq));
                 c.reset();
             }
 
-            selectedCellsSeq.callObservers(new MappingChange<TreeTablePosition<S,?>, TreeTablePosition<S,?>>(c, MappingChange.NOOP_MAP, selectedCellsSeq));
+            selectedCellsSeq.callObservers(new MappingChange<>(c, MappingChange.NOOP_MAP, selectedCellsSeq));
             c.reset();
         }
     }
--- a/modules/controls/src/main/java/javafx/scene/control/TreeUtil.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeUtil.java	Thu Jun 12 09:52:47 2014 -0700
@@ -108,7 +108,7 @@
         List<TreeItem<T>> siblings;
         
         while (!i.equals(root) && p != null) {
-            siblings = p.getChildren();
+            siblings = p.children;
             
             // work up each sibling, from the current item
             int itemIndex = siblings.indexOf(i);
--- a/modules/controls/src/test/java/javafx/scene/control/TableViewTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/test/java/javafx/scene/control/TableViewTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -3040,7 +3040,7 @@
         VirtualFlow flow = VirtualFlowTestUtils.getVirtualFlow(tableView);
         flow.adjustPixels(1000 * 24);
 
-        assertEquals(cellCountAtStart + 1, rt36556_instanceCount);
+        assertEquals(cellCountAtStart, rt36556_instanceCount);
 
         sl.dispose();
     }
@@ -3582,4 +3582,93 @@
 
         sl.dispose();
     }
+
+    @Test public void test_rt_37429() {
+        // get the current exception handler before replacing with our own,
+        // as ListListenerHelp intercepts the exception otherwise
+        final Thread.UncaughtExceptionHandler exceptionHandler = Thread.currentThread().getUncaughtExceptionHandler();
+        Thread.currentThread().setUncaughtExceptionHandler((t, e) -> fail("We don't expect any exceptions in this test!"));
+
+        // table columns - 1 column; name
+        TableColumn<String, String> nameColumn = new TableColumn<>("name");
+        nameColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper(param.getValue()));
+        nameColumn.setPrefWidth(200);
+
+        // table
+        TableView<String> table = new TableView<>();
+        table.setItems(FXCollections.observableArrayList("one", "two", "three", "four", "five"));
+        table.getColumns().addAll(nameColumn);
+
+        table.getSelectionModel().getSelectedItems().addListener((ListChangeListener<String>) c -> {
+            while (c.next()) {
+                if(c.wasRemoved()) {
+                    // The removed list of items must be iterated or the AIOOBE will
+                    // not be thrown when getAddedSubList is called.
+                    c.getRemoved().forEach(item -> {});
+                }
+
+                if (c.wasAdded()) {
+                    c.getAddedSubList();
+                }
+            }
+        });
+
+        StageLoader sl = new StageLoader(table);
+
+        table.getSelectionModel().select(0);
+        table.getSortOrder().add(nameColumn);
+
+        sl.dispose();
+
+        // reset the exception handler
+        Thread.currentThread().setUncaughtExceptionHandler(exceptionHandler);
+    }
+
+    private int rt_37429_items_change_count = 0;
+    private int rt_37429_cells_change_count = 0;
+    @Test public void test_rt_37429_sortEventsShouldNotFireExtraChangeEvents() {
+        // table columns - 1 column; name
+        TableColumn<String, String> nameColumn = new TableColumn<>("name");
+        nameColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper(param.getValue()));
+        nameColumn.setPrefWidth(200);
+
+        // table
+        TableView<String> table = new TableView<>();
+        table.setItems(FXCollections.observableArrayList("a", "c", "b"));
+        table.getColumns().addAll(nameColumn);
+
+        table.getSelectionModel().getSelectedItems().addListener((ListChangeListener<String>) c -> {
+            while (c.next()) {
+                rt_37429_items_change_count++;
+            }
+        });
+        table.getSelectionModel().getSelectedCells().addListener((ListChangeListener<TablePosition>) c -> {
+            while (c.next()) {
+                rt_37429_cells_change_count++;
+            }
+        });
+
+        StageLoader sl = new StageLoader(table);
+
+        assertEquals(0, rt_37429_items_change_count);
+        assertEquals(0, rt_37429_cells_change_count);
+
+        table.getSelectionModel().select(0);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(1, rt_37429_cells_change_count);
+
+        table.getSortOrder().add(nameColumn);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(1, rt_37429_cells_change_count);
+
+        nameColumn.setSortType(TableColumn.SortType.DESCENDING);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(2, rt_37429_cells_change_count);
+
+        nameColumn.setSortType(TableColumn.SortType.ASCENDING);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(3, rt_37429_cells_change_count);
+
+        sl.dispose();
+    }
 }
--- a/modules/controls/src/test/java/javafx/scene/control/TreeTableViewMouseInputTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/test/java/javafx/scene/control/TreeTableViewMouseInputTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -530,7 +530,7 @@
         final int items = 8;
         root.getChildren().clear();
         root.setExpanded(true);
-        for (int i = 0; i < items; i++) {
+        for (int i = 1; i < items; i++) {
             root.getChildren().add(new TreeItem<>("Row " + i));
         }
         tableView.setRoot(root);
--- a/modules/controls/src/test/java/javafx/scene/control/TreeTableViewTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/test/java/javafx/scene/control/TreeTableViewTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -2343,7 +2343,7 @@
 
         // now test to ensure that CCC is still the only selected item, but now
         // located in index 1 (as the first child of the root)
-        assertTrue(sm.isSelected(1));
+        assertTrue(debug(), sm.isSelected(1));
         assertEquals(1, sm.getSelectedIndex());
         assertEquals(1, sm.getSelectedIndices().size());
         assertTrue(sm.getSelectedIndices().contains(1));
@@ -3606,4 +3606,117 @@
 
         sl.dispose();
     }
+
+    @Test public void test_rt_37429() {
+        // get the current exception handler before replacing with our own,
+        // as ListListenerHelp intercepts the exception otherwise
+        final Thread.UncaughtExceptionHandler exceptionHandler = Thread.currentThread().getUncaughtExceptionHandler();
+        Thread.currentThread().setUncaughtExceptionHandler((t, e) -> {
+            e.printStackTrace();
+            fail("We don't expect any exceptions in this test!");
+        });
+
+        // table items - 3 items, 2nd item has 2 children
+        TreeItem<String> root = new TreeItem<>();
+
+        TreeItem<String> two = new TreeItem<>("two");
+        two.getChildren().add(new TreeItem<>("childOne"));
+        two.getChildren().add(new TreeItem<>("childTwo"));
+        two.setExpanded(true);
+
+        root.getChildren().add(new TreeItem<>("one"));
+        root.getChildren().add(two);
+        root.getChildren().add(new TreeItem<>("three"));
+
+        // table columns - 1 column; name
+        TreeTableColumn<String, String> nameColumn = new TreeTableColumn<>("name");
+        nameColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper(param.getValue().getValue()));
+        nameColumn.setPrefWidth(200);
+
+        // table
+        TreeTableView<String> table = new TreeTableView<>();
+        table.setShowRoot(false);
+        table.setRoot(root);
+        table.getColumns().addAll(nameColumn);
+
+        table.getSelectionModel().getSelectedItems().addListener((ListChangeListener<TreeItem<String>>) c -> {
+            while (c.next()) {
+                if(c.wasRemoved()) {
+                    // The removed list of items must be iterated or the AIOOBE will
+                    // not be thrown when getAddedSubList is called.
+                    c.getRemoved().forEach(item -> {});
+                }
+
+                if (c.wasAdded()) {
+                    c.getAddedSubList();
+                }
+            }
+        });
+
+        StageLoader sl = new StageLoader(table);
+
+        table.getSelectionModel().select(0);
+        table.getSortOrder().add(nameColumn);
+
+        sl.dispose();
+
+        // reset the exception handler
+        Thread.currentThread().setUncaughtExceptionHandler(exceptionHandler);
+    }
+
+    private int rt_37429_items_change_count = 0;
+    private int rt_37429_cells_change_count = 0;
+    @Test public void test_rt_37429_sortEventsShouldNotFireExtraChangeEvents() {
+        // table items - 3 items, 2nd item has 2 children
+        TreeItem<String> root = new TreeItem<>();
+
+        root.getChildren().add(new TreeItem<>("a"));
+        root.getChildren().add(new TreeItem<>("c"));
+        root.getChildren().add(new TreeItem<>("b"));
+
+        // table columns - 1 column; name
+        TreeTableColumn<String, String> nameColumn = new TreeTableColumn<>("name");
+        nameColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper(param.getValue().getValue()));
+        nameColumn.setPrefWidth(200);
+
+        // table
+        TreeTableView<String> table = new TreeTableView<>();
+        table.setShowRoot(false);
+        table.setRoot(root);
+        table.getColumns().addAll(nameColumn);
+
+        table.getSelectionModel().getSelectedItems().addListener((ListChangeListener<TreeItem<String>>) c -> {
+            while (c.next()) {
+                rt_37429_items_change_count++;
+            }
+        });
+        table.getSelectionModel().getSelectedCells().addListener((ListChangeListener<TreeTablePosition<String, ?>>) c -> {
+            while (c.next()) {
+                rt_37429_cells_change_count++;
+            }
+        });
+
+        StageLoader sl = new StageLoader(table);
+
+        assertEquals(0, rt_37429_items_change_count);
+        assertEquals(0, rt_37429_cells_change_count);
+
+        table.getSelectionModel().select(0);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(1, rt_37429_cells_change_count);
+
+        table.getSortOrder().add(nameColumn);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(1, rt_37429_cells_change_count);
+
+        nameColumn.setSortType(TreeTableColumn.SortType.DESCENDING);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(2, rt_37429_cells_change_count);
+
+        nameColumn.setSortType(TreeTableColumn.SortType.ASCENDING);
+        assertEquals(1, rt_37429_items_change_count);
+        assertEquals(3, rt_37429_cells_change_count);
+
+        sl.dispose();
+    }
 }
--- a/modules/controls/src/test/java/javafx/scene/control/TreeViewTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/controls/src/test/java/javafx/scene/control/TreeViewTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1937,4 +1937,55 @@
 
         sl.dispose();
     }
+
+    @Test public void test_rt_37502() {
+        final TreeView<Long> tree = new TreeView<>(new NumberTreeItem(1));
+        tree.setCellFactory(new Callback<TreeView<Long>, TreeCell<Long>>() {
+            @Override
+            public TreeCell<Long> call(TreeView<Long> param) {
+                return new TreeCell<Long>() {
+                    @Override
+                    protected void updateItem(Long item, boolean empty) {
+                        super.updateItem(item, empty);
+                        if (!empty) {
+                            setText(item != null ? String.valueOf(item) : "");
+                        } else{
+                            setText(null);
+                        }
+                    }
+                };
+            }
+        });
+
+        StageLoader sl = new StageLoader(tree);
+
+        tree.getSelectionModel().select(0);
+        tree.getRoot().setExpanded(true);
+        Toolkit.getToolkit().firePulse();
+
+        sl.dispose();
+    }
+
+    private static class NumberTreeItem extends TreeItem<Long>{
+        private boolean loaded = false;
+
+        private NumberTreeItem(long value) {
+            super(value);
+        }
+
+        @Override public boolean isLeaf() {
+            return false;
+        }
+
+        @Override public ObservableList<TreeItem<Long>> getChildren() {
+            if(!loaded){
+                final ObservableList<TreeItem<Long>> children =  super.getChildren();
+                for (int i = 0; i < 10; i++) {
+                    children.add(new NumberTreeItem(10 * getValue() + i));
+                }
+                loaded = true;
+            }
+            return super.getChildren();
+        }
+    }
 }
--- a/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Thu Jun 12 09:52:47 2014 -0700
@@ -3302,7 +3302,7 @@
         private static final int PACKAGE = 4;
         private static final int PRIVATE = 8;
         private static final int INITIAL_CLASS_ACCESS =
-                PUBLIC | PACKAGE | PRIVATE;
+                PUBLIC | PROTECTED | PACKAGE | PRIVATE;
         private static final int INITIAL_MEMBER_ACCESS =
                 PUBLIC | PROTECTED | PACKAGE | PRIVATE;
 
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/StandardBundlerParam.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/StandardBundlerParam.java	Thu Jun 12 09:52:47 2014 -0700
@@ -190,10 +190,10 @@
                     }
             );
 
-    public static final StandardBundlerParam<String> MAIN_JAR_CLASSPATH =
+    public static final StandardBundlerParam<String> CLASSPATH =
             new StandardBundlerParam<>(
-                    I18N.getString("param.main-jar-classpath.name"),
-                    I18N.getString("param.main-jar-classpath.description"),
+                    I18N.getString("param.classpath.name"),
+                    I18N.getString("param.classpath.description"),
                     "classpath",
                     String.class,
                     params -> {
@@ -201,7 +201,7 @@
                         String cp = (String) params.get("classpath");
                         return cp == null ? "" : cp;
                     },
-                    (s, p) -> s
+                    (s, p) -> s.replace(File.pathSeparator, " ")
             );
 
     public static final StandardBundlerParam<Boolean> USE_FX_PACKAGING =
@@ -454,7 +454,7 @@
     public static void extractMainClassInfoFromAppResources(Map<String, ? super Object> params) {
         boolean hasMainClass = params.containsKey(MAIN_CLASS.getID());
         boolean hasMainJar = params.containsKey(MAIN_JAR.getID());
-        boolean hasMainJarClassPath = params.containsKey(MAIN_JAR_CLASSPATH.getID());
+        boolean hasMainJarClassPath = params.containsKey(CLASSPATH.getID());
 
         if (hasMainClass && hasMainJar && hasMainJarClassPath) {
             return;
@@ -467,7 +467,7 @@
             files = rfs.getIncludedFiles();
             srcdir = rfs.getBaseDirectory();
         } else if (hasMainJarClassPath) {
-            files = Arrays.asList(MAIN_JAR_CLASSPATH.fetchFrom(params).split(File.pathSeparator));
+            files = Arrays.asList(CLASSPATH.fetchFrom(params).split("\\s+"));
             srcdir = APP_RESOURCES.fetchFrom(params).getBaseDirectory();
         } else {
             RelativeFileSet rfs = APP_RESOURCES.fetchFrom(params);
@@ -530,7 +530,7 @@
                     }
                     if (!hasMainJarClassPath) {
                         String cp = attrs.getValue(Attributes.Name.CLASS_PATH);
-                        params.put(MAIN_JAR_CLASSPATH.getID(), cp == null ? "" : cp);
+                        params.put(CLASSPATH.getID(), cp == null ? "" : cp);
                     }
                     break;
                 }
@@ -543,7 +543,7 @@
     public static void validateMainClassInfoFromAppResources(Map<String, ? super Object> params) throws ConfigException {
         boolean hasMainClass = params.containsKey(MAIN_CLASS.getID());
         boolean hasMainJar = params.containsKey(MAIN_JAR.getID());
-        boolean hasMainJarClassPath = params.containsKey(MAIN_JAR_CLASSPATH.getID());
+        boolean hasMainJarClassPath = params.containsKey(CLASSPATH.getID());
 
         if (hasMainClass && hasMainJar && hasMainJarClassPath) {
             return;
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxAppBundler.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxAppBundler.java	Thu Jun 12 09:52:47 2014 -0700
@@ -253,8 +253,7 @@
             out.println("app.mainclass=" +
                     MAIN_CLASS.fetchFrom(params).replaceAll("\\.", "/"));
         }
-        //This will be emtry string for correctly packaged JavaFX apps
-        out.println("app.classpath=" + MAIN_JAR_CLASSPATH.fetchFrom(params));
+        out.println("app.classpath=" + CLASSPATH.fetchFrom(params));
 
         List<String> jvmargs = JVM_OPTIONS.fetchFrom(params);
         int idx = 1;
@@ -337,7 +336,7 @@
                 LINUX_RUNTIME,
                 MAIN_CLASS,
                 MAIN_JAR,
-                MAIN_JAR_CLASSPATH,
+                CLASSPATH,
                 PREFERENCES_ID,
                 USER_JVM_OPTIONS,
                 VERSION
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/mac/MacAppBundler.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/mac/MacAppBundler.java	Thu Jun 12 09:52:47 2014 -0700
@@ -612,8 +612,7 @@
 //        } else {
         data.put("DEPLOY_LAUNCHER_CLASS", MAIN_CLASS.fetchFrom(params));
 //        }
-        // This will be an empty string for correctly packaged JavaFX apps
-        data.put("DEPLOY_APP_CLASSPATH", MAIN_JAR_CLASSPATH.fetchFrom(params).replace(":", " "));
+        data.put("DEPLOY_APP_CLASSPATH", CLASSPATH.fetchFrom(params));
 
         //TODO: Add remainder of the classpath
 
@@ -681,7 +680,7 @@
                 MAC_RUNTIME,
                 MAIN_CLASS,
                 MAIN_JAR,
-                MAIN_JAR_CLASSPATH,
+                CLASSPATH,
                 PREFERENCES_ID,
                 USER_JVM_OPTIONS,
                 VERSION
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinAppBundler.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinAppBundler.java	Thu Jun 12 09:52:47 2014 -0700
@@ -343,8 +343,7 @@
             out.println("app.mainclass=" +
                     MAIN_CLASS.fetchFrom(params).replaceAll("\\.", "/"));
         }
-        //This will be emtry string for correctly packaged JavaFX apps
-        out.println("app.classpath=" + MAIN_JAR_CLASSPATH.fetchFrom(params));
+        out.println("app.classpath=" + CLASSPATH.fetchFrom(params));
 
         List<String> jvmargs = JVM_OPTIONS.fetchFrom(params);
         int idx = 1;
@@ -425,7 +424,7 @@
                 JVM_PROPERTIES,
                 MAIN_CLASS,
                 MAIN_JAR,
-                MAIN_JAR_CLASSPATH,
+                CLASSPATH,
                 PREFERENCES_ID,
                 USER_JVM_OPTIONS,
                 VERSION,
--- a/modules/fxpackager/src/main/resources/com/oracle/tools/packager/StandardBundlerParam.properties	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/main/resources/com/oracle/tools/packager/StandardBundlerParam.properties	Thu Jun 12 09:52:47 2014 -0700
@@ -47,8 +47,8 @@
 param.main-class.name=Main Class
 param.main-class.description=The main class for the application.  Either a javafx.application.Application instance or a java class with a main method.
 
-param.main-jar-classpath.name=Main Jar Classpath
-param.main-jar-classpath.description=The classpath from the main jar of the application, relative to the assembled application directory.
+param.classpath.name=Main Jar Classpath
+param.classpath.description=The classpath from the main jar of the application, relative to the assembled application directory.
 
 param.main-jar.name=Main Jar
 param.main-jar.description=The main jar of the application.  This jar should have the main-class, and is relative to the assembled application dir.
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxAppBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxAppBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -138,7 +138,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(VERBOSE.getID(), true);
 
@@ -222,7 +222,7 @@
         bundleParams.put(JVM_PROPERTIES.getID(), "everything.jvm.property=everything.jvm.property.value");
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxDebBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxDebBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -142,7 +142,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(LICENSE_FILE.getID(), Arrays.asList("LICENSE", "LICENSE2"));
         bundleParams.put(LICENSE_TYPE.getID(), "GPL2 + Classpath Exception");
@@ -211,7 +211,7 @@
         bundleParams.put(JVM_PROPERTIES.getID(), "everything.jvm.property=everything.jvm.property.value");
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
@@ -282,7 +282,7 @@
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(MAIN_CLASS.getID(), "hello.HelloService");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
 
         bundleParams.put(DESCRIPTION.getID(), "Does a random heart beat every 30 seconds or so to a log file in tmp");
         bundleParams.put(LICENSE_FILE.getID(), "LICENSE");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxRpmBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxRpmBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -143,7 +143,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(LICENSE_FILE.getID(), Arrays.asList("LICENSE", "LICENSE2"));
         bundleParams.put(LICENSE_TYPE.getID(), "GPL2 + Classpath Exception");
@@ -213,7 +213,7 @@
         bundleParams.put(JVM_PROPERTIES.getID(), "everything.jvm.property=everything.jvm.property.value");
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
@@ -281,7 +281,7 @@
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(MAIN_CLASS.getID(), "hello.HelloService");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
 
         bundleParams.put(DESCRIPTION.getID(), "Does a random heart beat every 30 seconds or so to a log file in tmp");
         bundleParams.put(LICENSE_FILE.getID(), "LICENSE");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -145,7 +145,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(VERBOSE.getID(), true);
         bundleParams.put(DEVELOPER_ID_APP_SIGNING_KEY.getID(), null); // force no signing
@@ -264,7 +264,7 @@
         bundleParams.put(MAC_RUNTIME.getID(), System.getProperty("java.home"));
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppStoreBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppStoreBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -171,7 +171,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(IDENTIFIER.getID(), "com.example.javapacakger.hello.TestPackager");
         bundleParams.put(MacAppBundler.MAC_CATEGORY.getID(), "public.app-category.developer-tools");
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
@@ -205,7 +205,7 @@
         bundleParams.put(MAC_RUNTIME.getID(), System.getProperty("java.home"));
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDmgBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDmgBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -148,7 +148,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(LICENSE_FILE.getID(), Arrays.asList("LICENSE", "LICENSE2"));
         bundleParams.put(VERBOSE.getID(), true);
@@ -223,7 +223,7 @@
         bundleParams.put(MAC_RUNTIME.getID(), System.getProperty("java.home"));
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacPkgBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacPkgBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -149,7 +149,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(VERBOSE.getID(), true);
         bundleParams.put(LICENSE_FILE.getID(), Arrays.asList("LICENSE", "LICENSE2"));
         bundleParams.put(DEVELOPER_ID_APP_SIGNING_KEY.getID(), null); // force no signing
@@ -260,7 +260,7 @@
         bundleParams.put(MAC_RUNTIME.getID(), System.getProperty("java.home"));
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinAppBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinAppBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -140,7 +140,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(VERBOSE.getID(), true);
         bundleParams.put(ICON.getID(), "java-logo2.gif"); // force no signing
@@ -226,7 +226,7 @@
         bundleParams.put(JVM_PROPERTIES.getID(), "everything.jvm.property=everything.jvm.property.value");
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinExeBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinExeBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -145,7 +145,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(LICENSE_FILE.getID(), Arrays.asList("LICENSE", "LICENSE2"));
         bundleParams.put(COPYRIGHT.getID(), "Copyright(c) 2014 the testers \"who like to break stuff\"");
@@ -281,7 +281,7 @@
         bundleParams.put(JVM_PROPERTIES.getID(), "everything.jvm.property=everything.jvm.property.value");
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
         bundleParams.put(VERSION.getID(), "1.2.3.4");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinMsiBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinMsiBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -144,7 +144,7 @@
                 new RelativeFileSet(fakeMainJar.getParentFile(),
                         new HashSet<>(Arrays.asList(fakeMainJar)))
         );
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), fakeMainJar.toString());
+        bundleParams.put(CLASSPATH.getID(), fakeMainJar.toString());
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(VERBOSE.getID(), true);
 
@@ -292,7 +292,7 @@
         bundleParams.put(JVM_PROPERTIES.getID(), "everything.jvm.property=everything.jvm.property.value");
         bundleParams.put(MAIN_CLASS.getID(), "hello.TestPackager");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
         bundleParams.put(PREFERENCES_ID.getID(), "everything.preferences.id");
         bundleParams.put(PRODUCT_VERSION.getID(), "1.2.3");
         bundleParams.put(USER_JVM_OPTIONS.getID(), "-Xmx=256M\n");
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinServiceBundlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinServiceBundlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -167,7 +167,7 @@
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(MAIN_CLASS.getID(), "hello.HelloService");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
 
         bundleParams.put(DESCRIPTION.getID(), "Does a random heart beat every 30 seconds or so to a log file in tmp");
         bundleParams.put(LICENSE_FILE.getID(), "LICENSE");
@@ -208,7 +208,7 @@
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
         bundleParams.put(MAIN_CLASS.getID(), "hello.HelloService");
         bundleParams.put(MAIN_JAR.getID(), "mainApp.jar");
-        bundleParams.put(MAIN_JAR_CLASSPATH.getID(), "mainApp.jar");
+        bundleParams.put(CLASSPATH.getID(), "mainApp.jar");
 
         bundleParams.put(DESCRIPTION.getID(), "Does a random heart beat every 30 seconds or so to a log file in tmp");
         bundleParams.put(LICENSE_FILE.getID(), "LICENSE");
--- a/modules/graphics/src/main/java/com/sun/glass/events/KeyEvent.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/events/KeyEvent.java	Thu Jun 12 09:52:47 2014 -0700
@@ -24,13 +24,9 @@
  */
 package com.sun.glass.events;
 
+import com.sun.glass.ui.Application;
+
 public class KeyEvent {
-    /***************************************************************************
-     *                                                                         *
-     * Native methods                                                          *
-     *                                                                         *
-     **************************************************************************/
-    native private static int _getKeyCodeForChar(char c);
 
     /***************************************************************************
      *                                                                         *
@@ -249,7 +245,7 @@
      * @return integer code for the given char
      */
     public static int getKeyCodeForChar(char c) {
-        return _getKeyCodeForChar(c);
+        return Application.getKeyCodeForChar(c);
     }
 
     /**
--- a/modules/graphics/src/main/java/com/sun/glass/ui/Application.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/Application.java	Thu Jun 12 09:52:47 2014 -0700
@@ -729,4 +729,17 @@
         checkEventThread();
         return _supportsSystemMenu();
     }
+
+    protected abstract int _getKeyCodeForChar(char c);
+    /**
+     * Returns a VK_ code of a key capable of producing the given unicode
+     * character with respect to the currently active keyboard layout or
+     * VK_UNDEFINED if the character isn't present in the current layout.
+     *
+     * @param c the character
+     * @return integer code for the given char
+     */
+    public static int getKeyCodeForChar(char c) {
+        return application._getKeyCodeForChar(c);
+    }
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -324,4 +324,7 @@
         return false;
     }
 
+    @Override
+    protected native int _getKeyCodeForChar(char c);
+
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/ios/IosApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/ios/IosApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -279,4 +279,7 @@
     public boolean hasMultiTouch() {
         return true;
     }   
+
+    @Override
+    protected native int _getKeyCodeForChar(char c);
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/lens/LensApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/lens/LensApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1798,4 +1798,7 @@
         return deviceFlags[DEVICE_POINTER] > 0;
     }
 
+    @Override
+    protected native int _getKeyCodeForChar(char c);
+
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java	Thu Jun 12 09:52:47 2014 -0700
@@ -255,7 +255,6 @@
             null,
             null
         ),
-        /* ProgressIndicator can be either a ProgressIndicatorRole or a BusyIndicatorRole (Based on INDETERMINATE) */
         NSAccessibilityProgressIndicatorRole(Role.PROGRESS_INDICATOR,
             new MacAttribute[] {
                 MacAttribute.NSAccessibilityOrientationAttribute,
@@ -265,13 +264,6 @@
             },
             null
         ),
-        NSAccessibilityBusyIndicatorRole(Role.PROGRESS_INDICATOR,
-            new MacAttribute[] {
-                MacAttribute.NSAccessibilityOrientationAttribute,
-                MacAttribute.NSAccessibilityValueAttribute,
-            },
-            null
-        ),
         NSAccessibilityMenuBarRole(Role.MENU_BAR,
             new MacAttribute[] {
                 MacAttribute.NSAccessibilitySelectedChildrenAttribute,
@@ -593,7 +585,8 @@
         ;long ptr; /* Initialized natively - treat as final */
     }
 
-    /* Do not access the following lists directly from the Mac enums.
+    /* 
+     * Do not access the following lists directly from the Mac enums.
      * It can cause the static initialization to happen in an unexpected order.
      */
     static final List<MacAttribute> baseAttributes = Arrays.asList(
@@ -700,7 +693,8 @@
                 Node node = (Node)getAttribute(FOCUS_NODE);
                 View view = getView();
                 if (node == null && view == null) {
-                    /* The transientFocusContainer resigns focus.
+                    /* 
+                     * The transientFocusContainer resigns focus.
                      * Delegate to the scene.
                      */
                     Scene scene = (Scene)getAttribute(SCENE);
@@ -717,7 +711,8 @@
                     Node item = (Node)node.getAccessible().getAttribute(FOCUS_ITEM);
                     id = item != null ? getAccessible(item) : getAccessible(node);
                 } else {
-                    /* No focused element. Send the notification to the scene itself.
+                    /* 
+                     * No focused element. Send the notification to the scene itself.
                      * Note, the view is NULL when the FOCUS_NODE notification is sent
                      * by the transientFocusContainer.
                      */
@@ -761,11 +756,12 @@
                     } else {
                         macNotification = MacNotification.AXMenuClosed;
 
-                        /* When a submenu closes the focus is returned to the main
+                        /* 
+                         * When a submenu closes the focus is returned to the main
                          * window, as opposite of the previous menu.
                          * The work around is to look for a previous menu
                          * and send a close and open event for it.
-                         * */
+                         */
                         Node menuItemOwner = (Node)getAttribute(MENU_FOR);
                         long menu = getAccessible(getContainerNode(menuItemOwner, Role.CONTEXT_MENU));
                         if (menu != 0) {
@@ -776,6 +772,9 @@
                 }
                 break;
             }
+            case PARENT:
+                ignoreInnerText = null;
+                break;
             default:
                 macNotification = MacNotification.NSAccessibilityValueChangedNotification;
         }
@@ -830,6 +829,40 @@
         return inSlider;
     }
 
+    Boolean ignoreInnerText;
+    boolean ignoreInnerText() {
+        if (ignoreInnerText != null) return ignoreInnerText;
+        /* 
+         * JavaFX controls are implemented by the skin by adding new nodes.
+         * In accessibility these nodes sometimes duplicate the data in the
+         * control. For example, a Label is implemented using a Text, creating a
+         * AXStaticText inside an AXStaticText. In order to  improve accessibility
+         * navigation to following code ignores these inner text for the most 
+         * common cases.
+         */
+        Role role = (Role)getAttribute(ROLE);
+        ignoreInnerText = false;
+        if (role == Role.TEXT) {
+            Node parent = (Node)getAttribute(PARENT);
+            if (parent == null) return ignoreInnerText;
+            Role parentRole = (Role)parent.getAccessible().getAttribute(ROLE);
+            if (parentRole == null) return ignoreInnerText;
+            switch (parentRole) {
+                case BUTTON:
+                case TOGGLE_BUTTON:
+                case CHECKBOX:
+                case RADIO_BUTTON:
+                case COMBOBOX:
+                case TEXT:
+                case HYPERLINK:
+                case TAB_ITEM:
+                    ignoreInnerText = true;
+                default:
+            }
+        }
+        return ignoreInnerText;
+    }
+
     private int getMenuItemCmdGlyph(KeyCode code) {
         // Based on System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h
         switch (code) {
@@ -886,14 +919,7 @@
                 return MacRole.NSAccessibilityPopUpButtonRole;
             }
         }
-        MacRole macRole = MacRole.getRole(role);
-        if (macRole == MacRole.NSAccessibilityProgressIndicatorRole) {
-            Boolean state = (Boolean)getAttribute(INDETERMINATE);
-            if (Boolean.TRUE.equals(state)) {
-                macRole = MacRole.NSAccessibilityBusyIndicatorRole;
-            }
-        }
-        return macRole;
+        return MacRole.getRole(role);
     }
 
     private Bounds flipBounds(Bounds bounds) {
@@ -971,6 +997,13 @@
                 return count != null ? count : 1;
             }
             case NSAccessibilityChildrenAttribute: {
+                /*
+                 * The way VoiceOver identifies a menu item as having a sub menu is
+                 * by detecting an AXMenu child. It is important that the AXMenu
+                 * child be the actual sub menu so that navigation between menus
+                 * work.
+                 * Note: strictly the context menu is a child of the PopWindow.
+                 */
                 if (getAttribute(ROLE) == Role.MENU_ITEM) {
                     @SuppressWarnings("unchecked")
                     ObservableList<Node> children = (ObservableList<Node>)getAttribute(CHILDREN);
@@ -1293,6 +1326,16 @@
                 result = flipBounds((Bounds)result);
                 break;
             }
+            case NSAccessibilityMaxValueAttribute: {
+                /* 
+                 * VoiceOver reports 'Indeterminate Progress Indicator' when
+                 * the max value is not specified.
+                 */
+                if (Boolean.TRUE.equals(getAttribute(INDETERMINATE))) {
+                    return null;
+                }
+                break;
+            }
             case NSAccessibilityTitleAttribute: {
                 /*
                  * Voice over sends title attributes in unexpected cases.
@@ -1523,16 +1566,7 @@
     }
 
     long accessibilityIndexOfChild(long child) {
-        //TODO this method might not be necessary
-        ObservableList<Node> children = (ObservableList<Node>)getAttribute(CHILDREN);
-        if (children != null) {
-            for (int i = 0; i < children.size(); i++) {
-                Node node = children.get(i);
-                if (child == getAccessible(node)) {
-                    return i;
-                }
-            }
-        }
+        /* Forward to native code */
         return -1;
     }
 
@@ -1749,7 +1783,8 @@
     boolean accessibilityIsIgnored() {
         if (isIgnored()) return true;
         if (isInSlider()) {
-            /* Ignoring the children within the slider, otherwise VoiceOver
+            /* 
+             * Ignoring the children within the slider, otherwise VoiceOver
              * reports 'multiple indicator slider' instead of the value.
              */
             return true;
@@ -1758,6 +1793,9 @@
             Role role = (Role)getAttribute(ROLE);
             return role != Role.CONTEXT_MENU && role != Role.MENU_ITEM && role != Role.MENU_BAR;
         }
+        if (ignoreInnerText()) {
+            return true;
+        }
         return false;
     }
 
--- a/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -332,4 +332,7 @@
         }
         return baseDirectory + File.separator + name + File.separator;
     }
+
+    @Override
+    protected native int _getKeyCodeForChar(char c);
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -372,4 +372,9 @@
         _leaveNestedEventLoop(null);
     }
 
+    @Override
+    protected int _getKeyCodeForChar(char c) {
+        throw new UnsupportedOperationException("Missing function _getKeyCodeForChar ");
+    }
+
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleWindow.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleWindow.java	Thu Jun 12 09:52:47 2014 -0700
@@ -204,10 +204,31 @@
 
     @Override
     protected boolean _minimize(long nativeWindowPointer, boolean minimize) {
-        if (minimize) {
+        int x = getX();
+        int y = getY();
+        int width = getWidth();
+        int height = getHeight();
+        if (minimize && !(state == STATE_MINIMIZED)) {
             state = STATE_MINIMIZED;
-        } else {
+            cachedX = x;
+            cachedY = y;
+            cachedW = width;
+            cachedH = height;
+            // remove the window from the list of visible windows in the
+            // superclass
+            remove(this);
+            notifyResize(WindowEvent.MINIMIZE, width, height);
+
+        } else if (!minimize && state == STATE_MINIMIZED) {
             state = STATE_NORMAL;
+            x = cachedX;
+            y = cachedY;
+            width = cachedW;
+            height = cachedH;
+            // this call will add the window back into the visible list of
+            // windows in the superclass
+            add(this);
+            notifyResize(WindowEvent.RESTORE, width, height);
         }
         return true;
     }
@@ -403,6 +424,7 @@
     @Override
     protected void notifyDestroy() {
         super.notifyDestroy();
+        MonocleWindowManager.getInstance().repaintAll();
     }
 
     @Override
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleWindowManager.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonocleWindowManager.java	Thu Jun 12 09:52:47 2014 -0700
@@ -158,4 +158,10 @@
         return focusedWindow;
     }
 
+    public void repaintAll() {
+        for (int i = 0; i < windows.length; i++) {
+            ((MonocleView)(windows[i].getView())).notifyRepaint();
+        }
+    }
+
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/dispman/DispmanAcceleratedScreen.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/dispman/DispmanAcceleratedScreen.java	Thu Jun 12 09:52:47 2014 -0700
@@ -28,16 +28,25 @@
 import com.sun.glass.ui.monocle.AcceleratedScreen;
 import com.sun.glass.ui.monocle.GLException;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 public class DispmanAcceleratedScreen extends AcceleratedScreen {
 
     public DispmanAcceleratedScreen(int[] attributes) throws GLException {
         super(attributes);
     }
 
-    private native long _platformGetNativeWindow();
+    private native long _platformGetNativeWindow(int displayID, int layerID);
 
     @Override
     protected long platformGetNativeWindow() {
-        return _platformGetNativeWindow();
+        int displayID = AccessController.doPrivileged(
+                (PrivilegedAction<Integer>)
+                        () -> Integer.getInteger("dispman.display", 0 /* LCD */));
+        int layerID = AccessController.doPrivileged(
+                (PrivilegedAction<Integer>)
+                        () -> Integer.getInteger("dispman.layer", 1));
+        return _platformGetNativeWindow(displayID, layerID);
     }
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/linux/FBDevScreen.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/linux/FBDevScreen.java	Thu Jun 12 09:52:47 2014 -0700
@@ -39,6 +39,8 @@
 import java.nio.file.FileSystems;
 import java.nio.file.Path;
 import java.nio.file.StandardOpenOption;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 public class FBDevScreen implements NativeScreen {
 
@@ -50,10 +52,14 @@
     private int consoleCursorBlink;
     private Framebuffer fb;
     private LinuxFrameBuffer linuxFB;
+    private final String fbDevPath;
 
     public FBDevScreen() {
+        fbDevPath = AccessController.doPrivileged(
+                (PrivilegedAction<String>) () ->
+                        System.getProperty("monocle.screen.fb", "/dev/fb0"));
         try {
-            linuxFB = new LinuxFrameBuffer("/dev/fb0");
+            linuxFB = new LinuxFrameBuffer(fbDevPath);
             nativeHandle = 1l;
             nativeFormat = Pixels.Format.BYTE_BGRA_PRE;
             try {
@@ -109,7 +115,7 @@
 
     private void openFBDev() throws IOException {
         if (mappedFB == null) {
-            Path fbdevPath = FileSystems.getDefault().getPath("/dev/fb0");
+            Path fbdevPath = FileSystems.getDefault().getPath(fbDevPath);
             fbdev = FileChannel.open(fbdevPath, StandardOpenOption.WRITE);
         }
     }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/linux/LinuxFrameBuffer.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/linux/LinuxFrameBuffer.java	Thu Jun 12 09:52:47 2014 -0700
@@ -49,7 +49,7 @@
     public LinuxFrameBuffer(String devNode) throws IOException {
         system = LinuxSystem.getLinuxSystem();
         FBIO_WAITFORVSYNC = system.IOW('F', 0x20, 4);
-        fd = system.open("/dev/fb0", LinuxSystem.O_RDWR);
+        fd = system.open(devNode, LinuxSystem.O_RDWR);
         if (fd == -1) {
             throw new IOException(system.getErrorMessage());
         }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/util/IntSet.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/util/IntSet.java	Thu Jun 12 09:52:47 2014 -0700
@@ -42,7 +42,6 @@
                 elements = Arrays.copyOf(elements, size * 2);
             }
             if (insertionPoint != size) {
-            } else {
                 System.arraycopy(elements, insertionPoint,
                                  elements, insertionPoint + 1,
                                  size - insertionPoint);
@@ -124,7 +123,7 @@
 
     /** Copies the contents of this set to the target set. */
     public void copyTo(IntSet target) {
-        if (target.elements.length > size) {
+        if (target.elements.length < size) {
             target.elements = Arrays.copyOf(elements, elements.length);
         } else {
             System.arraycopy(elements, 0, target.elements, 0, size);
--- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/vnc/VNCScreen.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/vnc/VNCScreen.java	Thu Jun 12 09:52:47 2014 -0700
@@ -39,6 +39,8 @@
 import java.nio.channels.SocketChannel;
 import java.nio.channels.WritableByteChannel;
 import java.nio.charset.Charset;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.BitSet;
 import java.util.HashSet;
 import java.util.Set;
@@ -55,10 +57,13 @@
         super(1024, 600, 32);
         try {
             server = ServerSocketChannel.open();
-            server.bind(new InetSocketAddress(5901));
+            int vncPort = AccessController.doPrivileged(
+                    (PrivilegedAction<Integer>)
+                            () -> Integer.getInteger("vnc.port", 5901));
+            server.bind(new InetSocketAddress(vncPort));
             Thread t = new Thread(new ConnectionAccepter());
             t.setDaemon(true);
-            t.setName("VNC Server on port 5901");
+            t.setName("VNC Server on port " + vncPort);
             t.start();
         } catch (IOException e) {
             e.printStackTrace();
--- a/modules/graphics/src/main/java/com/sun/glass/ui/swt/SWTApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/swt/SWTApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -978,4 +978,9 @@
 //        return new SWTPixels(width, height, buffer);
         return null;
     }
+
+    @Override
+    protected int _getKeyCodeForChar(char c) {
+        return KeyEvent.VK_UNDEFINED;
+    }
 }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Thu Jun 12 09:52:47 2014 -0700
@@ -25,6 +25,7 @@
 
 package com.sun.glass.ui.win;
 
+import java.util.function.Function;
 import javafx.collections.ObservableList;
 import javafx.geometry.Bounds;
 import javafx.geometry.Point2D;
@@ -208,6 +209,14 @@
     WinTextRangeProvider selectionRange;
     boolean documentRangeValid, selectionRangeValid;
 
+    /* The lastIndex is used by parents to keep track of the index of the last child
+     * returned in Navigate. It is very common for Narrator to traverse the children
+     * list by calling next sibling sequentially, without lastIndex the caller would
+     * have to traverse the list to find the location of the current child before it
+     * can return the next sibling.
+     */
+    private int lastIndex = 0;
+
     /* Creates a GlassAccessible linked to the caller (GlobalRef) */
     private native long _createGlassAccessible();
 
@@ -413,6 +422,8 @@
                 }
                 break;
             }
+            case PARENT:
+                break;
             default:
                 UiaRaiseAutomationEvent(peer, UIA_AutomationPropertyChangedEventId);
         }
@@ -933,34 +944,46 @@
                  */
                 if (parent != null) {
                     Accessible parentAccessible = parent.getAccessible();
+                    Function<Integer, Node> getChild;
+                    int count = 0;
                     if (treeCell) {
                         Integer result = (Integer)parentAccessible.getAttribute(TREE_ITEM_COUNT);
-                        int count = result != null ? result : 0;
+                        if (result == null) return 0;
+                        count = result;
+                        getChild = index -> {
+                            return (Node)parentAccessible.getAttribute(Attribute.TREE_ITEM_AT_INDEX, index);
+                        };
+                    } else {
+                        ObservableList<Node> children = (ObservableList<Node>)parentAccessible.getAttribute(CHILDREN);
+                        if (children == null) return 0;
+                        count = children.size();
+                        getChild = index -> {
+                            return children.get(index);
+                        };
+                    }
+
+                    WinAccessible winAcc = (WinAccessible)parentAccessible.impl_getDelegate();
+                    int lastIndex = winAcc.lastIndex;
+                    int currentIndex = -1;
+                    if (0 <= lastIndex && lastIndex < count && getAccessible(getChild.apply(lastIndex)) == peer) {
+                        currentIndex = lastIndex;
+                    } else {
                         for (int i = 0; i < count; i++) {
-                            Node item = (Node)parentAccessible.getAttribute(Attribute.TREE_ITEM_AT_INDEX, i);
-                            if (getAccessible(item) == peer) {
-                                if (direction == NavigateDirection_NextSibling && i + 1 < count) {
-                                    node = (Node)parentAccessible.getAttribute(TREE_ITEM_AT_INDEX, i + 1);
-                                }
-                                if (direction == NavigateDirection_PreviousSibling && i > 0) {
-                                    node = (Node)parentAccessible.getAttribute(TREE_ITEM_AT_INDEX, i - 1);
-                                }
+                            if (getAccessible(getChild.apply(i)) == peer) {
+                                currentIndex = i;
                                 break;
                             }
                         }
-                    } else {
-                        ObservableList<Node> children = (ObservableList<Node>)parentAccessible.getAttribute(CHILDREN);
-                        int size = children != null ? children.size() : 0;
-                        for (int i = 0; i < size; i++) {
-                            if (getAccessible(children.get(i)) == peer) {
-                                if (direction == NavigateDirection_NextSibling && i + 1 < size) {
-                                   node = children.get(i + 1);
-                                }
-                                if (direction == NavigateDirection_PreviousSibling && i > 0) {
-                                   node = children.get(i - 1);
-                                }
-                                break;
-                            }
+                    }
+                    if (currentIndex != -1) {
+                        if (direction == NavigateDirection_NextSibling) {
+                            currentIndex++;
+                        } else {
+                            currentIndex--;
+                        }
+                        if (0 <= currentIndex && currentIndex < count) {
+                            node = getChild.apply(currentIndex);
+                            winAcc.lastIndex = currentIndex;
                         }
                     }
                 }
@@ -968,27 +991,22 @@
             }
             case NavigateDirection_FirstChild:
             case NavigateDirection_LastChild: {
+                lastIndex = -1;
                 if (role == Role.TREE_VIEW || role == Role.TREE_TABLE_VIEW) {
                     /* The TreeView only returns the root node as child */
+                    lastIndex = 0;
                     node = (Node)getAttribute(ROW_AT_INDEX, 0);
                 } else if (treeCell) {
                     Integer count = (Integer)getAttribute(TREE_ITEM_COUNT);
                     if (count != null && count > 0) {
-                        if (direction == NavigateDirection_FirstChild) {
-                            node = (Node)getAttribute(TREE_ITEM_AT_INDEX, 0);
-                        } else if (direction == NavigateDirection_LastChild) {
-                            node = (Node)getAttribute(TREE_ITEM_AT_INDEX, count - 1);
-                        }
+                        lastIndex = direction == NavigateDirection_FirstChild ? 0 : count - 1;
+                        node = (Node)getAttribute(TREE_ITEM_AT_INDEX, lastIndex);
                     }
                 } else {
                     ObservableList<Node> children = (ObservableList<Node>)getAttribute(CHILDREN);
-                    int size = children != null ? children.size() : 0;
-                    if (size > 0) {
-                        if (direction == NavigateDirection_FirstChild) {
-                            node = children.get(0);
-                        } else {
-                            node = children.get(size - 1);
-                        }
+                    if (children != null && children.size() > 0) {
+                        lastIndex = direction == NavigateDirection_FirstChild ? 0 : children.size() - 1;
+                        node = children.get(lastIndex);
                     }
                     if (node != null) {
                         role = (Role)node.getAccessible().getAttribute(ROLE);
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -283,4 +283,7 @@
         }
         return baseDirectory + File.separator + name + File.separator;
     }
+
+    @Override
+    protected native int _getKeyCodeForChar(char c);
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Thu Jun 12 09:52:47 2014 -0700
@@ -173,12 +173,11 @@
 
         if (root == null) return null;
 
-        CacheContainer container = cacheContainerMap.computeIfAbsent(
-                root,
-                (key) -> {
-                    return new CacheContainer();
-                }
-        );
+        CacheContainer container = cacheContainerMap.get(root);
+        if (container == null) {
+            container = new CacheContainer();
+            cacheContainerMap.put(root, container);
+        }
 
         return container;
 
--- a/modules/graphics/src/main/java/com/sun/javafx/iio/bmp/BMPImageLoaderFactory.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/iio/bmp/BMPImageLoaderFactory.java	Thu Jun 12 09:52:47 2014 -0700
@@ -84,6 +84,12 @@
     static final int BIH_SIZE = 40;
     static final int BIH4_SIZE = 108;
     static final int BIH5_SIZE = 124;
+    static final int BI_RGB = 0;
+    static final int BI_RLE8 = 1;
+    static final int BI_RLE4 = 2;
+    static final int BI_BITFIELDS = 3;
+    static final int BI_JPEG = 4;
+    static final int BI_PNG = 5;
 
     final int    biSize;
     final int    biWidth;
@@ -120,11 +126,34 @@
         validate();
     }
 
-    void validate() {
-        if (biCompression != 0 || biPlanes != 1 || biBitCount != 24) {
-            throw new RuntimeException(
-                    "Unsupported BMP image: " +
-                    "only 24 bit uncompressed BMP`s is supported");
+    void validate() throws IOException {
+        if (biBitCount < 1 ||
+                biCompression == BI_JPEG || biCompression == BI_PNG)
+        {
+            throw new IOException("Unsupported BMP image: " +
+                    "Embedded JPEG or PNG images are not supported");
+        }
+
+        switch (biCompression) {
+            case BI_RLE4:
+                if (biBitCount != 4) {
+                    throw new IOException("Invalid BMP image: " +
+                            "Only 4 bpp images can be RLE4 compressed");
+                }
+                break;
+            case BI_RLE8:
+                if (biBitCount != 8) {
+                    throw new IOException("Invalid BMP image: " +
+                            "Only 8 bpp images can be RLE8 compressed");
+                }
+                break;
+            case BI_BITFIELDS:
+                throw new IOException("Unsupported BMP image: " +
+                        "Bitfields BMP files are not supported");
+            case BI_RGB:
+                break;
+            default:
+                throw new IOException("Unknown BMP compression type");
         }
     }
 }
@@ -136,19 +165,18 @@
 
     final LEInputStream data;
 
-    short bfType; // must be equal to BM
     int   bfSize;
     int   bfOffBits;
-    int   bgra_palette[];
+    byte  bgra_palette[];
     BitmapInfoHeader bih;
 
     BMPImageLoader(InputStream input) throws IOException {
         super(BMPDescriptor.theInstance);
         data = new LEInputStream(input);
-        bfType = data.readShort();
-        if (isValid()) {
-            readHeader();
+        if (data.readShort() != BM) {
+            throw new IOException("Invalid BMP file signature");
         }
+        readHeader();
     }
 
     private void readHeader() throws IOException {
@@ -156,67 +184,259 @@
         data.skipBytes(4); // 32  bits reserved
         bfOffBits = data.readInt();
         bih = new BitmapInfoHeader(data);
+        if (bfOffBits < bih.biSize + BFH_SIZE) {
+            throw new IOException("Invalid bitmap bits offset");
+        }
+
         if (bih.biSize + BFH_SIZE != bfOffBits) {
-            data.skipBytes(bfOffBits - bih.biSize - BFH_SIZE);
+            int length = bfOffBits - bih.biSize - BFH_SIZE;
+            int paletteSize = length / 4;
+            bgra_palette = new byte[paletteSize * 4];
+            int read = data.in.read(bgra_palette);
+            // goto bitmap bits
+            if (read < length) {
+                data.in.skip(length - read);
+            }
         }
     }
 
-    private boolean isValid() {
-        return bfType == BM;
+    @Override
+    public void dispose() {
     }
 
-    public void dispose() { }
+    private void readRLE(byte[] image, int rowLength, int hght, boolean isRLE4)
+            throws IOException
+    {
+        int imgSize = bih.biSizeImage;
+        if (imgSize == 0) {
+            imgSize = bfSize - bfOffBits;
+        }
+        byte imgData[] = new byte[imgSize];
+        ImageTools.readFully(data.in, imgData);
 
-    static void GBRtoRGB(byte data[], int pos, int size) {
+        boolean isBottomUp = bih.biHeight > 0;
+        int line = isBottomUp ? hght - 1 : 0;
+        int i = 0;
+        int dstOffset = line * rowLength;
+        while (i < imgSize) {
+            int b1 = getByte(imgData, i++);
+            int b2 = getByte(imgData, i++);
+            if (b1 == 0) { // absolute
+                switch (b2) {
+                    case 0: // end of line
+                        line += isBottomUp ? -1 : 1;
+                        dstOffset = line * rowLength;
+                        break;
+                    case 1: // end of bitmap
+                        return;
+                    case 2: // delta
+                        int deltaX = getByte(imgData, i++);
+                        int deltaY = getByte(imgData, i++);
+                        line += deltaY;
+                        dstOffset += (deltaY * rowLength);
+                        dstOffset += deltaX * 3;
+                        break;
+                    default:
+                        int indexData = 0;
+                        int index;
+                        for (int p = 0; p < b2; p++) {
+                            if (isRLE4) {
+                                if ((p & 1) == 0) {
+                                    indexData = getByte(imgData, i++);
+                                    index = (indexData & 0xf0) >> 4;
+                                } else {
+                                    index = indexData & 0x0f;
+                                }
+                            } else {
+                                index = getByte(imgData, i++);
+                            }
+                            dstOffset = setRGBFromPalette(image, dstOffset, index);
+                        }
+                        if (isRLE4) {
+                            if ((b2 & 3) == 1 || (b2 & 3) == 2) i++;
+                        } else {
+                            if ((b2 & 1) == 1) i++;
+                        }
+                        break;
+                }
+            } else { // encoded
+                if (isRLE4) {
+                    int index1 = (b2 & 0xf0) >> 4;
+                    int index2 = b2 & 0x0f;
+                    for (int p = 0; p < b1; p++) {
+                        dstOffset = setRGBFromPalette(image, dstOffset,
+                                (p & 1) == 0 ? index1 : index2);
+                    }
+                } else {
+                    for (int p = 0; p < b1; p++) {
+                        dstOffset = setRGBFromPalette(image, dstOffset, b2);
+                    }
+                }
+            }
+        }
+
+    }
+
+    private int setRGBFromPalette(byte[] image, int dstOffset, int index) {
+        index *= 4;
+        image[dstOffset++] = bgra_palette[index + 2];
+        image[dstOffset++] = bgra_palette[index + 1];
+        image[dstOffset++] = bgra_palette[index];
+        return dstOffset;
+    }
+
+    private void readPackedBits(byte[] image, int rowLength, int hght)
+            throws IOException
+    {
+        int pixPerByte = 8 / bih.biBitCount;
+        int bytesPerLine = (bih.biWidth + pixPerByte - 1) / pixPerByte;
+        int srcStride = (bytesPerLine + 3) & ~3;
+        int bitMask = (1 << bih.biBitCount) - 1;
+
+        byte lineBuf[] = new byte[srcStride];
+        for (int i = 0; i != hght; ++i) {
+            ImageTools.readFully(data.in, lineBuf);
+            int line = bih.biHeight < 0 ? i : hght - i - 1;
+            int dstOffset = line * rowLength;
+
+            for (int x = 0; x != bih.biWidth; x++) {
+                int bitnum = x * bih.biBitCount;
+                int element = lineBuf[bitnum / 8];
+                int shift = 8 - (bitnum & 7) - bih.biBitCount;
+                int index = (element >> shift) & bitMask;
+                dstOffset = setRGBFromPalette(image, dstOffset, index);
+            }
+        }
+    }
+
+    private static int getWord(byte[] buf, int pos) {
+        return ((buf[pos    ] & 0xff)     ) |
+               ((buf[pos + 1] & 0xff) << 8);
+    }
+
+    private static int getByte(byte[] buf, int pos) {
+        return buf[pos] & 0xff;
+    }
+
+    private byte convertFrom5to8Bit(int i) {
+        byte b = (byte)(i & 0x1F);
+        return (byte)(b << 3 | b >> 2);
+    }
+
+    private void read16Bit555(byte[] image, int rowLength, int hght) throws IOException {
+        int bytesPerLine = bih.biWidth * 2;
+        int srcStride = (bytesPerLine + 3) & ~3;
+        byte lineBuf[] = new byte[srcStride];
+        for (int i = 0; i != hght; ++i) {
+            ImageTools.readFully(data.in, lineBuf);
+            int line = bih.biHeight < 0 ? i : hght - i - 1;
+            int dstOffset = line * rowLength;
+
+            for (int x = 0; x != bih.biWidth; x++) {
+                int element = getWord(lineBuf, x * 2);
+                image[dstOffset++] = convertFrom5to8Bit(element >> 10);
+                image[dstOffset++] = convertFrom5to8Bit(element >> 5);
+                image[dstOffset++] = convertFrom5to8Bit(element);
+            }
+        }
+    }
+
+    private void read32BitRGB(byte[] image, int rowLength, int hght) throws IOException {
+        int bytesPerLine = bih.biWidth * 4;
+        byte lineBuf[] = new byte[bytesPerLine];
+        for (int i = 0; i != hght; ++i) {
+            ImageTools.readFully(data.in, lineBuf);
+            int line = bih.biHeight < 0 ? i : hght - i - 1;
+            int dstOff = line * rowLength;
+
+            for (int x = 0; x != bih.biWidth; x++) {
+                int srcOff = x * 4;
+                image[dstOff++] = lineBuf[srcOff + 2];
+                image[dstOff++] = lineBuf[srcOff + 1];
+                image[dstOff++] = lineBuf[srcOff    ];
+            }
+        }
+    }
+
+    private void read24Bit(byte[] image, int rowLength, int hght) throws IOException {
+        int bmpStride = (rowLength + 3) & ~3;
+        int padding = bmpStride - rowLength;
+
+        for (int i = 0; i != hght; ++i) {
+            int line = bih.biHeight < 0 ? i : hght - i - 1;
+            int lineOffset = line * rowLength;
+            ImageTools.readFully(data.in, image, lineOffset, rowLength);
+            data.skipBytes(padding);
+            BGRtoRGB(image, lineOffset, rowLength);
+        }
+    }
+
+    static void BGRtoRGB(byte data[], int pos, int size) {
         for (int sz = size / 3; sz != 0; --sz) {
-            byte x = data[pos], y = data[pos + 2];
-            data[pos + 2] = x; data[pos] = y;
+            byte b = data[pos], r = data[pos + 2];
+            data[pos + 2] = b; data[pos] = r;
             pos += 3;
         }
     }
 
     public ImageFrame load(int imageIndex, int width, int height,
             boolean preserveAspectRatio, boolean smooth) throws IOException
-{
+    {
         if (0 != imageIndex) {
             return null;
         }
 
+        int hght = Math.abs(bih.biHeight);
+
         if ((width > 0 && width != bih.biWidth) ||
-            (height > 0 && height != bih.biHeight))
+            (height > 0 && height != hght))
         {
-            throw new RuntimeException("scaling for BMP is not supported");
+            throw new IOException("scaling for BMP is not supported");
         }
 
         // Pass image metadata to any listeners.
         ImageMetadata imageMetadata = new ImageMetadata(null, Boolean.TRUE,
-            null, null, null, null, bih.biWidth, bih.biHeight,
+            null, null, null, null, bih.biWidth, hght,
             null, null, null);
         updateImageMetadata(imageMetadata);
 
-        int bmpStride = (bih.biBitCount*bih.biWidth/8 + 3) & ~3;
-        int rowLength = (bih.biBitCount/8)*bih.biWidth;
+        int stride = bih.biWidth * 3;
 
-        int hght = Math.abs(bih.biHeight);
+        byte image[] = new byte[stride * hght];
 
-        byte image[] = new byte[rowLength * hght];
-
-        for (int i = 0; i != hght; ++i) {
-            int line = bih.biHeight < 0 ? i : hght-i-1;
-            int nRead = data.in.read(image, line * rowLength, rowLength);
-            GBRtoRGB(image, line * rowLength, nRead);
-
-            if (nRead != rowLength) {
+        switch (bih.biBitCount) {
+            case 1:
+                readPackedBits(image, stride, hght);
                 break;
-            }
-
-            if (nRead < bmpStride) {
-                data.skipBytes(bmpStride-nRead);
-            }
+            case 4:
+                if (bih.biCompression == BitmapInfoHeader.BI_RLE4) {
+                    readRLE(image, stride, hght, true);
+                } else {
+                    readPackedBits(image, stride, hght);
+                }
+                break;
+            case 8:
+                if (bih.biCompression == BitmapInfoHeader.BI_RLE8) {
+                    readRLE(image, stride, hght, false);
+                } else {
+                    readPackedBits(image, stride, hght);
+                }
+                break;
+            case 16:
+                read16Bit555(image, stride, hght);
+                break;
+            case 32:
+                read32BitRGB(image, stride, hght);
+                break;
+            case 24:
+                read24Bit(image, stride, hght);
+                break;
+            default:
+                throw new IOException("Unknown BMP bit depth");
         }
 
         return new ImageFrame(ImageStorage.ImageType.RGB, ByteBuffer.wrap(image),
-                bih.biWidth, hght, rowLength, null, null);
+                bih.biWidth, hght, stride, null, null);
     }
 }
 
@@ -237,4 +457,3 @@
         return new BMPImageLoader(input);
     }
 }
-
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGCanvas.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGCanvas.java	Thu Jun 12 09:52:47 2014 -0700
@@ -246,6 +246,7 @@
             }
             if (init_type == InitType.CLEAR) {
                 g.setCompositeMode(CompositeMode.CLEAR);
+                g.setTransform(BaseTransform.IDENTITY_TRANSFORM);
                 g.fillRect(0, 0, tw, th);
                 g.setCompositeMode(CompositeMode.SRC_OVER);
             }
@@ -835,6 +836,7 @@
                     // fillQuad does hard edges which matches the concept
                     // of setting adjacent abutting, non-overlapping "pixels"
                     gr.fillQuad(dx1, dy1, dx1+highestPixelScale, dy1+highestPixelScale);
+                    gr.setCompositeMode(CompositeMode.SRC_OVER);
                     break;
                 }
                 case PUT_ARGBPRE_BUF:
--- a/modules/graphics/src/main/java/javafx/animation/Timeline.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/animation/Timeline.java	Thu Jun 12 09:52:47 2014 -0700
@@ -34,7 +34,7 @@
 import com.sun.scenario.animation.shared.TimelineClipCore;
 
 /**
- * A {@code Timeline} can be used to define a free from animation of any
+ * A {@code Timeline} can be used to define a free form animation of any
  * {@link javafx.beans.value.WritableValue}, e.g. all
  * {@link javafx.beans.property.Property JavaFX Properties}.
  * <p>
--- a/modules/graphics/src/main/java/javafx/scene/Node.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/Node.java	Thu Jun 12 09:52:47 2014 -0700
@@ -745,6 +745,7 @@
                     oldParent = newParent;
                     invalidateLocalToSceneTransform();
                     parentResolvedOrientationInvalidated();
+                    accSendNotification(Attribute.PARENT);
                 }
 
                 @Override
--- a/modules/graphics/src/main/java/javafx/scene/text/TextFlow.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/text/TextFlow.java	Thu Jun 12 09:52:47 2014 -0700
@@ -37,6 +37,8 @@
 import javafx.geometry.Orientation;
 import javafx.geometry.VPos;
 import javafx.scene.Node;
+import javafx.scene.accessibility.Attribute;
+import javafx.scene.accessibility.Role;
 import javafx.scene.layout.Pane;
 import javafx.css.StyleableDoubleProperty;
 import javafx.css.StyleableObjectProperty;
@@ -551,4 +553,22 @@
     }
     /* end of copied code */
 
+    /** @treatAsPrivate */
+    @Override
+    public Object accGetAttribute(Attribute attribute, Object... parameters) {
+        switch (attribute) {
+            case ROLE: return Role.TEXT;
+            case TITLE: {
+                StringBuilder title = new StringBuilder();
+                for (Node node: getChildren()) {
+                    Object text = node.accGetAttribute(Attribute.TITLE, parameters);
+                    if (text != null) {
+                        title.append(text.toString());
+                    }
+                }
+                return title.toString();
+            }
+            default: return super.accGetAttribute(attribute, parameters);
+        }
+    }
 }
--- a/modules/graphics/src/main/native-glass/gtk/glass_key.cpp	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/gtk/glass_key.cpp	Thu Jun 12 09:52:47 2014 -0700
@@ -25,6 +25,7 @@
 #include "glass_key.h"
 #include "glass_gtkcompat.h"
 #include <com_sun_glass_events_KeyEvent.h>
+#include <com_sun_glass_ui_gtk_GtkApplication.h>
 
 #include <glib.h>
 #include <gdk/gdk.h>
@@ -289,12 +290,12 @@
 extern "C" {
 
 /*
- * Class:     com_sun_glass_events_KeyEvent
+ * Class:     com_sun_glass_ui_gtk_GtkApplication
  * Method:    _getKeyCodeForChar
  * Signature: (C)I
  */
-JNIEXPORT jint JNICALL Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar
-  (JNIEnv *env, jclass clazz, jchar character)
+JNIEXPORT jint JNICALL Java_com_sun_glass_ui_gtk_GtkApplication__1getKeyCodeForChar
+  (JNIEnv *env, jobject jApplication, jchar character)
 {
     gunichar *ucs_char = g_utf16_to_ucs4(&character, 1, NULL, NULL, NULL);
     if (ucs_char == NULL) {
--- a/modules/graphics/src/main/native-glass/ios/GlassKey.m	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/ios/GlassKey.m	Thu Jun 12 09:52:47 2014 -0700
@@ -26,19 +26,20 @@
 #import <UIKit/UIKit.h>
 
 #include "com_sun_glass_events_KeyEvent.h"
+#include "com_sun_glass_ui_ios_IosApplication.h"
 
 #include "GlassMacros.h"
 
 
 /*
- * Class:     com_sun_glass_events_KeyEvent
+ * Class:     com_sun_glass_ui_ios_IosApplication
  * Method:    _getKeyCodeForChar
  * Signature: (C)I
  */
-JNIEXPORT jint JNICALL Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar
-(JNIEnv * env, jclass cls, jchar c)
+JNIEXPORT jint JNICALL Java_com_sun_glass_ui_ios_IosApplication__1getKeyCodeForChar
+(JNIEnv * env, jobject jApplication, jchar c)
 {
-    GLASS_LOG("Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar");
+    GLASS_LOG("Java_com_sun_glass_ui_ios_IosApplication__1getKeyCodeForChar");
     
     return com_sun_glass_events_KeyEvent_VK_UNDEFINED;
 }
--- a/modules/graphics/src/main/native-glass/lens/LensApplication.c	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/lens/LensApplication.c	Thu Jun 12 09:52:47 2014 -0700
@@ -789,12 +789,12 @@
 
 
 /*
- * Class:     com_sun_glass_events_KeyEvent
+ * Class:     com_sun_glass_ui_lens_LensApplication
  * Method:    _getKeyCodeForChar
  * Signature: (C)I
  */
-JNIEXPORT jint JNICALL Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar
-(JNIEnv *env, jclass keyeventClass, jchar c) {
+JNIEXPORT jint JNICALL Java_com_sun_glass_ui_lens_LensApplication__1getKeyCodeForChar
+(JNIEnv *env, jobject jApplication, jchar c) {
     GLASS_LOG_FINE("Java key code requested for c='%c' (0x%04x)",
                    (char) c, (int) c);
     return glass_inputEvents_getJavaKeyCodeFromJChar(c);
--- a/modules/graphics/src/main/native-glass/mac/GlassKey.m	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/mac/GlassKey.m	Thu Jun 12 09:52:47 2014 -0700
@@ -25,6 +25,7 @@
 
 #import "common.h"
 #import "com_sun_glass_events_KeyEvent.h"
+#import "com_sun_glass_ui_mac_MacApplication.h"
 
 #import "GlassApplication.h"
 #import "GlassMacros.h"
@@ -369,14 +370,14 @@
 }
 
 /*
- * Class:     com_sun_glass_events_KeyEvent
+ * Class:     com_sun_glass_ui_mac_MacApplication
  * Method:    _getKeyCodeForChar
  * Signature: (C)I
  */
-JNIEXPORT jint JNICALL Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar
-(JNIEnv * env, jclass cls, jchar c)
+JNIEXPORT jint JNICALL Java_com_sun_glass_ui_mac_MacApplication__1getKeyCodeForChar
+(JNIEnv * env, jobject jApplication, jchar c)
 {
-    LOG("Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar");
+    LOG("Java_com_sun_glass_ui_mac_MacApplication__1getKeyCodeForChar");
 
     return [GlassApplication getKeyCodeForChar:c];
 }
--- a/modules/graphics/src/main/native-glass/mac/GlassView3D.m	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/mac/GlassView3D.m	Thu Jun 12 09:52:47 2014 -0700
@@ -330,12 +330,6 @@
     [self->_delegate updateTrackingAreas];
 }
 
-- (NSMenu *)menuForEvent:(NSEvent *)theEvent
-{
-    [self->_delegate sendJavaMenuEvent:theEvent];
-    return [super menuForEvent: theEvent];
-}
-
 - (void)mouseEntered:(NSEvent *)theEvent
 {
     MOUSELOG("mouseEntered");
@@ -383,10 +377,9 @@
 {
     MOUSELOG("rightMouseDown");
     [self->_delegate sendJavaMouseEvent:theEvent];
-    // By default, calling rightMouseDown: generates menuForEvent: but none of the other glass mouse handlers call the super
-    // To be consistent with the rest of glass, call the menu event handler directly rather than letting the operating system do it
-    [self->_delegate sendJavaMenuEvent:theEvent];
-//    return [super rightMouseDown: theEvent];
+    // NOTE: menuForEvent: is invoked differently for right-click
+    // and Ctrl+Click actions. So instead we always synthesize
+    // the menu event in Glass. See sendJavaMouseEvent for details.
 }
 
 - (void)rightMouseDragged:(NSEvent *)theEvent
--- a/modules/graphics/src/main/native-glass/mac/GlassViewDelegate.m	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/mac/GlassViewDelegate.m	Thu Jun 12 09:52:47 2014 -0700
@@ -578,6 +578,10 @@
                     modifiers, isPopupTrigger, isSynthesized);
         }
         GLASS_CHECK_EXCEPTION(env);
+
+        if (isPopupTrigger) {
+            [self sendJavaMenuEvent:theEvent];
+        }
     }
 }
 
--- a/modules/graphics/src/main/native-glass/monocle/dispman/DispmanAcceleratedScreen.c	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/monocle/dispman/DispmanAcceleratedScreen.c	Thu Jun 12 09:52:47 2014 -0700
@@ -36,7 +36,7 @@
 #endif /* USE_DISPMAN */
 
 JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_dispman_DispmanAcceleratedScreen__1platformGetNativeWindow
-    (JNIEnv *env, jobject obj) {
+    (JNIEnv *env, jobject obj, jint displayID, jint layerID) {
 
 #ifdef USE_DISPMAN
 
@@ -53,7 +53,7 @@
 
     dispmanWindow = (EGL_DISPMANX_WINDOW_T *)calloc(sizeof(EGL_DISPMANX_WINDOW_T), 1);
 
-    display = (*wr_vc_dispmanx_display_open)(0 /* LCD */);
+    display = (*wr_vc_dispmanx_display_open)(displayID);
     if (display == 0) {
         fprintf(stderr, "Dispman: Cannot open display\n");
         return 0;
@@ -84,7 +84,7 @@
     element = (*wr_vc_dispmanx_element_add)(
                   update,
                   display,
-                  1 /*layer*/,
+                  layerID,
                   &dst,
                   0 /*src*/,
                   &src,
--- a/modules/graphics/src/main/native-glass/win/KeyTable.cpp	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/graphics/src/main/native-glass/win/KeyTable.cpp	Thu Jun 12 09:52:47 2014 -0700
@@ -29,6 +29,7 @@
 #include "GlassApplication.h"
 
 #include "com_sun_glass_events_KeyEvent.h"
+#include "com_sun_glass_ui_win_WinApplication.h"
 
 
 struct KeyMapEntry
@@ -229,12 +230,12 @@
 }
 
 /*
- * Class:     com_sun_glass_events_KeyEvent
+ * Class:     Java_com_sun_glass_ui_win_WinApplication
  * Method:    _getKeyCodeForChar
  * Signature: (C)I
  */
-JNIEXPORT jint JNICALL Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar
-  (JNIEnv * env, jclass cls, jchar c)
+JNIEXPORT jint JNICALL Java_com_sun_glass_ui_win_WinApplication__1getKeyCodeForChar
+  (JNIEnv * env, jobject jApplication, jchar c)
 {
     BYTE vkey = 0xFF & ::VkKeyScanEx((TCHAR)c,
             ::GetKeyboardLayout(GlassApplication::GetMainThreadId()));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/test/java/com/sun/javafx/iio/BMPImageLoaderTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2014, 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.iio;
+
+import com.sun.javafx.iio.bmp.BMPImageLoaderFactory;
+import com.sun.prism.Image;
+import java.awt.Color;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBuffer;
+import java.awt.image.IndexColorModel;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.Random;
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.ImageOutputStream;
+import javax.imageio.stream.MemoryCacheImageInputStream;
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+public class BMPImageLoaderTest {
+    // if true, the test will write BMP files generated by JDK to the current directory
+    static final boolean writeFiles = false;
+    static final int testWidth = 509, testHeight = 157;
+
+    ByteArrayInputStream constructStream(int[] bytes) {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        for (int b : bytes) {
+            baos.write(b);
+        }
+        return new ByteArrayInputStream(baos.toByteArray());
+    }
+
+    int getByte(int dword, int shift) {
+        return (dword >> shift) & 0xff;
+    }
+
+    boolean compareByte(int p1, int p2, int shift, int tolerance) {
+        return Math.abs(getByte(p1, shift) - getByte(p2, shift)) <= tolerance;
+    }
+
+    boolean compareRGB(int p1, int p2, int tolerance) {
+        return compareByte(p1, p2, 24, tolerance) &&
+               compareByte(p1, p2, 16, tolerance) &&
+               compareByte(p1, p2, 8,  tolerance);
+    }
+
+    void compare(Image img, BufferedImage bImg) {
+        assertNotNull(img);
+        assertNotNull(bImg);
+        int w = bImg.getWidth(), h = bImg.getHeight();
+        assertEquals("Unmatched width", w, img.getWidth());
+        assertEquals("Unmatched height", h, img.getHeight());
+
+        for (int y = 0; y < h; y++) {
+            for (int x = 0; x < w; x++) {
+                int p1 = bImg.getRGB(x, y);
+                int p2 = img.getArgb(x, y);
+                if (!compareRGB(p1, p2, 1)) {
+                    throw new org.junit.ComparisonFailure(
+                        "pixel " + x + ", " + y + " does not match", 
+                        String.format("0x%08X", p1), String.format("0x%08X", p2)
+                    );
+                }
+            }
+        }
+    }
+
+    Image loadImage(InputStream stream) {
+        ImageLoaderFactory loaderFactory = BMPImageLoaderFactory.getInstance();
+        ImageLoader loader = null;
+        try {
+            loader = loaderFactory.createImageLoader(stream);
+        } catch (IOException ioEx) {
+            fail("unexpected IOException: " + ioEx);
+        }
+        assertNotNull(loader);
+
+        try {
+            ImageFrame frame = loader.load(0, 0, 0, true, true);
+            return Image.convertImageFrame(frame);
+        } catch (IOException e) {
+            fail("unexpected IOException: " + e);
+        }
+        return null;
+    }
+
+    BufferedImage create4BitImage() {
+        int[] cmap = new int[16];
+        int i = 0;
+        for (int r = 0; r < 2; r++) {
+            for (int g = 0; g < 2; g++) {
+                for (int b = 0; b < 2; b++) {
+                    cmap[i++] = 0xff << 24 | r * 255 << 16 | g * 255 << 8 | b * 255;
+                    if ((r | g | b) == 0) {
+                        cmap[i++] = 0xffc0c0c0;
+                    } else {
+                        cmap[i++] = 0xff << 24 | r * 128 << 16 | g * 128 << 8 | b * 128;
+                    }
+                }
+            }
+        }
+        IndexColorModel cm = new IndexColorModel(4, 16, cmap, 0, false, -1, DataBuffer.TYPE_BYTE);
+        return new BufferedImage(testWidth, testHeight, BufferedImage.TYPE_BYTE_BINARY, cm);
+    }
+
+    BufferedImage createImage(int type) {
+        return new BufferedImage(testWidth, testHeight, type);
+    }
+
+    void writeImage(BufferedImage bImg, Object out, String compression) {
+        try {
+            ImageOutputStream ios = ImageIO.createImageOutputStream(out);
+            Iterator<ImageWriter> iter = ImageIO.getImageWritersByFormatName("bmp");
+            ImageWriter writer = iter.next();
+            ImageWriteParam iwp = writer.getDefaultWriteParam();
+            if (compression != null) {
+                iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
+                iwp.setCompressionType(compression);
+            }
+            writer.setOutput(ios);
+            writer.write(null, new IIOImage(bImg, null, null), iwp);
+        } catch (IOException e) {
+            fail("unexpected IOException: " + e);
+        }
+    }
+
+    Image getImage(BufferedImage bImg, String compression) {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        writeImage(bImg, out, compression);
+        return loadImage(new ByteArrayInputStream(out.toByteArray()));
+    }
+
+    void testImageType(int type, String fileName, String compression) {
+        BufferedImage bImg = createImage(type);
+        testImage(bImg, fileName, compression);
+    }
+
+    void testImageType(int type, String fileName) {
+        BufferedImage bImg = createImage(type);
+        testImage(bImg, fileName, null);
+    }
+
+    void drawImageGradient(BufferedImage bImg) {
+        Graphics2D graphics = bImg.createGraphics();
+        GradientPaint g = new GradientPaint(0, 0, Color.RED, testWidth, testHeight, Color.GREEN);
+        graphics.setPaint(g);
+        graphics.fillRect(0, 0, testWidth, testHeight);
+    }
+
+    void drawImageRandom(BufferedImage bImg) {
+        int h = bImg.getHeight(), w = bImg.getWidth();
+        Random r = new Random(1);
+        for (int y = 0; y < h; y++) {
+            for (int x = 0; x < w; x++) {
+                bImg.setRGB(x, y, r.nextInt(1 << 24));
+            }
+        }
+    }
+
+    void drawImageHue(BufferedImage bImg) {
+        int h = bImg.getHeight(), w = bImg.getWidth();
+        for (int y = 0; y < h; y++) {
+            float s = 2.0f * y / h;
+            if (s > 1) {
+                s = 1;
+            }
+            float b = 2.0f * (h - y) / h;
+            if (b > 1) {
+                b = 1;
+            }
+            for (int x = 0; x < w; x++) {
+                float hue = (float) x / w;
+                bImg.setRGB(x, y, Color.HSBtoRGB(hue, s, b));
+            }
+        }
+    }
+
+    void drawImageAll(BufferedImage bImg) {
+        int h = bImg.getHeight(), w = bImg.getWidth();
+        //if (h*w < (1<<24)) return;
+        for (int y = 0; y < h; y++) {
+            for (int x = 0; x < w; x++) {
+                bImg.setRGB(x, y, y * h + x);
+            }
+        }
+    }
+
+    void testImage(BufferedImage bImg, String fileName, String compression) {
+        //drawImageHue(bImg);
+        //drawImageAll(bImg);
+        drawImageRandom(bImg);
+        if (writeFiles && fileName != null) {
+            File file = new File(fileName);
+            file.delete();
+            writeImage(bImg, file, compression);
+        }
+        Image image = getImage(bImg, compression);
+        compare(image, bImg);
+    }
+
+    @Test
+    public void testRT32213()  {
+        final int[] bytes = {
+            0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
+            0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
+            0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x80, 0x00,
+            0x00, 0x00
+        };
+
+        ByteArrayInputStream stream = constructStream(bytes);
+        Image image = loadImage(stream);
+        stream.reset();
+        try {
+            BufferedImage bImg = ImageIO.read(new MemoryCacheImageInputStream(stream));
+            compare(image, bImg);
+        } catch (IOException e) {
+            fail("unexpected IOException: " + e);
+        }
+    }
+
+    @Test
+    public void test1Bit() {
+        testImageType(BufferedImage.TYPE_BYTE_BINARY, "out1bit.bmp");
+    }
+
+    @Test
+    public void test4Bit() {
+        testImage(create4BitImage(), "out4bit.bmp", null);
+    }
+
+    //@Test
+    public void test4BitRLE() {
+        testImage(create4BitImage(), "out4bitRLE.bmp", "BI_RLE4");
+    }
+
+    @Test
+    public void test8Bit() {
+        testImageType(BufferedImage.TYPE_BYTE_INDEXED, "out8bit.bmp");
+    }
+
+    @Test
+    public void test8BitRLE() {
+        testImageType(BufferedImage.TYPE_BYTE_INDEXED, "out8bitRLE.bmp", "BI_RLE8");
+    }
+
+    @Test
+    public void test16Bit() {
+        testImageType(BufferedImage.TYPE_USHORT_555_RGB, "out16bit.bmp");
+    }
+
+    @Test
+    public void test24Bit() {
+        testImageType(BufferedImage.TYPE_INT_RGB, "out24bit.bmp");
+    }
+
+    void testFile(String fileName, String outFileName, String compression) {
+        try {
+            Image image = loadImage(new FileInputStream(fileName));
+            BufferedImage bImg = ImageIO.read(new File(fileName));
+            if (writeFiles && outFileName != null) {
+                File outFile = new File(outFileName);
+                outFile.delete();
+                writeImage(bImg, outFile, compression);
+            }
+            compare(image, bImg);
+        } catch (IOException e) {
+            fail("unexpected IOException: " + e);
+        }
+    }
+
+    //@Test
+    public void testFiles() {
+        testFile("pal4rle.bmp", "pal4rleOut.bmp", "BI_RLE4");
+        testFile("out4bitRLE.bmp", "out4bitRLEOut.bmp", "BI_RLE4");
+        testFile("pal8rletrns.bmp", "pal8rletrnsOut.bmp", null);
+    }
+}
--- a/modules/swing/src/main/java/javafx/embed/swing/DataFlavorUtils.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/swing/src/main/java/javafx/embed/swing/DataFlavorUtils.java	Thu Jun 12 09:52:47 2014 -0700
@@ -45,6 +45,8 @@
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 
+import java.nio.ByteBuffer;
+
 
 final class DataFlavorUtils {
 
@@ -52,6 +54,31 @@
         return flavor.getPrimaryType() + "/" + flavor.getSubType();
     }
 
+    /**
+     * InputStream implementation backed by a ByteBuffer.
+     * It can handle byte buffers that are backed by arrays
+     * as well as operating system memory.
+     */
+    private static class ByteBufferInputStream extends InputStream {
+        private final ByteBuffer bb;
+
+        private ByteBufferInputStream(ByteBuffer bb) { this.bb = bb; }
+
+        @Override public int available() { return bb.remaining(); }
+
+        @Override public int read() throws IOException {
+            if (!bb.hasRemaining()) return -1;
+            return bb.get() & 0xFF; // Make sure the value is in [0..255]
+        }
+
+        @Override public int read(byte[] bytes, int off, int len) throws IOException {
+            if (!bb.hasRemaining()) return -1;
+            len = Math.min(len, bb.remaining());
+            bb.get(bytes, off, len);
+            return len;
+        }
+    }
+
     static Object adjustFxData(final DataFlavor flavor, final Object fxData)
             throws UnsupportedEncodingException
     {
@@ -67,6 +94,11 @@
                 // ...
             }
         }
+        if (fxData instanceof ByteBuffer) {
+            if (flavor.isRepresentationClassInputStream()) {
+                return new ByteBufferInputStream((ByteBuffer)fxData);
+            }
+        }
         return fxData;
     }
 
--- a/modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java	Thu Jun 12 09:52:47 2014 -0700
@@ -319,6 +319,15 @@
         if (scenePeer == null || !isFxEnabled()) {
             return;
         }
+        
+        // FX only supports 3 buttons so don't send the event for other buttons
+        switch (e.getID()) {
+            case MouseEvent.MOUSE_DRAGGED:
+            case MouseEvent.MOUSE_PRESSED:
+            case MouseEvent.MOUSE_RELEASED:
+                if (e.getButton() > 3)  return;
+                break;
+        }
 
         int extModifiers = e.getModifiersEx();
         // Fix for RT-15457: we should report no mouse button upon mouse release, so
--- a/modules/swt/src/main/java/javafx/embed/swt/FXCanvas.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/modules/swt/src/main/java/javafx/embed/swt/FXCanvas.java	Thu Jun 12 09:52:47 2014 -0700
@@ -398,17 +398,26 @@
             }
             @Override
             public void mouseDown(MouseEvent me) {
+                // FX only supports 3 buttons so don't send the event for other buttons
+                if (me.button > 3) return;
                 FXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_PRESSED);
             }
             @Override
             public void mouseUp(MouseEvent me) {
+                // FX only supports 3 buttons so don't send the event for other buttons
+                if (me.button > 3) return;
                 FXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_RELEASED);
             }
         });
 
         addMouseMoveListener(me -> {
             if ((me.stateMask & SWT.BUTTON_MASK) != 0) {
-                FXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_DRAGGED);
+                // FX only supports 3 buttons so don't send the event for other buttons
+                if ((me.stateMask & (SWT.BUTTON1 | SWT.BUTTON2 | SWT.BUTTON3)) != 0) {
+                    FXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_DRAGGED);
+                } else {
+                    FXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_MOVED);
+                }
             } else {
                 FXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_MOVED);
             }
--- a/tests/app-lifecycle/ClassLoaderApp/src/classloader/TestApp2.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/app-lifecycle/ClassLoaderApp/src/classloader/TestApp2.java	Thu Jun 12 09:52:47 2014 -0700
@@ -56,11 +56,7 @@
             throw new NullPointerException("TestApp2.init: myCcl is null");
         }
 
-        PlatformImpl.runAndWait(new Runnable() {
-            public void run() {
-                Thread.currentThread().setContextClassLoader(myCcl);
-            }
-        });
+        PlatformImpl.runAndWait(() -> Thread.currentThread().setContextClassLoader(myCcl));
     }
 
     @Override public void start(final Stage stage) throws Exception {
--- a/tests/golden-image-suite/src/modena/Modena.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/golden-image-suite/src/modena/Modena.java	Thu Jun 12 09:52:47 2014 -0700
@@ -49,10 +49,9 @@
 import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import javafx.application.Application;
 import javafx.application.Platform;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
 import javafx.embed.swing.SwingFXUtils;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
@@ -90,6 +89,7 @@
 import javafx.scene.transform.Scale;
 import javafx.stage.FileChooser;
 import javafx.stage.Stage;
+
 import javax.imageio.ImageIO;
 
 public class Modena extends Application {
@@ -151,18 +151,12 @@
     private TabPane contentTabs;
     private boolean test = false;
     private boolean embeddedPerformanceMode = false;
-    private final EventHandler<ActionEvent> rebuild = new EventHandler<ActionEvent>(){
-        @Override public void handle(ActionEvent event) {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    updateUserAgentStyleSheet();
-                    rebuildUI(modenaButton.isSelected(), retinaButton.isSelected(),
-                              contentTabs.getSelectionModel().getSelectedIndex(),
-                              samplePageNavigation.getCurrentSection());
-                }
-            });
-        }
-    };
+    private final EventHandler<ActionEvent> rebuild = event -> Platform.runLater(() -> {
+        updateUserAgentStyleSheet();
+        rebuildUI(modenaButton.isSelected(), retinaButton.isSelected(),
+                  contentTabs.getSelectionModel().getSelectedIndex(),
+                  samplePageNavigation.getCurrentSection());
+    });
     
     private static Modena instance;
 
@@ -290,11 +284,7 @@
         if (root != null) root.requestLayout();
 
         // restore scrolled section
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                samplePageNavigation.setCurrentSection(scrolledSection);
-            }
-        });
+        Platform.runLater(() -> samplePageNavigation.setCurrentSection(scrolledSection));
     }
     
     private void rebuildUI(boolean modena, boolean retina, int selectedTab, final SamplePage.Section scrolledSection) {
@@ -344,25 +334,21 @@
             contentTabs.getSelectionModel().select(selectedTab);
             samplePage.setMouseTransparent(test);
             // height test set selection for 
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    for (Node n: heightTest.lookupAll(".choice-box")) {
-                        ((ChoiceBox)n).getSelectionModel().selectFirst();
-                    }
-                    for (Node n: heightTest.lookupAll(".combo-box")) {
-                        ((ComboBox)n).getSelectionModel().selectFirst();
-                    }
+            Platform.runLater(() -> {
+                for (Node n: heightTest.lookupAll(".choice-box")) {
+                    ((ChoiceBox)n).getSelectionModel().selectFirst();
+                }
+                for (Node n: heightTest.lookupAll(".combo-box")) {
+                    ((ComboBox)n).getSelectionModel().selectFirst();
                 }
             });
             // Create Toolbar
             retinaButton = ToggleButtonBuilder.create()
                 .text("@2x")
                 .selected(retina)
-                .onAction(new EventHandler<ActionEvent>(){
-                    @Override public void handle(ActionEvent event) {
-                        ToggleButton btn = (ToggleButton)event.getSource();
-                        setRetinaMode(btn.isSelected());
-                    }
+                .onAction(event -> {
+                    ToggleButton btn = (ToggleButton)event.getSource();
+                    setRetinaMode(btn.isSelected());
                 })
                 .build();
             ToggleGroup themesToggleGroup = new ToggleGroup();
@@ -391,22 +377,16 @@
                     .build(),
                 rtlButton = ToggleButtonBuilder.create()
                     .text("RTL")
-                    .onAction(new EventHandler<ActionEvent>() {
-                            @Override public void handle(ActionEvent event) {
-                                root.setNodeOrientation(rtlButton.isSelected() ? 
-                                        NodeOrientation.RIGHT_TO_LEFT : NodeOrientation.LEFT_TO_RIGHT);
-                            }
-                        })
+                    .onAction(event -> root.setNodeOrientation(rtlButton.isSelected() ? 
+                            NodeOrientation.RIGHT_TO_LEFT : NodeOrientation.LEFT_TO_RIGHT))
                     .build(),
                 embeddedPerformanceButton = ToggleButtonBuilder.create()
                     .text("EP")
                     .selected(embeddedPerformanceMode)
                     .tooltip(new Tooltip("Apply Embedded Performance extra stylesheet"))
-                    .onAction(new EventHandler<ActionEvent>() {
-                        @Override public void handle(ActionEvent event) {
-                            embeddedPerformanceMode = embeddedPerformanceButton.isSelected();
-                            rebuild.handle(event);
-                        }
+                    .onAction(event -> {
+                        embeddedPerformanceMode = embeddedPerformanceButton.isSelected();
+                        rebuild.handle(event);
                     })
                     .build(),
                 new Separator(),
@@ -419,11 +399,7 @@
                 createAccentColorPicker(),
                 new Separator(),
                 ButtonBuilder.create().text("Save...").onAction(saveBtnHandler).build(),
-                ButtonBuilder.create().text("Restart").onAction(new EventHandler<ActionEvent>() {
-                    @Override public void handle(ActionEvent event) {
-                        restart();
-                    }
-                }).build()
+                ButtonBuilder.create().text("Restart").onAction(event -> restart()).build()
             );
             toolBar.setId("TestAppToolbar");
             // Create content group used for scaleing @2x
@@ -449,12 +425,10 @@
                 contentTabs.getTransforms().setAll(new Scale(2,2));
             }
             // update state
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // move focus out of the way
-                    modenaButton.requestFocus();
-                    samplePageNavigation.setCurrentSection(scrolledSection);
-                }
+            Platform.runLater(() -> {
+                // move focus out of the way
+                modenaButton.requestFocus();
+                samplePageNavigation.setCurrentSection(scrolledSection);
             });
         } catch (IOException ex) {
             Logger.getLogger(Modena.class.getName()).log(Level.SEVERE, null, ex);
@@ -462,11 +436,7 @@
     }
 
     public RadioMenuItem buildFontRadioMenuItem(String name, final String in_fontName, final int in_fontSize, ToggleGroup tg) {
-        return RadioMenuItemBuilder.create().text(name).onAction(new EventHandler<ActionEvent>(){
-                   @Override public void handle(ActionEvent event) {
-                       setFont(in_fontName, in_fontSize);
-                   }
-               }).style("-fx-font: " + in_fontSize + "px \"" + in_fontName + "\";").toggleGroup(tg).build();
+        return RadioMenuItemBuilder.create().text(name).onAction(event -> setFont(in_fontName, in_fontSize)).style("-fx-font: " + in_fontSize + "px \"" + in_fontName + "\";").toggleGroup(tg).build();
     }
     
     public void setFont(String in_fontName, int in_fontSize) {
@@ -497,11 +467,7 @@
                 Color.MAGENTA,
                 Color.BLACK
         );
-        colorPicker.valueProperty().addListener(new ChangeListener<Color>() {
-            @Override public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color c) {
-                setBaseColor(c);
-            }
-        });
+        colorPicker.valueProperty().addListener((observable, oldValue, c) -> setBaseColor(c));
         return colorPicker;
     }
     
@@ -533,15 +499,13 @@
                 Color.MAGENTA,
                 Color.BLACK
         );
-        colorPicker.valueProperty().addListener(new ChangeListener<Color>() {
-            @Override public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color c) {
-                if (c == null) {
-                    backgroundColor = null;
-                } else {
-                    backgroundColor = c;
-                }
-                updateUserAgentStyleSheet();
+        colorPicker.valueProperty().addListener((observable, oldValue, c) -> {
+            if (c == null) {
+                backgroundColor = null;
+            } else {
+                backgroundColor = c;
             }
+            updateUserAgentStyleSheet();
         });
         return colorPicker;
     }
@@ -567,11 +531,7 @@
                 Color.MAGENTA,
                 Color.BLACK
         );
-        colorPicker.valueProperty().addListener(new ChangeListener<Color>() {
-            @Override public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color c) {
-                setAccentColor(c);
-            }
-        });
+        colorPicker.valueProperty().addListener((observable, oldValue, c) -> setAccentColor(c));
         return colorPicker;
     }
 
@@ -584,31 +544,29 @@
         updateUserAgentStyleSheet();
     }
     
-    private EventHandler<ActionEvent> saveBtnHandler = new EventHandler<ActionEvent>() {
-        @Override public void handle(ActionEvent event) {
-            FileChooser fc = new FileChooser();
-            fc.getExtensionFilters().add(new FileChooser.ExtensionFilter("PNG", "*.png"));
-            File file = fc.showSaveDialog(mainStage);
-            if (file != null) {
-                try {
-                    samplePage.getStyleClass().add("root");
-                    int width = (int)(samplePage.getLayoutBounds().getWidth()+0.5d);
-                    int height = (int)(samplePage.getLayoutBounds().getHeight()+0.5d);
-                    BufferedImage imgBuffer = new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
-                    Graphics2D g2 = imgBuffer.createGraphics();
-                    for (int y=0; y<height; y+=2048) {
-                        SnapshotParameters snapshotParameters = new SnapshotParameters();
-                        int remainingHeight = Math.min(2048, height - y);
-                        snapshotParameters.setViewport(new Rectangle2D(0,y,width,remainingHeight));
-                        WritableImage img = samplePage.snapshot(snapshotParameters, null);
-                        g2.drawImage(SwingFXUtils.fromFXImage(img,null),0,y,null);
-                    }
-                    g2.dispose();
-                    ImageIO.write(imgBuffer, "PNG", file);
-                    System.out.println("Written image: "+file.getAbsolutePath());
-                } catch (IOException ex) {
-                    Logger.getLogger(Modena.class.getName()).log(Level.SEVERE, null, ex);
+    private EventHandler<ActionEvent> saveBtnHandler = event -> {
+        FileChooser fc = new FileChooser();
+        fc.getExtensionFilters().add(new FileChooser.ExtensionFilter("PNG", "*.png"));
+        File file = fc.showSaveDialog(mainStage);
+        if (file != null) {
+            try {
+                samplePage.getStyleClass().add("root");
+                int width = (int)(samplePage.getLayoutBounds().getWidth()+0.5d);
+                int height = (int)(samplePage.getLayoutBounds().getHeight()+0.5d);
+                BufferedImage imgBuffer = new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
+                Graphics2D g2 = imgBuffer.createGraphics();
+                for (int y=0; y<height; y+=2048) {
+                    SnapshotParameters snapshotParameters = new SnapshotParameters();
+                    int remainingHeight = Math.min(2048, height - y);
+                    snapshotParameters.setViewport(new Rectangle2D(0,y,width,remainingHeight));
+                    WritableImage img = samplePage.snapshot(snapshotParameters, null);
+                    g2.drawImage(SwingFXUtils.fromFXImage(img,null),0,y,null);
                 }
+                g2.dispose();
+                ImageIO.write(imgBuffer, "PNG", file);
+                System.out.println("Written image: "+file.getAbsolutePath());
+            } catch (IOException ex) {
+                Logger.getLogger(Modena.class.getName()).log(Level.SEVERE, null, ex);
             }
         }
     };
--- a/tests/golden-image-suite/src/modena/SameHeightTestController.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/golden-image-suite/src/modena/SameHeightTestController.java	Thu Jun 12 09:52:47 2014 -0700
@@ -33,9 +33,9 @@
 
 import java.net.URL;
 import java.util.ResourceBundle;
+
 import javafx.application.Platform;
 import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
 import javafx.fxml.FXML;
 import javafx.fxml.Initializable;
 import javafx.geometry.Insets;
@@ -67,33 +67,19 @@
     private Node arrow;
 
     @Override public void initialize(URL url, ResourceBundle rb) {
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                Text buttonTextNode = (Text)horizFirstButton.lookup(".text");
-                buttonTextNode.layoutYProperty().addListener(new ChangeListener<Number>() {
-                    @Override public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
-                        StackPane.setMargin(horizBaseLine, new Insets(t1.doubleValue(),0,0,0));
-                    }
-                });
-                Text textFieldTextNode = (Text)vertFirstTextField.lookup(".text");
-                textFieldTextNode.layoutXProperty().addListener(new ChangeListener<Number>() {
-                    @Override public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
-                        StackPane.setMargin(vertBaseLine, new Insets(0,0,0,t1.doubleValue()));
-                    }
-                });
-                arrowButton = editableCombo.lookup(".arrow-button");
-                arrow = editableCombo.lookup(".arrow");
-                ChangeListener updater = new ChangeListener() {
-                    @Override public void changed(ObservableValue ov, Object t, Object t1) {
-                        updateArrowLinePositions();
-                    }
-                };
-                arrow.layoutBoundsProperty().addListener(updater);
-                arrowButton.layoutBoundsProperty().addListener(updater);
-                editableCombo.layoutBoundsProperty().addListener(updater);
-                arrowButtonContainer.layoutBoundsProperty().addListener(updater);
-                updateArrowLinePositions();
-            }
+        Platform.runLater(() -> {
+            Text buttonTextNode = (Text)horizFirstButton.lookup(".text");
+            buttonTextNode.layoutYProperty().addListener((ov, t, t1) -> StackPane.setMargin(horizBaseLine, new Insets(t1.doubleValue(),0,0,0)));
+            Text textFieldTextNode = (Text)vertFirstTextField.lookup(".text");
+            textFieldTextNode.layoutXProperty().addListener((ov, t, t1) -> StackPane.setMargin(vertBaseLine, new Insets(0,0,0,t1.doubleValue())));
+            arrowButton = editableCombo.lookup(".arrow-button");
+            arrow = editableCombo.lookup(".arrow");
+            ChangeListener updater = (ov, t, t1) -> updateArrowLinePositions();
+            arrow.layoutBoundsProperty().addListener(updater);
+            arrowButton.layoutBoundsProperty().addListener(updater);
+            editableCombo.layoutBoundsProperty().addListener(updater);
+            arrowButtonContainer.layoutBoundsProperty().addListener(updater);
+            updateArrowLinePositions();
         });
     }
     
--- a/tests/golden-image-suite/src/modena/SamplePageHelpers.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/golden-image-suite/src/modena/SamplePageHelpers.java	Thu Jun 12 09:52:47 2014 -0700
@@ -33,9 +33,8 @@
 
 import java.util.ArrayList;
 import java.util.List;
+
 import javafx.application.Platform;
-import javafx.beans.InvalidationListener;
-import javafx.beans.Observable;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.css.PseudoClass;
@@ -75,7 +74,6 @@
 import javafx.scene.paint.Color;
 import javafx.scene.shape.LineBuilder;
 import javafx.scene.shape.RectangleBuilder;
-import javafx.util.Callback;
 
 /**
  * Helper static methods for Sample Page
@@ -98,18 +96,16 @@
     
     static <T extends Node> T withState(final T node, final String state, final String subNodeStyleClass, final String subNodeState) {
         withState(node, state);
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                if (node != null) {
-                    Node subNode = node.lookup(subNodeStyleClass);
-                    if (subNode != null) {
-                        withState(node.lookup(subNodeStyleClass), subNodeState);
-                    } else {
-                        System.err.println("node = " + node+" node.lookup("+subNodeStyleClass+") = " + subNode);
-                    }
+        Platform.runLater(() -> {
+            if (node != null) {
+                Node subNode = node.lookup(subNodeStyleClass);
+                if (subNode != null) {
+                    withState(node.lookup(subNodeStyleClass), subNodeState);
                 } else {
-                    System.err.println("node = " + node);
+                    System.err.println("node = " + node+" node.lookup("+subNodeStyleClass+") = " + subNode);
                 }
+            } else {
+                System.err.println("node = " + node);
             }
         });
         return node;
@@ -225,11 +221,7 @@
         Pagination pagination = new Pagination(numOfPages);
         if (bullet) pagination.getStyleClass().add("bullet");
         if (!arrows) pagination.setStyle("-fx-arrows-visible:false;");
-        pagination.setPageFactory(new Callback<Integer, Node>() {
-            @Override public Node call(Integer param) {
-                return new Label("Page Label "+param);
-            }
-        });
+        pagination.setPageFactory(param -> new Label("Page Label "+param));
         return pagination;
     }
     
@@ -272,13 +264,11 @@
             createMenu("Help")
         );
 //        mb.setMouseTransparent(true);
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                // get second menu and force into hover state
-                try {
-                    new ArrayList<Node>(mb.lookupAll(".menu")).get(1).pseudoClassStateChanged(PseudoClass.getPseudoClass("hover"), true);
-                } catch (Exception e) { e.printStackTrace(); }
-            }
+        Platform.runLater(() -> {
+            // get second menu and force into hover state
+            try {
+                new ArrayList<Node>(mb.lookupAll(".menu")).get(1).pseudoClassStateChanged(PseudoClass.getPseudoClass("hover"), true);
+            } catch (Exception e) { e.printStackTrace(); }
         });
         return  mb;
     }
@@ -302,18 +292,16 @@
         // create a place holder container
         final StackPane contextMenu = new StackPane();
         // show context menu then steal and place inline
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                menu.show(contextMenu,-1000,-1000);
-                menu.hide();
-                Platform.runLater(new Runnable() {
-                    @Override public void run() {
-                        final Node menuContent = menu.getSkin().getNode();
-                        contextMenu.getChildren().add(menuContent);
-                        menuContent.setMouseTransparent(true);
+        Platform.runLater(() -> {
+            menu.show(contextMenu,-1000,-1000);
+            menu.hide();
+            Platform.runLater(() -> {
+                final Node menuContent = menu.getSkin().getNode();
+                contextMenu.getChildren().add(menuContent);
+                menuContent.setMouseTransparent(true);
 //                        System.out.println("menuContent = " + menuContent);
 //                        System.out.println("menuContent.lookupAll(\".menu-item\") = " + menuContent.lookupAll(".menu-item"));
-                        
+                
 //                        Platform.runLater(new Runnable() {
 //                            @Override public void run() {
 ////                        if (selectAll) {
@@ -326,9 +314,7 @@
 ////                        }
 //                            }
 //                        });
-                    }
-                });
-            }
+            });
         });
         return contextMenu;
     }
@@ -371,11 +357,9 @@
         final MenuItem menu112 = new MenuItem("foo");
         final CheckMenuItem menu113 = new CheckMenuItem("Show \"foo\" item");
         menu113.setSelected(true);
-        menu113.selectedProperty().addListener(new InvalidationListener() {
-            @Override public void invalidated(Observable valueModel) {
-                menu112.setVisible(menu113.isSelected());
-                System.err.println("MenuItem \"foo\" is now " + (menu112.isVisible() ? "" : "not") + " visible.");
-            }
+        menu113.selectedProperty().addListener(valueModel -> {
+            menu112.setVisible(menu113.isSelected());
+            System.err.println("MenuItem \"foo\" is now " + (menu112.isVisible() ? "" : "not") + " visible.");
         });
         menu11.getItems().addAll(menu111, menu112, menu113);
 
--- a/tests/golden-image-suite/src/modena/SamplePageNavigation.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/golden-image-suite/src/modena/SamplePageNavigation.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1,7 +1,5 @@
 package modena;
 
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
 import javafx.scene.control.ChoiceBox;
 import javafx.scene.control.Label;
 import javafx.scene.control.ScrollPane;
@@ -25,37 +23,31 @@
         toolBar.getStyleClass().add("bottom");
         toolBar.getItems().add(new Label("Go to section:"));
         final ChoiceBox<SamplePage.Section> sectionChoiceBox = new ChoiceBox<>();
-        sectionChoiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<SamplePage.Section>() {
-            @Override public void changed(ObservableValue<? extends SamplePage.Section> observable, SamplePage.Section oldValue, SamplePage.Section newValue) {
-                setCurrentSection(newValue);
-            }
-        });
+        sectionChoiceBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> setCurrentSection(newValue));
         sectionChoiceBox.getItems().addAll(samplePage.getSections());
         toolBar.getItems().add(sectionChoiceBox);
         setBottom(toolBar);
-        scrollPane.vvalueProperty().addListener(new ChangeListener<Number>() {
-            @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
-                if (!isLocalChange) {
-                    isLocalChange = true;
-                    // calc scroll position relative to scroll pane content
-                    double posPixels = samplePage.getLayoutBounds().getHeight() * newValue.doubleValue();
-                    // move to top of view port
-                    posPixels -=  scrollPane.getLayoutBounds().getHeight() * newValue.doubleValue();
-                    // move to center of view port
-                    posPixels +=  scrollPane.getLayoutBounds().getHeight() * 0.5;
-                    // find section that contains view port center
-                    currentSection = null;
-                    for (SamplePage.Section section: samplePage.getSections()) {
-                        if (section.box.getBoundsInParent().getMaxY() > posPixels ) {
-                            currentSection = section;
-                            break;
-                        }
+        scrollPane.vvalueProperty().addListener((observable, oldValue, newValue) -> {
+            if (!isLocalChange) {
+                isLocalChange = true;
+                // calc scroll position relative to scroll pane content
+                double posPixels = samplePage.getLayoutBounds().getHeight() * newValue.doubleValue();
+                // move to top of view port
+                posPixels -=  scrollPane.getLayoutBounds().getHeight() * newValue.doubleValue();
+                // move to center of view port
+                posPixels +=  scrollPane.getLayoutBounds().getHeight() * 0.5;
+                // find section that contains view port center
+                currentSection = null;
+                for (SamplePage.Section section: samplePage.getSections()) {
+                    if (section.box.getBoundsInParent().getMaxY() > posPixels ) {
+                        currentSection = section;
+                        break;
                     }
-                    sectionChoiceBox.getSelectionModel().select(currentSection);
-                    isLocalChange = false;
                 }
+                sectionChoiceBox.getSelectionModel().select(currentSection);
+                isLocalChange = false;
+            }
 
-            }
         });
     }
 
--- a/tests/golden-image-suite/src/modena/SamplePageTableHelper.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/golden-image-suite/src/modena/SamplePageTableHelper.java	Thu Jun 12 09:52:47 2014 -0700
@@ -38,12 +38,9 @@
 import javafx.beans.property.SimpleBooleanProperty;
 import javafx.beans.property.SimpleStringProperty;
 import javafx.beans.property.StringProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.collections.SetChangeListener;
-import javafx.event.EventHandler;
 import javafx.scene.Node;
 import javafx.scene.control.Label;
 import javafx.scene.control.SelectionMode;
@@ -58,7 +55,6 @@
 import javafx.scene.paint.Color;
 import javafx.scene.paint.Paint;
 import javafx.scene.shape.Rectangle;
-import javafx.util.Callback;
 
 /**
  * Helper class for creating table views for testing
@@ -95,11 +91,7 @@
                     return firstName.get() + " " + lastName.get();
                 }
             });
-            this.invited.addListener(new ChangeListener<Boolean>() {
-                public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
-                    System.out.println(getFirstName() + " invited: " + t1);
-                }
-            });
+            this.invited.addListener((ov, t, t1) -> System.out.println(getFirstName() + " invited: " + t1));
         }
         
         public Boolean isInvited() { return invited.get(); }
@@ -216,18 +208,10 @@
         emailCol = new TableColumn<Person, String>();
         emailCol.setText("Email");
         emailCol.setMinWidth(200);
-        emailCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
-            public ObservableValue<String> call(TableColumn.CellDataFeatures<Person, String> p) {
-                return p.getValue().emailProperty();
-            }
-        });
+        emailCol.setCellValueFactory(p -> p.getValue().emailProperty());
         countryCol = new TableColumn<Person, String>();
         countryCol.setText("Country");
-        countryCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
-            public ObservableValue<String> call(TableColumn.CellDataFeatures<Person, String> p) {
-                return new ReadOnlyObjectWrapper<String>("New Zealand");
-            }
-        });
+        countryCol.setCellValueFactory(p -> new ReadOnlyObjectWrapper<String>("New Zealand"));
         // Create TableView
         TableView<Person> tableView = new TableView<Person>();
         tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
@@ -268,56 +252,38 @@
 //        });
 //        firstNameCol.setSortNode(sortNode);
         firstNameCol.setCellValueFactory(new PropertyValueFactory<Person,String>("firstName"));
-        firstNameCol.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<Person, String>>() {
-            @Override public void handle(TableColumn.CellEditEvent<Person, String> t) {
-                System.out.println("Edit commit event: " + t.getNewValue());
-            }
-        });
+        firstNameCol.setOnEditCommit(t -> System.out.println("Edit commit event: " + t.getNewValue()));
         final Node graphic1 = new ImageView(new Image("file:src/helloworld/about_16.png"));
         lastNameCol = new TableColumn<Person, String>();
         lastNameCol.setGraphic(graphic1);
         lastNameCol.setText("Last");
         lastNameCol.setSortType(TableColumn.SortType.DESCENDING);
-        lastNameCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
-            public ObservableValue<String> call(TableColumn.CellDataFeatures<Person, String> p) {
-                return p.getValue().lastNameProperty();
-            }
-        });
+        lastNameCol.setCellValueFactory(p -> p.getValue().lastNameProperty());
         nameCol = new TableColumn<Person, String>();
         nameCol.setText("Name");
         nameCol.getColumns().addAll(firstNameCol, lastNameCol);
         emailCol = new TableColumn<Person, String>();
         emailCol.setText("Email");
         emailCol.setMinWidth(200);
-        emailCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
-            public ObservableValue<String> call(TableColumn.CellDataFeatures<Person, String> p) {
-                return p.getValue().emailProperty();
-            }
-        });
+        emailCol.setCellValueFactory(p -> p.getValue().emailProperty());
         countryCol = new TableColumn<Person, String>();
         countryCol.setText("Country");
-        countryCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
-            public ObservableValue<String> call(TableColumn.CellDataFeatures<Person, String> p) {
-                return new ReadOnlyObjectWrapper<String>("New Zealand");
-            }
-        });
+        countryCol.setCellValueFactory(p -> new ReadOnlyObjectWrapper<String>("New Zealand"));
         // Test case for RT-28410 MODENA: can't make tree/table cell factories change color based
         // on background when setGraphic(...) is used
-        countryCol.setCellFactory(new Callback<TableColumn<Person, String>, TableCell<Person, String>>() {
-            @Override public TableCell<Person, String> call(TableColumn<Person, String> param) {
-                final Label label = new Label();
-                label.setStyle(
-                        "-fx-font-family: 'Times New Roman';" +
-                        "-fx-font-size: 0.8em;" +
-                        "-fx-text-fill: ladder(-fx-background, yellow 49%, red 50%);");
-                TableCell cell = new TableCell() {
-                    @Override protected void updateItem(Object item, boolean empty) {
-                        label.setText(empty ? null : item.toString());
-                    }
-                };
-                cell.setGraphic(label);
-                return cell;
-            }
+        countryCol.setCellFactory(param -> {
+            final Label label = new Label();
+            label.setStyle(
+                    "-fx-font-family: 'Times New Roman';" +
+                    "-fx-font-size: 0.8em;" +
+                    "-fx-text-fill: ladder(-fx-background, yellow 49%, red 50%);");
+            TableCell cell = new TableCell() {
+                @Override protected void updateItem(Object item, boolean empty) {
+                    label.setText(empty ? null : item.toString());
+                }
+            };
+            cell.setGraphic(label);
+            return cell;
         });
 
         invitedCol = new TableColumn<Person, Boolean>();
@@ -325,11 +291,7 @@
         invitedCol.setPrefWidth(55);
         invitedCol.setMaxWidth(55);
         invitedCol.setCellValueFactory(new PropertyValueFactory("invited"));
-        invitedCol.setCellFactory(new Callback<TableColumn<Person, Boolean>, TableCell<Person, Boolean>>() {
-            public TableCell<Person, Boolean> call(TableColumn<Person, Boolean> p) {
-                return new CheckBoxTableCell<Person, Boolean>();
-            }
-        });
+        invitedCol.setCellFactory(p -> new CheckBoxTableCell<Person, Boolean>());
         
         
         TableView<Person> tableView = new TableView<Person>();
--- a/tests/golden-image-suite/src/modena/SamplePageTreeTableHelper.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/golden-image-suite/src/modena/SamplePageTreeTableHelper.java	Thu Jun 12 09:52:47 2014 -0700
@@ -36,12 +36,11 @@
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
 import java.util.Random;
+
 import javafx.beans.property.ReadOnlyObjectWrapper;
-import javafx.beans.value.ObservableValue;
 import javafx.collections.ObservableList;
 import javafx.scene.Node;
 import javafx.scene.control.SelectionMode;
@@ -51,7 +50,6 @@
 import javafx.scene.control.TreeTableColumn;
 import javafx.scene.control.TreeTableView;
 import javafx.scene.shape.SVGPath;
-import javafx.util.Callback;
 
 /**
  * Helper class for creating tree table views for testing
@@ -141,83 +139,63 @@
         // --- name column
         TreeTableColumn<DummyFile, String> nameColumn = new TreeTableColumn<DummyFile, String>("Name");
         nameColumn.setPrefWidth(300);
-        nameColumn.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<DummyFile, String>, ObservableValue<String>>() {
-            @Override public ObservableValue<String> call(TreeTableColumn.CellDataFeatures<DummyFile, String> p) {
-                DummyFile f = p.getValue().getValue();
-                String text = f == ROOT ? "/" : f.getName();
-                return new ReadOnlyObjectWrapper<String>(text);
-            }
+        nameColumn.setCellValueFactory(p -> {
+            DummyFile f = p.getValue().getValue();
+            String text = f == ROOT ? "/" : f.getName();
+            return new ReadOnlyObjectWrapper<String>(text);
         });
 
         // --- size column
         TreeTableColumn<DummyFile, DummyFile> sizeColumn = new TreeTableColumn<DummyFile, DummyFile>("Size");
         sizeColumn.setPrefWidth(100);
-        sizeColumn.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<DummyFile, DummyFile>, ObservableValue<DummyFile>>() {
-            @Override public ObservableValue<DummyFile> call(TreeTableColumn.CellDataFeatures<DummyFile, DummyFile> p) {
-                return new ReadOnlyObjectWrapper<DummyFile>(p.getValue().getValue());
+        sizeColumn.setCellValueFactory(p -> new ReadOnlyObjectWrapper<DummyFile>(p.getValue().getValue()));
+        sizeColumn.setCellFactory(p -> new TreeTableCell<DummyFile, DummyFile>() {
+            @Override protected void updateItem(DummyFile item, boolean empty) {
+                super.updateItem(item, empty);
+                
+                TreeTableView treeTable = p.getTreeTableView();
+
+                // if the File is a directory, it has no size...
+//                        ObservableList<TreeItem<DummyFile>> items = p.getTreeTableView().getItems();
+                if (getIndex() >= treeTable.getExpandedItemCount()) {
+                    setText(null);
+                } else {
+                    TreeItem<DummyFile> treeItem = treeTable.getTreeItem(getIndex());
+                    if (item == null || empty || treeItem == null || 
+                            treeItem.getValue() == null || treeItem.getValue().isDirectory()) {
+                        setText(null);
+                    } else {
+                        setText(nf.format(item.getSize()) + " KB");
+                    }
+                }
             }
         });
-        sizeColumn.setCellFactory(new Callback<TreeTableColumn<DummyFile, DummyFile>, TreeTableCell<DummyFile, DummyFile>>() {
-            @Override public TreeTableCell<DummyFile, DummyFile> call(final TreeTableColumn<DummyFile, DummyFile> p) {
-                return new TreeTableCell<DummyFile, DummyFile>() {
-                    @Override protected void updateItem(DummyFile item, boolean empty) {
-                        super.updateItem(item, empty);
-                        
-                        TreeTableView treeTable = p.getTreeTableView();
-
-                        // if the File is a directory, it has no size...
-//                        ObservableList<TreeItem<DummyFile>> items = p.getTreeTableView().getItems();
-                        if (getIndex() >= treeTable.getExpandedItemCount()) {
-                            setText(null);
-                        } else {
-                            TreeItem<DummyFile> treeItem = treeTable.getTreeItem(getIndex());
-                            if (item == null || empty || treeItem == null || 
-                                    treeItem.getValue() == null || treeItem.getValue().isDirectory()) {
-                                setText(null);
-                            } else {
-                                setText(nf.format(item.getSize()) + " KB");
-                            }
-                        }
-                    }
-                };
-            }
-        });
-        sizeColumn.setComparator(new Comparator<DummyFile>() {
-            @Override public int compare(DummyFile f1, DummyFile f2) {
-                long s1 = f1.isDirectory() ? 0 : f1.getSize();
-                long s2 = f2.isDirectory() ? 0 : f2.getSize();
-                long result = s1 - s2;
-                if (result < 0) {
-                    return -1;
-                } else if (result == 0) {
-                    return 0;
-                } else {
-                    return 1;
-                }
+        sizeColumn.setComparator((f1, f2) -> {
+            long s1 = f1.isDirectory() ? 0 : f1.getSize();
+            long s2 = f2.isDirectory() ? 0 : f2.getSize();
+            long result = s1 - s2;
+            if (result < 0) {
+                return -1;
+            } else if (result == 0) {
+                return 0;
+            } else {
+                return 1;
             }
         });
         
         // --- modified column
         TreeTableColumn<DummyFile, Date> lastModifiedColumn = new TreeTableColumn<DummyFile, Date>("Last Modified");
         lastModifiedColumn.setPrefWidth(130);
-        lastModifiedColumn.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<DummyFile, Date>, ObservableValue<Date>>() {
-            @Override public ObservableValue<Date> call(TreeTableColumn.CellDataFeatures<DummyFile, Date> p) {
-                return new ReadOnlyObjectWrapper<Date>(p.getValue().getValue().getModified());
-            }
-        });
-        lastModifiedColumn.setCellFactory(new Callback<TreeTableColumn<DummyFile, Date>, TreeTableCell<DummyFile, Date>>() {
-            @Override public TreeTableCell<DummyFile, Date> call(TreeTableColumn<DummyFile, Date> p) {
-                return new TreeTableCell<DummyFile, Date>() {
-                    @Override protected void updateItem(Date item, boolean empty) {
-                        super.updateItem(item, empty);
-                        
-                        if (item == null || empty) {
-                            setText(null);
-                        } else {
-                            setText(df.format(item));
-                        }
-                    }
-                };
+        lastModifiedColumn.setCellValueFactory(p -> new ReadOnlyObjectWrapper<Date>(p.getValue().getValue().getModified()));
+        lastModifiedColumn.setCellFactory(p -> new TreeTableCell<DummyFile, Date>() {
+            @Override protected void updateItem(Date item, boolean empty) {
+                super.updateItem(item, empty);
+                
+                if (item == null || empty) {
+                    setText(null);
+                } else {
+                    setText(df.format(item));
+                }
             }
         });
         
--- a/tests/golden-image-suite/src/modena/SimpleWindowPage.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/golden-image-suite/src/modena/SimpleWindowPage.java	Thu Jun 12 09:52:47 2014 -0700
@@ -86,21 +86,19 @@
             ubuntuWindowContent = (Node)FXMLLoader.load(SimpleWindowPage.class.getResource("simple-window.fxml"));
             ubuntuWindow.getChildren().add(ubuntuWindowContent);
             
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    final Node macRB2 = macWindowContent.lookup("#RadioButton2");
-                    macRB2.setMouseTransparent(true);
-                    macRB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
-                    final Node windows7RB2 = windows7WindowContent.lookup("#RadioButton2");
-                    windows7RB2.setMouseTransparent(true);
-                    windows7RB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
-                    final Node windows8RB2 = windows8WindowContent.lookup("#RadioButton2");
-                    windows8RB2.setMouseTransparent(true);
-                    windows8RB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
-                    final Node ubuntuRB2 = ubuntuWindowContent.lookup("#RadioButton2");
-                    ubuntuRB2.setMouseTransparent(true);
-                    ubuntuRB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
-                }
+            Platform.runLater(() -> {
+                final Node macRB2 = macWindowContent.lookup("#RadioButton2");
+                macRB2.setMouseTransparent(true);
+                macRB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
+                final Node windows7RB2 = windows7WindowContent.lookup("#RadioButton2");
+                windows7RB2.setMouseTransparent(true);
+                windows7RB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
+                final Node windows8RB2 = windows8WindowContent.lookup("#RadioButton2");
+                windows8RB2.setMouseTransparent(true);
+                windows8RB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
+                final Node ubuntuRB2 = ubuntuWindowContent.lookup("#RadioButton2");
+                ubuntuRB2.setMouseTransparent(true);
+                ubuntuRB2.pseudoClassStateChanged(PseudoClass.getPseudoClass("focused"), true);
             });
             
             box.getChildren().addAll(macWindow, ubuntuWindow, windows7Window, windows8Window);
--- a/tests/manual/printing/PageLayoutTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/manual/printing/PageLayoutTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -22,8 +22,6 @@
  */
 
 import javafx.application.Application;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
 import javafx.scene.Group;
 import javafx.scene.Scene;
 import javafx.scene.control.Button;
@@ -32,7 +30,6 @@
 import javafx.scene.text.Text;
 import javafx.stage.Screen;
 import javafx.stage.Stage;
-
 import javafx.print.PageLayout;
 import javafx.print.PageOrientation;
 import javafx.print.Paper;
@@ -113,12 +110,7 @@
         scene.setFill(Color.RED);
 
         Button print = new Button("Print");
-        print.setOnAction(new EventHandler<ActionEvent>() {
-            @Override
-            public void handle(ActionEvent e) {
-                createJob();
-            }
-        });
+        print.setOnAction(e -> createJob());
         ((Group) scene.getRoot()).getChildren().add(print);
         return scene;
 
--- a/tests/manual/printing/PrintOrientTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/manual/printing/PrintOrientTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -1,20 +1,16 @@
 import java.util.Set;
+
 import javafx.print.JobSettings;
 import javafx.print.Printer;
 import javafx.print.PrinterAttributes;
-
 import javafx.print.PrinterJob;
 import javafx.print.PrintColor;
 import javafx.print.PageOrientation;
 import javafx.print.PageLayout;
 import static javafx.print.PageOrientation.*;
-
 import javafx.application.Application;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
 import javafx.geometry.Rectangle2D;
 import javafx.geometry.VPos;
-
 import javafx.scene.Group;
 import javafx.scene.Scene;
 import javafx.scene.control.Button;
@@ -82,14 +78,11 @@
         Button print = new Button("Print");
         print.setLayoutX(80);
         print.setLayoutY(200);
-        print.setOnAction(new EventHandler<ActionEvent>() {
-            @Override
-            public void handle(ActionEvent e) {
-                createJob(PORTRAIT);
-                createJob(REVERSE_PORTRAIT);
-                createJob(LANDSCAPE);
-                createJob(REVERSE_LANDSCAPE);
-            }
+        print.setOnAction(e -> {
+            createJob(PORTRAIT);
+            createJob(REVERSE_PORTRAIT);
+            createJob(LANDSCAPE);
+            createJob(REVERSE_LANDSCAPE);
         });
         ((Group)scene.getRoot()).getChildren().add(print);
         return scene;
--- a/tests/performance/VMPerformance/src/VMPerformance.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/performance/VMPerformance/src/VMPerformance.java	Thu Jun 12 09:52:47 2014 -0700
@@ -610,15 +610,13 @@
 
     static class CreateAndCollectWeakReferenceWithQueue extends ObjectCreationTest {
         final ReferenceQueue queue = new ReferenceQueue();
-        Thread queueThread = new Thread(new Runnable() {
-            public void run() {
-                try {
-                    while (true) {
-                        Reference r = queue.remove();
-                    }
-                } catch (InterruptedException e) {
-                    return;
+        Thread queueThread = new Thread(() -> {
+            try {
+                while (true) {
+                    Reference r = queue.remove();
                 }
+            } catch (InterruptedException e) {
+                return;
             }
         });
         {
@@ -637,15 +635,13 @@
     static class CreateAndCollectPhantomReferenceWithQueue
             extends ObjectCreationTest {
         final ReferenceQueue queue = new ReferenceQueue();
-        Thread queueThread = new Thread(new Runnable() {
-            public void run() {
-                try {
-                    while (true) {
-                        Reference r = queue.remove();
-                    }
-                } catch (InterruptedException e) {
-                    return;
+        Thread queueThread = new Thread(() -> {
+            try {
+                while (true) {
+                    Reference r = queue.remove();
                 }
+            } catch (InterruptedException e) {
+                return;
             }
         });
         {
--- a/tests/system/src/test/java/com/sun/glass/ui/DefaultExceptionHandlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/DefaultExceptionHandlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -55,20 +55,12 @@
 
     @BeforeClass
     public static void setup() throws Exception {
-        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
-            @Override
-            public void uncaughtException(Thread t, Throwable e) {
-                exception = e;
-                System.out.println("Exception caught: " + e);
-                System.out.flush();
-            }
+        Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
+            exception = e;
+            System.out.println("Exception caught: " + e);
+            System.out.flush();
         });
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                Application.launch(TestApp.class);
-            }
-        }).start();
+        new Thread(() -> Application.launch(TestApp.class)).start();
         startupLatch.await();
     }
 
@@ -76,18 +68,10 @@
     public void test1() throws Throwable {
         exception = null;
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                throw new TestException("test1");
-            }
+        Platform.runLater(() -> {
+            throw new TestException("test1");
         });
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                l.countDown();
-            }
-        });
+        Platform.runLater(l::countDown);
         l.await(10000, TimeUnit.MILLISECONDS);
         if (exception == null) {
             throw new RuntimeException("Test FAILED: TestException is not caught");
--- a/tests/system/src/test/java/com/sun/glass/ui/ExceptionHandlerTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/ExceptionHandlerTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -49,13 +49,10 @@
     public static class TestApp extends Application {
         @Override
         public void start(Stage t) {
-            Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
-                @Override
-                public void uncaughtException(Thread t, Throwable e) {
-                    exception = e;
-                    System.out.println("Exception caught: " + e);
-                    System.out.flush();
-                }
+            Thread.currentThread().setUncaughtExceptionHandler((t2, e) -> {
+                exception = e;
+                System.out.println("Exception caught: " + e);
+                System.out.flush();
             });
             startupLatch.countDown();
         }
@@ -69,12 +66,7 @@
 
     @BeforeClass
     public static void setup() throws Exception {
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                Application.launch(TestApp.class);
-            }
-        }).start();
+        new Thread(() -> Application.launch(TestApp.class)).start();
         startupLatch.await();
     }
 
@@ -82,18 +74,10 @@
     public void test1() throws Throwable {
         exception = null;
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                throw new TestException("test1");
-            }
+        Platform.runLater(() -> {
+            throw new TestException("test1");
         });
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                l.countDown();
-            }
-        });
+        Platform.runLater(l::countDown);
         l.await(10000, TimeUnit.MILLISECONDS);
         if (exception == null) {
             throw new RuntimeException("Test FAILED: TestException is not caught");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/IntSetTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2014, 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.glass.ui.monocle;
+
+import com.sun.glass.ui.monocle.util.IntSet;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@RunWith(Parameterized.class)
+public class IntSetTest {
+
+    private Integer[] array;
+
+    @Parameterized.Parameters
+    public static Collection<Object[]> data() {
+        Integer[][] sets = {
+                { 1 },
+                { 1, 2 },
+                { 1, 2, 3},
+                { 1, 1 },
+                { 1, 1, 1 },
+                { 1, 1, 2 },
+        };
+        return Arrays.asList(sets).stream()
+                .map(d -> new Object[] { d })
+                .collect(Collectors.toList());
+    }
+
+    public IntSetTest(Integer[] array) {
+        this.array = array;
+    }
+
+    private int[] getIntSetAsArray(IntSet s) {
+        int[] a = new int[s.size()];
+        for (int i = 0; i < s.size(); i++) {
+            a[i] = s.get(i);
+        }
+        Arrays.sort(a);
+        return a;
+    }
+
+    private int[] getHashSetAsArray(Set<Integer> set) {
+        return set.stream().sorted().mapToInt(x -> x).toArray();
+    }
+
+    private void assertSet(Set<Integer> expected, IntSet actual) {
+        Assert.assertArrayEquals(
+                "Expected: " + expected + ", found " + actual,
+                getHashSetAsArray(expected),
+                getIntSetAsArray(actual));
+    }
+
+    @Test
+    public void testAddInOrderRemoveInOrder() {
+        IntSet set = new IntSet();
+        Set<Integer> hashSet = new HashSet<>();
+        assertSet(hashSet, set);
+        for (int i = 0; i < array.length; i++) {
+            set.addInt(array[i]);
+            hashSet.add(array[i]);
+            assertSet(hashSet, set);
+        }
+        for (int i = 0; i < array.length; i++) {
+            set.removeInt(array[i]);
+            hashSet.remove(array[i]);
+            assertSet(hashSet, set);
+        }
+    }
+
+    @Test
+    public void testAddInOrderRemoveInReverse() {
+        IntSet set = new IntSet();
+        Set<Integer> hashSet = new HashSet<>();
+        assertSet(hashSet, set);
+        for (int i = 0; i < array.length; i++) {
+            set.addInt(array[i]);
+            hashSet.add(array[i]);
+            assertSet(hashSet, set);
+        }
+        for (int i = array.length - 1; i >= 0; i--) {
+            set.removeInt(array[i]);
+            hashSet.remove(array[i]);
+            assertSet(hashSet, set);
+        }
+    }
+
+    @Test
+    public void testAddInReverseRemoveInOrder() {
+        IntSet set = new IntSet();
+        Set<Integer> hashSet = new HashSet<>();
+        assertSet(hashSet, set);
+        for (int i = array.length - 1; i >= 0; i--) {
+            set.addInt(array[i]);
+            hashSet.add(array[i]);
+            assertSet(hashSet, set);
+        }
+        for (int i = 0; i < array.length; i++) {
+            set.removeInt(array[i]);
+            hashSet.remove(array[i]);
+            assertSet(hashSet, set);
+        }
+    }
+
+    @Test
+    public void testAddInReverseRemoveInReverse() {
+        IntSet set = new IntSet();
+        Set<Integer> hashSet = new HashSet<>();
+        assertSet(hashSet, set);
+        for (int i = array.length - 1; i >= 0; i--) {
+            set.addInt(array[i]);
+            hashSet.add(array[i]);
+            assertSet(hashSet, set);
+        }
+        for (int i = array.length - 1; i >= 0; i--) {
+            set.removeInt(array[i]);
+            hashSet.remove(array[i]);
+            assertSet(hashSet, set);
+        }
+    }
+
+}
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/DoubleClickTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/DoubleClickTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -50,11 +50,9 @@
     public void testDoubleClick1() throws Exception {
         int x = (int) Math.round(width / 2.0);
         int y = (int) Math.round(height / 2.0);
-        TestApplication.getStage().getScene().setOnMouseClicked((e) -> {
-            TestLog.format("Mouse clicked: %d, %d: clickCount %d",
-                           (int) e.getScreenX(), (int) e.getScreenY(),
-                           e.getClickCount());
-        });
+        TestApplication.getStage().getScene().setOnMouseClicked((e) -> TestLog.format("Mouse clicked: %d, %d: clickCount %d",
+                       (int) e.getScreenX(), (int) e.getScreenY(),
+                       e.getClickCount()));
         TestLog.reset();
         int p = device.addPoint(x, y);
         device.sync();
@@ -75,11 +73,9 @@
         int x2 = x1 + device.getTapRadius();
         int y2 = y1 + device.getTapRadius();
 
-        TestApplication.getStage().getScene().setOnMouseClicked((e) -> {
-            TestLog.format("Mouse clicked: %d, %d: clickCount %d",
-                           (int) e.getScreenX(), (int) e.getScreenY(),
-                           e.getClickCount());
-        });
+        TestApplication.getStage().getScene().setOnMouseClicked((e) -> TestLog.format("Mouse clicked: %d, %d: clickCount %d",
+                       (int) e.getScreenX(), (int) e.getScreenY(),
+                       e.getClickCount()));
         TestLog.reset();
         int p = device.addPoint(x1, y1);
         device.sync();
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/InputDevicePropertyTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/InputDevicePropertyTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -55,26 +55,20 @@
 
     @Test
     public void testTouch() throws Exception {
-        TestRunnable.invokeAndWait(() -> {
-            Assert.assertTrue(Platform.isSupported(ConditionalFeature.INPUT_TOUCH));
-        });
+        TestRunnable.invokeAndWait(() -> Assert.assertTrue(Platform.isSupported(ConditionalFeature.INPUT_TOUCH)));
     }
 
     @Test
     public void testMultiTouch() throws Exception {
-        TestRunnable.invokeAndWait(() -> {
-            Assert.assertEquals(device.getPointCount() > 1,
-                                Platform.isSupported(
-                                        ConditionalFeature.INPUT_MULTITOUCH));
-        });
+        TestRunnable.invokeAndWait(() -> Assert.assertEquals(device.getPointCount() > 1,
+                            Platform.isSupported(
+                                    ConditionalFeature.INPUT_MULTITOUCH)));
     }
 
     @Test
     public void testPointer() throws Exception {
-        TestRunnable.invokeAndWait(() -> {
-            Assert.assertFalse(
-                    Platform.isSupported(ConditionalFeature.INPUT_POINTER));
-        });
+        TestRunnable.invokeAndWait(() -> Assert.assertFalse(
+                Platform.isSupported(ConditionalFeature.INPUT_POINTER)));
     }
 
 }
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/MonocleUInput.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/MonocleUInput.java	Thu Jun 12 09:52:47 2014 -0700
@@ -61,15 +61,13 @@
                    + Integer.toHexString(vendor) + "/"
                    + Integer.toHexString(product) + "/"
                    + Integer.toHexString(version));
-        Application.invokeAndWait(() -> {
-            device = registry.addDevice(
-                    new LinuxInputDevice(capabilities,
-                                         createAbsCapsMap(),
-                                         pipe.source(),
-                                         udevManifest,
-                                         uevent),
-                    "Simulated Linux Input Device");
-        });
+        Application.invokeAndWait(() -> device = registry.addDevice(
+                new LinuxInputDevice(capabilities,
+                                     createAbsCapsMap(),
+                                     pipe.source(),
+                                     udevManifest,
+                                     uevent),
+                "Simulated Linux Input Device"));
     }
 
     protected void openConnection() {
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/RapidTapTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/RapidTapTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -90,7 +90,7 @@
                 while (System.nanoTime() < end) { } // spin
             }
         };
-        Platform.runLater(() -> a.start());
+        Platform.runLater(a::start);
         latch.await();
         try {
             for (int i = 0; i < 20; i++) {
@@ -109,7 +109,7 @@
                 Assert.assertEquals(20, TestLog.countLogContaining("Mouse clicked"));
             }, 10000);
         } finally {
-            Platform.runLater(() -> a.stop());
+            Platform.runLater(a::stop);
         }
     }
 
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/RotateTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/RotateTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -133,9 +133,10 @@
 
         if (Math.abs(angleStep) >= getRotateThreshold()) {
             TestLog.waitForLogContaining("Rotation started, angle: " + ZERO_ANGLE
-                + ", total angle: " + ZERO_ANGLE);
+                + ", total angle: " + ZERO_ANGLE + ", inertia value: false");
             TestLog.waitForLogContaining("Rotation, angle: " + angleStep
-                + ", total angle: " + totalAngle);
+                + ", total angle: " + totalAngle
+                + ", inertia value: false");
         } else {
             Assert.assertEquals(0, TestLog.countLogContaining("Rotation started"));
             Assert.assertEquals(0, TestLog.countLogContaining("Rotation, angle"));
@@ -157,18 +158,21 @@
                     if(Math.abs(totalAngle) >= getRotateThreshold()) {
                         if (!passedTheThreshold) {
                             expectedLog = "Rotation, angle: " + totalAngle
-                                + ", total angle: " + totalAngle;
+                                + ", total angle: " + totalAngle
+                                + ", inertia value: false";
                             passedTheThreshold = true;
                         } else {
                             expectedLog = "Rotation, angle: " + angleStep
-                                + ", total angle: " + totalAngle;
+                                + ", total angle: " + totalAngle
+                                + ", inertia value: false";
                         }
                     } else {
                         expectedLog = "sync";
                     }
                 } else {
                     expectedLog = "Rotation, angle: " + angleStep
-                            + ", total angle: " + totalAngle;
+                            + ", total angle: " + totalAngle
+                            + ", inertia value: false";
                 }
                 TestLog.waitForLogContaining(expectedLog);
             }
@@ -181,14 +185,19 @@
         TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d", newX1, newY1);
         TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d", x2, y2);
         if (Math.abs(totalAngle) >= getRotateThreshold()) {
-            TestLog.waitForLogContaining("Rotation finished, angle: "
-                    + ZERO_ANGLE + ", total angle: " + totalAngle);
-            Assert.assertEquals(1, TestLog.countLogContaining("Rotation " +
-                    "finished, "
-                    + "angle: " + ZERO_ANGLE + ", total angle: " + totalAngle));
+            TestLog.waitForLogContaining("Rotation finished, angle: " + ZERO_ANGLE
+                    + ", total angle: " + totalAngle + ", inertia value: false");
+            Assert.assertEquals(1, TestLog.countLogContaining("Rotation "
+                    + "finished, " + "angle: " + ZERO_ANGLE
+                    + ", total angle: " + totalAngle
+                    + ", inertia value: false"));
         } else {
             Assert.assertEquals(0, TestLog.countLogContaining("Rotation finished, "
-                    + "angle: " + ZERO_ANGLE + ", total angle: " + totalAngle));
+                    + "angle: " + ZERO_ANGLE + ", total angle: " + totalAngle
+                    + ", inertia value: false"));
+        }
+        if (TestLog.countLogContaining("Rotation finished") > 0) {
+            TestLog.waitForLogContaining("Rotation", "inertia value: true");
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/SwipeTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2014, 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.glass.ui.monocle.input;
+
+import com.sun.glass.ui.monocle.input.devices.TestTouchDevice;
+import com.sun.glass.ui.monocle.input.devices.TestTouchDevices;
+import com.sun.javafx.PlatformUtil;
+import javafx.scene.input.GestureEvent;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runners.Parameterized;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.CountDownLatch;
+
+public class SwipeTest extends ParameterizedTestBase {
+
+    static {
+        System.setProperty("com.sun.javafx.isEmbedded", "true");
+    }
+
+    private static final SwipeTestCase[] TEST_CASES = {
+        new SwipeTestCase(200.0, Math.PI * 0.5, 10l, 100.0, 0.0, 200.0, "SWIPE_RIGHT"),
+        new SwipeTestCase(200.0, Math.PI * 0.5, 50l, 100.0, 0.0, 200.0, "SWIPE_RIGHT"),
+
+        new SwipeTestCase(200.0, Math.PI * 0.4, 200l, 100.0, 0.0, 200.0, "SWIPE_RIGHT"),
+        new SwipeTestCase(200.0, Math.PI * 0.5, 200l, 100.0, 0.0, 200.0, "SWIPE_RIGHT"),
+        new SwipeTestCase(200.0, Math.PI * 0.6, 200l, 100.0, 0.0, 200.0, "SWIPE_RIGHT"),
+        new SwipeTestCase(200.0, Math.PI * 0.4, 200l, 100.0, 30.0, 200.0, "SWIPE_RIGHT"),
+        new SwipeTestCase(200.0, Math.PI * 0.5, 200l, 100.0, 30.0, 200.0, "SWIPE_RIGHT"),
+        new SwipeTestCase(200.0, Math.PI * 0.6, 200l, 100.0, 30.0, 200.0, "SWIPE_RIGHT"),
+
+        new SwipeTestCase(200.0, Math.PI * 1.4, 200l, 100.0, 0.0, 200.0, "SWIPE_LEFT"),
+        new SwipeTestCase(200.0, Math.PI * 1.5, 200l, 100.0, 0.0, 200.0, "SWIPE_LEFT"),
+        new SwipeTestCase(200.0, Math.PI * 1.6, 200l, 100.0, 0.0, 200.0, "SWIPE_LEFT"),
+        new SwipeTestCase(200.0, Math.PI * 1.4, 200l, 100.0, 30.0, 200.0, "SWIPE_LEFT"),
+        new SwipeTestCase(200.0, Math.PI * 1.5, 200l, 100.0, 30.0, 200.0, "SWIPE_LEFT"),
+        new SwipeTestCase(200.0, Math.PI * 1.6, 200l, 100.0, 30.0, 200.0, "SWIPE_LEFT"),
+
+        new SwipeTestCase(200.0, Math.PI * 1.9, 200l, 100.0, 0.0, 200.0, "SWIPE_UP"),
+        new SwipeTestCase(200.0, Math.PI * 0.0, 200l, 100.0, 0.0, 200.0, "SWIPE_UP"),
+        new SwipeTestCase(200.0, Math.PI * 0.1, 200l, 100.0, 0.0, 200.0, "SWIPE_UP"),
+        new SwipeTestCase(200.0, Math.PI * 1.9, 200l, 100.0, 30.0, 200.0, "SWIPE_UP"),
+        new SwipeTestCase(200.0, Math.PI * 0.0, 200l, 100.0, 30.0, 200.0, "SWIPE_UP"),
+        new SwipeTestCase(200.0, Math.PI * 0.1, 200l, 100.0, 30.0, 200.0, "SWIPE_UP"),
+
+        new SwipeTestCase(200.0, Math.PI * 0.9, 200l, 100.0, 0.0, 200.0, "SWIPE_DOWN"),
+        new SwipeTestCase(200.0, Math.PI * 1.0, 200l, 100.0, 0.0, 200.0, "SWIPE_DOWN"),
+        new SwipeTestCase(200.0, Math.PI * 1.1, 200l, 100.0, 0.0, 200.0, "SWIPE_DOWN"),
+        new SwipeTestCase(200.0, Math.PI * 0.9, 200l, 100.0, 30.0, 200.0, "SWIPE_DOWN"),
+        new SwipeTestCase(200.0, Math.PI * 1.0, 200l, 100.0, 30.0, 200.0, "SWIPE_DOWN"),
+        new SwipeTestCase(200.0, Math.PI * 1.1, 200l, 100.0, 30.0, 200.0, "SWIPE_DOWN"),
+    };
+
+    private SwipeTestCase testCase;
+
+    static class SwipeTestCase {
+        double length;
+        double theta;
+        long time;
+        double density;
+        double amplitude;
+        double wavelength;
+        String expectedSwipe;
+        SwipeTestCase(double length, double theta, long time, double density,
+                      double amplitude, double wavelength, String expectedSwipe) {
+            this.length = length;
+            this.theta = theta;
+            this.time = time;
+            this.density = density;
+            this.amplitude = amplitude;
+            this.wavelength = wavelength;
+            this.expectedSwipe = expectedSwipe;
+        }
+
+        public String toString() {
+            return "SwipeTestCase["
+                    + "length=" + length
+                    + ",theta=" + theta
+                    + ",time=" + time
+                    + ",density=" + density
+                    + ",amplitude=" + amplitude
+                    + ",wavelength=" + wavelength
+                    + ",expectedSwipe=" + expectedSwipe + "]";
+        }
+    }
+
+    public SwipeTest(TestTouchDevice device, SwipeTestCase testCase) throws Exception {
+        super(device);
+        this.testCase = testCase;
+        TestLog.format("Starting test with %s, %s", device, testCase);
+        TestApplication.getStage();
+        TestRunnable.invokeAndWait(() -> {
+            Assume.assumeTrue(
+                    TestApplication.isMonocle() || TestApplication.isLens());
+            Assume.assumeTrue(PlatformUtil.isEmbedded());
+        });
+    }
+
+    @Parameterized.Parameters
+    public static Collection<Object[]> data() {
+        List<Object[]> params = new ArrayList<>();
+        List<TestTouchDevice> devices = TestTouchDevices.getTouchDevices();
+        for (TestTouchDevice device : devices) {
+            for (SwipeTestCase testCase : TEST_CASES) {
+                params.add(new Object[] { device, testCase });
+            }
+        }
+        return params;
+    }
+
+    @Before
+    public void addListener() throws Exception {
+        TestApplication.getStage().getScene().addEventHandler(
+                GestureEvent.ANY,
+                e -> TestLog.format("%s at %.0f, %.0f",
+                                    e.getEventType(),
+                                    e.getScreenX(),
+                                    e.getScreenY()));
+    }
+
+    /**
+     * Sends a series of points as a sine wave
+     *
+     * @param p The point ID to move
+     * @param x1 Starting X
+     * @param y1 Starting Y
+     * @param length length of the vector from the start point to the end point
+     * @param theta Direction of the sine wave, measured in radians
+     *              clockwise from the upwards Y axis
+     * @param time Time to send all points, in milliseconds
+     * @param density number of points to send per second
+     * @param amplitude of the sine wave, in pixels
+     * @param wavelength of the sine wave, in pixels
+     */
+    private CountDownLatch generatePoints(int p,
+                                int x1, int y1,
+                                double length,
+                                double theta,
+                                long time,
+                                double density,
+                                double amplitude,
+                                double wavelength) {
+        long startTime = System.currentTimeMillis();
+        double deltaX = length / (time * density / 1000.0);
+        CountDownLatch latch = new CountDownLatch(1);
+        TimerTask task = new TimerTask() {
+            private double x = 0;
+            @Override
+            public void run() {
+                try {
+                    double targetX =
+                            (System.currentTimeMillis() - startTime) * length
+                                    / time;
+                    if (targetX > length) {
+                        cancel();
+                        latch.countDown();
+                        return;
+                    }
+                    if (x > targetX) {
+                        return;
+                    }
+                    do {
+                        x += deltaX;
+                        double y = amplitude * Math.sin(
+                                x / (Math.PI * 2.0 * wavelength));
+                        double phi = Math.atan2(x, y);
+                        double h = Math.sqrt(x * x + y * y);
+                        double rotatedX = h * Math.cos(theta - phi);
+                        double rotatedY = h * Math.sin(theta - phi);
+                        device.setPoint(p, x1 + rotatedX, y1 + rotatedY);
+                        device.sync();
+                    } while (x < targetX);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        };
+        new Timer("Touch point generator", true)
+                .scheduleAtFixedRate(task, 0, (int) Math.max(1, time / density));
+        return latch;
+    }
+
+    @Test
+    public void testSwipe() throws Exception {
+        final int x = (int) Math.round(width * 0.5);
+        final int y = (int) Math.round(height * 0.5);
+        // tap
+        int p = device.addPoint(x, y);
+        device.sync();
+        // swipe
+        generatePoints(p, x, y,
+                       testCase.length,
+                       testCase.theta,
+                       testCase.time,
+                       testCase.density,
+                       testCase.amplitude,
+                       testCase.wavelength).await();
+        // release
+        device.removePoint(p);
+        device.sync();
+        TestLog.waitForLog("Mouse pressed: %d, %d", x, y);
+        TestLog.waitForLogContaining("Mouse released");
+        TestLog.waitForLogContaining("Mouse clicked");
+        TestLog.waitForLogContaining("Touch pressed");
+        TestLog.waitForLogContaining("Touch released");
+        if (testCase.expectedSwipe == null) {
+            Assert.assertEquals(0, TestLog.countLogContaining("SWIPE"));
+        } else {
+            TestLog.waitForLogContaining(testCase.expectedSwipe);
+            Assert.assertEquals(1, TestLog.countLogContaining("SWIPE"));
+        }
+    }
+
+}
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TestApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TestApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -96,9 +96,7 @@
         if (stage == null) {
             ready.acquire();
             UInput.setup();
-            new Thread(() -> {
-                Application.launch(TestApplication.class);
-            }).start();
+            new Thread(() -> Application.launch(TestApplication.class)).start();
             ready.acquire();
             Platform.runLater(() -> {
                 if (isMonocle()) {
@@ -196,46 +194,26 @@
     }
 
     public static void addKeyListeners() throws Exception {
-        getStage().getScene().setOnKeyTyped((e) -> {
-            TestLog.log("Key typed: " + e.getCharacter());
-        });
-        getStage().getScene().setOnKeyPressed((e) -> {
-            TestLog.log("Key pressed: " + e.getCode());
-        });
-        getStage().getScene().setOnKeyReleased((e) -> {
-            TestLog.log("Key released: " + e.getCode());
-        });
+        getStage().getScene().setOnKeyTyped((e) -> TestLog.log("Key typed: " + e.getCharacter()));
+        getStage().getScene().setOnKeyPressed((e) -> TestLog.log("Key pressed: " + e.getCode()));
+        getStage().getScene().setOnKeyReleased((e) -> TestLog.log("Key released: " + e.getCode()));
     }
 
     public static void addMouseListeners() throws Exception {
-        getStage().getScene().setOnMousePressed((e) -> {
-            TestLog.log("Mouse pressed: "
-                    + (int) e.getScreenX() + ", " + (int) e.getScreenY());
-        });
-        getStage().getScene().setOnMouseMoved((e) -> {
-            TestLog.log("Mouse moved: "
-                    + (int) e.getScreenX() + ", " + (int) e.getScreenY());
-        });
-        getStage().getScene().setOnMouseDragged((e) -> {
-            TestLog.log("Mouse dragged: "
-                    + (int) e.getScreenX() + ", " + (int) e.getScreenY());
-        });
-        getStage().getScene().setOnMouseReleased((e) -> {
-            TestLog.log("Mouse released: "
-                    + (int) e.getScreenX() + ", " + (int) e.getScreenY());
-        });
-        getStage().getScene().setOnMouseClicked((e) -> {
-            TestLog.log("Mouse clicked: "
-                    + (int) e.getScreenX() + ", " + (int) e.getScreenY());
-        });
-        getStage().getScene().setOnMouseEntered((e) -> {
-            TestLog.log("Mouse entered: "
-                                + (int) e.getScreenX() + ", " + (int) e.getScreenY());
-        });
-        getStage().getScene().setOnMouseExited((e) -> {
-            TestLog.log("Mouse exited: "
-                                + (int) e.getScreenX() + ", " + (int) e.getScreenY());
-        });
+        getStage().getScene().setOnMousePressed((e) -> TestLog.log("Mouse pressed: "
+                + (int) e.getScreenX() + ", " + (int) e.getScreenY()));
+        getStage().getScene().setOnMouseMoved((e) -> TestLog.log("Mouse moved: "
+                + (int) e.getScreenX() + ", " + (int) e.getScreenY()));
+        getStage().getScene().setOnMouseDragged((e) -> TestLog.log("Mouse dragged: "
+                + (int) e.getScreenX() + ", " + (int) e.getScreenY()));
+        getStage().getScene().setOnMouseReleased((e) -> TestLog.log("Mouse released: "
+                + (int) e.getScreenX() + ", " + (int) e.getScreenY()));
+        getStage().getScene().setOnMouseClicked((e) -> TestLog.log("Mouse clicked: "
+                + (int) e.getScreenX() + ", " + (int) e.getScreenY()));
+        getStage().getScene().setOnMouseEntered((e) -> TestLog.log("Mouse entered: "
+                            + (int) e.getScreenX() + ", " + (int) e.getScreenY()));
+        getStage().getScene().setOnMouseExited((e) -> TestLog.log("Mouse exited: "
+                            + (int) e.getScreenX() + ", " + (int) e.getScreenY()));
     }
 
     public static void addTouchListeners() throws Exception {
@@ -279,77 +257,57 @@
 
     public static void addGestureListeners() throws Exception {
         //Zoom
-        getStage().getScene().setOnZoom((e) -> {
-            TestLog.log("Zoom, factor: " + e.getZoomFactor()
-                    + ", total factor: " + e.getTotalZoomFactor()
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnZoom((e) -> TestLog.log("Zoom, factor: " + e.getZoomFactor()
+                + ", total factor: " + e.getTotalZoomFactor()
+                + ", inertia value: " + e.isInertia()));
 
-        getStage().getScene().setOnZoomStarted((e) -> {
-            TestLog.log("Zoom started, factor: " + e.getZoomFactor()
-                    + ", total factor: " + e.getTotalZoomFactor()
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnZoomStarted((e) -> TestLog.log("Zoom started, factor: " + e.getZoomFactor()
+                + ", total factor: " + e.getTotalZoomFactor()
+                + ", inertia value: " + e.isInertia()));
 
-        getStage().getScene().setOnZoomFinished((e) -> {
-            TestLog.log("Zoom finished, factor: " + e.getZoomFactor()
-                    + ", total factor: " + e.getTotalZoomFactor()
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnZoomFinished((e) -> TestLog.log("Zoom finished, factor: " + e.getZoomFactor()
+                + ", total factor: " + e.getTotalZoomFactor()
+                + ", inertia value: " + e.isInertia()));
 
         //Rotate
-        getStage().getScene().setOnRotate((e) -> {
-            TestLog.log("Rotation, angle: " + Math.round(e.getAngle())
-                    + ", total angle: " + Math.round(e.getTotalAngle())
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnRotate((e) -> TestLog.log("Rotation, angle: " + Math.round(e.getAngle())
+                + ", total angle: " + Math.round(e.getTotalAngle())
+                + ", inertia value: " + e.isInertia()));
 
-        getStage().getScene().setOnRotationStarted((e) -> {
-            TestLog.log("Rotation started, angle: " + Math.round(e.getAngle())
-                    + ", total angle: " + Math.round(e.getTotalAngle())
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnRotationStarted((e) -> TestLog.log("Rotation started, angle: " + Math.round(e.getAngle())
+                + ", total angle: " + Math.round(e.getTotalAngle())
+                + ", inertia value: " + e.isInertia()));
 
-        getStage().getScene().setOnRotationFinished((e) -> {
-            TestLog.log("Rotation finished, angle: " + Math.round(e.getAngle())
-                    + ", total angle: " + Math.round(e.getTotalAngle())
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnRotationFinished((e) -> TestLog.log("Rotation finished, angle: " + Math.round(e.getAngle())
+                + ", total angle: " + Math.round(e.getTotalAngle())
+                + ", inertia value: " + e.isInertia()));
 
         //Scroll
-        getStage().getScene().setOnScroll((e) -> {
-            TestLog.log("Scroll, DeltaX: " + Math.round(e.getDeltaX())
-                    + ", DeltaY: " + Math.round(e.getDeltaY())
-                    + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
-                    + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
-                    + ", touch points: " + e.getTouchCount()
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnScroll((e) -> TestLog.log("Scroll, DeltaX: " + Math.round(e.getDeltaX())
+                + ", DeltaY: " + Math.round(e.getDeltaY())
+                + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
+                + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
+                + ", touch points: " + e.getTouchCount()
+                + ", inertia value: " + e.isInertia()));
 
-        getStage().getScene().setOnScrollStarted((e) -> {
-            TestLog.log("Scroll started, DeltaX: " + Math.round(e.getDeltaX())
-                    + ", DeltaY: " + Math.round(e.getDeltaY())
-                    + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
-                    + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
-                    + ", touch points: " + e.getTouchCount()
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnScrollStarted((e) -> TestLog.log("Scroll started, DeltaX: " + Math.round(e.getDeltaX())
+                + ", DeltaY: " + Math.round(e.getDeltaY())
+                + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
+                + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
+                + ", touch points: " + e.getTouchCount()
+                + ", inertia value: " + e.isInertia()));
 
-        getStage().getScene().setOnScrollFinished((e) -> {
-            TestLog.log("Scroll finished, DeltaX: " + Math.round(e.getDeltaX())
-                    + ", DeltaY: " + Math.round(e.getDeltaY())
-                    + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
-                    + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
-                    + ", touch points: " + e.getTouchCount()
-                    + ", inertia value: " + e.isInertia());
-        });
+        getStage().getScene().setOnScrollFinished((e) -> TestLog.log("Scroll finished, DeltaX: " + Math.round(e.getDeltaX())
+                + ", DeltaY: " + Math.round(e.getDeltaY())
+                + ", totalDeltaX: " + Math.round(e.getTotalDeltaX())
+                + ", totalDeltaY: " + Math.round(e.getTotalDeltaY())
+                + ", touch points: " + e.getTouchCount()
+                + ", inertia value: " + e.isInertia()));
     }
 
     public static void movePointerTo(final int targetX, final int targetY) throws Exception {
         final Semaphore released = new Semaphore(0);
-        EventHandler<TouchEvent> touchHandler = (e) -> {
-            released.release();
-        };
+        EventHandler<TouchEvent> touchHandler = (e) -> released.release();
         getStage().addEventHandler(TouchEvent.TOUCH_RELEASED, touchHandler);
         final UInput ui = new UInput();
         ui.processLine("OPEN");
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TestLog.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TestLog.java	Thu Jun 12 09:52:47 2014 -0700
@@ -29,6 +29,7 @@
 
 import java.text.MessageFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Formatter;
 import java.util.List;
 
@@ -114,15 +115,28 @@
         return countLog(s, 0, false);
     }
 
-    private static String checkLog(String s, int startIndex, boolean exact) {
+    private static String checkLog(String[] matches, int startIndex, boolean exact) {
         for (int i = startIndex; i < log.size(); i++) {
             String line  = log.get(i);
-            if (exact) {
-                if (line.equals(s)) {
-                    return line;
+            if (matches.length == 1) {
+                if (exact) {
+                    if (line.equals(matches[0])) {
+                        return line;
+                    }
+                } else {
+                    if (line.indexOf(matches[0]) >= 0) {
+                        return line;
+                    }
                 }
             } else {
-                if (line.indexOf(s) >= 0) {
+                boolean isMatch = true;
+                for (String match : matches) {
+                    if (line.indexOf(match) < 0) {
+                        isMatch = false;
+                        break;
+                    }
+                }
+                if (isMatch) {
                     return line;
                 }
             }
@@ -131,11 +145,11 @@
     }
 
     public static boolean checkLog(String s) {
-        return checkLog(s, 0, true) != null;
+        return checkLog(new String[] {s}, 0, true) != null;
     }
 
     public static boolean checkLogContaining(String s) {
-        return checkLog(s, 0, false) != null;
+        return checkLog(new String[] {s}, 0, false) != null;
     }
 
     public static void assertLog(String s) {
@@ -162,11 +176,12 @@
         }
     }
 
-    private static String waitForLog(String s, long timeout, boolean exact) throws InterruptedException {
+    private static String waitForLog(String[] s, long timeout, boolean exact) throws InterruptedException {
         long startTime = System.currentTimeMillis();
         long timeNow = startTime;
         long endTime = timeNow + (long) (timeout * TestApplication.getTimeScale());
         String line;
+        String logString = Arrays.toString(s).substring(1, Arrays.toString(s).length() - 1);
         synchronized (lock) {
             int index = 0;
             while ((line = checkLog(s, index, exact)) == null) {
@@ -177,7 +192,7 @@
                 timeNow = System.currentTimeMillis();
                 if (timeNow >= endTime) {
                     String message = "Timed out after " + (timeNow - startTime)
-                            + "ms waiting for '" + s + "'";
+                            + "ms waiting for '" + logString + "'";
                     if (!TestApplication.isVerbose()) {
                         System.out.flush();
                         System.err.flush();
@@ -194,12 +209,12 @@
         if (TestApplication.isVerbose()) {
             if (exact) {
                 System.out.println("TestLog matched '"
-                        + s + "' in "
+                        + logString + "' in "
                         + matchTime + "ms");
 
             } else {
                 System.out.println("TestLog matched '"
-                        + s + "' with '"
+                        + logString + "' with '"
                         + line + "' in "
                         + matchTime + "ms");
             }
@@ -208,23 +223,25 @@
     }
 
     public static String waitForLog(String s, long timeout) throws InterruptedException {
-        return waitForLog(s, timeout, true);
+        return waitForLog(new String [] {s}, timeout, true);
     }
 
     public static String waitForLogContaining(String s, long timeout) throws InterruptedException {
-        return waitForLog(s, timeout, false);
+        return waitForLog(new String [] {s}, timeout, false);
     }
 
     public static String waitForLog(String format, Object... args) throws InterruptedException {
         return waitForLog(new Formatter().format(format, args).toString(),
                           DEFAULT_TIMEOUT);
-
     }
 
     public static String waitForLogContaining(String format, Object... args) throws InterruptedException {
         return waitForLogContaining(new Formatter().format(format, args).toString(),
                           DEFAULT_TIMEOUT);
+    }
 
+    public static String waitForLogContaining(String... s) throws InterruptedException {
+        return waitForLog(s, DEFAULT_TIMEOUT, false);
     }
 
 }
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TouchButtonTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TouchButtonTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -61,9 +61,7 @@
         button.setId(text);
         button.setLayoutX(x);
         button.setLayoutY(y);
-        button.setOnMousePressed((e) -> {
-            button.requestFocus();
-        });
+        button.setOnMousePressed((e) -> button.requestFocus());
         if (setListeners) {
             button.addEventHandler(MouseEvent.ANY, e ->
                 TestLog.log(e.getEventType().getName() +": " 
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TouchExceptionTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TouchExceptionTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -48,9 +48,7 @@
     public void testRuntimeException() throws Exception {
         Platform.runLater(
                 () -> Thread.currentThread()
-                        .setUncaughtExceptionHandler((t, e) -> {
-                            TestLog.log(e.toString());
-                        })
+                        .setUncaughtExceptionHandler((t, e) -> TestLog.log(e.toString()))
         );
         TestApplication.getStage().getScene().addEventHandler(
                 InputEvent.ANY,
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TouchTestBase.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/TouchTestBase.java	Thu Jun 12 09:52:47 2014 -0700
@@ -84,9 +84,7 @@
         ui = new UInput();
         systemErrFilter = new SystemErrFilter(System.err);
         System.setErr(systemErrFilter);
-        TestRunnable.invokeAndWait(() -> {
-            screen = Screen.getPrimary().getBounds();
-        });
+        TestRunnable.invokeAndWait(() -> screen = Screen.getPrimary().getBounds());
     }
 
     @After
--- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/USKeyboardTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/USKeyboardTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -26,7 +26,7 @@
 package com.sun.glass.ui.monocle.input;
 
 import org.junit.After;
-import org.junit.Assume;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -200,4 +200,77 @@
         TestLog.waitForLog("Key released: DIGIT3");
     }
 
+    @Test
+    public void testBackspace() throws Exception {
+        TestApplication.showFullScreenScene();
+        TestApplication.addKeyListeners();
+        ui.processLine("OPEN");
+        ui.processLine("EVBIT EV_KEY");
+        ui.processLine("EVBIT EV_SYN");
+        ui.processLine("KEYBIT KEY_BACKSPACE");
+        ui.processLine("KEYBIT KEY_LEFTSHIFT");
+        ui.processLine("KEYBIT KEY_CAPSLOCK");
+        ui.processLine("PROPERTY ID_INPUT_KEYBOARD 1");
+        ui.processLine("CREATE");
+
+        ui.processLine("EV_KEY KEY_BACKSPACE 1");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key pressed: BACK_SPACE");
+        ui.processLine("EV_KEY KEY_BACKSPACE 0");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key released: BACK_SPACE");
+        Assert.assertEquals(0l, TestLog.countLogContaining("Key typed"));
+
+        TestLog.reset();
+        ui.processLine("EV_KEY KEY_LEFTSHIFT 1");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_BACKSPACE 1");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key pressed: BACK_SPACE");
+        ui.processLine("EV_KEY KEY_BACKSPACE 0");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_LEFTSHIFT 0");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key released: BACK_SPACE");
+        Assert.assertEquals(0l, TestLog.countLogContaining("Key typed"));
+
+        TestLog.reset();
+        ui.processLine("EV_KEY KEY_CAPSLOCK 1");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_CAPSLOCK 0");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_BACKSPACE 1");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key pressed: BACK_SPACE");
+        ui.processLine("EV_KEY KEY_BACKSPACE 0");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_CAPSLOCK 1");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_CAPSLOCK 0");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key released: BACK_SPACE");
+        Assert.assertEquals(0l, TestLog.countLogContaining("Key typed"));
+
+        TestLog.reset();
+        ui.processLine("EV_KEY KEY_CAPSLOCK 1");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_CAPSLOCK 0");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_LEFTSHIFT 1");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_BACKSPACE 1");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key pressed: BACK_SPACE");
+        ui.processLine("EV_KEY KEY_BACKSPACE 0");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_LEFTSHIFT 0");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_CAPSLOCK 1");
+        ui.processLine("EV_SYN");
+        ui.processLine("EV_KEY KEY_CAPSLOCK 0");
+        ui.processLine("EV_SYN");
+        TestLog.waitForLog("Key released: BACK_SPACE");
+        Assert.assertEquals(0l, TestLog.countLogContaining("Key typed"));
+    }
+
 }
--- a/tests/system/src/test/java/com/sun/javafx/application/ListenerTestCommon.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/application/ListenerTestCommon.java	Thu Jun 12 09:52:47 2014 -0700
@@ -75,16 +75,10 @@
 
     private void setup() {
         // Start the FX Platform
-        new Thread(new Runnable() {
-            @Override public void run() {
-                PlatformImpl.startup(new Runnable() {
-                    @Override public void run() {
-                        assertTrue(Platform.isFxApplicationThread());
-                        launchLatch.countDown();
-                    }
-                });
-            }
-        }).start();
+        new Thread(() -> PlatformImpl.startup(() -> {
+            assertTrue(Platform.isFxApplicationThread());
+            launchLatch.countDown();
+        })).start();
 
         try {
             if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
@@ -133,11 +127,9 @@
         setup();
         assertNotNull(listener);
 
-        Util.runAndWait(new Runnable() {
-            @Override public void run() {
-                assertTrue(Platform.isFxApplicationThread());
-                assertTrue(Platform.isImplicitExit());
-            }
+        Util.runAndWait(() -> {
+            assertTrue(Platform.isFxApplicationThread());
+            assertTrue(Platform.isImplicitExit());
         });
 
         Util.sleep(DELAY);
@@ -170,26 +162,22 @@
         setup();
         assertNotNull(listener);
 
-        Util.runAndWait(new Runnable() {
-            @Override public void run() {
-                assertTrue(Platform.isFxApplicationThread());
-                assertTrue(Platform.isImplicitExit());
-                if (!implicit) {
-                    Platform.setImplicitExit(false);
-                }
-                PlatformImpl.addListener(listener);
+        Util.runAndWait(() -> {
+            assertTrue(Platform.isFxApplicationThread());
+            assertTrue(Platform.isImplicitExit());
+            if (!implicit) {
+                Platform.setImplicitExit(false);
             }
+            PlatformImpl.addListener(listener);
         });
 
         Util.sleep(DELAY);
         assertEquals(1, exitNotification.getCount());
         assertEquals(1, idleNotification.getCount());
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                stage = makeStage();
-                stage.show();
-            }
+        Util.runAndWait(() -> {
+            stage = makeStage();
+            stage.show();
         });
 
         Util.sleep(SLEEP_TIME);
@@ -197,17 +185,15 @@
         assertEquals(1, idleNotification.getCount());
 
         final CountDownLatch rDone = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            public void run() {
-                try {
-                    if (throwableType == ThrowableType.EXCEPTION) {
-                        throw new RuntimeException("this exception is expected");
-                    } else if (throwableType == ThrowableType.ERROR) {
-                        throw new InternalError("this error is expected");
-                    }
-                } finally {
-                    rDone.countDown();
+        Platform.runLater(() -> {
+            try {
+                if (throwableType == ThrowableType.EXCEPTION) {
+                    throw new RuntimeException("this exception is expected");
+                } else if (throwableType == ThrowableType.ERROR) {
+                    throw new InternalError("this error is expected");
                 }
+            } finally {
+                rDone.countDown();
             }
         });
 
@@ -221,11 +207,7 @@
                         + throwableType);
         }
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                stage.hide();
-            }
-        });
+        Util.runAndWait(stage::hide);
 
         try {
             if (!idleNotification.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
--- a/tests/system/src/test/java/com/sun/javafx/application/RunLaterTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/application/RunLaterTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -61,11 +61,7 @@
     @BeforeClass
     public static void setupOnce() {
         // Start the Application
-        new Thread(new Runnable() {
-            @Override public void run() {
-                Application.launch(MyApp.class, (String[])null);
-            }
-        }).start();
+        new Thread(() -> Application.launch(MyApp.class, (String[])null)).start();
 
         try {
             if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
@@ -91,14 +87,12 @@
         Runnable[] runnables = new Runnable[numRunnables];
         for (int i = 0; i < numRunnables; i++) {
             final int idx = i;
-            runnables[idx] = new Runnable() {
-                @Override public void run() {
-                    if (idx == 0) {
-                        Util.sleep(100);
-                    }
-                    int seq = seqNum.getAndIncrement();
-                    assertEquals(idx, seq);
+            runnables[idx] = () -> {
+                if (idx == 0) {
+                    Util.sleep(100);
                 }
+                int seq = seqNum.getAndIncrement();
+                assertEquals(idx, seq);
             };
         }
         Util.runAndWait(DELAY, runnables);
--- a/tests/system/src/test/java/com/sun/javafx/application/SingleExitCommon.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/application/SingleExitCommon.java	Thu Jun 12 09:52:47 2014 -0700
@@ -152,15 +152,13 @@
         final Thread testThread = Thread.currentThread();
 
         // Start the Application
-        new Thread(new Runnable() {
-            @Override public void run() {
-                try {
-                    Application.launch(MyApp.class, (String[])null);
-                    latch.countDown();
-                } catch (Throwable th) {
-                    testError[0] = th;
-                    testThread.interrupt();
-                }
+        new Thread(() -> {
+            try {
+                Application.launch(MyApp.class, (String[])null);
+                latch.countDown();
+            } catch (Throwable th) {
+                testError[0] = th;
+                testThread.interrupt();
             }
         }).start();
 
@@ -174,17 +172,15 @@
             }
 
             final CountDownLatch rDone = new CountDownLatch(1);
-            Platform.runLater(new Runnable() {
-                public void run() {
-                    try {
-                        if (throwableType == ThrowableType.EXCEPTION) {
-                            throw new RuntimeException("this exception is expected");
-                        } else if (throwableType == ThrowableType.ERROR) {
-                            throw new InternalError("this error is expected");
-                        }
-                    } finally {
-                        rDone.countDown();
+            Platform.runLater(() -> {
+                try {
+                    if (throwableType == ThrowableType.EXCEPTION) {
+                        throw new RuntimeException("this exception is expected");
+                    } else if (throwableType == ThrowableType.ERROR) {
+                        throw new InternalError("this error is expected");
                     }
+                } finally {
+                    rDone.countDown();
                 }
             });
 
@@ -195,11 +191,7 @@
 
             if (stageShown) {
                 Thread.sleep(SLEEP_TIME);
-                Util.runAndWait(new Runnable() {
-                    public void run() {
-                        myApp.primaryStage.hide();
-                    }
-                });
+                Util.runAndWait(myApp.primaryStage::hide);
             }
 
             final CountDownLatch exitLatch = PlatformImpl.test_getPlatformExitLatch();
--- a/tests/system/src/test/java/com/sun/javafx/application/SwingExitCommon.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/application/SwingExitCommon.java	Thu Jun 12 09:52:47 2014 -0700
@@ -81,13 +81,11 @@
         frame.getContentPane().add(fxPanel, BorderLayout.CENTER);
 
         // Create scene and add it to the panel
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                Group root = new Group();
-                Scene scene = new Scene(root);
-                scene.setFill(Color.LIGHTYELLOW);
-                fxPanel.setScene(scene);
-            }
+        Util.runAndWait(() -> {
+            Group root = new Group();
+            Scene scene = new Scene(root);
+            scene.setFill(Color.LIGHTYELLOW);
+            fxPanel.setScene(scene);
         });
 
         // show frame
@@ -108,14 +106,12 @@
         final Thread testThread = Thread.currentThread();
 
         // Start the Application
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                try {
-                    init();
-                } catch (Throwable th) {
-                    testError[0] = th;
-                    testThread.interrupt();
-                }
+        SwingUtilities.invokeLater(() -> {
+            try {
+                init();
+            } catch (Throwable th) {
+                testError[0] = th;
+                testThread.interrupt();
             }
         });
 
@@ -126,11 +122,9 @@
 
             Thread.sleep(SLEEP_TIME);
             try {
-                SwingUtilities.invokeAndWait(new Runnable() {
-                    public void run() {
-                        frame.setVisible(false);
-                        frame.dispose();
-                    }
+                SwingUtilities.invokeAndWait(() -> {
+                    frame.setVisible(false);
+                    frame.dispose();
                 });
             }
             catch (InvocationTargetException ex) {
--- a/tests/system/src/test/java/com/sun/javafx/application/SwingNoExit.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/application/SwingNoExit.java	Thu Jun 12 09:52:47 2014 -0700
@@ -68,13 +68,11 @@
         frame.getContentPane().add(fxPanel, BorderLayout.CENTER);
 
         // Create scene and add it to the panel
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                Group root = new Group();
-                Scene scene = new Scene(root);
-                scene.setFill(Color.LIGHTYELLOW);
-                fxPanel.setScene(scene);
-            }
+        Util.runAndWait(() -> {
+            Group root = new Group();
+            Scene scene = new Scene(root);
+            scene.setFill(Color.LIGHTYELLOW);
+            fxPanel.setScene(scene);
         });
 
         // show frame
@@ -88,14 +86,12 @@
         final AtomicReference<Throwable> error = new AtomicReference<>(null);
 
         final CountDownLatch initLatch = new CountDownLatch(1);
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                try {
-                    init();
-                    initLatch.countDown();
-                } catch (Throwable th) {
-                    error.set(th);
-                }
+        SwingUtilities.invokeLater(() -> {
+            try {
+                init();
+                initLatch.countDown();
+            } catch (Throwable th) {
+                error.set(th);
             }
         });
         if (!initLatch.await(Util.TIMEOUT, TimeUnit.MILLISECONDS)) {
@@ -107,11 +103,9 @@
         }
 
         final CountDownLatch runAndWait = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            public void run() {
-                Platform.exit();
-                runAndWait.countDown();
-            }
+        Platform.runLater(() -> {
+            Platform.exit();
+            runAndWait.countDown();
         });
         if (!runAndWait.await(Util.TIMEOUT, TimeUnit.MILLISECONDS)) {
             throw new AssertionFailedError("Timeout waiting for Platform.exit()");
@@ -124,11 +118,9 @@
                             1, exitLatch.getCount());
 
         try {
-            SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    frame.setVisible(false);
-                    frame.dispose();
-                }
+            SwingUtilities.invokeAndWait(() -> {
+                frame.setVisible(false);
+                frame.dispose();
             });
         }
         catch (InvocationTargetException ex) {
--- a/tests/system/src/test/java/com/sun/javafx/application/TaskbarAppCommon.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/application/TaskbarAppCommon.java	Thu Jun 12 09:52:47 2014 -0700
@@ -46,16 +46,10 @@
 
     private void startup() {
         // Start the FX Platform
-        new Thread(new Runnable() {
-            @Override public void run() {
-                PlatformImpl.startup(new Runnable() {
-                    @Override public void run() {
-                        assertTrue(Platform.isFxApplicationThread());
-                        launchLatch.countDown();
-                    }
-                });
-            }
-        }).start();
+        new Thread(() -> PlatformImpl.startup(() -> {
+            assertTrue(Platform.isFxApplicationThread());
+            launchLatch.countDown();
+        })).start();
 
         try {
             if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
--- a/tests/system/src/test/java/com/sun/javafx/sg/prism/RT36296Test.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/sg/prism/RT36296Test.java	Thu Jun 12 09:52:47 2014 -0700
@@ -68,11 +68,7 @@
     @BeforeClass
     public static void setupOnce() {
         // Start the Application
-        new Thread(new Runnable() {
-            @Override public void run() {
-                Application.launch(MyApp.class, (String[])null);
-            }
-        }).start();
+        new Thread(() -> Application.launch(MyApp.class, (String[])null)).start();
 
         try {
             if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
--- a/tests/system/src/test/java/com/sun/javafx/tk/quantum/CloseWindowTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/tk/quantum/CloseWindowTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -56,12 +56,9 @@
             t.setHeight(100);
             t.show();
 
-            Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
-                @Override
-                public void uncaughtException(Thread t, Throwable e) {
-                    System.out.println("e = " + e);
-                    exception = e;
-                }
+            Thread.currentThread().setUncaughtExceptionHandler((t2, e) -> {
+                System.out.println("e = " + e);
+                exception = e;
             });
 
             startupLatch.countDown();
@@ -70,48 +67,32 @@
 
     @BeforeClass
     public static void setup() throws Exception {
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                Application.launch(TestApp.class);
-            }
-        }).start();
+        new Thread(() -> Application.launch(TestApp.class)).start();
         startupLatch.await();
     }
 
     @AfterClass
     public static void shutdown() {
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                primaryStage.hide();
-            }
-        });
+        Platform.runLater(primaryStage::hide);
     }
 
     @Test
     public void test1() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                            t.hide();
-                        } catch (Throwable z) {
-                            exception = z;
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                    t.hide();
+                } catch (Throwable z) {
+                    exception = z;
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -122,30 +103,24 @@
     @Test
     public void test2() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                final Stage p = new Stage();
-                p.initOwner(t);
-                p.setScene(new Scene(new Group()));
-                p.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                            p.hide();
-                        } catch (Throwable z) {
-                            exception = z;
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            final Stage p = new Stage();
+            p.initOwner(t);
+            p.setScene(new Scene(new Group()));
+            p.show();
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                    p.hide();
+                } catch (Throwable z) {
+                    exception = z;
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -156,31 +131,25 @@
     @Test
     public void test3() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                final Stage p = new Stage();
-                p.initOwner(t);
-                p.initModality(Modality.WINDOW_MODAL);
-                p.setScene(new Scene(new Group()));
-                p.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                            p.hide();
-                        } catch (Throwable z) {
-                            exception = z;
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            final Stage p = new Stage();
+            p.initOwner(t);
+            p.initModality(Modality.WINDOW_MODAL);
+            p.setScene(new Scene(new Group()));
+            p.show();
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                    p.hide();
+                } catch (Throwable z) {
+                    exception = z;
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -191,35 +160,29 @@
     @Test
     public void test4() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                final Stage p = new Stage();
-                p.initOwner(t);
-                p.setScene(new Scene(new Group()));
-                p.show();
-                final Stage s = new Stage();
-                s.initOwner(p);
-                s.setScene(new Scene(new Group()));
-                p.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                            s.hide();
-                            p.hide();
-                        } catch (Throwable z) {
-                            exception = z;
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            final Stage p = new Stage();
+            p.initOwner(t);
+            p.setScene(new Scene(new Group()));
+            p.show();
+            final Stage s = new Stage();
+            s.initOwner(p);
+            s.setScene(new Scene(new Group()));
+            p.show();
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                    s.hide();
+                    p.hide();
+                } catch (Throwable z) {
+                    exception = z;
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
--- a/tests/system/src/test/java/com/sun/javafx/tk/quantum/WindowSceneInitDisposeTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/com/sun/javafx/tk/quantum/WindowSceneInitDisposeTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -56,13 +56,10 @@
             t.setHeight(100);
             t.show();
 
-            Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
-                @Override
-                public void uncaughtException(Thread t, Throwable e) {
-                    System.out.println("Exception caught: " + e);
-                    System.out.flush();
-                    exception = e;
-                }
+            Thread.currentThread().setUncaughtExceptionHandler((t2, e) -> {
+                System.out.println("Exception caught: " + e);
+                System.out.flush();
+                exception = e;
             });
 
             startupLatch.countDown();
@@ -71,45 +68,29 @@
 
     @BeforeClass
     public static void setup() throws Exception {
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                Application.launch(TestApp.class);
-            }
-        }).start();
+        new Thread(() -> Application.launch(TestApp.class)).start();
         startupLatch.await();
     }
 
     @AfterClass
     public static void shutdown() {
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                primaryStage.hide();
-            }
-        });
+        Platform.runLater(primaryStage::hide);
     }
 
     @Test
     public void test1() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -120,23 +101,17 @@
     @Test
     public void test2() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.show();
-                t.setScene(new Scene(new Group()));
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.show();
+            t.setScene(new Scene(new Group()));
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -147,22 +122,16 @@
     @Test
     public void test3() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.show();
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -173,24 +142,18 @@
     @Test
     public void test4() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.setScene(null);
-                            t.hide();
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            Platform.runLater(() -> {
+                try {
+                    t.setScene(null);
+                    t.hide();
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -201,24 +164,18 @@
     @Test
     public void test5() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.hide();
-                            t.setScene(null);
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            Platform.runLater(() -> {
+                try {
+                    t.hide();
+                    t.setScene(null);
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -229,24 +186,18 @@
     @Test
     public void test6() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                t.setScene(new Scene(new Group()));
-                t.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            t.setScene(new Scene(new Group()));
-                            t.hide();
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            t.setScene(new Scene(new Group()));
+            t.show();
+            Platform.runLater(() -> {
+                try {
+                    t.setScene(new Scene(new Group()));
+                    t.hide();
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
@@ -257,28 +208,22 @@
     @Test
     public void test7() throws Throwable {
         final CountDownLatch l = new CountDownLatch(1);
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                final Stage t = new Stage();
-                final Scene s = new Scene(new Group());
-                t.setScene(s);
-                t.show();
-                final Stage p = new Stage();
-                p.show();
-                Platform.runLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        try {
-                            p.setScene(s);
-                            p.hide();
-                            t.hide();
-                        } finally {
-                            l.countDown();
-                        }
-                    }
-                });
-            }
+        Platform.runLater(() -> {
+            final Stage t = new Stage();
+            final Scene s = new Scene(new Group());
+            t.setScene(s);
+            t.show();
+            final Stage p = new Stage();
+            p.show();
+            Platform.runLater(() -> {
+                try {
+                    p.setScene(s);
+                    p.hide();
+                    t.hide();
+                } finally {
+                    l.countDown();
+                }
+            });
         });
         l.await();
         if (exception != null) {
--- a/tests/system/src/test/java/helloworld/RectangleTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/helloworld/RectangleTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -48,20 +48,16 @@
         final int WIDTH = 400;
         final int HEIGHT = 300;
 
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                testStage = getStage();
-                testScene = new Scene(new Group(), WIDTH, HEIGHT);
-                testStage.setScene(testScene);
-                testStage.show();
-            }
+        runAndWait(() -> {
+            testStage = getStage();
+            testScene = new Scene(new Group(), WIDTH, HEIGHT);
+            testStage.setScene(testScene);
+            testStage.show();
         });
         waitFirstFrame();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Color color = getColor(testScene, WIDTH / 2, HEIGHT / 2);
-                assertColorEquals(Color.WHITE, color, TOLERANCE);
-            }
+        runAndWait(() -> {
+            Color color = getColor(testScene, WIDTH / 2, HEIGHT / 2);
+            assertColorEquals(Color.WHITE, color, TOLERANCE);
         });
     }
 
@@ -70,21 +66,17 @@
         final int WIDTH = 400;
         final int HEIGHT = 300;
 
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                testStage = getStage();
-                testScene = new Scene(new Group(), WIDTH, HEIGHT);
-                testScene.setFill(Color.CORNFLOWERBLUE);
-                testStage.setScene(testScene);
-                testStage.show();
-            }
+        runAndWait(() -> {
+            testStage = getStage();
+            testScene = new Scene(new Group(), WIDTH, HEIGHT);
+            testScene.setFill(Color.CORNFLOWERBLUE);
+            testStage.setScene(testScene);
+            testStage.show();
         });
         waitFirstFrame();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Color color = getColor(testScene, WIDTH / 2, HEIGHT / 2);
-                assertColorEquals(Color.CORNFLOWERBLUE, color, TOLERANCE);
-            }
+        runAndWait(() -> {
+            Color color = getColor(testScene, WIDTH / 2, HEIGHT / 2);
+            assertColorEquals(Color.CORNFLOWERBLUE, color, TOLERANCE);
         });
     }
 
@@ -98,29 +90,25 @@
         final int RECT_H = 60;
         final int OFFSET = 10;
 
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Rectangle rect = new Rectangle(RECT_X, RECT_Y, RECT_W, RECT_H);
-                rect.setFill(Color.ORANGE);
-                Group root = new Group(rect);
-                testScene = new Scene(root, WIDTH, HEIGHT);
-                testScene.setFill(Color.PALEGREEN);
+        runAndWait(() -> {
+            Rectangle rect = new Rectangle(RECT_X, RECT_Y, RECT_W, RECT_H);
+            rect.setFill(Color.ORANGE);
+            Group root = new Group(rect);
+            testScene = new Scene(root, WIDTH, HEIGHT);
+            testScene.setFill(Color.PALEGREEN);
 
-                testStage = getStage();
-                testStage.setScene(testScene);
-                testStage.show();
-            }
+            testStage = getStage();
+            testStage.setScene(testScene);
+            testStage.show();
         });
         waitFirstFrame();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Color color = getColor(testScene, RECT_X - OFFSET, RECT_Y - OFFSET);
-                assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
-                color = getColor(testScene, RECT_X + RECT_W + OFFSET, RECT_Y + RECT_H + OFFSET);
-                assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
-                color = getColor(testScene, RECT_X + (RECT_W / 2), RECT_Y + (RECT_H / 2));
-                assertColorEquals(Color.ORANGE, color, TOLERANCE);
-            }
+        runAndWait(() -> {
+            Color color = getColor(testScene, RECT_X - OFFSET, RECT_Y - OFFSET);
+            assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
+            color = getColor(testScene, RECT_X + RECT_W + OFFSET, RECT_Y + RECT_H + OFFSET);
+            assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
+            color = getColor(testScene, RECT_X + (RECT_W / 2), RECT_Y + (RECT_H / 2));
+            assertColorEquals(Color.ORANGE, color, TOLERANCE);
         });
     }
 
@@ -134,48 +122,40 @@
         final int RECT_H = 60;
         final int OFFSET = 10;
 
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Group root = new Group();
-                testScene = new Scene(root, WIDTH, HEIGHT);
-                testScene.setFill(Color.PALEGREEN);
+        runAndWait(() -> {
+            Group root = new Group();
+            testScene = new Scene(root, WIDTH, HEIGHT);
+            testScene.setFill(Color.PALEGREEN);
 
-                testStage = getStage();
-                testStage.setScene(testScene);
-                testStage.show();
-            }
+            testStage = getStage();
+            testStage.setScene(testScene);
+            testStage.show();
         });
         waitFirstFrame();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Color color = getColor(testScene, RECT_X - OFFSET, RECT_Y - OFFSET);
-                assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
-                color = getColor(testScene, RECT_X + RECT_W + OFFSET, RECT_Y + RECT_H + OFFSET);
-                assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
-                color = getColor(testScene, RECT_X + (RECT_W / 2), RECT_Y + (RECT_H / 2));
-                assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
-            }
+        runAndWait(() -> {
+            Color color = getColor(testScene, RECT_X - OFFSET, RECT_Y - OFFSET);
+            assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
+            color = getColor(testScene, RECT_X + RECT_W + OFFSET, RECT_Y + RECT_H + OFFSET);
+            assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
+            color = getColor(testScene, RECT_X + (RECT_W / 2), RECT_Y + (RECT_H / 2));
+            assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
         });
 
         // Now add a rectangle
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Rectangle rect = new Rectangle(RECT_X, RECT_Y, RECT_W, RECT_H);
-                rect.setFill(Color.ORANGE);
-                Group root = (Group)testScene.getRoot();
-                root.getChildren().add(rect);
-            }
+        runAndWait(() -> {
+            Rectangle rect = new Rectangle(RECT_X, RECT_Y, RECT_W, RECT_H);
+            rect.setFill(Color.ORANGE);
+            Group root = (Group)testScene.getRoot();
+            root.getChildren().add(rect);
         });
         waitNextFrame();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Color color = getColor(testScene, RECT_X - OFFSET, RECT_Y - OFFSET);
-                assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
-                color = getColor(testScene, RECT_X + RECT_W + OFFSET, RECT_Y + RECT_H + OFFSET);
-                assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
-                color = getColor(testScene, RECT_X + (RECT_W / 2), RECT_Y + (RECT_H / 2));
-                assertColorEquals(Color.ORANGE, color, TOLERANCE);
-            }
+        runAndWait(() -> {
+            Color color = getColor(testScene, RECT_X - OFFSET, RECT_Y - OFFSET);
+            assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
+            color = getColor(testScene, RECT_X + RECT_W + OFFSET, RECT_Y + RECT_H + OFFSET);
+            assertColorEquals(Color.PALEGREEN, color, TOLERANCE);
+            color = getColor(testScene, RECT_X + (RECT_W / 2), RECT_Y + (RECT_H / 2));
+            assertColorEquals(Color.ORANGE, color, TOLERANCE);
         });
     }
 
--- a/tests/system/src/test/java/javafx/embed/swing/RT23603Test.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/embed/swing/RT23603Test.java	Thu Jun 12 09:52:47 2014 -0700
@@ -25,7 +25,6 @@
 
 package javafx.embed.swing;
 
-import com.sun.javafx.tk.TKPulseListener;
 import javafx.application.Platform;
 import javafx.scene.Scene;
 import javafx.scene.layout.Region;
@@ -36,15 +35,18 @@
 import java.awt.Point;
 import java.awt.Robot;
 import java.awt.Toolkit;
+
 import javax.swing.JFrame;
 import javax.swing.SwingUtilities;
+
 import sun.awt.SunToolkit;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
+
 import javafx.animation.AnimationTimer;
+import junit.framework.Assert;
 
-import junit.framework.Assert;
 import org.junit.Test;
 import org.junit.Ignore;
 
@@ -58,12 +60,7 @@
 
     @Test
     public void test() {
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                initAndShowGUI();
-            }
-        });
+        SwingUtilities.invokeLater(this::initAndShowGUI);
 
         //
         // wait for frame to be set visible and jfxpanel to be installed
@@ -77,12 +74,7 @@
 
         // 3 pulses should guarantee the scene is rendered
         final CountDownLatch l2 = new CountDownLatch(3);
-        com.sun.javafx.tk.Toolkit.getToolkit().addSceneTkPulseListener(new TKPulseListener() {
-            @Override
-            public void pulse() {
-                l2.countDown();
-            }
-        });
+        com.sun.javafx.tk.Toolkit.getToolkit().addSceneTkPulseListener(l2::countDown);
 
         //
         // wait for jfxpanel to be rendered
@@ -118,21 +110,18 @@
 
         final JFXPanel fxPanel = new JFXPanel();
 
-        Platform.runLater(new Runnable() {
-            @Override
-            public void run() {
-                Region rgn = new Region();
-                Scene scene = new Scene(rgn);
-                rgn.setStyle("-fx-background-color: #00ff00;");
-                fxPanel.setScene(scene);
+        Platform.runLater(() -> {
+            Region rgn = new Region();
+            Scene scene = new Scene(rgn);
+            rgn.setStyle("-fx-background-color: #00ff00;");
+            fxPanel.setScene(scene);
 
-                // start constant pulse activity
-                new AnimationTimer() {
-                    @Override public void handle(long l) {}
-                }.start();
+            // start constant pulse activity
+            new AnimationTimer() {
+                @Override public void handle(long l) {}
+            }.start();
 
-                l1.countDown(); // jfxpanel is installed
-            }
+            l1.countDown(); // jfxpanel is installed
         });
 
         frame.getContentPane().setBackground(java.awt.Color.RED);
--- a/tests/system/src/test/java/javafx/embed/swing/RT30650GUI.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/embed/swing/RT30650GUI.java	Thu Jun 12 09:52:47 2014 -0700
@@ -87,38 +87,22 @@
         stage.setTitle("RT-30650");
         stage.show();
         
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                JPanel panel = new JPanel();
-                panel.setBackground(Color.RED);
-                swingNode.setContent(panel);
-                
-                Platform.runLater(new Runnable() {
-                    @Override public void run() {
-                        pulseListener = new TKPulseListener() {
-                            @Override
-                            public void pulse() {
-                                if (--pulseCount == 0) {
-                                    SwingUtilities.invokeLater(new Runnable() {
-                                        @Override
-                                        public void run() {
-                                            passed = testColor(stage);
-                                            Platform.runLater(new Runnable() {
-                                                @Override
-                                                public void run() {
-                                                    stage.close();
-                                                }
-                                            });
-                                        }
-                                    });
-                                }
-                            }
-                        };
-                        com.sun.javafx.tk.Toolkit.getToolkit().addSceneTkPulseListener(pulseListener);
+        SwingUtilities.invokeLater(() -> {
+            JPanel panel = new JPanel();
+            panel.setBackground(Color.RED);
+            swingNode.setContent(panel);
+            
+            Platform.runLater(() -> {
+                pulseListener = () -> {
+                    if (--pulseCount == 0) {
+                        SwingUtilities.invokeLater(() -> {
+                            passed = testColor(stage);
+                            Platform.runLater(stage::close);
+                        });
                     }
-                });
-            }
+                };
+                com.sun.javafx.tk.Toolkit.getToolkit().addSceneTkPulseListener(pulseListener);
+            });
         });        
     }
     
--- a/tests/system/src/test/java/javafx/scene/PhongMaterialTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/scene/PhongMaterialTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -112,11 +112,7 @@
         System.setProperty("prism.order", "es2");
 
         // Start the Application
-        new Thread(new Runnable() {
-            @Override public void run() {
-                Application.launch(MyApp.class, (String[])null);
-            }
-        }).start();
+        new Thread(() -> Application.launch(MyApp.class, (String[])null)).start();
 
         try {
             if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
@@ -140,18 +136,14 @@
     private RuntimeException exception = null;
 
     private void runAndWait(final Runnable r) {
-        PlatformImpl.runAndWait(new Runnable() {
-
-            public void run() {
-                try {
-                    r.run();
-                } catch (RuntimeException ex) {
-                    exception = ex;
-                } catch (Error err) {
-                    error = err;
-                }
+        PlatformImpl.runAndWait(() -> {
+            try {
+                r.run();
+            } catch (RuntimeException ex) {
+                exception = ex;
+            } catch (Error err) {
+                error = err;
             }
-
         });
 
         if (error != null) {
@@ -182,29 +174,25 @@
     public void testDefaultPhongMaterial() {
 
 
-        runAndWait(new Runnable() {
-            public void run() {
-                testMat = new PhongMaterial();
-                shape = new Sphere();
-                shape.setMaterial(testMat);
-                Group root = (Group) myApp.scene.getRoot();
-                root.getChildren().add(shape);
-            }
+        runAndWait(() -> {
+            testMat = new PhongMaterial();
+            shape = new Sphere();
+            shape.setMaterial(testMat);
+            Group root = (Group) myApp.scene.getRoot();
+            root.getChildren().add(shape);
         });
 
         //TODO: should just wait for pulse
         sleep(SLEEP_TIME);
 
-        runAndWait(new Runnable() {
-            public void run() {
-                final NGShape3D peer = shape.impl_getPeer();
-                final NGPhongMaterial phongMaterial = NGHelper.getMaterial(peer);
-                com.sun.prism.PhongMaterial tmp = NGHelper.createMaterial(phongMaterial);
-                if (com.sun.prism.es2.ES2Pipeline.class.equals(pipelineClass)) {
-                    ES2Helper.checkMaterial(testMat, tmp);
-                }
+        runAndWait(() -> {
+            final NGShape3D peer = shape.impl_getPeer();
+            final NGPhongMaterial phongMaterial = NGHelper.getMaterial(peer);
+            com.sun.prism.PhongMaterial tmp = NGHelper.createMaterial(phongMaterial);
+            if (com.sun.prism.es2.ES2Pipeline.class.equals(pipelineClass)) {
+                ES2Helper.checkMaterial(testMat, tmp);
+            }
 
-            }
         });
 
     }
--- a/tests/system/src/test/java/javafx/scene/Snapshot1Test.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/scene/Snapshot1Test.java	Thu Jun 12 09:52:47 2014 -0700
@@ -110,11 +110,7 @@
     public void testSnapshotSceneImmediateWrongThread() {
         assertFalse(Platform.isFxApplicationThread());
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpScene = new Scene(new Group(), 200, 100);
-            }
-        });
+        Util.runAndWait(() -> tmpScene = new Scene(new Group(), 200, 100));
 
         // Should throw IllegalStateException
         tmpScene.snapshot(null);
@@ -126,17 +122,11 @@
     public void testSnapshotSceneDeferredWrongThread() {
         assertFalse(Platform.isFxApplicationThread());
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpScene = new Scene(new Group(), 200, 100);
-            }
-        });
+        Util.runAndWait(() -> tmpScene = new Scene(new Group(), 200, 100));
 
         // Should throw IllegalStateException
-        tmpScene.snapshot(new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult p) {
-                throw new AssertionFailedError("Should never get here");
-            }
+        tmpScene.snapshot(p -> {
+            throw new AssertionFailedError("Should never get here");
         }, null);
     }
 
@@ -161,22 +151,18 @@
         tmpNode = new Rectangle(10, 10);
 
         // Should throw IllegalStateException
-        tmpNode.snapshot(new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult p) {
-                throw new AssertionFailedError("Should never get here");
-            }
+        tmpNode.snapshot(p -> {
+            throw new AssertionFailedError("Should never get here");
         }, null, null);
     }
 
     // Test immediate snapshot
     @Test
     public void testSceneImmediate() {
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpScene = new Scene(new Group(), 200, 100);
-                WritableImage img = tmpScene.snapshot(null);
-                assertNotNull(img);
-            }
+        Util.runAndWait(() -> {
+            tmpScene = new Scene(new Group(), 200, 100);
+            WritableImage img = tmpScene.snapshot(null);
+            assertNotNull(img);
         });
     }
 
@@ -185,23 +171,19 @@
     public void testSceneCallback() {
         final CountDownLatch latch = new CountDownLatch(1);
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpScene = new Scene(new Group(), 200, 100);
+        Util.runAndWait(() -> {
+            tmpScene = new Scene(new Group(), 200, 100);
 
-                Callback<SnapshotResult, Void> cb = new Callback<SnapshotResult, Void>() {
-                    @Override public Void call(SnapshotResult param) {
-                        assertNotNull(param);
+            Callback<SnapshotResult, Void> cb = param -> {
+                assertNotNull(param);
 
-                        latch.countDown();
-                        return null;
-                    }
-                };
+                latch.countDown();
+                return null;
+            };
 
-                tmpScene.snapshot(cb, null);
-                Util.sleep(SLEEP_TIME);
-                assertEquals(1, latch.getCount());
-            }
+            tmpScene.snapshot(cb, null);
+            Util.sleep(SLEEP_TIME);
+            assertEquals(1, latch.getCount());
         });
 
         try {
@@ -299,23 +281,19 @@
     // Test deferred snapshot with null callback (should throw NPE)
     @Test (expected=NullPointerException.class)
     public void testNullSceneCallback() {
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpScene = new Scene(new Group(), 200, 100);
-                tmpScene.snapshot(null, null);
-            }
+        Util.runAndWait(() -> {
+            tmpScene = new Scene(new Group(), 200, 100);
+            tmpScene.snapshot(null, null);
         });
     }
 
     // Test immediate snapshot
     @Test
     public void testNodeImmediate() {
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpNode = new Rectangle(10, 10);
-                WritableImage img = tmpNode.snapshot(null, null);
-                assertNotNull(img);
-            }
+        Util.runAndWait(() -> {
+            tmpNode = new Rectangle(10, 10);
+            WritableImage img = tmpNode.snapshot(null, null);
+            assertNotNull(img);
         });
     }
 
@@ -324,23 +302,19 @@
     public void testNodeCallback() {
         final CountDownLatch latch = new CountDownLatch(1);
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpNode = new Rectangle(10, 10);
+        Util.runAndWait(() -> {
+            tmpNode = new Rectangle(10, 10);
 
-                Callback<SnapshotResult, Void> cb = new Callback<SnapshotResult, Void>() {
-                    @Override public Void call(SnapshotResult param) {
-                        assertNotNull(param);
+            Callback<SnapshotResult, Void> cb = param -> {
+                assertNotNull(param);
 
-                        latch.countDown();
-                        return null;
-                    }
-                };
+                latch.countDown();
+                return null;
+            };
 
-                tmpNode.snapshot(cb, null, null);
-                Util.sleep(SLEEP_TIME);
-                assertEquals(1, latch.getCount());
-            }
+            tmpNode.snapshot(cb, null, null);
+            Util.sleep(SLEEP_TIME);
+            assertEquals(1, latch.getCount());
         });
 
         try {
@@ -438,11 +412,9 @@
     // Test deferred snapshot with null callback (should throw NPE)
     @Test (expected=NullPointerException.class)
     public void testNullNodeCallback() {
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpNode = new Rectangle(10, 10);
-                tmpNode.snapshot(null, null, null);
-            }
+        Util.runAndWait(() -> {
+            tmpNode = new Rectangle(10, 10);
+            tmpNode.snapshot(null, null, null);
         });
     }
 
--- a/tests/system/src/test/java/javafx/scene/Snapshot2Test.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/scene/Snapshot2Test.java	Thu Jun 12 09:52:47 2014 -0700
@@ -105,11 +105,9 @@
 
     @After
     public void teardownEach() {
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                if (tmpStage != null && tmpStage.isShowing()) {
-                    tmpStage.hide();
-                }
+        Util.runAndWait(() -> {
+            if (tmpStage != null && tmpStage.isShowing()) {
+                tmpStage.hide();
             }
         });
     }
@@ -117,17 +115,15 @@
     // ========================== TEST CASES ==========================
 
     private void setupEmptyScene() {
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                Group root = new Group();
-                tmpScene = new Scene(root);
-                if (live) {
-                    tmpStage = new TestStage(tmpScene);
-                    assertNotNull(tmpScene.getWindow());
-                    tmpStage.show();
-                } else {
-                    assertNull(tmpScene.getWindow());
-                }
+        Util.runAndWait(() -> {
+            Group root = new Group();
+            tmpScene = new Scene(root);
+            if (live) {
+                tmpStage = new TestStage(tmpScene);
+                assertNotNull(tmpScene.getWindow());
+                tmpStage.show();
+            } else {
+                assertNull(tmpScene.getWindow());
             }
         });
     }
@@ -138,17 +134,15 @@
         setupEmptyScene();
 
         final WritableImage img = useImage ? new WritableImage(1, 1) : null;
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                WritableImage wimg = tmpScene.snapshot(img);
-                assertNotNull(wimg);
-                if (img != null) {
-                    assertSame(img, wimg);
-                }
+        Util.runAndWait(() -> {
+            WritableImage wimg = tmpScene.snapshot(img);
+            assertNotNull(wimg);
+            if (img != null) {
+                assertSame(img, wimg);
+            }
 
-                assertEquals(1, (int)wimg.getWidth());
-                assertEquals(1, (int)wimg.getHeight());
-            }
+            assertEquals(1, (int)wimg.getWidth());
+            assertEquals(1, (int)wimg.getHeight());
         });
     }
 
@@ -156,37 +150,33 @@
     public void testSnapshotEmptySceneDefer() {
         setupEmptyScene();
         final WritableImage img = useImage ? new WritableImage(1, 1) : null;
-        runDeferredSnapshotWait(tmpScene, new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene, result.getSource());
-                assertNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        runDeferredSnapshotWait(tmpScene, result -> {
+            assertSame(tmpScene, result.getSource());
+            assertNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(1, (int)result.getImage().getWidth());
-                assertEquals(1, (int)result.getImage().getHeight());
+            assertEquals(1, (int)result.getImage().getWidth());
+            assertEquals(1, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         }, img);
     }
 
     private void doTestSnapshotEmptyNodeImm(final SnapshotParameters snapshotParams) {
         setupEmptyScene();
         final WritableImage img = useImage ? new WritableImage(1, 1) : null;
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
-                assertNotNull(wimg);
-                if (img != null) {
-                    assertSame(img, wimg);
-                }
+        Util.runAndWait(() -> {
+            WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
+            assertNotNull(wimg);
+            if (img != null) {
+                assertSame(img, wimg);
+            }
 
-                assertEquals(1, (int)wimg.getWidth());
-                assertEquals(1, (int)wimg.getHeight());
-            }
+            assertEquals(1, (int)wimg.getWidth());
+            assertEquals(1, (int)wimg.getHeight());
         });
     }
 
@@ -203,20 +193,18 @@
     private void doTestSnapshotEmptyNodeDefer(final SnapshotParameters snapshotParams) {
         setupEmptyScene();
         final WritableImage img = useImage ? new WritableImage(1, 1) : null;
-        runDeferredSnapshotWait(tmpScene.getRoot(), new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene.getRoot(), result.getSource());
-                assertNotNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        runDeferredSnapshotWait(tmpScene.getRoot(), result -> {
+            assertSame(tmpScene.getRoot(), result.getSource());
+            assertNotNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(1, (int)result.getImage().getWidth());
-                assertEquals(1, (int)result.getImage().getHeight());
+            assertEquals(1, (int)result.getImage().getWidth());
+            assertEquals(1, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         }, snapshotParams, img);
     }
 
@@ -236,19 +224,17 @@
     private static final int NODE_H = SCENE_H - 2*5;
 
     private void setupSimpleScene() {
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpNode = new Rectangle(10, 5, NODE_W, NODE_H);
-                Group root = new Group();
-                tmpScene = new Scene(root, SCENE_W, SCENE_H);
-                root.getChildren().add(tmpNode);
-                if (live) {
-                    tmpStage = new TestStage(tmpScene);
-                    assertNotNull(tmpScene.getWindow());
-                    tmpStage.show();
-                } else {
-                    assertNull(tmpScene.getWindow());
-                }
+        Util.runAndWait(() -> {
+            tmpNode = new Rectangle(10, 5, NODE_W, NODE_H);
+            Group root = new Group();
+            tmpScene = new Scene(root, SCENE_W, SCENE_H);
+            root.getChildren().add(tmpNode);
+            if (live) {
+                tmpStage = new TestStage(tmpScene);
+                assertNotNull(tmpScene.getWindow());
+                tmpStage.show();
+            } else {
+                assertNull(tmpScene.getWindow());
             }
         });
     }
@@ -260,17 +246,15 @@
         setupSimpleScene();
 
         final WritableImage img = useImage ? new WritableImage(SCENE_W, SCENE_H) : null;
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                WritableImage wimg = tmpScene.snapshot(img);
-                assertNotNull(wimg);
-                if (img != null) {
-                    assertSame(img, wimg);
-                }
+        Util.runAndWait(() -> {
+            WritableImage wimg = tmpScene.snapshot(img);
+            assertNotNull(wimg);
+            if (img != null) {
+                assertSame(img, wimg);
+            }
 
-                assertEquals(SCENE_W, (int)wimg.getWidth());
-                assertEquals(SCENE_H, (int)wimg.getHeight());
-            }
+            assertEquals(SCENE_W, (int)wimg.getWidth());
+            assertEquals(SCENE_H, (int)wimg.getHeight());
         });
     }
 
@@ -279,20 +263,18 @@
         setupSimpleScene();
 
         final WritableImage img = useImage ? new WritableImage(SCENE_W, SCENE_H) : null;
-        runDeferredSnapshotWait(tmpScene, new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene, result.getSource());
-                assertNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        runDeferredSnapshotWait(tmpScene, result -> {
+            assertSame(tmpScene, result.getSource());
+            assertNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(SCENE_W, (int)result.getImage().getWidth());
-                assertEquals(SCENE_H, (int)result.getImage().getHeight());
+            assertEquals(SCENE_W, (int)result.getImage().getWidth());
+            assertEquals(SCENE_H, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         }, img);
     }
 
@@ -301,17 +283,15 @@
         setupSimpleScene();
         final SnapshotParameters snapshotParams = new SnapshotParameters();
         final WritableImage img = useImage ? new WritableImage(NODE_W, NODE_H) : null;
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
-                assertNotNull(wimg);
-                if (img != null) {
-                    assertSame(img, wimg);
-                }
+        Util.runAndWait(() -> {
+            WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
+            assertNotNull(wimg);
+            if (img != null) {
+                assertSame(img, wimg);
+            }
 
-                assertEquals(NODE_W, (int)wimg.getWidth());
-                assertEquals(NODE_H, (int)wimg.getHeight());
-            }
+            assertEquals(NODE_W, (int)wimg.getWidth());
+            assertEquals(NODE_H, (int)wimg.getHeight());
         });
     }
 
@@ -320,20 +300,18 @@
         setupSimpleScene();
         final SnapshotParameters snapshotParams = new SnapshotParameters();
         final WritableImage img = useImage ? new WritableImage(NODE_W, NODE_H) : null;
-        runDeferredSnapshotWait(tmpScene.getRoot(), new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene.getRoot(), result.getSource());
-                assertNotNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        runDeferredSnapshotWait(tmpScene.getRoot(), result -> {
+            assertSame(tmpScene.getRoot(), result.getSource());
+            assertNotNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(NODE_W, (int)result.getImage().getWidth());
-                assertEquals(NODE_H, (int)result.getImage().getHeight());
+            assertEquals(NODE_W, (int)result.getImage().getWidth());
+            assertEquals(NODE_H, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         }, snapshotParams, img);
     }
 
@@ -346,17 +324,15 @@
         final int WIDTH = NODE_W * xScale;
         final int HEIGHT = NODE_H * yScale;
         final WritableImage img = useImage ? new WritableImage(WIDTH, HEIGHT) : null;
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
-                assertNotNull(wimg);
-                if (img != null) {
-                    assertSame(img, wimg);
-                }
+        Util.runAndWait(() -> {
+            WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
+            assertNotNull(wimg);
+            if (img != null) {
+                assertSame(img, wimg);
+            }
 
-                assertEquals(WIDTH, (int)wimg.getWidth());
-                assertEquals(HEIGHT, (int)wimg.getHeight());
-            }
+            assertEquals(WIDTH, (int)wimg.getWidth());
+            assertEquals(HEIGHT, (int)wimg.getHeight());
         });
     }
 
@@ -367,20 +343,18 @@
         final int WIDTH = NODE_W * xScale;
         final int HEIGHT = NODE_H * yScale;
         final WritableImage img = useImage ? new WritableImage(WIDTH, HEIGHT) : null;
-        runDeferredSnapshotWait(tmpScene.getRoot(), new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene.getRoot(), result.getSource());
-                assertNotNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        runDeferredSnapshotWait(tmpScene.getRoot(), result -> {
+            assertSame(tmpScene.getRoot(), result.getSource());
+            assertNotNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(WIDTH, (int)result.getImage().getWidth());
-                assertEquals(HEIGHT, (int)result.getImage().getHeight());
+            assertEquals(WIDTH, (int)result.getImage().getWidth());
+            assertEquals(HEIGHT, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         }, snapshotParams, img);
     }
 
@@ -429,17 +403,15 @@
         final int WIDTH = NODE_H;
         final int HEIGHT = NODE_W;
         final WritableImage img = useImage ? new WritableImage(WIDTH, HEIGHT) : null;
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
-                assertNotNull(wimg);
-                if (img != null) {
-                    assertSame(img, wimg);
-                }
+        Util.runAndWait(() -> {
+            WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
+            assertNotNull(wimg);
+            if (img != null) {
+                assertSame(img, wimg);
+            }
 
-                assertEquals(WIDTH, (int)wimg.getWidth());
-                assertEquals(HEIGHT, (int)wimg.getHeight());
-            }
+            assertEquals(WIDTH, (int)wimg.getWidth());
+            assertEquals(HEIGHT, (int)wimg.getHeight());
         });
     }
 
@@ -452,20 +424,18 @@
         final int WIDTH = NODE_H;
         final int HEIGHT = NODE_W;
         final WritableImage img = useImage ? new WritableImage(WIDTH, HEIGHT) : null;
-        runDeferredSnapshotWait(tmpScene.getRoot(), new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene.getRoot(), result.getSource());
-                assertNotNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        runDeferredSnapshotWait(tmpScene.getRoot(), result -> {
+            assertSame(tmpScene.getRoot(), result.getSource());
+            assertNotNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(WIDTH, (int)result.getImage().getWidth());
-                assertEquals(HEIGHT, (int)result.getImage().getHeight());
+            assertEquals(WIDTH, (int)result.getImage().getWidth());
+            assertEquals(HEIGHT, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         }, snapshotParams, img);
     }
 
@@ -483,17 +453,15 @@
         final WritableImage img = useImage ? new WritableImage(NODE_W, NODE_H) : null;
         final int WIDTH = useImage ? NODE_W : VP_WIDTH;
         final int HEIGHT = useImage ? NODE_H : VP_HEIGHT;
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
-                assertNotNull(wimg);
-                if (img != null) {
-                    assertSame(img, wimg);
-                }
+        Util.runAndWait(() -> {
+            WritableImage wimg = tmpScene.getRoot().snapshot(snapshotParams, img);
+            assertNotNull(wimg);
+            if (img != null) {
+                assertSame(img, wimg);
+            }
 
-                assertEquals(WIDTH, (int)wimg.getWidth());
-                assertEquals(HEIGHT, (int)wimg.getHeight());
-            }
+            assertEquals(WIDTH, (int)wimg.getWidth());
+            assertEquals(HEIGHT, (int)wimg.getHeight());
         });
     }
 
@@ -505,20 +473,18 @@
         final WritableImage img = useImage ? new WritableImage(NODE_W, NODE_H) : null;
         final int WIDTH = useImage ? NODE_W : VP_WIDTH;
         final int HEIGHT = useImage ? NODE_H : VP_HEIGHT;
-        runDeferredSnapshotWait(tmpScene.getRoot(), new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene.getRoot(), result.getSource());
-                assertNotNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        runDeferredSnapshotWait(tmpScene.getRoot(), result -> {
+            assertSame(tmpScene.getRoot(), result.getSource());
+            assertNotNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(WIDTH, (int)result.getImage().getWidth());
-                assertEquals(HEIGHT, (int)result.getImage().getHeight());
+            assertEquals(WIDTH, (int)result.getImage().getWidth());
+            assertEquals(HEIGHT, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         }, snapshotParams, img);
     }
 
@@ -536,28 +502,24 @@
         final WritableImage img = useImage ? new WritableImage(NODE_W, NODE_H) : null;
         final int WIDTH = useImage ? NODE_W : NEW_WIDTH;
         final int HEIGHT = useImage ? NODE_H : NEW_HEIGHT;
-        Callback<SnapshotResult, Void> cb = new Callback<SnapshotResult, Void>() {
-            public Void call(SnapshotResult result) {
-                assertSame(tmpScene.getRoot(), result.getSource());
-                assertNotNull(result.getSnapshotParameters());
-                assertNotNull(result.getImage());
-                if (img != null) {
-                    assertSame(img, result.getImage());
-                }
+        Callback<SnapshotResult, Void> cb = result -> {
+            assertSame(tmpScene.getRoot(), result.getSource());
+            assertNotNull(result.getSnapshotParameters());
+            assertNotNull(result.getImage());
+            if (img != null) {
+                assertSame(img, result.getImage());
+            }
 
-                assertEquals(WIDTH, (int)result.getImage().getWidth());
-                assertEquals(HEIGHT, (int)result.getImage().getHeight());
+            assertEquals(WIDTH, (int)result.getImage().getWidth());
+            assertEquals(HEIGHT, (int)result.getImage().getHeight());
 
-                return null;
-            }
+            return null;
         };
-        Runnable runAfter = new Runnable() {
-            public void run() {
-                assertTrue(tmpNode instanceof Rectangle);
-                Rectangle rect = (Rectangle)tmpNode;
-                rect.setWidth(NEW_WIDTH);
-                rect.setHeight(NEW_HEIGHT);
-            }
+        Runnable runAfter = () -> {
+            assertTrue(tmpNode instanceof Rectangle);
+            Rectangle rect = (Rectangle)tmpNode;
+            rect.setWidth(NEW_WIDTH);
+            rect.setHeight(NEW_HEIGHT);
         };
 
         runDeferredSnapshotWait(tmpScene.getRoot(), cb, snapshotParams, img, runAfter);
--- a/tests/system/src/test/java/javafx/scene/SnapshotCommon.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/scene/SnapshotCommon.java	Thu Jun 12 09:52:47 2014 -0700
@@ -101,11 +101,7 @@
 
     static void doSetupOnce() {
         // Start the Application
-        new Thread(new Runnable() {
-            @Override public void run() {
-                Application.launch(MyApp.class, (String[])null);
-            }
-        }).start();
+        new Thread(() -> Application.launch(MyApp.class, (String[])null)).start();
 
         try {
             if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
@@ -133,25 +129,21 @@
         final Throwable[] testError = new Throwable[1];
         final CountDownLatch latch = new CountDownLatch(1);
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                node.snapshot(new Callback<SnapshotResult, Void>() {
-                    public Void call(SnapshotResult result) {
-                        try {
-                            cb.call(result);
-                        } catch (Throwable th) {
-                            testError[0] = th;
-                        } finally {
-                            latch.countDown();
-                        }
-                        return null;
-                    }
-                }, params, img);
-                assertEquals(1, latch.getCount());
+        Util.runAndWait(() -> {
+            node.snapshot(result -> {
+                try {
+                    cb.call(result);
+                } catch (Throwable th) {
+                    testError[0] = th;
+                } finally {
+                    latch.countDown();
+                }
+                return null;
+            }, params, img);
+            assertEquals(1, latch.getCount());
 
-                if (runAfter != null) {
-                    runAfter.run();
-                }
+            if (runAfter != null) {
+                runAfter.run();
             }
         });
 
@@ -193,22 +185,18 @@
         final Throwable[] testError = new Throwable[1];
         final CountDownLatch latch = new CountDownLatch(1);
 
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                scene.snapshot(new Callback<SnapshotResult, Void>() {
-                    public Void call(SnapshotResult result) {
-                        try {
-                            cb.call(result);
-                        } catch (Throwable th) {
-                            testError[0] = th;
-                        } finally {
-                            latch.countDown();
-                        }
-                        return null;
-                    }
-                }, img);
-                assertEquals(1, latch.getCount());
-            }
+        Util.runAndWait(() -> {
+            scene.snapshot(result -> {
+                try {
+                    cb.call(result);
+                } catch (Throwable th) {
+                    testError[0] = th;
+                } finally {
+                    latch.countDown();
+                }
+                return null;
+            }, img);
+            assertEquals(1, latch.getCount());
         });
 
         try {
--- a/tests/system/src/test/java/javafx/scene/layout/RegionUITestBase.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/scene/layout/RegionUITestBase.java	Thu Jun 12 09:52:47 2014 -0700
@@ -56,26 +56,20 @@
     @Override
     public void doSetup() {
         super.doSetup();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                stage = getStage();
-                region = new Region();
-                region.setPrefSize(REGION_WIDTH, REGION_HEIGHT);
-                region.relocate(REGION_LEFT, REGION_TOP);
-                scene = new Scene(root = new Group(region), WIDTH, HEIGHT);
-                scene.setFill(SCENE_FILL);
-                stage.setScene(scene);
-                stage.show();
-            }
+        runAndWait(() -> {
+            stage = getStage();
+            region = new Region();
+            region.setPrefSize(REGION_WIDTH, REGION_HEIGHT);
+            region.relocate(REGION_LEFT, REGION_TOP);
+            scene = new Scene(root = new Group(region), WIDTH, HEIGHT);
+            scene.setFill(SCENE_FILL);
+            stage.setScene(scene);
+            stage.show();
         });
     }
 
     protected void setStyle(final String style) {
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                region.setStyle(style);
-            }
-        });
+        runAndWait(() -> region.setStyle(style));
         waitFirstFrame();
     }
 
@@ -97,12 +91,7 @@
 
     private Color getColor(int x, int y) {
         AtomicReference<Color> color = new AtomicReference<>();
-        runAndWait(new Runnable() {
-            @Override
-            public void run() {
-                color.set(getColor(scene, x, y));
-            }
-        });
+        runAndWait(() -> color.set(getColor(scene, x, y)));
         return color.get();
     }
 
--- a/tests/system/src/test/java/javafx/stage/ShowAndWaitTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/javafx/stage/ShowAndWaitTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -114,11 +114,7 @@
     @BeforeClass
     public static void setupOnce() {
         // Start the Application
-        new Thread(new Runnable() {
-            @Override public void run() {
-                Application.launch(MyApp.class, (String[])null);
-            }
-        }).start();
+        new Thread(() -> Application.launch(MyApp.class, (String[])null)).start();
 
         try {
             if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
@@ -172,11 +168,7 @@
             if (stage.isShowing()) {
                 System.err.println("Cleaning up stage after a failed test...");
                 try {
-                    Util.runAndWait(new Runnable() {
-                        public void run() {
-                            stage.hide();
-                        }
-                    });
+                    Util.runAndWait(stage::hide);
                 } catch (Throwable t) {
                     System.err.println("WARNING: unable to hide stage after test failure");
                     t.printStackTrace(System.err);
@@ -209,21 +201,19 @@
         test1Run = true;
 
         assertEquals(0, launchLatch.getCount());
-        Util.runAndWait(new Runnable() {
-            @Override public void run() {
-                assertTrue(Platform.isFxApplicationThread());
-                assertTrue(myApp.primaryStage.isPrimary());
-                assertFalse(myApp.primaryStage.isShowing());
+        Util.runAndWait(() -> {
+            assertTrue(Platform.isFxApplicationThread());
+            assertTrue(myApp.primaryStage.isPrimary());
+            assertFalse(myApp.primaryStage.isShowing());
 
-                // Verify that we cannot call showAndWait on the primaryStage
-                try {
-                    myApp.primaryStage.showAndWait();
-                    throw new AssertionFailedError("Expected IllegalStateException was not thrown");
-                } catch (IllegalStateException ex) {
-                }
+            // Verify that we cannot call showAndWait on the primaryStage
+            try {
+                myApp.primaryStage.showAndWait();
+                throw new AssertionFailedError("Expected IllegalStateException was not thrown");
+            } catch (IllegalStateException ex) {
+            }
 
-                myApp.primaryStage.show();
-            }
+            myApp.primaryStage.show();
         });
     }
 
@@ -246,13 +236,11 @@
     public void testShowWaitWrongThread() {
         ensureTest1();
         assertFalse(Platform.isFxApplicationThread());
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpStage1 = new TestStage(modality);
-                stages.add(tmpStage1);
-                assertFalse(tmpStage1.isPrimary());
-                assertFalse(tmpStage1.isShowing());
-            }
+        Util.runAndWait(() -> {
+            tmpStage1 = new TestStage(modality);
+            stages.add(tmpStage1);
+            assertFalse(tmpStage1.isPrimary());
+            assertFalse(tmpStage1.isShowing());
         });
         assertNotNull(tmpStage1);
 
@@ -264,21 +252,19 @@
     @Test (expected=IllegalStateException.class)
     public void testVisibleThrow() {
         ensureTest1();
-        Util.runAndWait(new Runnable() {
-            public void run() {
-                tmpStage1 = new TestStage(modality);
-                stages.add(tmpStage1);
-                assertFalse(tmpStage1.isPrimary());
-                assertFalse(tmpStage1.isShowing());
-                tmpStage1.show();
-                assertTrue(tmpStage1.isShowing());
+        Util.runAndWait(() -> {
+            tmpStage1 = new TestStage(modality);
+            stages.add(tmpStage1);
+            assertFalse(tmpStage1.isPrimary());
+            assertFalse(tmpStage1.isShowing());
+            tmpStage1.show();
+            assertTrue(tmpStage1.isShowing());
 
-                try {
-                    // The following should throw IllegalStateException
-                    tmpStage1.showAndWait();
-                } finally {
-                    tmpStage1.hide();
-                }
+            try {
+                // The following should throw IllegalStateException
+                tmpStage1.showAndWait();
+            } finally {
+                tmpStage1.hide();
             }
         });
     }
@@ -291,27 +277,23 @@
         final AtomicBoolean stageShowReturned = new AtomicBoolean(false);
         final AtomicBoolean hideActionReached = new AtomicBoolean(false);
 
-        Runnable rShow = new Runnable() {
-            @Override public void run() {
-                tmpStage1 = new TestStage(modality);
-                stages.add(tmpStage1);
-                assertFalse(tmpStage1.isPrimary());
-                assertFalse(tmpStage1.isShowing());
-                tmpStage1.show();
-                stageShowReturned.set(true);
-                assertTrue(tmpStage1.isShowing());
-                assertFalse(hideActionReached.get());
-            }
+        Runnable rShow = () -> {
+            tmpStage1 = new TestStage(modality);
+            stages.add(tmpStage1);
+            assertFalse(tmpStage1.isPrimary());
+            assertFalse(tmpStage1.isShowing());
+            tmpStage1.show();
+            stageShowReturned.set(true);
+            assertTrue(tmpStage1.isShowing());
+            assertFalse(hideActionReached.get());
         };
 
-        Runnable rHide = new Runnable() {
-            @Override public void run() {
-                assertNotNull(tmpStage1);
-                assertTrue(tmpStage1.isShowing());
-                assertTrue(stageShowReturned.get());
-                hideActionReached.set(true);
-                tmpStage1.hide();
-            }
+        Runnable rHide = () -> {
+            assertNotNull(tmpStage1);
+            assertTrue(tmpStage1.isShowing());
+            assertTrue(stageShowReturned.get());
+            hideActionReached.set(true);
+            tmpStage1.hide();
         };
 
         Util.runAndWait(rShow, rHide);
@@ -331,37 +313,28 @@
         final AtomicBoolean hide1EventReached = new AtomicBoolean(false);
         final AtomicBoolean nextRunnableReached = new AtomicBoolean(false);
 
-        Runnable rShow1 = new Runnable() {
-            @Override public void run() {
-                tmpStage1 = new TestStage(modality);
-                stages.add(tmpStage1);
-                assertFalse(tmpStage1.isPrimary());
-                assertFalse(tmpStage1.isShowing());
-                tmpStage1.showAndWait();
-                stage1ShowReturned.set(true);
-                assertFalse(tmpStage1.isShowing());
-                assertTrue(hide1EventReached.get());
-                assertFalse(nextRunnableReached.get());
-            }
+        Runnable rShow1 = () -> {
+            tmpStage1 = new TestStage(modality);
+            stages.add(tmpStage1);
+            assertFalse(tmpStage1.isPrimary());
+            assertFalse(tmpStage1.isShowing());
+            tmpStage1.showAndWait();
+            stage1ShowReturned.set(true);
+            assertFalse(tmpStage1.isShowing());
+            assertTrue(hide1EventReached.get());
+            assertFalse(nextRunnableReached.get());
         };
 
-        Runnable rHide1 = new Runnable() {
-            @Override public void run() {
-                hide1EventReached.set(true);
-                assertFalse(stage1ShowReturned.get());
-                assertNotNull(tmpStage1);
-                tmpStage1.hide();
-                Util.sleep(1);
-                assertFalse(stage1ShowReturned.get());
-            }
+        Runnable rHide1 = () -> {
+            hide1EventReached.set(true);
+            assertFalse(stage1ShowReturned.get());
+            assertNotNull(tmpStage1);
+            tmpStage1.hide();
+            Util.sleep(1);
+            assertFalse(stage1ShowReturned.get());
         };
 
-        Runnable rNext = new Runnable() {
-            public void run() {
-                // This should happen after the nested event loop exits
-                nextRunnableReached.set(true);
-            }
-        };
+        Runnable rNext = () -> nextRunnableReached.set(true);
 
         Util.runAndWait(rShow1, rHide1, rNext);
 
@@ -381,35 +354,26 @@
         final AtomicBoolean hide1EventReached = new AtomicBoolean(false);
         final AtomicBoolean nextRunnableReached = new AtomicBoolean(false);
 
-        Runnable rShow1 = new Runnable() {
-            @Override public void run() {
-                tmpStage1 = new TestStage(modality);
-                stages.add(tmpStage1);
-                assertFalse(tmpStage1.isPrimary());
-                assertFalse(tmpStage1.isShowing());
-                tmpStage1.showAndWait();
-                stage1ShowReturned.set(true);
-                assertFalse(tmpStage1.isShowing());
-                assertTrue(hide1EventReached.get());
-                assertFalse(nextRunnableReached.get());
-            }
+        Runnable rShow1 = () -> {
+            tmpStage1 = new TestStage(modality);
+            stages.add(tmpStage1);
+            assertFalse(tmpStage1.isPrimary());
+            assertFalse(tmpStage1.isShowing());
+            tmpStage1.showAndWait();
+            stage1ShowReturned.set(true);
+            assertFalse(tmpStage1.isShowing());
+            assertTrue(hide1EventReached.get());
+            assertFalse(nextRunnableReached.get());
         };
 
-        Runnable rHide1 = new Runnable() {
-            @Override public void run() {
-                hide1EventReached.set(true);
-                assertFalse(stage1ShowReturned.get());
-                assertNotNull(tmpStage1);
-                tmpStage1.hide();
-                Util.sleep(1);
-                assertFalse(stage1ShowReturned.get());
-                Platform.runLater(new Runnable() {
-                    public void run() {
-                        // This should happen after the nested event loop exits
-                        nextRunnableReached.set(true);
-                    }
-                });
-            }
+        Runnable rHide1 = () -> {
+            hide1EventReached.set(true);
+            assertFalse(stage1ShowReturned.get());
+            assertNotNull(tmpStage1);
+            tmpStage1.hide();
+            Util.sleep(1);
+            assertFalse(stage1ShowReturned.get());
+            Platform.runLater(() -> nextRunnableReached.set(true));
         };
 
         Util.runAndWait(rShow1, rHide1);
@@ -428,60 +392,52 @@
         final AtomicBoolean stage2ShowReturned = new AtomicBoolean(false);
         final AtomicBoolean hide2EventReached = new AtomicBoolean(false);
 
-        Runnable rShow1 = new Runnable() {
-            @Override public void run() {
-                tmpStage1 = new TestStage(modality);
-                stages.add(tmpStage1);
-                assertFalse(tmpStage1.isPrimary());
-                assertFalse(tmpStage1.isShowing());
-                tmpStage1.showAndWait();
-                stage1ShowReturned.set(true);
-                assertFalse(tmpStage1.isShowing());
-                assertTrue(stage2ShowReturned.get());
-                assertTrue(hide1EventReached.get());
-                assertTrue(hide2EventReached.get());
-            }
+        Runnable rShow1 = () -> {
+            tmpStage1 = new TestStage(modality);
+            stages.add(tmpStage1);
+            assertFalse(tmpStage1.isPrimary());
+            assertFalse(tmpStage1.isShowing());
+            tmpStage1.showAndWait();
+            stage1ShowReturned.set(true);
+            assertFalse(tmpStage1.isShowing());
+            assertTrue(stage2ShowReturned.get());
+            assertTrue(hide1EventReached.get());
+            assertTrue(hide2EventReached.get());
         };
 
-        Runnable rShow2 = new Runnable() {
-            @Override public void run() {
-                tmpStage2 = new TestStage(modality);
-                stages.add(tmpStage2);
-                assertFalse(tmpStage2.isPrimary());
-                assertFalse(tmpStage2.isShowing());
-                tmpStage2.showAndWait();
-                stage2ShowReturned.set(true);
-                assertFalse(stage1ShowReturned.get());
-                assertFalse(tmpStage2.isShowing());
-                assertTrue(hide2EventReached.get());
-                assertFalse(hide1EventReached.get());
-            }
+        Runnable rShow2 = () -> {
+            tmpStage2 = new TestStage(modality);
+            stages.add(tmpStage2);
+            assertFalse(tmpStage2.isPrimary());
+            assertFalse(tmpStage2.isShowing());
+            tmpStage2.showAndWait();
+            stage2ShowReturned.set(true);
+            assertFalse(stage1ShowReturned.get());
+            assertFalse(tmpStage2.isShowing());
+            assertTrue(hide2EventReached.get());
+            assertFalse(hide1EventReached.get());
         };
 
-        Runnable rHide1 = new Runnable() {
-            @Override public void run() {
-                hide1EventReached.set(true);
-                assertFalse(stage1ShowReturned.get());
-                assertTrue(stage2ShowReturned.get());
-                assertTrue(hide2EventReached.get());
-                assertNotNull(tmpStage1);
-                tmpStage1.hide();
-                Util.sleep(1);
-                assertFalse(stage1ShowReturned.get());
-            }
+        Runnable rHide1 = () -> {
+            hide1EventReached.set(true);
+            assertFalse(stage1ShowReturned.get());
+            assertTrue(stage2ShowReturned.get());
+            assertTrue(hide2EventReached.get());
+            assertNotNull(tmpStage1);
+            tmpStage1.hide();
+            Util.sleep(1);
+            assertFalse(stage1ShowReturned.get());
         };
 
-        Runnable rHide2 = new Runnable() {
-            @Override public void run() {
-                hide2EventReached.set(true);
-                assertFalse(stage2ShowReturned.get());
-                assertFalse(stage1ShowReturned.get());
-                assertFalse(hide1EventReached.get());
-                assertNotNull(tmpStage2);
-                tmpStage2.hide();
-                Util.sleep(1);
-                assertFalse(stage2ShowReturned.get());
-            }
+        Runnable rHide2 = () -> {
+            hide2EventReached.set(true);
+            assertFalse(stage2ShowReturned.get());
+            assertFalse(stage1ShowReturned.get());
+            assertFalse(hide1EventReached.get());
+            assertNotNull(tmpStage2);
+            tmpStage2.hide();
+            Util.sleep(1);
+            assertFalse(stage2ShowReturned.get());
         };
 
         Util.runAndWait(rShow1, rShow2, rHide2, rHide1);
@@ -501,60 +457,52 @@
         final AtomicBoolean stage2ShowReturned = new AtomicBoolean(false);
         final AtomicBoolean hide2EventReached = new AtomicBoolean(false);
 
-        Runnable rShow1 = new Runnable() {
-            @Override public void run() {
-                tmpStage1 = new TestStage(modality);
-                stages.add(tmpStage1);
-                assertFalse(tmpStage1.isPrimary());
-                assertFalse(tmpStage1.isShowing());
-                tmpStage1.showAndWait();
-                stage1ShowReturned.set(true);
-                assertFalse(tmpStage1.isShowing());
-                assertTrue(stage2ShowReturned.get());
-                assertTrue(hide1EventReached.get());
-                assertTrue(hide2EventReached.get());
-            }
+        Runnable rShow1 = () -> {
+            tmpStage1 = new TestStage(modality);
+            stages.add(tmpStage1);
+            assertFalse(tmpStage1.isPrimary());
+            assertFalse(tmpStage1.isShowing());
+            tmpStage1.showAndWait();
+            stage1ShowReturned.set(true);
+            assertFalse(tmpStage1.isShowing());
+            assertTrue(stage2ShowReturned.get());
+            assertTrue(hide1EventReached.get());
+            assertTrue(hide2EventReached.get());
         };
 
-        Runnable rShow2 = new Runnable() {
-            @Override public void run() {
-                tmpStage2 = new TestStage(modality);
-                stages.add(tmpStage2);
-                assertFalse(tmpStage2.isPrimary());
-                assertFalse(tmpStage2.isShowing());
-                tmpStage2.showAndWait();
-                stage2ShowReturned.set(true);
-                assertFalse(tmpStage2.isShowing());
-                assertFalse(stage1ShowReturned.get());
-                assertTrue(hide2EventReached.get());
-                assertTrue(hide1EventReached.get());
-            }
+        Runnable rShow2 = () -> {
+            tmpStage2 = new TestStage(modality);
+            stages.add(tmpStage2);
+            assertFalse(tmpStage2.isPrimary());
+            assertFalse(tmpStage2.isShowing());
+            tmpStage2.showAndWait();
+            stage2ShowReturned.set(true);
+            assertFalse(tmpStage2.isShowing());
+            assertFalse(stage1ShowReturned.get());
+            assertTrue(hide2EventReached.get());
+            assertTrue(hide1EventReached.get());
         };
 
-        Runnable rHide1 = new Runnable() {
-            @Override public void run() {
-                hide1EventReached.set(true);
-                assertFalse(stage1ShowReturned.get());
-                assertFalse(stage2ShowReturned.get());
-                assertFalse(hide2EventReached.get());
-                assertNotNull(tmpStage1);
-                tmpStage1.hide();
-                Util.sleep(1);
-                assertFalse(stage1ShowReturned.get());
-            }
+        Runnable rHide1 = () -> {
+            hide1EventReached.set(true);
+            assertFalse(stage1ShowReturned.get());
+            assertFalse(stage2ShowReturned.get());
+            assertFalse(hide2EventReached.get());
+            assertNotNull(tmpStage1);
+            tmpStage1.hide();
+            Util.sleep(1);
+            assertFalse(stage1ShowReturned.get());
         };
 
-        Runnable rHide2 = new Runnable() {
-            @Override public void run() {
-                hide2EventReached.set(true);
-                assertFalse(stage2ShowReturned.get());
-                assertFalse(stage1ShowReturned.get());
-                assertTrue(hide1EventReached.get());
-                assertNotNull(tmpStage2);
-                tmpStage2.hide();
-                Util.sleep(1);
-                assertFalse(stage2ShowReturned.get());
-            }
+        Runnable rHide2 = () -> {
+            hide2EventReached.set(true);
+            assertFalse(stage2ShowReturned.get());
+            assertFalse(stage1ShowReturned.get());
+            assertTrue(hide1EventReached.get());
+            assertNotNull(tmpStage2);
+            tmpStage2.hide();
+            Util.sleep(1);
+            assertFalse(stage2ShowReturned.get());
         };
 
         Util.runAndWait(rShow1, rShow2, rHide1, rHide2);
@@ -580,43 +528,39 @@
             final int idx = i;
             stageShowReturned[idx] = new AtomicBoolean(false);
             hideEventReached[idx] = new AtomicBoolean(false);
-            rShow[idx] = new Runnable() {
-                @Override public void run() {
-                    tmpStage[idx] = new TestStage(modality);
-                    stages.add(tmpStage[idx]);
-                    assertFalse(tmpStage[idx].isShowing());
-                    tmpStage[idx].showAndWait();
-                    stageShowReturned[idx].set(true);
-                    assertFalse(tmpStage[idx].isShowing());
-                    assertTrue(hideEventReached[idx].get());
-                    for (int j = 0; j < idx; j++) {
-                        assertFalse(stageShowReturned[j].get());
-                        assertFalse(hideEventReached[j].get());
-                    }
-                    for (int j = idx+1; j < N; j++) {
-                        assertTrue(stageShowReturned[j].get());
-                        assertTrue(hideEventReached[j].get());
-                    }
+            rShow[idx] = () -> {
+                tmpStage[idx] = new TestStage(modality);
+                stages.add(tmpStage[idx]);
+                assertFalse(tmpStage[idx].isShowing());
+                tmpStage[idx].showAndWait();
+                stageShowReturned[idx].set(true);
+                assertFalse(tmpStage[idx].isShowing());
+                assertTrue(hideEventReached[idx].get());
+                for (int j = 0; j < idx; j++) {
+                    assertFalse(stageShowReturned[j].get());
+                    assertFalse(hideEventReached[j].get());
+                }
+                for (int j = idx+1; j < N; j++) {
+                    assertTrue(stageShowReturned[j].get());
+                    assertTrue(hideEventReached[j].get());
                 }
             };
 
-            rHide[idx] = new Runnable() {
-                @Override public void run() {
-                    hideEventReached[idx].set(true);
-                    assertFalse(stageShowReturned[idx].get());
-                    for (int j = 0; j < idx; j++) {
-                        assertFalse(stageShowReturned[j].get());
-                        assertFalse(hideEventReached[j].get());
-                    }
-                    for (int j = idx+1; j < N; j++) {
-                        assertTrue(stageShowReturned[j].get());
-                        assertTrue(hideEventReached[j].get());
-                    }
-                    assertNotNull(tmpStage[idx]);
-                    tmpStage[idx].hide();
-                    Util.sleep(1);
-                    assertFalse(stageShowReturned[idx].get());
+            rHide[idx] = () -> {
+                hideEventReached[idx].set(true);
+                assertFalse(stageShowReturned[idx].get());
+                for (int j = 0; j < idx; j++) {
+                    assertFalse(stageShowReturned[j].get());
+                    assertFalse(hideEventReached[j].get());
                 }
+                for (int j = idx+1; j < N; j++) {
+                    assertTrue(stageShowReturned[j].get());
+                    assertTrue(hideEventReached[j].get());
+                }
+                assertNotNull(tmpStage[idx]);
+                tmpStage[idx].hide();
+                Util.sleep(1);
+                assertFalse(stageShowReturned[idx].get());
             };
         }
 
@@ -649,43 +593,39 @@
             final int idx = i;
             stageShowReturned[idx] = new AtomicBoolean(false);
             hideEventReached[idx] = new AtomicBoolean(false);
-            rShow[idx] = new Runnable() {
-                @Override public void run() {
-                    tmpStage[idx] = new TestStage(modality);
-                    stages.add(tmpStage[idx]);
-                    assertFalse(tmpStage[idx].isShowing());
-                    tmpStage[idx].showAndWait();
-                    stageShowReturned[idx].set(true);
-                    assertFalse(tmpStage[idx].isShowing());
-                    assertTrue(hideEventReached[idx].get());
-                    for (int j = 0; j < idx; j++) {
-                        assertFalse(stageShowReturned[j].get());
-                        assertTrue(hideEventReached[j].get());
-                    }
-                    for (int j = idx+1; j < N; j++) {
-                        assertTrue(stageShowReturned[j].get());
-                        assertTrue(hideEventReached[j].get());
-                    }
+            rShow[idx] = () -> {
+                tmpStage[idx] = new TestStage(modality);
+                stages.add(tmpStage[idx]);
+                assertFalse(tmpStage[idx].isShowing());
+                tmpStage[idx].showAndWait();
+                stageShowReturned[idx].set(true);
+                assertFalse(tmpStage[idx].isShowing());
+                assertTrue(hideEventReached[idx].get());
+                for (int j = 0; j < idx; j++) {
+                    assertFalse(stageShowReturned[j].get());
+                    assertTrue(hideEventReached[j].get());
+                }
+                for (int j = idx+1; j < N; j++) {
+                    assertTrue(stageShowReturned[j].get());
+                    assertTrue(hideEventReached[j].get());
                 }
             };
 
-            rHide[idx] = new Runnable() {
-                @Override public void run() {
-                    hideEventReached[idx].set(true);
-                    assertFalse(stageShowReturned[idx].get());
-                    for (int j = 0; j < idx; j++) {
-                        assertFalse(stageShowReturned[j].get());
-                        assertTrue(hideEventReached[j].get());
-                    }
-                    for (int j = idx+1; j < N; j++) {
-                        assertFalse(stageShowReturned[j].get());
-                        assertFalse(hideEventReached[j].get());
-                    }
-                    assertNotNull(tmpStage[idx]);
-                    tmpStage[idx].hide();
-                    Util.sleep(1);
-                    assertFalse(stageShowReturned[idx].get());
+            rHide[idx] = () -> {
+                hideEventReached[idx].set(true);
+                assertFalse(stageShowReturned[idx].get());
+                for (int j = 0; j < idx; j++) {
+                    assertFalse(stageShowReturned[j].get());
+                    assertTrue(hideEventReached[j].get());
                 }
+                for (int j = idx+1; j < N; j++) {
+                    assertFalse(stageShowReturned[j].get());
+                    assertFalse(hideEventReached[j].get());
+                }
+                assertNotNull(tmpStage[idx]);
+                tmpStage[idx].hide();
+                Util.sleep(1);
+                assertFalse(stageShowReturned[idx].get());
             };
         }
 
--- a/tests/system/src/test/java/launchertest/TestApp.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/launchertest/TestApp.java	Thu Jun 12 09:52:47 2014 -0700
@@ -58,11 +58,7 @@
             System.exit(ERROR_START_BEFORE_INIT);
         }
         startCalled = true;
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                Platform.exit();
-            }
-        });
+        Platform.runLater(Platform::exit);
     }
 
     @Override public void stop() {
@@ -87,10 +83,8 @@
 
     static {
         try {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // do nothing
-                }
+            Platform.runLater(() -> {
+                // do nothing
             });
         } catch (IllegalStateException ex) {
             ex.printStackTrace();
--- a/tests/system/src/test/java/launchertest/TestAppNoMain.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/launchertest/TestAppNoMain.java	Thu Jun 12 09:52:47 2014 -0700
@@ -40,11 +40,7 @@
 
     @Override public void start(Stage stage) throws Exception {
         startCalled = true;
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                Platform.exit();
-            }
-        });
+        Platform.runLater(Platform::exit);
     }
 
     @Override public void stop() {
@@ -56,10 +52,8 @@
 
     static {
         try {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // do nothing
-                }
+            Platform.runLater(() -> {
+                // do nothing
             });
         } catch (IllegalStateException ex) {
             ex.printStackTrace();
--- a/tests/system/src/test/java/launchertest/TestAppNoMainThreadCheck.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/launchertest/TestAppNoMainThreadCheck.java	Thu Jun 12 09:52:47 2014 -0700
@@ -53,11 +53,7 @@
             System.exit(ERROR_START_WRONG_THREAD);
         }
 
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                Platform.exit();
-            }
-        });
+        Platform.runLater(Platform::exit);
     }
 
     @Override public void stop() {
@@ -75,10 +71,8 @@
         }
 
         try {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // do nothing
-                }
+            Platform.runLater(() -> {
+                // do nothing
             });
         } catch (IllegalStateException ex) {
             ex.printStackTrace();
--- a/tests/system/src/test/java/launchertest/TestAppThreadCheck.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/launchertest/TestAppThreadCheck.java	Thu Jun 12 09:52:47 2014 -0700
@@ -53,11 +53,7 @@
             System.exit(ERROR_START_WRONG_THREAD);
         }
 
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                Platform.exit();
-            }
-        });
+        Platform.runLater(Platform::exit);
     }
 
     @Override public void stop() {
@@ -82,10 +78,8 @@
         }
 
         try {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // do nothing
-                }
+            Platform.runLater(() -> {
+                // do nothing
             });
         } catch (IllegalStateException ex) {
             ex.printStackTrace();
--- a/tests/system/src/test/java/launchertest/TestNotApplication.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/launchertest/TestNotApplication.java	Thu Jun 12 09:52:47 2014 -0700
@@ -37,10 +37,8 @@
 
     public static void main(String[] args) {
         try {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // do nothing
-                }
+            Platform.runLater(() -> {
+                // do nothing
             });
             System.exit(ERROR_TOOLKIT_IS_RUNNING);
         } catch (IllegalStateException ex) {
--- a/tests/system/src/test/java/launchertest/TestNotApplicationThreadCheck.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/launchertest/TestNotApplicationThreadCheck.java	Thu Jun 12 09:52:47 2014 -0700
@@ -37,10 +37,8 @@
 
     public static void main(String[] args) {
         try {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // do nothing
-                }
+            Platform.runLater(() -> {
+                // do nothing
             });
             System.exit(ERROR_TOOLKIT_IS_RUNNING);
         } catch (IllegalStateException ex) {
--- a/tests/system/src/test/java/launchertest/TestPreloader.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/launchertest/TestPreloader.java	Thu Jun 12 09:52:47 2014 -0700
@@ -54,10 +54,8 @@
             System.exit(ERROR_PRELOADER_START_WRONG_THREAD);
         }
 
-        Platform.runLater(new Runnable() {
-            @Override public void run() {
-                // No-op
-            }
+        Platform.runLater(() -> {
+            // No-op
         });
     }
 
@@ -74,10 +72,8 @@
         }
 
         try {
-            Platform.runLater(new Runnable() {
-                @Override public void run() {
-                    // do nothing
-                }
+            Platform.runLater(() -> {
+                // do nothing
             });
         } catch (IllegalStateException ex) {
             ex.printStackTrace();
--- a/tests/system/src/test/java/painttest/ImagePaintTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/painttest/ImagePaintTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -75,44 +75,40 @@
         final Color COLOR1 = Color.RED;
         final Color COLOR2 = Color.GREEN;
 
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Image image1;
-                Image image2;
-                image1 = createImage(IMAGE_WIDTH, IMAGE_HEIGHT, COLOR1, COLOR2);
-                if (useSeparateImage) {
-                    image2 = createImage(IMAGE_WIDTH, IMAGE_HEIGHT, COLOR1, COLOR2);
-                } else {
-                    image2 = image1;
-                }
-                Rectangle rect1 = createRect(image1, 0, 0, 0, 0);
-                Rectangle rect2 = createRect(image2, IMAGE_WIDTH / 2, 0, 0, IMAGE_HEIGHT);
-                Group root = new Group(rect1, rect2);
-                testScene = new Scene(root, WIDTH, HEIGHT);
-                testScene.setFill(Color.WHITE);
+        runAndWait(() -> {
+            Image image1;
+            Image image2;
+            image1 = createImage(IMAGE_WIDTH, IMAGE_HEIGHT, COLOR1, COLOR2);
+            if (useSeparateImage) {
+                image2 = createImage(IMAGE_WIDTH, IMAGE_HEIGHT, COLOR1, COLOR2);
+            } else {
+                image2 = image1;
+            }
+            Rectangle rect1 = createRect(image1, 0, 0, 0, 0);
+            Rectangle rect2 = createRect(image2, IMAGE_WIDTH / 2, 0, 0, IMAGE_HEIGHT);
+            Group root = new Group(rect1, rect2);
+            testScene = new Scene(root, WIDTH, HEIGHT);
+            testScene.setFill(Color.WHITE);
 
-                testStage = getStage();
-                testStage.setScene(testScene);
-                testStage.show();
-            }
+            testStage = getStage();
+            testStage.setScene(testScene);
+            testStage.show();
         });
         waitFirstFrame();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                Color color;
+        runAndWait(() -> {
+            Color color;
 
-                // Test first rectangle, anchor at (0,0)
-                color = getColor(testScene, 1, 1);
-                assertColorEquals(COLOR1, color, TOLERANCE);
-                color = getColor(testScene, 1 + IMAGE_WIDTH / 2, 1);
-                assertColorEquals(COLOR2, color, TOLERANCE);
+            // Test first rectangle, anchor at (0,0)
+            color = getColor(testScene, 1, 1);
+            assertColorEquals(COLOR1, color, TOLERANCE);
+            color = getColor(testScene, 1 + IMAGE_WIDTH / 2, 1);
+            assertColorEquals(COLOR2, color, TOLERANCE);
 
-                // Test second rectangle, anchor at (w/2,0)
-                color = getColor(testScene, 1, 1 + IMAGE_HEIGHT);
-                assertColorEquals(COLOR2, color, TOLERANCE);
-                color = getColor(testScene, 1 + IMAGE_WIDTH / 2, 1 + IMAGE_HEIGHT);
-                assertColorEquals(COLOR1, color, TOLERANCE);
-            }
+            // Test second rectangle, anchor at (w/2,0)
+            color = getColor(testScene, 1, 1 + IMAGE_HEIGHT);
+            assertColorEquals(COLOR2, color, TOLERANCE);
+            color = getColor(testScene, 1 + IMAGE_WIDTH / 2, 1 + IMAGE_HEIGHT);
+            assertColorEquals(COLOR1, color, TOLERANCE);
         });
     }
 
--- a/tests/system/src/test/java/sandbox/app/FXApp.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/sandbox/app/FXApp.java	Thu Jun 12 09:52:47 2014 -0700
@@ -86,9 +86,7 @@
             stage.show();
 
             // Hide the stage after the specified amount of time
-            KeyFrame kf = new KeyFrame(Duration.millis(SHOWTIME), e -> {
-                stage.hide();
-            });
+            KeyFrame kf = new KeyFrame(Duration.millis(SHOWTIME), e -> stage.hide());
             Timeline timeline = new Timeline(kf);
             timeline.play();
         } catch (SecurityException ex) {
--- a/tests/system/src/test/java/test3d/NearAndFarClipTest.java	Tue Jun 10 21:34:57 2014 -0700
+++ b/tests/system/src/test/java/test3d/NearAndFarClipTest.java	Thu Jun 12 09:52:47 2014 -0700
@@ -55,97 +55,92 @@
         final double NEAR = 0.1;
         final double FAR = 10.0;
 
-        runAndWait(new Runnable() {
-            @Override
-            public void run() {
-                testStage = getStage();
-                testStage.setTitle("Near and Far Clip Test");
+        runAndWait(() -> {
+            testStage = getStage();
+            testStage.setTitle("Near and Far Clip Test");
 
-                final double tanOfHalfFOV = Math.tan(Math.toRadians(FOV) / 2.0);
-                final double halfHeight = HEIGHT / 2;
-                final double focalLength = halfHeight / tanOfHalfFOV;
-                final double eyePositionZ = -1.0 * focalLength;
-                final double nearClipDistance = focalLength * NEAR + eyePositionZ;
-                final double farClipDistance =  focalLength * FAR + eyePositionZ;
-                final double nearClipDistanceOffset = Math.abs(nearClipDistance * OFFSET_PERCENT);
-                final double farClipDistanceOffset = Math.abs(farClipDistance * OFFSET_PERCENT);
-        
+            final double tanOfHalfFOV = Math.tan(Math.toRadians(FOV) / 2.0);
+            final double halfHeight = HEIGHT / 2;
+            final double focalLength = halfHeight / tanOfHalfFOV;
+            final double eyePositionZ = -1.0 * focalLength;
+            final double nearClipDistance = focalLength * NEAR + eyePositionZ;
+            final double farClipDistance =  focalLength * FAR + eyePositionZ;
+            final double nearClipDistanceOffset = Math.abs(nearClipDistance * OFFSET_PERCENT);
+            final double farClipDistanceOffset = Math.abs(farClipDistance * OFFSET_PERCENT);
+      
 //                System.out.println("In scene coordinate: focalLength = " + focalLength
 //                        + ", nearClipDistance = " + nearClipDistance
 //                        + ", nearClipDistanceOffset = " + nearClipDistanceOffset
 //                        + ", farClipDistance = " + farClipDistance
 //                        + ", farClipDistanceOffset = " + farClipDistanceOffset);
 
-                Rectangle insideRect = new Rectangle(220, 220, Color.GREEN);
-                insideRect.setLayoutX(140);
-                insideRect.setLayoutY(140);
+            Rectangle insideRect = new Rectangle(220, 220, Color.GREEN);
+            insideRect.setLayoutX(140);
+            insideRect.setLayoutY(140);
 
-                Rectangle insideNearClip = new Rectangle(16, 16, Color.BLUE);
-                insideNearClip.setLayoutX(242);
-                insideNearClip.setLayoutY(242);
-                insideNearClip.setTranslateZ(nearClipDistance + nearClipDistanceOffset);
+            Rectangle insideNearClip = new Rectangle(16, 16, Color.BLUE);
+            insideNearClip.setLayoutX(242);
+            insideNearClip.setLayoutY(242);
+            insideNearClip.setTranslateZ(nearClipDistance + nearClipDistanceOffset);
 
-                Rectangle outsideNearClip = new Rectangle(16, 16, Color.YELLOW);
-                outsideNearClip.setLayoutX(242);
-                outsideNearClip.setLayoutY(242);
-                outsideNearClip.setTranslateZ(nearClipDistance - nearClipDistanceOffset);
+            Rectangle outsideNearClip = new Rectangle(16, 16, Color.YELLOW);
+            outsideNearClip.setLayoutX(242);
+            outsideNearClip.setLayoutY(242);
+            outsideNearClip.setTranslateZ(nearClipDistance - nearClipDistanceOffset);
 
-                Rectangle insideFarClip = new Rectangle(3000, 3000, Color.RED);
-                insideFarClip.setTranslateX(-1250);
-                insideFarClip.setTranslateY(-1250);
-                insideFarClip.setTranslateZ(farClipDistance - farClipDistanceOffset);
+            Rectangle insideFarClip = new Rectangle(3000, 3000, Color.RED);
+            insideFarClip.setTranslateX(-1250);
+            insideFarClip.setTranslateY(-1250);
+            insideFarClip.setTranslateZ(farClipDistance - farClipDistanceOffset);
 
-                Rectangle outsideFarClip = new Rectangle(4000, 4000, Color.CYAN);
-                outsideFarClip.setTranslateX(-1750);
-                outsideFarClip.setTranslateY(-1750);
-                outsideFarClip.setTranslateZ(farClipDistance + farClipDistanceOffset);
+            Rectangle outsideFarClip = new Rectangle(4000, 4000, Color.CYAN);
+            outsideFarClip.setTranslateX(-1750);
+            outsideFarClip.setTranslateY(-1750);
+            outsideFarClip.setTranslateZ(farClipDistance + farClipDistanceOffset);
 
-                Group root = new Group();
+            Group root = new Group();
 
-                // Render in painter order (far to near)
-                root.getChildren().addAll(outsideFarClip, insideFarClip, insideRect, insideNearClip, outsideNearClip);
+            // Render in painter order (far to near)
+            root.getChildren().addAll(outsideFarClip, insideFarClip, insideRect, insideNearClip, outsideNearClip);
 
-                // Intentionally set depth buffer to false to reduce test complexity
-                testScene = new Scene(root, WIDTH, HEIGHT, false);
+            // Intentionally set depth buffer to false to reduce test complexity
+            testScene = new Scene(root, WIDTH, HEIGHT, false);
 
-                PerspectiveCamera camera = new PerspectiveCamera();
-                camera.setFieldOfView(FOV);
-                camera.setNearClip(NEAR);
-                camera.setFarClip(FAR);
-                testScene.setCamera(camera);
+            PerspectiveCamera camera = new PerspectiveCamera();
+            camera.setFieldOfView(FOV);
+            camera.setNearClip(NEAR);
+            camera.setFarClip(FAR);
+            testScene.setCamera(camera);
 
-                testStage.setScene(testScene);
-                testStage.show();
-            }
+            testStage.setScene(testScene);
+            testStage.show();
         });
         waitFirstFrame();
-        runAndWait(new Runnable() {
-            @Override public void run() {
-                
-                if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
-                    System.out.println("*************************************************************");
-                    System.