changeset 4207:8fb0ea0159d9

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx/rt
author jgodinez
date Tue, 09 Jul 2013 09:36:39 -0700
parents 230a187a7746 56e31708e758
children fc5da25527e5 0fb3ba0cc9ee
files apps/experiments/3DViewer/src/main/java/META-INF/MANIFEST.MF apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/main.fxml apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/navigation.fxml apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/settings.fxml apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/viewer.css idea/javafx.iml modules/graphics/src/main/android/com/oracle/dalvik/AppDataInstaller.java modules/graphics/src/main/android/com/oracle/dalvik/FXActivity.java modules/graphics/src/main/android/com/oracle/dalvik/InternalWebView.java modules/graphics/src/main/android/com/oracle/dalvik/MainActivity.java modules/graphics/src/main/android/com/oracle/dalvik/NativePipeReader.java modules/graphics/src/main/android/com/oracle/dalvik/VMLauncher.java modules/graphics/src/main/android/com/oracle/dalvik/net/DalvikProxySelector.java modules/graphics/src/main/native-android/DalvikProxySelector.c modules/graphics/src/main/native-android/DalvikProxySelector.h modules/graphics/src/main/native-android/NativePipeReader.c modules/graphics/src/main/native-android/VMLauncher.c modules/web/src/test/java/html/RT30835.html modules/web/src/test/java/html/RT9969.html modules/web/src/test/java/html/dom.html modules/web/src/test/java/html/guimark2-vector.html modules/web/src/test/java/html/h1.html modules/web/src/test/java/html/h2.html modules/web/src/test/java/html/h3.html modules/web/src/test/java/html/h4.html modules/web/src/test/java/html/ipsum.html
diffstat 168 files changed, 7318 insertions(+), 4172 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sun Jul 07 19:34:28 2013 -0700
+++ b/.hgignore	Tue Jul 09 09:36:39 2013 -0700
@@ -6,9 +6,9 @@
 \.rej$
 \.conflict\~$
 ^\.ant-targets.*$
+\.idea/tasks.xml$
 \.idea/workspace.xml$
 ^\.gradle/
-^\.libs/
 ^buildSrc/\.gradle/
 ^idea/out/
 build/
@@ -24,6 +24,6 @@
 */Release/*
 */Debug/*
 *~
-webview/native/LayoutTests
-webview/native/WebKitBuild
-webview/native/WebKitLibraries/import
+modules/web/src/main/native/LayoutTests
+modules/web/src/main/native/WebKitBuild
+modules/web/src/main/native/WebKitLibraries/import
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/test/java"/>
+	<classpathentry kind="src" path="src/main/resources"/>
+	<classpathentry kind="src" path="src/test/resources"/>
+	<classpathentry kind="lib" path="build/libs/3DViewer.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/rt">
+	<attributes>
+		<attribute name="optional" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/.name	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,1 @@
+3DViewer
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/compiler.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <option name="DEFAULT_COMPILER" value="Javac" />
+    <resourceExtensions />
+    <wildcardResourcePatterns>
+      <entry name="!?*.java" />
+      <entry name="!?*.form" />
+      <entry name="!?*.class" />
+      <entry name="!?*.groovy" />
+      <entry name="!?*.scala" />
+      <entry name="!?*.flex" />
+      <entry name="!?*.kt" />
+      <entry name="!?*.clj" />
+    </wildcardResourcePatterns>
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="false">
+        <processorPath useClasspath="true" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/copyright/profiles_settings.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,5 @@
+<component name="CopyrightManager">
+  <settings default="">
+    <module2copyright />
+  </settings>
+</component>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/encodings.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/misc.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/modules.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/3DViewer.iml" filepath="$PROJECT_DIR$/3DViewer.iml" />
+    </modules>
+  </component>
+</project>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/runConfigurations/3DViewer.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,18 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="3DViewer" type="Application" factoryName="Application">
+    <option name="MAIN_CLASS_NAME" value="com.javafx.experiments.jfx3dviewer.Jfx3dViewerApp" />
+    <option name="VM_PARAMETERS" value="-Dprism.verbose=true" />
+    <option name="PROGRAM_PARAMETERS" value="" />
+    <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+    <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+    <option name="ALTERNATIVE_JRE_PATH" value="" />
+    <option name="ENABLE_SWING_INSPECTOR" value="false" />
+    <option name="ENV_VARIABLES" />
+    <option name="PASS_PARENT_ENVS" value="true" />
+    <module name="3DViewer" />
+    <envs />
+    <RunnerSettings RunnerId="Run" />
+    <ConfigurationWrapper RunnerId="Run" />
+    <method />
+  </configuration>
+</component>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/scopes/scope_settings.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.idea/vcs.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="hg4idea" />
+  </component>
+</project>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/.project	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>3DViewer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/3DViewer.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,19 @@
+<?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$/build/classes" />
+    <output-test url="file://$MODULE_DIR$/build/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/.idea" />
+      <excludeFolder url="file://$MODULE_DIR$/nbproject" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/build.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="3DViewer" default="default" basedir=".">
+    <description>Builds, tests, and runs the project 3DViewer.</description>
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)
+      run:                      execution of project 
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="3DViewer-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on 
+    the compile target as the regular run target does. Again, for a list of available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+</project>
--- a/apps/experiments/3DViewer/src/main/java/META-INF/MANIFEST.MF	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: com.javafx.experiments.jfx3dviewer.Jfx3dViewerApp
-
--- a/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/importers/maya/Loader.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/importers/maya/Loader.java	Tue Jul 09 09:36:39 2013 -0700
@@ -47,11 +47,13 @@
 import com.javafx.experiments.shape3d.PolygonMeshView;
 import com.javafx.experiments.shape3d.SkinningMesh;
 import com.sun.javafx.geom.Vec3f;
+import java.util.HashSet;
+import java.util.Set;
 import javafx.animation.AnimationTimer;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
+import javafx.scene.Parent;
 import javafx.scene.Scene;
-import javafx.scene.transform.Transform;
 
 /** Loader */
 class Loader {
@@ -216,11 +218,18 @@
         MArray ma = (MArray) n.getAttr("ma");
 
         List<Joint> jointNodes = new ArrayList<Joint>();
+        Set<Parent> jointForest = new HashSet<Parent>(); // root's children that have joints in their trees
         for (int i = 0; i < ma.getSize(); i++) {
             // hack... ?
             MNode c = n.getIncomingConnectionToType("ma[" + i + "]", "joint");
             Joint jn = (Joint) resolveNode(c);
             jointNodes.add(jn);
+            
+            Parent rootChild = jn; // root's child, which is an ancestor of joint jn
+            while (rootChild.getParent() != null) {
+                rootChild = rootChild.getParent();
+            }
+            jointForest.add(rootChild);
         }
         
         MNode outputMeshMNode = resolveOutputMesh(n);
@@ -231,11 +240,12 @@
         // We must be able to find the original converter in the meshConverters map
         MNode origOrigMesh = resolveOrigInputMesh(n);
         //               println("ORIG ORIG={origOrigMesh}");
-
+        
         // TODO: What is with this? origMesh
         resolveNode(origOrigMesh).setVisible(false);
 
         MArray bindPreMatrixArray = (MArray) n.getAttr("pm");
+        Affine bindGlobalMatrix = convertMatrix((MFloatArray) n.getAttr("gm"));
 
         Affine[] bindPreMatrix = new Affine[bindPreMatrixArray.getSize()];
         for (int i = 0; i < bindPreMatrixArray.getSize(); i++) {
@@ -243,11 +253,11 @@
         }
 
         MArray mayaWeights = (MArray) n.getAttr("wl");
-        float[][] weights = new float [mayaWeights.getSize()][jointNodes.size()];
+        float[][] weights = new float [jointNodes.size()][mayaWeights.getSize()];
         for (int i=0; i<mayaWeights.getSize(); i++) {
             MFloatArray curWeights = (MFloatArray) mayaWeights.getData(i).getData("w");
             for (int j = 0; j < jointNodes.size(); j++) {
-                weights[i][j] = j < curWeights.getSize() ? curWeights.get(j) : 0;
+                weights[j][i] = j < curWeights.getSize() ? curWeights.get(j) : 0;
             }
         }
         
@@ -259,8 +269,7 @@
             PolygonMeshView targetMayaMeshView = (PolygonMeshView) targetMayaMeshNode;
             
             PolygonMesh sourceMesh = (PolygonMesh) sourceMayaMeshView.getMesh();
-            Transform meshTransform = targetMayaMeshView.getLocalToSceneTransform();
-            SkinningMesh targetMesh = new SkinningMesh(sourceMesh, meshTransform, weights, bindPreMatrix, jointNodes);
+            SkinningMesh targetMesh = new SkinningMesh(sourceMesh, weights, bindPreMatrix, bindGlobalMatrix, jointNodes, new ArrayList(jointForest));
             targetMayaMeshView.setMesh(targetMesh);
 
             final SkinningMeshTimer skinningMeshTimer = new SkinningMeshTimer(targetMesh);
@@ -462,10 +471,8 @@
             mv.setMesh((PolygonMesh) mesh);
 //            mv.setCullFace(CullFace.NONE); //TODO
             loaded.put(n, mv);
-            if (((PolygonMesh)mesh).getPoints().size() > 0) {
-                if (node != null) {
-                    ((Group) node).getChildren().add(mv);
-                }
+            if (node != null) {
+                ((Group) node).getChildren().add(mv);
             }
         } else {
             MeshView mv = new MeshView();
@@ -478,10 +485,8 @@
             mv.setMesh((TriangleMesh) mesh);
 
             loaded.put(n, mv);
-            if (((TriangleMesh)mesh).getPoints().size() > 0) {
-                if (node != null) {
-                    ((Group) node).getChildren().add(mv);
-                }
+            if (node != null) {
+                ((Group) node).getChildren().add(mv);
             }
         }
     }
--- a/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/MainController.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/MainController.java	Tue Jul 09 09:36:39 2013 -0700
@@ -204,16 +204,20 @@
         loadedPath = file;
         try {
             doLoad(file.toURI().toURL().toString());
-        } catch (MalformedURLException ex) {
+        } catch (Exception ex) {
             Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
         }
     }
 
     private void load(String fileUrl) {
         try {
-            loadedPath = new File(new URL(fileUrl).toURI()).getAbsoluteFile();
+            try {
+                loadedPath = new File(new URL(fileUrl).toURI()).getAbsoluteFile();
+            } catch (IllegalArgumentException | MalformedURLException | URISyntaxException ignored) {
+                loadedPath = null;
+            }
             doLoad(fileUrl);
-        } catch (MalformedURLException | URISyntaxException ex) {
+        } catch (Exception ex) {
             Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
         }
     }
--- a/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/main.fxml	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Copyright (c) 2010, 2013 Oracle and/or its affiliates.
-All rights reserved. Use is subject to license terms.
-
-This file is available and licensed under the following license:
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
- - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in
-   the documentation and/or other materials provided with the distribution.
- - Neither the name of Oracle Corporation nor the names of its
-   contributors may be used to endorse or promote products derived
-   from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-<?import java.lang.*?>
-<?import java.net.*?>
-<?import java.util.*?>
-<?import javafx.geometry.*?>
-<?import javafx.scene.control.*?>
-<?import javafx.scene.control.MenuBar?>
-<?import javafx.scene.control.ToolBar?>
-<?import javafx.scene.layout.*?>
-<?import javafx.scene.paint.*?>
-<?import com.javafx.experiments.jfx3dviewer.*?>
-
-<VBox id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.javafx.experiments.jfx3dviewer.MainController">
-  <ToolBar>
-    <items>
-      <SplitMenuButton fx:id="openMenuBtn" mnemonicParsing="false" onAction="#open" text="Open...">
-        <items>
-          <CheckMenuItem mnemonicParsing="false" text="Load as Polygons" fx:id="loadAsPolygonsCheckBox" />
-          <CheckMenuItem mnemonicParsing="false" text="Optimize" fx:id="optimizeCheckBox" />
-        </items>
-      </SplitMenuButton>
-      <Button mnemonicParsing="false" onAction="#export" text="Export..." />
-      <!--HBox.hgrow="ALWAYS"-->
-      <Pane maxWidth="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS"/>
-      <TimelineDisplay fx:id="timelineDisplay" />
-      <HBox id="playControls" prefHeight="-1.0" prefWidth="-1.0">
-        <children>
-          <Button fx:id="startBtn" mnemonicParsing="false" styleClass="left-pill" text="|&lt;">
-            <graphic>
-              <Pane prefHeight="16.0" prefWidth="16.0" />
-            </graphic>
-          </Button>
-          <Button fx:id="rwBtn" mnemonicParsing="false" styleClass="center-pill" text="&lt;&lt;">
-            <graphic>
-              <Pane prefHeight="16.0" prefWidth="16.0" />
-            </graphic>
-          </Button>
-          <ToggleButton fx:id="playBtn" mnemonicParsing="false" styleClass="center-pill" text="&gt;">
-            <graphic>
-              <Pane prefHeight="16.0" prefWidth="16.0" />
-            </graphic>
-          </ToggleButton>
-          <Button fx:id="ffBtn" mnemonicParsing="false" styleClass="center-pill" text="&gt;&gt;">
-            <graphic>
-              <Pane prefHeight="16.0" prefWidth="16.0" />
-            </graphic>
-          </Button>
-          <Button fx:id="endBtn" mnemonicParsing="false" styleClass="center-pill" text="&gt;|">
-            <graphic>
-              <Pane prefHeight="16.0" prefWidth="16.0" />
-            </graphic>
-          </Button>
-          <ToggleButton fx:id="loopBtn" mnemonicParsing="false" selected="true" styleClass="right-pill" text="R">
-            <graphic>
-              <Pane prefHeight="16.0" prefWidth="16.0" />
-            </graphic>
-          </ToggleButton>
-        </children>
-        <padding>
-          <Insets right="5.0" />
-        </padding>
-      </HBox>
-      <ToggleButton fx:id="settingsBtn" mnemonicParsing="false" onAction="#toggleSettings" text="Settings" />
-    </items>
-  </ToolBar>
-  <SplitPane fx:id="splitPane" dividerPositions="" focusTraversable="true" prefHeight="160.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
-  <ToolBar id="statusBar" styleClass="bottom">
-    <items>
-      <Label fx:id="status" text="Label" />
-    </items>
-  </ToolBar>
-  <stylesheets>
-    <URL value="@viewer.css" />
-  </stylesheets>
-</VBox>
--- a/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/navigation.fxml	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Copyright (c) 2010, 2013 Oracle and/or its affiliates.
-All rights reserved. Use is subject to license terms.
-
-This file is available and licensed under the following license:
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
- - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in
-   the documentation and/or other materials provided with the distribution.
- - Neither the name of Oracle Corporation nor the names of its
-   contributors may be used to endorse or promote products derived
-   from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-<?import com.javafx.experiments.jfx3dviewer.*?>
-<?import com.javafx.experiments.jfx3dviewer.FourWayNavControl?>
-<?import java.lang.*?>
-<?import javafx.geometry.*?>
-<?import javafx.geometry.Insets?>
-<?import javafx.scene.control.*?>
-<?import javafx.scene.control.ScrollBar?>
-<?import javafx.scene.layout.*?>
-<?import javafx.scene.layout.VBox?>
-<?scenebuilder-classpath-element ../../../../../../../build/classes?>
-
-<VBox id="controller" alignment="CENTER" spacing="10.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.javafx.experiments.jfx3dviewer.NavigationController">
-  <children>
-    <FourWayNavControl fx:id="eyeNav" />
-    <FourWayNavControl fx:id="camNav" />
-    <ScrollBar fx:id="zoomBar" orientation="VERTICAL" rotate="180.0" />
-  </children>
-  <padding>
-    <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
-  </padding>
-</VBox>
--- a/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/settings.fxml	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Copyright (c) 2010, 2013 Oracle and/or its affiliates.
-All rights reserved. Use is subject to license terms.
-
-This file is available and licensed under the following license:
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
- - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in
-   the documentation and/or other materials provided with the distribution.
- - Neither the name of Oracle Corporation nor the names of its
-   contributors may be used to endorse or promote products derived
-   from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-<?import java.lang.*?>
-<?import java.net.*?>
-<?import java.util.*?>
-<?import javafx.geometry.*?>
-<?import javafx.scene.control.*?>
-<?import javafx.scene.control.MenuBar?>
-<?import javafx.scene.control.ToolBar?>
-<?import javafx.scene.layout.*?>
-<?import javafx.scene.paint.*?>
-<?import com.javafx.experiments.shape3d.*?>
-<?scenebuilder-stylesheet viewer.css?>
-<!--suppress JavaFxUnresolvedStyleClassReference -->
-
-<Accordion fx:id="settings" minWidth="0.0" prefHeight="798.0" prefWidth="279.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.javafx.experiments.jfx3dviewer.SettingsController">
-  <expandedPane>
-    <TitledPane fx:id="x5" animated="false" expanded="true" text="Hierarchy">
-      <content>
-        <TreeTableView fx:id="hierarachyTreeTable" editable="true" prefHeight="200.0" prefWidth="200.0">
-          <columns>
-            <TreeTableColumn fx:id="nodeColumn" editable="false" prefWidth="75.0" sortable="false" text="Node" />
-            <TreeTableColumn fx:id="idColumn" editable="false" prefWidth="75.0" text="Id" />
-            <TreeTableColumn fx:id="visibilityColumn" editable="true" text="Visibility" />
-            <TreeTableColumn fx:id="widthColumn" editable="false" text="W" />
-            <TreeTableColumn fx:id="heightColumn" editable="false" text="H" />
-            <TreeTableColumn fx:id="depthColumn" editable="false" text="D" />
-          </columns>
-        </TreeTableView>
-      </content>
-    </TitledPane>
-  </expandedPane>
-  <panes>
-    <TitledPane fx:id="x4" animated="false" expanded="false" text="Options">
-      <content>
-        <GridPane hgap="5.0" styleClass="settings" vgap="5.0">
-          <children>
-            <Label text="Show Axis:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
-            <Label text="Y Up:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
-            <CheckBox fx:id="showAxisCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="0" />
-            <CheckBox fx:id="yUpCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
-            <Label text="Scale to Fit" GridPane.columnIndex="0" GridPane.rowIndex="2" />
-            <CheckBox id="yUpCheckBox" fx:id="scaleToFitCheckBox" mnemonicParsing="false" selected="true" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
-            <Label text="Background Color" GridPane.columnIndex="0" GridPane.rowIndex="3" />
-            <ColorPicker fx:id="backgroundColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="3" />
-            <Label text="Wireframe" GridPane.columnIndex="0" GridPane.rowIndex="4" />
-            <CheckBox fx:id="wireFrameCheckbox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="4" />
-            <Label text="Subdivision level" GridPane.columnIndex="0" GridPane.rowIndex="5" />
-            <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="5">
-              <children>
-                <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="None" userData="0">
-                  <toggleGroup>
-                    <ToggleGroup fx:id="subdivisionLevelGroup" />
-                  </toggleGroup>
-                </ToggleButton>
-                <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="1" toggleGroup="$subdivisionLevelGroup" userData="1" />
-                <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="2" toggleGroup="$subdivisionLevelGroup" userData="2" />
-                <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="3" toggleGroup="$subdivisionLevelGroup" userData="3" />
-              </children>
-            </HBox>
-            <Label text="Creases (Boundary Rules)" GridPane.columnIndex="0" GridPane.rowIndex="6" />
-            <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="6">
-              <children>
-                <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="Edges">
-                  <toggleGroup>
-                    <ToggleGroup fx:id="subdivisionBoundaryGroup" />
-                  </toggleGroup>
-                  <userData>
-                    <SubdivisionMesh.BoundaryMode fx:value="CREASE_EDGES"/>
-                  </userData>
-                  <tooltip>
-                    <Tooltip text="Only edges at the boundary are treated as creases" />
-                  </tooltip>
-                </ToggleButton>
-                <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionBoundaryGroup">
-                  <userData>
-                    <SubdivisionMesh.BoundaryMode fx:value="CREASE_ALL"/>
-                  </userData>
-                  <tooltip>
-                    <Tooltip text="Edges and points at the boundary are treated as creases" />
-                  </tooltip>
-                </ToggleButton>
-              </children>
-            </HBox>
-            <Label text="Smooth Texture Map" GridPane.columnIndex="0" GridPane.rowIndex="7" />
-            <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="7">
-              <children>
-                <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="None">
-                  <toggleGroup>
-                    <ToggleGroup fx:id="subdivisionSmoothGroup" />
-                  </toggleGroup>
-                  <userData>
-                    <SubdivisionMesh.MapBorderMode fx:value="NOT_SMOOTH"/>
-                  </userData>
-                  <tooltip>
-                    <Tooltip text="Keeps the same uvs for all control points" />
-                  </tooltip>
-                </ToggleButton>
-                <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="Internal" toggleGroup="$subdivisionSmoothGroup">
-                  <userData>
-                    <SubdivisionMesh.MapBorderMode fx:value="SMOOTH_INTERNAL"/>
-                  </userData>
-                  <tooltip>
-                    <Tooltip text="Smooths uvs of points at corners" />
-                  </tooltip>
-                </ToggleButton>
-                <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionSmoothGroup">
-                  <userData>
-                    <SubdivisionMesh.MapBorderMode fx:value="SMOOTH_ALL"/>
-                  </userData>
-                  <tooltip>
-                    <Tooltip text="Smooths uvs of points at boundaries" />
-                  </tooltip>
-                </ToggleButton>
-              </children>
-            </HBox>
-            <Region maxHeight="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="0" GridPane.rowIndex="8" />
-          </children>
-          <columnConstraints>
-            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
-            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
-          </columnConstraints>
-          <padding>
-            <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" fx:id="x3" />
-          </padding>
-          <rowConstraints>
-            <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-            <RowConstraints minHeight="10.0" vgrow="ALWAYS" />
-          </rowConstraints>
-        </GridPane>
-      </content>
-    </TitledPane>
-    <TitledPane fx:id="x2" animated="false" text="Lights">
-      <content>
-        <ScrollPane fitToWidth="true" prefHeight="200.0" prefWidth="200.0">
-          <content>
-            <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0">
-              <children>
-                <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="2" />
-                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Ambient" GridPane.columnIndex="0" GridPane.columnSpan="2147483647" GridPane.hgrow="ALWAYS" GridPane.rowIndex="0" />
-                <ColorPicker fx:id="ambientColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="2" />
-                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="1" />
-                <CheckBox fx:id="ambientEnableCheckbox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
-                <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="5" />
-                <ColorPicker id="ambientColorPicker" fx:id="light1ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="5" />
-                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 1 (Camera)" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="3" />
-                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="4" />
-                <CheckBox fx:id="light1EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="4" />
-                <Label text="Lock to Camera" GridPane.columnIndex="0" GridPane.rowIndex="6" />
-                <CheckBox fx:id="light1followCameraCheckBox" mnemonicParsing="false" selected="true" text="" GridPane.columnIndex="1" GridPane.rowIndex="6" />
-                <Label text="X" GridPane.columnIndex="0" GridPane.rowIndex="7" />
-                <Slider fx:id="light1x" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="7" />
-                <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="8" />
-                <Slider fx:id="light1y" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="8" />
-                <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="9" />
-                <Slider fx:id="light1z" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="9" />
-                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 2" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="10" />
-                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="11" />
-                <CheckBox fx:id="light2EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="11" />
-                <Label text="X" GridPane.columnIndex="0" GridPane.rowIndex="13" />
-                <Slider fx:id="light2x" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="13" />
-                <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="14" />
-                <Slider fx:id="light2y" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="14" />
-                <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="15" />
-                <Slider fx:id="light2z" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="15" />
-                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 3" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="16" />
-                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="17" />
-                <CheckBox fx:id="light3EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="17" />
-                <Label text="Lock to Camera" GridPane.columnIndex="0" GridPane.rowIndex="19" />
-                <Slider fx:id="light3x" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="19" />
-                <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="20" />
-                <Slider fx:id="light3y" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="20" />
-                <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="21" />
-                <Slider fx:id="light3z" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="21" />
-                <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="12" />
-                <ColorPicker fx:id="light2ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="12" />
-                <Label text="Color" GridPane.columnIndex="0" GridPane.rowIndex="18" />
-                <ColorPicker fx:id="light3ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="18" />
-              </children>
-              <columnConstraints>
-                <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
-                <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
-              </columnConstraints>
-              <rowConstraints>
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
-              </rowConstraints>
-            </GridPane>
-          </content>
-        </ScrollPane>
-      </content>
-    </TitledPane>
-    <TitledPane fx:id="x1" animated="false" text="Camera">
-      <content>
-        <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0">
-          <children>
-            <Label text="Field of view:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
-            <Slider fx:id="fovSlider" majorTickUnit="40.0" max="180.0" min="0.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="0" />
-          </children>
-          <columnConstraints>
-            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
-            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
-          </columnConstraints>
-          <rowConstraints>
-            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
-          </rowConstraints>
-        </GridPane>
-      </content>
-    </TitledPane>
-    <fx:reference source="x5" />
-    <TitledPane fx:id="x6" animated="false" expanded="false" text="Transforms">
-      <content>
-        <VBox>
-          <children>
-            <Label fx:id="selectedNodeLabel"/>
-            <ListView fx:id="transformsList" prefHeight="200.0" prefWidth="200.0">
-                <VBox.vgrow>ALWAYS</VBox.vgrow>
-            </ListView>
-          </children>
-        </VBox>
-      </content>
-    </TitledPane>
-  </panes>
-</Accordion>
--- a/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/viewer.css	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2010, 2013 Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *  - Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  - Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the distribution.
- *  - Neither the name of Oracle Corporation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-.split-pane {
-    -fx-background-color: null;
-    -fx-background-insets: 0, 0;
-    -fx-padding: 0;
-}
-#statusBar > .container {
-    -fx-alignment: center;
-}
-#statusBar .text {
-    -fx-font-size: 11px;
-    -fx-font-weight: bold;
-    -fx-fill: #1d3866;
-    -fx-effect: dropshadow(one-pass-box, white, 0, 1.0, 0, 1);
-}
-#zoomBar {
-    -fx-background-insets: 0, 1;
-    -fx-background-radius: 10, 10;
-    -fx-padding: 2 0 2 0;
-}
-#zoomBar > .increment-button > .increment-arrow {
-    -fx-padding: 4;
-    -fx-shape: "M124.438,1083.516H121.5v-2.953c0-0.587-0.476-1.062-1.062-1.062s-1.062,0.476-1.062,1.062v2.953h-2.812c-0.587,0-1.062,0.476-1.062,1.062s0.476,1.062,1.062,1.062h2.812v2.797c0,0.587,0.476,1.062,1.062,1.062s1.062-0.476,1.062-1.062v-2.797h2.938c0.587,0,1.062-0.476,1.062-1.062S125.024,1083.516,124.438,1083.516z";
-}
-#zoomBar > .decrement-button > .decrement-arrow {
-    -fx-padding: 2 8 0 0;
-    -fx-shape: "M128.562,1085.625c-0.587,0-1.062-0.476-1.062-1.062l0,0c0-0.587,0.476-1.062,1.062-1.062h7.875 c0.587,0,1.062,0.476,1.062,1.062l0,0c0,0.587-0.476,1.062-1.062,1.062H128.562z";
-}
-#zoomBar > .decrement-button {
-    -fx-padding: 8 6 8 6;
-    -fx-background-radius: 10;
-}
-#zoomBar > .increment-button {
-    -fx-padding: 5 6 5 6;
-    -fx-background-radius: 10;
-}
-.four-way {
-    -fx-background-radius: 100;
-    -fx-padding: 3px;
-}
-.four-way > * {
-    -fx-shape: "M6.623,6.144L6.62,8.168L2.372,2.501L6.62-3.167L6.623-1.14l-2.8,3.641L6.623,6.";
-    -fx-scale-shape: false;
-    -fx-padding: 4px;
-    -fx-background-color: -fx-mark-highlight-color,derive(-fx-base,-45%);
-    -fx-effect: dropshadow(two-pass-box , -fx-shadow-highlight-color, 1, 0.0 , 0, 1.4);
-}
-.four-way > .center {
-    -fx-scale-shape: false;
-    -fx-padding: 10px;
-}
-.four-way > .up {
-    -fx-rotate: 90;
-}
-.four-way > .down {
-    -fx-rotate: -90;
-}
-.four-way > .right {
-    -fx-rotate: 180;
-    -fx-effect: dropshadow(two-pass-box , -fx-shadow-highlight-color, 1, 0.0 , 0, -1.4);
-}
-#eyeNav > .center {
-    -fx-shape: "M121.5,1093.484c-3.866,0-7,2.025-7,4.523s3.134,4.523,7,4.523s7-2.025,7-4.523S125.366,1093.484,121.5,1093.484z M121.5,1101.531c-3.252,0-6-1.613-6-3.523s2.748-3.523,6-3.523s6,1.613,6,3.523S124.752,1101.531,121.5,1101.531z M121.5,1094.833c-1.749,0-3.167,1.418-3.167,3.167s1.418,3.167,3.167,3.167s3.167-1.418,3.167-3.167S123.249,1094.833,121.5,1094.833z M120.595,1097.548c-0.25,0-0.453-0.202-0.453-0.453c0-0.25,0.203-0.452,0.453-0.452s0.452,0.202,0.452,0.452C121.047,1097.346,120.845,1097.548,120.595,1097.548z";
-}
-#camNav > .center {
-    -fx-shape: "M20.34,47.5c0,0-0.875-2.688-1.938-3.688s-4.688-4.438-3.625-5.562s5.25,2.25,5.25,2.25s-3.295-7.148-1.438-8c1.5-0.688,3.438,4.938,3.438,4.938S21.34,30.5,23.152,30.5c1.938,0,1.25,6.938,1.25,6.938s1.5-6.188,2.938-5.812s0,6.375,0,6.375s3.039-3.571,3.812-2.875c1.25,1.125-2.381,5.987-2.443,7.362S28.277,47.5,28.277,47.5H20.34z";
-}
-.four-way > .up:pressed,
-.four-way > .down:pressed,
-.four-way > .left:pressed,
-.four-way > .right:pressed {
-    -fx-effect: dropshadow(gaussian, -fx-accent, 15, 0.7, 0, 0);
-
-}
-.settings-header {
-    -fx-font-weight: bold;
-    -fx-alignment: center;
-    -fx-text-fill: #6f6f6f;
-    -fx-border-color: transparent transparent #dddddd transparent;
-}
-.settings {
-    -fx-font-size: 11px;
-}
-/**
-.radio-button:selected > .radio > .dot,
-.check-box:selected > .box > .mark,
-.check-box:indeterminate  > .box > .mark {
-    -fx-background-color: -fx-mark-highlight-color, -fx-mark-color !important;
-    -fx-background-insets: 1 0 -1 0, 0;
-}
-
-*/
-.settings .check-box > .box > .mark {
-    -fx-background-color: -fx-mark-highlight-color, -fx-mark-color !important;
-    -fx-background-insets: 1 0 -1 0, 0;
-    -fx-shape: "M0.288,2.742C0.48,2.195,0.756,1.716,1.115,1.308C1.476,0.9,1.918,0.58,2.442,0.348S3.555,0,4.212,0c0.664,0,1.256,0.116,1.776,0.348s0.96,0.552,1.32,0.96c0.36,0.408,0.636,0.886,0.828,1.434C8.328,3.29,8.424,3.885,8.424,4.524c0,0.624-0.096,1.206-0.288,1.746c-0.192,0.54-0.468,1.01-0.828,1.41c-0.36,0.4-0.8,0.714-1.32,0.942S4.876,8.964,4.212,8.964c-0.656,0-1.246-0.114-1.77-0.342S1.476,8.08,1.115,7.68c-0.36-0.4-0.636-0.87-0.828-1.41C0.095,5.73,0,5.148,0,4.524C0,3.885,0.095,3.29,0.288,2.742z M2.01,5.574c0.084,0.34,0.218,0.646,0.402,0.918c0.184,0.272,0.424,0.49,0.72,0.654s0.656,0.246,1.08,0.246c0.424,0,0.784-0.082,1.08-0.246s0.536-0.382,0.72-0.654S6.33,5.914,6.414,5.574c0.084-0.34,0.126-0.69,0.126-1.05c0-0.376-0.042-0.74-0.126-1.092S6.196,2.766,6.011,2.49c-0.184-0.276-0.424-0.496-0.72-0.66s-0.656-0.246-1.08-0.246c-0.424,0-0.784,0.082-1.08,0.246s-0.536,0.384-0.72,0.66C2.228,2.766,2.094,3.08,2.01,3.432S1.884,4.148,1.884,4.524C1.884,4.884,1.926,5.234,2.01,5.574z M11.58,0.204l3.576,5.748h0.024V0.204h1.764v8.568H15.06l-3.564-5.736h-0.024v5.736H9.708V0.204H11.58z M28.524,2.742c0.191-0.548,0.468-1.026,0.828-1.434c0.359-0.408,0.802-0.728,1.326-0.96C31.202,0.116,31.792,0,32.448,0c0.664,0,1.256,0.116,1.776,0.348c0.52,0.232,0.96,0.552,1.319,0.96c0.36,0.408,0.637,0.886,0.828,1.434c0.192,0.548,0.288,1.142,0.288,1.782c0,0.624-0.096,1.206-0.288,1.746c-0.191,0.54-0.468,1.01-0.828,1.41c-0.359,0.4-0.8,0.714-1.319,0.942c-0.521,0.228-1.112,0.342-1.776,0.342c-0.656,0-1.246-0.114-1.77-0.342c-0.524-0.228-0.967-0.542-1.326-0.942c-0.36-0.4-0.637-0.87-0.828-1.41c-0.192-0.54-0.288-1.122-0.288-1.746C28.236,3.885,28.332,3.29,28.524,2.742z M30.246,5.574c0.084,0.34,0.218,0.646,0.402,0.918c0.184,0.272,0.424,0.49,0.72,0.654s0.656,0.246,1.08,0.246s0.784-0.082,1.08-0.246s0.536-0.382,0.72-0.654c0.185-0.272,0.318-0.578,0.402-0.918c0.084-0.34,0.126-0.69,0.126-1.05c0-0.376-0.042-0.74-0.126-1.092s-0.218-0.666-0.402-0.942c-0.184-0.276-0.424-0.496-0.72-0.66s-0.656-0.246-1.08-0.246s-0.784,0.082-1.08,0.246s-0.536,0.384-0.72,0.66c-0.185,0.276-0.318,0.59-0.402,0.942S30.12,4.148,30.12,4.524C30.12,4.884,30.162,5.234,30.246,5.574zM43.968,0.204v1.584h-4.14v1.98h3.588v1.464h-3.588v3.54h-1.884V0.204H43.968z M51.083,0.204v1.584h-4.14v1.98h3.588v1.464h-3.588v3.54h-1.884V0.204H51.083z";
-    -fx-padding: 4.5 25.5 4.5 25.5;
-}
-.settings .check-box > .box {
-    -fx-padding: 5px 5px 5px 7px;
-    -fx-background-color:
-        -fx-shadow-highlight-color,
-        -fx-outer-border,
-        -fx-inner-border,
-        -fx-body-color,
-        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
-        linear-gradient(to bottom, derive(-fx-color, -22%) 0%, derive(-fx-color, -13%) 20%, derive(-fx-color, -11%) 50%);
-    -fx-background-insets: 0 0 -1 0, 0, 1, 2, 0 0 0 30, 1 1 1 31;
-    -fx-background-radius: 3px, 3px, 2px, 1px, 0 2px 2px 0, 0 1 1 0;
-}
-.settings .check-box:selected > .box {
-    -fx-background-color:
-        -fx-shadow-highlight-color,
-        -fx-outer-border,
-        -fx-inner-border,
-        -fx-body-color,
-        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
-        linear-gradient(to bottom, derive(-fx-default-button, -12%) 0%, derive(-fx-default-button, -3%) 20%, derive(-fx-default-button, -1%) 50%);
-
-    -fx-background-insets: 0 0 -1 0, 0, 1, 2, 0 32 0 0, 1 33 1 1;
-    -fx-background-radius: 3px, 3px, 2px, 1px, 2px 0 0 2px, 1 0 0 1;
-}
-.settings .check-box:focused > .box {
-    -fx-background-color:
-        -fx-focus-color,
-        -fx-inner-border,
-        -fx-body-color,
-        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
-        linear-gradient(to bottom, derive(-fx-color, -22%) 0%, derive(-fx-color, -13%) 20%, derive(-fx-color, -11%) 50%);
-    -fx-background-insets: -0.2, 1, 2, 1 1 1 30, 1 1 1 31;
-    -fx-background-radius: 3px, 2px, 1px, 0 2px 2px 0, 0 1 1 0;
-}
-.settings .check-box:focused:selected > .box {
-    -fx-background-color:
-        -fx-focus-color,
-        -fx-inner-border,
-        -fx-body-color,
-        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
-        linear-gradient(to bottom, derive(-fx-default-button, -12%) 0%, derive(-fx-default-button, -3%) 20%, derive(-fx-default-button, -1%) 50%);
-    -fx-background-insets: -0.2, 1, 2, 1 32 1 1, 1 33 1 1;
-    -fx-background-radius: 3px, 2px, 1px, 2px 0 0 2px, 1 0 0 1;
-}
-#playControls * {
-    -fx-content-display: graphic-only;
-}
-#playControls > * > Pane {
-    -fx-background-color: white,#666;
-    -fx-background-insets: 1 0 -1 0, 0;
-}
-#playControls > #startBtn > Pane {
-    -fx-shape: "M27.05,532h-0.782c-0.333,0-0.602,0.273-0.602,0.61v14.659c0,0.338,0.269,0.61,0.602,0.61h0.782c0.332,0,0.602-0.272,0.602-0.61V532.61C27.652,532.273,27.382,532,27.05,532zM38.9,532l-9.263,7.94l9.263,7.939V532z";
-}
-#playControls > #rwBtn > Pane {
-    -fx-shape: "M64.866,531.999l-8.818,7.965l8.818,7.964v-6.796l7.301,6.796v-15.929l-7.301,6.797V531.999z";
-}
-#playControls > #playBtn:selected  > Pane {
-    -fx-shape: "M20.716,531.999c-0.665,0-1.204,0.542-1.204,1.212v13.328c0,0.671,0.539,1.213,1.204,1.213h2.188c0.665,0,1.203-0.542,1.203-1.213v-13.328c0-0.67-0.538-1.212-1.203-1.212H20.716zM10.87,531.999c-0.665,0-1.204,0.542-1.204,1.212v13.328c0,0.671,0.539,1.213,1.204,1.213h2.188c0.665,0,1.203-0.542,1.203-1.213v-13.328c0-0.67-0.539-1.212-1.203-1.212H10.87z";
-}
-#playControls > #playBtn> Pane {
-    -fx-shape: "M0,531.999l8.667,8L0,548V531.999z";
-}
-#playControls > #ffBtn > Pane {
-    -fx-shape: "M82.09,532v6.606L74.833,532v15.832l7.257-6.606v6.606l8.576-7.916L82.09,532z";
-}
-#playControls > #endBtn > Pane {
-    -fx-shape: "M52.525,532c-0.333,0-0.602,0.273-0.602,0.611v14.669c0,0.337,0.27,0.611,0.602,0.611h0.782c0.333,0,0.602-0.274,0.602-0.611v-14.669c0-0.338-0.27-0.611-0.602-0.611H52.525zM40.667,532v15.892l9.27-7.946L40.667,532z";
-}
-.tool-bar #loopBtn Pane {
-    -fx-shape: "M103.31,539.442v-2.544h-6.487c-0.907,0-1.646,0.738-1.646,1.646v1.637l-2.512,2.526v-4.163c0-2.296,1.861-4.157,4.157-4.157h6.487v-2.392l4.034,3.724L103.31,539.442z M92.753,544.033l4.034,3.725v-2.393h6.487c2.296,0,4.157-1.861,4.157-4.157v-4.163l-2.512,2.526v1.637c0,0.907-0.738,1.646-1.646,1.646h-6.487v-2.544L92.753,544.033z";
-}
-.timeline-display {
-    -fx-font-size: 10px;
-    -fx-font-weight: bold;
-    -fx-padding: 6 6 4 6;
-}
-.timeline-display .background {
-    -fx-background-color: white,#b8c3a6;
-    -fx-background-insets: 1 0 -1 0,0;
-    -fx-background-radius: 6, 6;
-    -fx-effect: innershadow(gaussian, #52574abb, 5, 0, 0, 2);
-}
-.timeline-display Text {
-    -fx-fill: #52574a;
-}
-.timeline-display .bar {
-    -fx-border-color: #52574a;
-}
-.timeline-display .progress {
-    -fx-background-color: #52574a;
-}
\ No newline at end of file
--- a/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/shape3d/SkinningMesh.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/experiments/3DViewer/src/main/java/com/javafx/experiments/shape3d/SkinningMesh.java	Tue Jul 09 09:36:39 2013 -0700
@@ -4,105 +4,164 @@
 import com.javafx.experiments.importers.maya.Joint;
 import java.util.ArrayList;
 import java.util.List;
+import javafx.beans.InvalidationListener;
+import javafx.beans.Observable;
 import javafx.collections.ObservableFloatArray;
 import javafx.geometry.Point3D;
+import javafx.scene.Node;
+import javafx.scene.Parent;
 import javafx.scene.shape.TriangleMesh;
 import javafx.scene.transform.Affine;
+import javafx.scene.transform.MatrixType;
 import javafx.scene.transform.NonInvertibleTransformException;
 import javafx.scene.transform.Transform;
 
 /**
- * PolygonMesh that updates itself when the joint transforms are updated.
- * Assumes that the dimensions of weights is nJoints x nPoints
+ * PolygonMesh that knows how to update itself given changes in joint transforms.
+ * The mesh can be updated with an AnimationTimer.
  */
 public class SkinningMesh extends PolygonMesh {
-    private final Point3D[][] relativePoints; // nPoints x nJoints
-    private final float[][] weights; // nPoints x nJoints
+    private final float[][] relativePoints; // nJoints x nPoints*3
+    private final float[][] weights; // nJoints x nPoints
     private final List<Integer>[] weightIndices;
-    private final List<Joint> joints;
+    private final List<JointIndex> jointIndexForest;
+    private boolean jointsTransformDirty = true;
+    private Transform bindGlobalInverseTransform;
+    private final Transform[] jointToRootTransforms; // the root refers to the group containing all the mesh skinning nodes (i.e. the parent of jointForest)
     private final int nPoints;
     private final int nJoints;
-    private Transform meshInverseTransform;
-
-    public SkinningMesh(PolygonMesh mesh, Transform meshTransform, float[][] weights, Affine[] bindTransforms, List<Joint> joints) {
+    
+    
+    /**
+     * SkinningMesh constructor
+     * 
+     * @param mesh The binding mesh
+     * @param weights A two-dimensional array (nJoints x nPoints) of the influence weights used for skinning
+     * @param bindTransforms The binding transforms for every joint
+     * @param bindGlobalTransform The global binding transform; all binding transforms are defined with respect to this frame
+     * @param joints A list of joints used for skinning; the order of these are associated with the respective attributes of @weights and @bindTransforms
+     * @param jointForest A list of the top level trees that contain the joints; all the @joints should be contained in this forest
+     */
+    public SkinningMesh(PolygonMesh mesh, float[][] weights, Affine[] bindTransforms, Affine bindGlobalTransform, List<Joint> joints, List<Parent> jointForest) {
         this.getPoints().addAll(mesh.getPoints());
         this.getTexCoords().addAll(mesh.getTexCoords());
         this.faces = mesh.faces;
         
         this.weights = weights;
-        this.joints = joints;
-        
+
         nJoints = joints.size();
         nPoints = getPoints().size()/ TriangleMesh.NUM_COMPONENTS_PER_POINT;
         
+        // Create the jointIndexForest forest. Its structure is the same as 
+        // jointForest, except that this forest have indices information and 
+        // some branches are pruned if they don't contain joints.
+        jointIndexForest = new ArrayList<JointIndex>(jointForest.size());
+        for (Parent jointRoot : jointForest) {
+            jointIndexForest.add(new JointIndex(jointRoot, joints.indexOf(jointRoot), joints));
+        }
+        
         try {
-            meshInverseTransform = meshTransform.createInverse();
+            bindGlobalInverseTransform = bindGlobalTransform.createInverse();
         } catch (NonInvertibleTransformException ex) {
             System.err.println("Caught NonInvertibleTransformException: " + ex.getMessage());
         }
         
-        weightIndices = new List[nPoints];
-        for (int i = 0; i < nPoints; i++) {
-            weightIndices[i] = new ArrayList<Integer>();
-            for (int j = 0; j < nJoints; j++) {
-                if (weights[i][j] != 0.0f) {
-                    weightIndices[i].add(new Integer(j));
+        jointToRootTransforms = new Transform[nJoints];
+        
+        // For optimization purposes, store the indices of the non-zero weights
+        weightIndices = new List[nJoints];
+        for (int j = 0; j < nJoints; j++) {
+            weightIndices[j] = new ArrayList<Integer>();
+            for (int i = 0; i < nPoints; i++) {
+                if (weights[j][i] != 0.0f) {
+                    weightIndices[j].add(new Integer(i));
                 }
             }
         }
         
+        // Compute the points of the binding mesh relative to the binding transforms
         ObservableFloatArray points = getPoints();
-        relativePoints = new Point3D[nPoints][nJoints];
+        relativePoints = new float[nJoints][nPoints*3];
         for (int j = 0; j < nJoints; j++) {
-            Transform postBindTransform = bindTransforms[j].createConcatenation(meshTransform);
+            Transform postBindTransform = bindTransforms[j].createConcatenation(bindGlobalTransform);
             for (int i = 0; i < nPoints; i++) {
-                relativePoints[i][j] = postBindTransform.transform(points.get(3*i), points.get(3*i+1), points.get(3*i+2));
+                Point3D relativePoint = postBindTransform.transform(points.get(3*i), points.get(3*i+1), points.get(3*i+2));
+                relativePoints[j][3*i]   = (float) relativePoint.getX();
+                relativePoints[j][3*i+1] = (float) relativePoint.getY();
+                relativePoints[j][3*i+2] = (float) relativePoint.getZ();
+            }
+        }
+        
+        // Add a listener to all the joints so that we can track when any of their transforms have changed
+        for (Joint joint : joints) {
+            joint.localToParentTransformProperty().addListener(new InvalidationListener() {
+                @Override
+                public void invalidated(Observable observable) {
+                    jointsTransformDirty = true;
+                }
+            });
+        }
+    }
+    
+    private class JointIndex {
+        public Node node;
+        public int index;
+        public List<JointIndex> children = new ArrayList<JointIndex>();
+        public JointIndex parent = null;
+        public Transform localToGlobalTransform;
+        public JointIndex(Node n, int ind, List<Joint> orderedJoints) {
+            node = n;
+            index = ind;
+            if (node instanceof Parent) {
+                for (Node childJoint : ((Parent)node).getChildrenUnmodifiable()) {
+                    if (childJoint instanceof Parent) { // is childJoint a joint or a node with children?
+                        int childInd = orderedJoints.indexOf(childJoint);
+                        JointIndex childJointIndex = new JointIndex(childJoint, childInd, orderedJoints);
+                        childJointIndex.parent = this;
+                        children.add(childJointIndex);
+                    }
+                }
             }
         }
     }
     
+    // Updates the jointToRootTransforms by doing a a depth-first search of the jointIndexForest
+    private void updateLocalToGlobalTransforms(List<JointIndex> jointIndexForest) {
+        for (JointIndex jointIndex : jointIndexForest) {
+            if (jointIndex.parent == null) {
+                jointIndex.localToGlobalTransform = bindGlobalInverseTransform.createConcatenation(jointIndex.node.getLocalToParentTransform());
+            } else {
+                jointIndex.localToGlobalTransform = jointIndex.parent.localToGlobalTransform.createConcatenation(jointIndex.node.getLocalToParentTransform());
+            }
+            if (jointIndex.index != -1) {
+                jointToRootTransforms[jointIndex.index] = jointIndex.localToGlobalTransform;
+            }
+            updateLocalToGlobalTransforms(jointIndex.children);
+        }
+    }
+    
+    // Updates its points only if any of the joints' transforms have changed
     public void update() {
-        Transform[] preJointTransforms = new Transform[nJoints];
+        if (!jointsTransformDirty) {
+            return;
+        }
+        
+        updateLocalToGlobalTransforms(jointIndexForest);
+        
+        float[] points = new float[nPoints*3];
+        double[] t = new double[12];
+        float[] relativePoint;
         for (int j = 0; j < nJoints; j++) {
-            preJointTransforms[j] = meshInverseTransform.createConcatenation(joints.get(j).getLocalToSceneTransform());
-        }
-
-        float[] points = new float [getPoints().size()];
-        
-        for (int i = 0; i < nPoints; i++) {
-            if (!weightIndices[i].isEmpty()) {
-                Point3D weightedPoint = new Point3D(0,0,0);
-                for (Integer j : weightIndices[i]) {
-                    Point3D absolutePoint = preJointTransforms[j].transform(relativePoints[i][j]);
-                    weightedPoint = weightedPoint.add(absolutePoint.multiply(weights[i][j]));
-                }
-                points[3*i] = (float) weightedPoint.getX();
-                points[3*i+1] = (float) weightedPoint.getY();
-                points[3*i+2] = (float) weightedPoint.getZ();
+            jointToRootTransforms[j].toArray(MatrixType.MT_3D_3x4, t);
+            relativePoint = relativePoints[j];
+            for (Integer i : weightIndices[j]) {
+                points[3*i]   += weights[j][i] * (t[0] * relativePoint[3*i] + t[1] * relativePoint[3*i+1] + t[2] * relativePoint[3*i+2] + t[3]);
+                points[3*i+1] += weights[j][i] * (t[4] * relativePoint[3*i] + t[5] * relativePoint[3*i+1] + t[6] * relativePoint[3*i+2] + t[7]);
+                points[3*i+2] += weights[j][i] * (t[8] * relativePoint[3*i] + t[9] * relativePoint[3*i+1] + t[10] * relativePoint[3*i+2] + t[11]);
             }
         }
         getPoints().set(0, points, 0, points.length);
         
-//        // The following loop is equivalent to the one above, the difference
-//        // being that this one is more straight-forward (it checks and skips
-//        // the zero weights).
-//        for (int i = 0; i < nPoints; i++) {
-//            Point3D weightedPoint = new Point3D(0,0,0);
-//            boolean isVertexInfluenced = false;
-//            for (int j = 0; j < nJoints; j++) {
-//                if (weights[i][j] != 0.0f) {
-//                    isVertexInfluenced = true;
-//                    Point3D absolutePoint = preJointTransforms[j].transform(relativePoints[i][j]);
-//                    weightedPoint = weightedPoint.add(absolutePoint.multiply(weights[i][j]));
-//                }
-//            }
-//            if (isVertexInfluenced) {
-//                points[3*i] = (float) weightedPoint.getX();
-//                points[3*i+1] = (float) weightedPoint.getY();
-//                points[3*i+2] = (float) weightedPoint.getZ();
-//            }
-//        }
-//        getPoints().set(0, points, 0, points.length);
-        
+        jointsTransformDirty = false;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/src/main/resources/com/javafx/experiments/jfx3dviewer/main.fxml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2010, 2013 Oracle and/or its affiliates.
+All rights reserved. Use is subject to license terms.
+
+This file is available and licensed under the following license:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in
+   the documentation and/or other materials provided with the distribution.
+ - Neither the name of Oracle Corporation nor the names of its
+   contributors may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<?import java.lang.*?>
+<?import java.net.*?>
+<?import java.util.*?>
+<?import javafx.geometry.*?>
+<?import javafx.scene.control.*?>
+<?import javafx.scene.control.MenuBar?>
+<?import javafx.scene.control.ToolBar?>
+<?import javafx.scene.layout.*?>
+<?import javafx.scene.paint.*?>
+<?import com.javafx.experiments.jfx3dviewer.*?>
+
+<VBox id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.javafx.experiments.jfx3dviewer.MainController">
+  <ToolBar>
+    <items>
+      <SplitMenuButton fx:id="openMenuBtn" mnemonicParsing="false" onAction="#open" text="Open...">
+        <items>
+          <CheckMenuItem mnemonicParsing="false" text="Load as Polygons" fx:id="loadAsPolygonsCheckBox" />
+          <CheckMenuItem mnemonicParsing="false" text="Optimize" fx:id="optimizeCheckBox" />
+        </items>
+      </SplitMenuButton>
+      <Button mnemonicParsing="false" onAction="#export" text="Export..." />
+      <!--HBox.hgrow="ALWAYS"-->
+      <Pane maxWidth="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS"/>
+      <TimelineDisplay fx:id="timelineDisplay" />
+      <HBox id="playControls" prefHeight="-1.0" prefWidth="-1.0">
+        <children>
+          <Button fx:id="startBtn" mnemonicParsing="false" styleClass="left-pill" text="|&lt;">
+            <graphic>
+              <Pane prefHeight="16.0" prefWidth="16.0" />
+            </graphic>
+          </Button>
+          <Button fx:id="rwBtn" mnemonicParsing="false" styleClass="center-pill" text="&lt;&lt;">
+            <graphic>
+              <Pane prefHeight="16.0" prefWidth="16.0" />
+            </graphic>
+          </Button>
+          <ToggleButton fx:id="playBtn" mnemonicParsing="false" styleClass="center-pill" text="&gt;">
+            <graphic>
+              <Pane prefHeight="16.0" prefWidth="16.0" />
+            </graphic>
+          </ToggleButton>
+          <Button fx:id="ffBtn" mnemonicParsing="false" styleClass="center-pill" text="&gt;&gt;">
+            <graphic>
+              <Pane prefHeight="16.0" prefWidth="16.0" />
+            </graphic>
+          </Button>
+          <Button fx:id="endBtn" mnemonicParsing="false" styleClass="center-pill" text="&gt;|">
+            <graphic>
+              <Pane prefHeight="16.0" prefWidth="16.0" />
+            </graphic>
+          </Button>
+          <ToggleButton fx:id="loopBtn" mnemonicParsing="false" selected="true" styleClass="right-pill" text="R">
+            <graphic>
+              <Pane prefHeight="16.0" prefWidth="16.0" />
+            </graphic>
+          </ToggleButton>
+        </children>
+        <padding>
+          <Insets right="5.0" />
+        </padding>
+      </HBox>
+      <ToggleButton fx:id="settingsBtn" mnemonicParsing="false" onAction="#toggleSettings" text="Settings" />
+    </items>
+  </ToolBar>
+  <SplitPane fx:id="splitPane" dividerPositions="" focusTraversable="true" prefHeight="160.0" prefWidth="200.0" VBox.vgrow="ALWAYS" />
+  <ToolBar id="statusBar" styleClass="bottom">
+    <items>
+      <Label fx:id="status" text="Label" />
+    </items>
+  </ToolBar>
+  <stylesheets>
+    <URL value="@viewer.css" />
+  </stylesheets>
+</VBox>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/src/main/resources/com/javafx/experiments/jfx3dviewer/navigation.fxml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2010, 2013 Oracle and/or its affiliates.
+All rights reserved. Use is subject to license terms.
+
+This file is available and licensed under the following license:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in
+   the documentation and/or other materials provided with the distribution.
+ - Neither the name of Oracle Corporation nor the names of its
+   contributors may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<?import com.javafx.experiments.jfx3dviewer.*?>
+<?import com.javafx.experiments.jfx3dviewer.FourWayNavControl?>
+<?import java.lang.*?>
+<?import javafx.geometry.*?>
+<?import javafx.geometry.Insets?>
+<?import javafx.scene.control.*?>
+<?import javafx.scene.control.ScrollBar?>
+<?import javafx.scene.layout.*?>
+<?import javafx.scene.layout.VBox?>
+<?scenebuilder-classpath-element ../../../../../../../build/classes?>
+
+<VBox id="controller" alignment="CENTER" spacing="10.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.javafx.experiments.jfx3dviewer.NavigationController">
+  <children>
+    <FourWayNavControl fx:id="eyeNav" />
+    <FourWayNavControl fx:id="camNav" />
+    <ScrollBar fx:id="zoomBar" orientation="VERTICAL" rotate="180.0" />
+  </children>
+  <padding>
+    <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
+  </padding>
+</VBox>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/src/main/resources/com/javafx/experiments/jfx3dviewer/settings.fxml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright (c) 2010, 2013 Oracle and/or its affiliates.
+All rights reserved. Use is subject to license terms.
+
+This file is available and licensed under the following license:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in
+   the documentation and/or other materials provided with the distribution.
+ - Neither the name of Oracle Corporation nor the names of its
+   contributors may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<?import java.lang.*?>
+<?import java.net.*?>
+<?import java.util.*?>
+<?import javafx.geometry.*?>
+<?import javafx.scene.control.*?>
+<?import javafx.scene.control.MenuBar?>
+<?import javafx.scene.control.ToolBar?>
+<?import javafx.scene.layout.*?>
+<?import javafx.scene.paint.*?>
+<?import com.javafx.experiments.shape3d.*?>
+<?scenebuilder-stylesheet viewer.css?>
+<!--suppress JavaFxUnresolvedStyleClassReference -->
+
+<Accordion fx:id="settings" minWidth="0.0" prefHeight="798.0" prefWidth="279.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.javafx.experiments.jfx3dviewer.SettingsController">
+  <expandedPane>
+    <TitledPane fx:id="x5" animated="false" expanded="true" text="Hierarchy">
+      <content>
+        <TreeTableView fx:id="hierarachyTreeTable" editable="true" prefHeight="200.0" prefWidth="200.0">
+          <columns>
+            <TreeTableColumn fx:id="nodeColumn" editable="false" prefWidth="75.0" sortable="false" text="Node" />
+            <TreeTableColumn fx:id="idColumn" editable="false" prefWidth="75.0" text="Id" />
+            <TreeTableColumn fx:id="visibilityColumn" editable="true" text="Visibility" />
+            <TreeTableColumn fx:id="widthColumn" editable="false" text="W" />
+            <TreeTableColumn fx:id="heightColumn" editable="false" text="H" />
+            <TreeTableColumn fx:id="depthColumn" editable="false" text="D" />
+          </columns>
+        </TreeTableView>
+      </content>
+    </TitledPane>
+  </expandedPane>
+  <panes>
+    <TitledPane fx:id="x4" animated="false" expanded="false" text="Options">
+      <content>
+        <GridPane hgap="5.0" styleClass="settings" vgap="5.0">
+          <children>
+            <Label text="Show Axis:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
+            <Label text="Y Up:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
+            <CheckBox fx:id="showAxisCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="0" />
+            <CheckBox fx:id="yUpCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
+            <Label text="Scale to Fit" GridPane.columnIndex="0" GridPane.rowIndex="2" />
+            <CheckBox id="yUpCheckBox" fx:id="scaleToFitCheckBox" mnemonicParsing="false" selected="true" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" />
+            <Label text="Background Color" GridPane.columnIndex="0" GridPane.rowIndex="3" />
+            <ColorPicker fx:id="backgroundColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="3" />
+            <Label text="Wireframe" GridPane.columnIndex="0" GridPane.rowIndex="4" />
+            <CheckBox fx:id="wireFrameCheckbox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="4" />
+            <Label text="Subdivision level" GridPane.columnIndex="0" GridPane.rowIndex="5" />
+            <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="5">
+              <children>
+                <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="None" userData="0">
+                  <toggleGroup>
+                    <ToggleGroup fx:id="subdivisionLevelGroup" />
+                  </toggleGroup>
+                </ToggleButton>
+                <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="1" toggleGroup="$subdivisionLevelGroup" userData="1" />
+                <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="2" toggleGroup="$subdivisionLevelGroup" userData="2" />
+                <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="3" toggleGroup="$subdivisionLevelGroup" userData="3" />
+              </children>
+            </HBox>
+            <Label text="Creases (Boundary Rules)" GridPane.columnIndex="0" GridPane.rowIndex="6" />
+            <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="6">
+              <children>
+                <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="Edges">
+                  <toggleGroup>
+                    <ToggleGroup fx:id="subdivisionBoundaryGroup" />
+                  </toggleGroup>
+                  <userData>
+                    <SubdivisionMesh.BoundaryMode fx:value="CREASE_EDGES"/>
+                  </userData>
+                  <tooltip>
+                    <Tooltip text="Only edges at the boundary are treated as creases" />
+                  </tooltip>
+                </ToggleButton>
+                <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionBoundaryGroup">
+                  <userData>
+                    <SubdivisionMesh.BoundaryMode fx:value="CREASE_ALL"/>
+                  </userData>
+                  <tooltip>
+                    <Tooltip text="Edges and points at the boundary are treated as creases" />
+                  </tooltip>
+                </ToggleButton>
+              </children>
+            </HBox>
+            <Label text="Smooth Texture Map" GridPane.columnIndex="0" GridPane.rowIndex="7" />
+            <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="7">
+              <children>
+                <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="None">
+                  <toggleGroup>
+                    <ToggleGroup fx:id="subdivisionSmoothGroup" />
+                  </toggleGroup>
+                  <userData>
+                    <SubdivisionMesh.MapBorderMode fx:value="NOT_SMOOTH"/>
+                  </userData>
+                  <tooltip>
+                    <Tooltip text="Keeps the same uvs for all control points" />
+                  </tooltip>
+                </ToggleButton>
+                <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="Internal" toggleGroup="$subdivisionSmoothGroup">
+                  <userData>
+                    <SubdivisionMesh.MapBorderMode fx:value="SMOOTH_INTERNAL"/>
+                  </userData>
+                  <tooltip>
+                    <Tooltip text="Smooths uvs of points at corners" />
+                  </tooltip>
+                </ToggleButton>
+                <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionSmoothGroup">
+                  <userData>
+                    <SubdivisionMesh.MapBorderMode fx:value="SMOOTH_ALL"/>
+                  </userData>
+                  <tooltip>
+                    <Tooltip text="Smooths uvs of points at boundaries" />
+                  </tooltip>
+                </ToggleButton>
+              </children>
+            </HBox>
+            <Region maxHeight="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="0" GridPane.rowIndex="8" />
+          </children>
+          <columnConstraints>
+            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
+            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
+          </columnConstraints>
+          <padding>
+            <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" fx:id="x3" />
+          </padding>
+          <rowConstraints>
+            <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+            <RowConstraints minHeight="10.0" vgrow="ALWAYS" />
+          </rowConstraints>
+        </GridPane>
+      </content>
+    </TitledPane>
+    <TitledPane fx:id="x2" animated="false" text="Lights">
+      <content>
+        <ScrollPane fitToWidth="true" prefHeight="200.0" prefWidth="200.0">
+          <content>
+            <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0">
+              <children>
+                <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="2" />
+                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Ambient" GridPane.columnIndex="0" GridPane.columnSpan="2147483647" GridPane.hgrow="ALWAYS" GridPane.rowIndex="0" />
+                <ColorPicker fx:id="ambientColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="2" />
+                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="1" />
+                <CheckBox fx:id="ambientEnableCheckbox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" />
+                <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="5" />
+                <ColorPicker id="ambientColorPicker" fx:id="light1ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="5" />
+                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 1 (Camera)" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="3" />
+                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="4" />
+                <CheckBox fx:id="light1EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="4" />
+                <Label text="Lock to Camera" GridPane.columnIndex="0" GridPane.rowIndex="6" />
+                <CheckBox fx:id="light1followCameraCheckBox" mnemonicParsing="false" selected="true" text="" GridPane.columnIndex="1" GridPane.rowIndex="6" />
+                <Label text="X" GridPane.columnIndex="0" GridPane.rowIndex="7" />
+                <Slider fx:id="light1x" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="7" />
+                <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="8" />
+                <Slider fx:id="light1y" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="8" />
+                <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="9" />
+                <Slider fx:id="light1z" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="9" />
+                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 2" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="10" />
+                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="11" />
+                <CheckBox fx:id="light2EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="11" />
+                <Label text="X" GridPane.columnIndex="0" GridPane.rowIndex="13" />
+                <Slider fx:id="light2x" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="13" />
+                <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="14" />
+                <Slider fx:id="light2y" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="14" />
+                <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="15" />
+                <Slider fx:id="light2z" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="15" />
+                <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 3" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="16" />
+                <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="17" />
+                <CheckBox fx:id="light3EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="17" />
+                <Label text="Lock to Camera" GridPane.columnIndex="0" GridPane.rowIndex="19" />
+                <Slider fx:id="light3x" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="19" />
+                <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="20" />
+                <Slider fx:id="light3y" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="20" />
+                <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="21" />
+                <Slider fx:id="light3z" majorTickUnit="20.0" max="20.0" min="-20.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="21" />
+                <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="12" />
+                <ColorPicker fx:id="light2ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="12" />
+                <Label text="Color" GridPane.columnIndex="0" GridPane.rowIndex="18" />
+                <ColorPicker fx:id="light3ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="18" />
+              </children>
+              <columnConstraints>
+                <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
+                <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
+              </columnConstraints>
+              <rowConstraints>
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+                <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
+              </rowConstraints>
+            </GridPane>
+          </content>
+        </ScrollPane>
+      </content>
+    </TitledPane>
+    <TitledPane fx:id="x1" animated="false" text="Camera">
+      <content>
+        <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0">
+          <children>
+            <Label text="Field of view:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
+            <Slider fx:id="fovSlider" majorTickUnit="40.0" max="180.0" min="0.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="0" />
+          </children>
+          <columnConstraints>
+            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
+            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
+          </columnConstraints>
+          <rowConstraints>
+            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
+          </rowConstraints>
+        </GridPane>
+      </content>
+    </TitledPane>
+    <fx:reference source="x5" />
+    <TitledPane fx:id="x6" animated="false" expanded="false" text="Transforms">
+      <content>
+        <VBox>
+          <children>
+            <Label fx:id="selectedNodeLabel"/>
+            <ListView fx:id="transformsList" prefHeight="200.0" prefWidth="200.0">
+                <VBox.vgrow>ALWAYS</VBox.vgrow>
+            </ListView>
+          </children>
+        </VBox>
+      </content>
+    </TitledPane>
+  </panes>
+</Accordion>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/src/main/resources/com/javafx/experiments/jfx3dviewer/viewer.css	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2010, 2013 Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
+ *
+ * This file is available and licensed under the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+.split-pane {
+    -fx-background-color: null;
+    -fx-background-insets: 0, 0;
+    -fx-padding: 0;
+}
+#statusBar > .container {
+    -fx-alignment: center;
+}
+#statusBar .text {
+    -fx-font-size: 11px;
+    -fx-font-weight: bold;
+    -fx-fill: #1d3866;
+    -fx-effect: dropshadow(one-pass-box, white, 0, 1.0, 0, 1);
+}
+#zoomBar {
+    -fx-background-insets: 0, 1;
+    -fx-background-radius: 10, 10;
+    -fx-padding: 2 0 2 0;
+}
+#zoomBar > .increment-button > .increment-arrow {
+    -fx-padding: 4;
+    -fx-shape: "M124.438,1083.516H121.5v-2.953c0-0.587-0.476-1.062-1.062-1.062s-1.062,0.476-1.062,1.062v2.953h-2.812c-0.587,0-1.062,0.476-1.062,1.062s0.476,1.062,1.062,1.062h2.812v2.797c0,0.587,0.476,1.062,1.062,1.062s1.062-0.476,1.062-1.062v-2.797h2.938c0.587,0,1.062-0.476,1.062-1.062S125.024,1083.516,124.438,1083.516z";
+}
+#zoomBar > .decrement-button > .decrement-arrow {
+    -fx-padding: 2 8 0 0;
+    -fx-shape: "M128.562,1085.625c-0.587,0-1.062-0.476-1.062-1.062l0,0c0-0.587,0.476-1.062,1.062-1.062h7.875 c0.587,0,1.062,0.476,1.062,1.062l0,0c0,0.587-0.476,1.062-1.062,1.062H128.562z";
+}
+#zoomBar > .decrement-button {
+    -fx-padding: 8 6 8 6;
+    -fx-background-radius: 10;
+}
+#zoomBar > .increment-button {
+    -fx-padding: 5 6 5 6;
+    -fx-background-radius: 10;
+}
+.four-way {
+    -fx-background-radius: 100;
+    -fx-padding: 3px;
+}
+.four-way > * {
+    -fx-shape: "M6.623,6.144L6.62,8.168L2.372,2.501L6.62-3.167L6.623-1.14l-2.8,3.641L6.623,6.";
+    -fx-scale-shape: false;
+    -fx-padding: 4px;
+    -fx-background-color: -fx-mark-highlight-color,derive(-fx-base,-45%);
+    -fx-effect: dropshadow(two-pass-box , -fx-shadow-highlight-color, 1, 0.0 , 0, 1.4);
+}
+.four-way > .center {
+    -fx-scale-shape: false;
+    -fx-padding: 10px;
+}
+.four-way > .up {
+    -fx-rotate: 90;
+}
+.four-way > .down {
+    -fx-rotate: -90;
+}
+.four-way > .right {
+    -fx-rotate: 180;
+    -fx-effect: dropshadow(two-pass-box , -fx-shadow-highlight-color, 1, 0.0 , 0, -1.4);
+}
+#eyeNav > .center {
+    -fx-shape: "M121.5,1093.484c-3.866,0-7,2.025-7,4.523s3.134,4.523,7,4.523s7-2.025,7-4.523S125.366,1093.484,121.5,1093.484z M121.5,1101.531c-3.252,0-6-1.613-6-3.523s2.748-3.523,6-3.523s6,1.613,6,3.523S124.752,1101.531,121.5,1101.531z M121.5,1094.833c-1.749,0-3.167,1.418-3.167,3.167s1.418,3.167,3.167,3.167s3.167-1.418,3.167-3.167S123.249,1094.833,121.5,1094.833z M120.595,1097.548c-0.25,0-0.453-0.202-0.453-0.453c0-0.25,0.203-0.452,0.453-0.452s0.452,0.202,0.452,0.452C121.047,1097.346,120.845,1097.548,120.595,1097.548z";
+}
+#camNav > .center {
+    -fx-shape: "M20.34,47.5c0,0-0.875-2.688-1.938-3.688s-4.688-4.438-3.625-5.562s5.25,2.25,5.25,2.25s-3.295-7.148-1.438-8c1.5-0.688,3.438,4.938,3.438,4.938S21.34,30.5,23.152,30.5c1.938,0,1.25,6.938,1.25,6.938s1.5-6.188,2.938-5.812s0,6.375,0,6.375s3.039-3.571,3.812-2.875c1.25,1.125-2.381,5.987-2.443,7.362S28.277,47.5,28.277,47.5H20.34z";
+}
+.four-way > .up:pressed,
+.four-way > .down:pressed,
+.four-way > .left:pressed,
+.four-way > .right:pressed {
+    -fx-effect: dropshadow(gaussian, -fx-accent, 15, 0.7, 0, 0);
+
+}
+.settings-header {
+    -fx-font-weight: bold;
+    -fx-alignment: center;
+    -fx-text-fill: #6f6f6f;
+    -fx-border-color: transparent transparent #dddddd transparent;
+}
+.settings {
+    -fx-font-size: 11px;
+}
+/**
+.radio-button:selected > .radio > .dot,
+.check-box:selected > .box > .mark,
+.check-box:indeterminate  > .box > .mark {
+    -fx-background-color: -fx-mark-highlight-color, -fx-mark-color !important;
+    -fx-background-insets: 1 0 -1 0, 0;
+}
+
+*/
+.settings .check-box > .box > .mark {
+    -fx-background-color: -fx-mark-highlight-color, -fx-mark-color !important;
+    -fx-background-insets: 1 0 -1 0, 0;
+    -fx-shape: "M0.288,2.742C0.48,2.195,0.756,1.716,1.115,1.308C1.476,0.9,1.918,0.58,2.442,0.348S3.555,0,4.212,0c0.664,0,1.256,0.116,1.776,0.348s0.96,0.552,1.32,0.96c0.36,0.408,0.636,0.886,0.828,1.434C8.328,3.29,8.424,3.885,8.424,4.524c0,0.624-0.096,1.206-0.288,1.746c-0.192,0.54-0.468,1.01-0.828,1.41c-0.36,0.4-0.8,0.714-1.32,0.942S4.876,8.964,4.212,8.964c-0.656,0-1.246-0.114-1.77-0.342S1.476,8.08,1.115,7.68c-0.36-0.4-0.636-0.87-0.828-1.41C0.095,5.73,0,5.148,0,4.524C0,3.885,0.095,3.29,0.288,2.742z M2.01,5.574c0.084,0.34,0.218,0.646,0.402,0.918c0.184,0.272,0.424,0.49,0.72,0.654s0.656,0.246,1.08,0.246c0.424,0,0.784-0.082,1.08-0.246s0.536-0.382,0.72-0.654S6.33,5.914,6.414,5.574c0.084-0.34,0.126-0.69,0.126-1.05c0-0.376-0.042-0.74-0.126-1.092S6.196,2.766,6.011,2.49c-0.184-0.276-0.424-0.496-0.72-0.66s-0.656-0.246-1.08-0.246c-0.424,0-0.784,0.082-1.08,0.246s-0.536,0.384-0.72,0.66C2.228,2.766,2.094,3.08,2.01,3.432S1.884,4.148,1.884,4.524C1.884,4.884,1.926,5.234,2.01,5.574z M11.58,0.204l3.576,5.748h0.024V0.204h1.764v8.568H15.06l-3.564-5.736h-0.024v5.736H9.708V0.204H11.58z M28.524,2.742c0.191-0.548,0.468-1.026,0.828-1.434c0.359-0.408,0.802-0.728,1.326-0.96C31.202,0.116,31.792,0,32.448,0c0.664,0,1.256,0.116,1.776,0.348c0.52,0.232,0.96,0.552,1.319,0.96c0.36,0.408,0.637,0.886,0.828,1.434c0.192,0.548,0.288,1.142,0.288,1.782c0,0.624-0.096,1.206-0.288,1.746c-0.191,0.54-0.468,1.01-0.828,1.41c-0.359,0.4-0.8,0.714-1.319,0.942c-0.521,0.228-1.112,0.342-1.776,0.342c-0.656,0-1.246-0.114-1.77-0.342c-0.524-0.228-0.967-0.542-1.326-0.942c-0.36-0.4-0.637-0.87-0.828-1.41c-0.192-0.54-0.288-1.122-0.288-1.746C28.236,3.885,28.332,3.29,28.524,2.742z M30.246,5.574c0.084,0.34,0.218,0.646,0.402,0.918c0.184,0.272,0.424,0.49,0.72,0.654s0.656,0.246,1.08,0.246s0.784-0.082,1.08-0.246s0.536-0.382,0.72-0.654c0.185-0.272,0.318-0.578,0.402-0.918c0.084-0.34,0.126-0.69,0.126-1.05c0-0.376-0.042-0.74-0.126-1.092s-0.218-0.666-0.402-0.942c-0.184-0.276-0.424-0.496-0.72-0.66s-0.656-0.246-1.08-0.246s-0.784,0.082-1.08,0.246s-0.536,0.384-0.72,0.66c-0.185,0.276-0.318,0.59-0.402,0.942S30.12,4.148,30.12,4.524C30.12,4.884,30.162,5.234,30.246,5.574zM43.968,0.204v1.584h-4.14v1.98h3.588v1.464h-3.588v3.54h-1.884V0.204H43.968z M51.083,0.204v1.584h-4.14v1.98h3.588v1.464h-3.588v3.54h-1.884V0.204H51.083z";
+    -fx-padding: 4.5 25.5 4.5 25.5;
+}
+.settings .check-box > .box {
+    -fx-padding: 5px 5px 5px 7px;
+    -fx-background-color:
+        -fx-shadow-highlight-color,
+        -fx-outer-border,
+        -fx-inner-border,
+        -fx-body-color,
+        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
+        linear-gradient(to bottom, derive(-fx-color, -22%) 0%, derive(-fx-color, -13%) 20%, derive(-fx-color, -11%) 50%);
+    -fx-background-insets: 0 0 -1 0, 0, 1, 2, 0 0 0 30, 1 1 1 31;
+    -fx-background-radius: 3px, 3px, 2px, 1px, 0 2px 2px 0, 0 1 1 0;
+}
+.settings .check-box:selected > .box {
+    -fx-background-color:
+        -fx-shadow-highlight-color,
+        -fx-outer-border,
+        -fx-inner-border,
+        -fx-body-color,
+        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
+        linear-gradient(to bottom, derive(-fx-default-button, -12%) 0%, derive(-fx-default-button, -3%) 20%, derive(-fx-default-button, -1%) 50%);
+
+    -fx-background-insets: 0 0 -1 0, 0, 1, 2, 0 32 0 0, 1 33 1 1;
+    -fx-background-radius: 3px, 3px, 2px, 1px, 2px 0 0 2px, 1 0 0 1;
+}
+.settings .check-box:focused > .box {
+    -fx-background-color:
+        -fx-focus-color,
+        -fx-inner-border,
+        -fx-body-color,
+        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
+        linear-gradient(to bottom, derive(-fx-color, -22%) 0%, derive(-fx-color, -13%) 20%, derive(-fx-color, -11%) 50%);
+    -fx-background-insets: -0.2, 1, 2, 1 1 1 30, 1 1 1 31;
+    -fx-background-radius: 3px, 2px, 1px, 0 2px 2px 0, 0 1 1 0;
+}
+.settings .check-box:focused:selected > .box {
+    -fx-background-color:
+        -fx-focus-color,
+        -fx-inner-border,
+        -fx-body-color,
+        linear-gradient(to bottom, derive(-fx-outer-border, -20%), -fx-outer-border),
+        linear-gradient(to bottom, derive(-fx-default-button, -12%) 0%, derive(-fx-default-button, -3%) 20%, derive(-fx-default-button, -1%) 50%);
+    -fx-background-insets: -0.2, 1, 2, 1 32 1 1, 1 33 1 1;
+    -fx-background-radius: 3px, 2px, 1px, 2px 0 0 2px, 1 0 0 1;
+}
+#playControls * {
+    -fx-content-display: graphic-only;
+}
+#playControls > * > Pane {
+    -fx-background-color: white,#666;
+    -fx-background-insets: 1 0 -1 0, 0;
+}
+#playControls > #startBtn > Pane {
+    -fx-shape: "M27.05,532h-0.782c-0.333,0-0.602,0.273-0.602,0.61v14.659c0,0.338,0.269,0.61,0.602,0.61h0.782c0.332,0,0.602-0.272,0.602-0.61V532.61C27.652,532.273,27.382,532,27.05,532zM38.9,532l-9.263,7.94l9.263,7.939V532z";
+}
+#playControls > #rwBtn > Pane {
+    -fx-shape: "M64.866,531.999l-8.818,7.965l8.818,7.964v-6.796l7.301,6.796v-15.929l-7.301,6.797V531.999z";
+}
+#playControls > #playBtn:selected  > Pane {
+    -fx-shape: "M20.716,531.999c-0.665,0-1.204,0.542-1.204,1.212v13.328c0,0.671,0.539,1.213,1.204,1.213h2.188c0.665,0,1.203-0.542,1.203-1.213v-13.328c0-0.67-0.538-1.212-1.203-1.212H20.716zM10.87,531.999c-0.665,0-1.204,0.542-1.204,1.212v13.328c0,0.671,0.539,1.213,1.204,1.213h2.188c0.665,0,1.203-0.542,1.203-1.213v-13.328c0-0.67-0.539-1.212-1.203-1.212H10.87z";
+}
+#playControls > #playBtn> Pane {
+    -fx-shape: "M0,531.999l8.667,8L0,548V531.999z";
+}
+#playControls > #ffBtn > Pane {
+    -fx-shape: "M82.09,532v6.606L74.833,532v15.832l7.257-6.606v6.606l8.576-7.916L82.09,532z";
+}
+#playControls > #endBtn > Pane {
+    -fx-shape: "M52.525,532c-0.333,0-0.602,0.273-0.602,0.611v14.669c0,0.337,0.27,0.611,0.602,0.611h0.782c0.333,0,0.602-0.274,0.602-0.611v-14.669c0-0.338-0.27-0.611-0.602-0.611H52.525zM40.667,532v15.892l9.27-7.946L40.667,532z";
+}
+.tool-bar #loopBtn Pane {
+    -fx-shape: "M103.31,539.442v-2.544h-6.487c-0.907,0-1.646,0.738-1.646,1.646v1.637l-2.512,2.526v-4.163c0-2.296,1.861-4.157,4.157-4.157h6.487v-2.392l4.034,3.724L103.31,539.442z M92.753,544.033l4.034,3.725v-2.393h6.487c2.296,0,4.157-1.861,4.157-4.157v-4.163l-2.512,2.526v1.637c0,0.907-0.738,1.646-1.646,1.646h-6.487v-2.544L92.753,544.033z";
+}
+.timeline-display {
+    -fx-font-size: 10px;
+    -fx-font-weight: bold;
+    -fx-padding: 6 6 4 6;
+}
+.timeline-display .background {
+    -fx-background-color: white,#b8c3a6;
+    -fx-background-insets: 1 0 -1 0,0;
+    -fx-background-radius: 6, 6;
+    -fx-effect: innershadow(gaussian, #52574abb, 5, 0, 0, 2);
+}
+.timeline-display Text {
+    -fx-fill: #52574a;
+}
+.timeline-display .bar {
+    -fx-border-color: #52574a;
+}
+.timeline-display .progress {
+    -fx-background-color: #52574a;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/Modena/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/main/resources"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/rt">
+	<attributes>
+		<attribute name="optional" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/Modena/.project	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Modena</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/Modena/build.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="Modena" default="default" basedir=".">
+    <description>Builds, tests, and runs the project Modena.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)
+      run:                      execution of project 
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="Modena-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on 
+    the compile target as the regular run target does. Again, for a list of available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+</project>
--- a/apps/experiments/Modena/nbproject/build-impl.xml	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/experiments/Modena/nbproject/build-impl.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -54,6 +54,43 @@
         <property file="nbproject/project.properties"/>
     </target>
     <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <j2seproject1:property name="platform.home" value="platforms.${platform.active}.home"/>
+        <j2seproject1:property name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/>
+        <j2seproject1:property name="platform.compiler" value="platforms.${platform.active}.compile"/>
+        <j2seproject1:property name="platform.javac.tmp" value="platforms.${platform.active}.javac"/>
+        <condition property="platform.javac" value="${platform.home}/bin/javac">
+            <equals arg1="${platform.javac.tmp}" arg2="$${platforms.${platform.active}.javac}"/>
+        </condition>
+        <property name="platform.javac" value="${platform.javac.tmp}"/>
+        <j2seproject1:property name="platform.java.tmp" value="platforms.${platform.active}.java"/>
+        <condition property="platform.java" value="${platform.home}/bin/java">
+            <equals arg1="${platform.java.tmp}" arg2="$${platforms.${platform.active}.java}"/>
+        </condition>
+        <property name="platform.java" value="${platform.java.tmp}"/>
+        <j2seproject1:property name="platform.javadoc.tmp" value="platforms.${platform.active}.javadoc"/>
+        <condition property="platform.javadoc" value="${platform.home}/bin/javadoc">
+            <equals arg1="${platform.javadoc.tmp}" arg2="$${platforms.${platform.active}.javadoc}"/>
+        </condition>
+        <property name="platform.javadoc" value="${platform.javadoc.tmp}"/>
+        <condition property="platform.invalid" value="true">
+            <or>
+                <contains string="${platform.javac}" substring="$${platforms."/>
+                <contains string="${platform.java}" substring="$${platforms."/>
+                <contains string="${platform.javadoc}" substring="$${platforms."/>
+            </or>
+        </condition>
+        <fail unless="platform.home">Must set platform.home</fail>
+        <fail unless="platform.bootcp">Must set platform.bootcp</fail>
+        <fail unless="platform.java">Must set platform.java</fail>
+        <fail unless="platform.javac">Must set platform.javac</fail>
+        <fail if="platform.invalid">
+ The J2SE Platform is not correctly set up.
+ Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. 
+ Either open the project in the IDE and setup the Platform with the same name or add it manually.
+ For example like this:
+     ant -Duser.properties.file=&lt;path_to_property_file&gt; jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
+  or ant -Dplatforms.${platform.active}.home=&lt;path_to_JDK_home&gt; jar (where no properties file is used) 
+  </fail>
         <available file="${manifest.file}" property="manifest.available"/>
         <condition property="splashscreen.available">
             <and>
@@ -140,7 +177,11 @@
         </condition>
         <condition property="have.sources">
             <or>
+                <available file="${src.modena.dir}"/>
+                <available file="${src.modena2.dir}"/>
                 <available file="${src.dir}"/>
+                <available file="${src.java.dir}"/>
+                <available file="${src.resources.dir}"/>
             </or>
         </condition>
         <condition property="netbeans.home+have.tests">
@@ -188,15 +229,6 @@
         <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
             <length length="0" string="${endorsed.classpath}" when="greater"/>
         </condition>
-        <condition else="false" property="jdkBug6558476">
-            <and>
-                <matches pattern="1\.[56]" string="${java.specification.version}"/>
-                <not>
-                    <os family="unix"/>
-                </not>
-            </and>
-        </condition>
-        <property name="javac.fork" value="${jdkBug6558476}"/>
         <property name="jar.index" value="false"/>
         <property name="jar.index.metainf" value="${jar.index}"/>
         <property name="copylibs.rebase" value="true"/>
@@ -228,7 +260,11 @@
         <!-- You can override this target in the ../build.xml file. -->
     </target>
     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.modena.dir">Must set src.modena.dir</fail>
+        <fail unless="src.modena2.dir">Must set src.modena2.dir</fail>
         <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="src.java.dir">Must set src.java.dir</fail>
+        <fail unless="src.resources.dir">Must set src.resources.dir</fail>
         <fail unless="test.src.dir">Must set test.src.dir</fail>
         <fail unless="build.dir">Must set build.dir</fail>
         <fail unless="dist.dir">Must set dist.dir</fail>
@@ -250,7 +286,7 @@
     </target>
     <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${src.modena.dir}:${src.modena2.dir}:${src.dir}:${src.java.dir}:${src.resources.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -265,7 +301,7 @@
                 <property location="${build.dir}/empty" name="empty.dir"/>
                 <mkdir dir="${empty.dir}"/>
                 <mkdir dir="@{apgeneratedsrcdir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
                     <src>
                         <dirset dir="@{gensrcdir}" erroronmissingdir="false">
                             <include name="*"/>
@@ -290,7 +326,7 @@
     </target>
     <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${src.modena.dir}:${src.modena2.dir}:${src.dir}:${src.java.dir}:${src.resources.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -304,7 +340,7 @@
             <sequential>
                 <property location="${build.dir}/empty" name="empty.dir"/>
                 <mkdir dir="${empty.dir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
                     <src>
                         <dirset dir="@{gensrcdir}" erroronmissingdir="false">
                             <include name="*"/>
@@ -322,7 +358,7 @@
     </target>
     <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
         <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${src.modena.dir}:${src.modena2.dir}:${src.dir}:${src.java.dir}:${src.resources.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <sequential>
@@ -384,7 +420,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
                     <syspropertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -407,7 +443,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <batchtest todir="${build.test.results.dir}">
                         <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
@@ -446,7 +482,7 @@
                     </fileset>
                 </union>
                 <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
-                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Modena" testname="TestNG tests" workingDir="${work.dir}">
+                <testng classfilesetref="test.set" failureProperty="tests.failed" jvm="${platform.java}" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Modena" testname="TestNG tests" workingDir="${work.dir}">
                     <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
                     <propertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -526,7 +562,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
                     <syspropertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -551,7 +587,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <batchtest todir="${build.test.results.dir}">
                         <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
@@ -731,6 +767,9 @@
                     <classpath>
                         <path path="@{classpath}"/>
                     </classpath>
+                    <bootclasspath>
+                        <path path="${platform.bootcp}"/>
+                    </bootclasspath>
                 </nbjpdastart>
             </sequential>
         </macrodef>
@@ -746,7 +785,9 @@
         </macrodef>
     </target>
     <target name="-init-debug-args">
-        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <exec executable="${platform.java}" outputproperty="version-output">
+            <arg value="-version"/>
+        </exec>
         <condition property="have-jdk-older-than-1.4">
             <or>
                 <contains string="${version-output}" substring="java version &quot;1.0"/>
@@ -771,7 +812,7 @@
             <attribute default="${debug.classpath}" name="classpath"/>
             <element name="customize" optional="true"/>
             <sequential>
-                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                <java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                     <jvmarg line="${debug-args-line}"/>
                     <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
@@ -798,7 +839,7 @@
             <attribute default="jvm" name="jvm"/>
             <element name="customize" optional="true"/>
             <sequential>
-                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                <java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                     <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
                     <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
@@ -920,12 +961,16 @@
                 <include name="*"/>
             </dirset>
         </pathconvert>
-        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
+        <j2seproject3:depend srcdir="${src.modena.dir}:${src.modena2.dir}:${src.dir}:${src.java.dir}:${src.resources.dir}:${build.generated.subdirs}"/>
     </target>
     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
         <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
         <copy todir="${build.classes.dir}">
+            <fileset dir="${src.modena.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.modena2.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.java.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.resources.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
         </copy>
     </target>
     <target if="has.persistence.xml" name="-copy-persistence-xml">
@@ -946,7 +991,7 @@
     <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile/>
-        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.modena.dir}:${src.modena2.dir}:${src.dir}:${src.java.dir}:${src.resources.dir}"/>
     </target>
     <target name="-post-compile-single">
         <!-- Empty placeholder for easier customization. -->
@@ -985,7 +1030,7 @@
             <path path="${run.classpath}"/>
             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
         </pathconvert>
-        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+        <echo level="info">${platform.java} -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
     </target>
     <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
         <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
@@ -1012,7 +1057,7 @@
         <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
         <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+        <echo level="info">${platform.java} -jar "${dist.jar.resolved}"</echo>
     </target>
     <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
         <delete>
@@ -1203,13 +1248,25 @@
                 </not>
             </and>
         </condition>
-        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" executable="${platform.javadoc}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
             <classpath>
                 <path path="${javac.classpath}"/>
             </classpath>
+            <fileset dir="${src.modena.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.modena2.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
             <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
+            <fileset dir="${src.java.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.resources.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
                 <include name="**/*.java"/>
                 <exclude name="*.java"/>
@@ -1217,9 +1274,21 @@
             <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
         </javadoc>
         <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.modena.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.modena2.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
             <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
+            <fileset dir="${src.java.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.resources.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
                 <include name="**/doc-files/**"/>
             </fileset>
--- a/apps/experiments/Modena/nbproject/genfiles.properties	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/experiments/Modena/nbproject/genfiles.properties	Tue Jul 09 09:36:39 2013 -0700
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=83fefa80
+build.xml.data.CRC32=404da80d
 build.xml.script.CRC32=dcafbe5a
 build.xml.stylesheet.CRC32=28e38971@1.56.1.46
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=83fefa80
-nbproject/build-impl.xml.script.CRC32=2fd1e588
+nbproject/build-impl.xml.data.CRC32=404da80d
+nbproject/build-impl.xml.script.CRC32=4573e166
 nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
--- a/apps/experiments/Modena/nbproject/project.properties	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/experiments/Modena/nbproject/project.properties	Tue Jul 09 09:36:39 2013 -0700
@@ -59,7 +59,7 @@
 manifest.file=manifest.mf
 meta.inf.dir=${src.dir}/META-INF
 mkdist.disabled=false
-platform.active=default_platform
+platform.active=JDK_1.8
 run.classpath=\
     ${javac.classpath}:\
     ${build.classes.dir}
@@ -72,4 +72,8 @@
     ${build.test.classes.dir}
 source.encoding=UTF-8
 src.dir=src
+src.java.dir=src/main/java
+src.modena.dir=src/main/java/modena
+src.modena2.dir=src/main/resources/modena
+src.resources.dir=src/main/resources
 test.src.dir=test
--- a/apps/experiments/Modena/nbproject/project.xml	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/experiments/Modena/nbproject/project.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -4,8 +4,13 @@
     <configuration>
         <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
             <name>Modena</name>
+            <explicit-platform explicit-source-supported="true"/>
             <source-roots>
+                <root id="src.modena.dir"/>
+                <root id="src.modena2.dir"/>
                 <root id="src.dir"/>
+                <root id="src.java.dir"/>
+                <root id="src.resources.dir"/>
             </source-roots>
             <test-roots>
                 <root id="test.src.dir"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/samples/Ensemble8/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/app/java"/>
+	<classpathentry kind="src" path="src/app/resources"/>
+	<classpathentry kind="src" path="src/samples/java"/>
+	<classpathentry kind="src" path="src/samples/resources"/>
+	<classpathentry kind="src" path="src/compiletime/java"/>
+	<classpathentry kind="src" path="src/generated/java"/>
+    <classpathentry kind="src" path="src/generated/resources"/>
+	<classpathentry kind="lib" path="lib/lucene-core-3.2.0.jar"/>
+	<classpathentry kind="lib" path="lib/lucene-grouping-3.2.0.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/rt">
+	<attributes>
+		<attribute name="optional" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/samples/Ensemble8/.project	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Ensemble8</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/samples/Ensemble8/build.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="Ensemble8" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
+    <description>Builds, tests, and runs the project Ensemble8.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)
+      run:                      execution of project 
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="Ensemble8-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on 
+    the compile target as the regular run target does. Again, for a list of available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+    
+    <!-- COPY SAMPLE SRC TO BUILD DIR -->
+    <target name="-pre-compile">
+        <echo>Copying all sample source files to build dir</echo>
+         <copy todir="${build.classes.dir}">
+            <fileset dir="${basedir}/src/samples">
+                <include name="**/samples/**/*.java"/>
+                <include name="**/*.js"/> <!-- include javascript files -->
+                <include name="**/*.wav"/> <!-- include wav files -->
+                <include name="**/*.css"/> <!-- include css files -->
+            </fileset>
+        </copy>
+    </target>
+    
+    <!-- DON'T INCLUDE COMPILE TIME CODE IN APP JAR -->
+    <target name="-pre-jar">
+        <delete dir="${build.classes.dir}/ensemble/compiletime"/>
+    </target>
+    
+    <!-- COPY LIBS INTO JAR FILE: so that we have a simple single jar application -->
+    <target name="-post-jar" depends="jfx-deployment">
+        <zip destfile="${dist.jar}" update="true">
+            <zipfileset src="${file.reference.lucene-core-3.2.0.jar}"/>
+            <zipfileset src="${file.reference.lucene-grouping-3.2.0.jar}"/>
+        </zip>
+    </target>
+    
+    <target name="ensemble-generate-samples-class" depends="init,compile" description="Ensemble: Generate source for all samples data class.">
+       <java classname="ensemble.compiletime.EnsembleCompiletimeMain" dir="${basedir}">
+         <arg value="samples"/>
+         <classpath>
+           <pathelement location="${build.classes.dir}"/>
+           <pathelement path="${javac.classpath}"/>
+         </classpath>
+       </java>
+    </target>
+    
+    <target name="ensemble-generate-search-index" depends="init,compile" description="Ensemble: Generate search index.">
+       <delete dir="${basedir}/src/generated/ensemble/search/index"/>
+       <java classname="ensemble.compiletime.EnsembleCompiletimeMain" dir="${basedir}">
+         <arg value="index"/>
+         <classpath>
+           <pathelement location="${build.classes.dir}"/>
+           <pathelement path="${javac.classpath}"/>
+         </classpath>
+       </java>
+    </target>
+    
+    <target name="jfx-deployment">
+        <!-- Delete the Ensemble8.jar build by netbeans as we will build one with JavaFX packager -->
+        <delete file="${dist.jar}"/>  
+        <fx:application id="ensemble8"
+                        name="${application.title}"
+                        mainClass="ensemble.EnsembleApp"/>
+        <fx:jar destfile="${dist.jar}">
+            <fx:application refId="ensemble8"/>
+            <fileset dir="${build.classes.dir}"/>
+            <manifest>
+                <attribute name="Implementation-Vendor" value="${application.vendor}"/>
+                <attribute name="Implementation-Title" value="${application.title}"/>
+                <attribute name="Implementation-Version" value="1.0"/>
+            </manifest>
+        </fx:jar>
+    </target>    
+</project>
--- a/apps/samples/Ensemble8/nbproject/build-impl.xml	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/samples/Ensemble8/nbproject/build-impl.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -54,6 +54,43 @@
         <property file="nbproject/project.properties"/>
     </target>
     <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <j2seproject1:property name="platform.home" value="platforms.${platform.active}.home"/>
+        <j2seproject1:property name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/>
+        <j2seproject1:property name="platform.compiler" value="platforms.${platform.active}.compile"/>
+        <j2seproject1:property name="platform.javac.tmp" value="platforms.${platform.active}.javac"/>
+        <condition property="platform.javac" value="${platform.home}/bin/javac">
+            <equals arg1="${platform.javac.tmp}" arg2="$${platforms.${platform.active}.javac}"/>
+        </condition>
+        <property name="platform.javac" value="${platform.javac.tmp}"/>
+        <j2seproject1:property name="platform.java.tmp" value="platforms.${platform.active}.java"/>
+        <condition property="platform.java" value="${platform.home}/bin/java">
+            <equals arg1="${platform.java.tmp}" arg2="$${platforms.${platform.active}.java}"/>
+        </condition>
+        <property name="platform.java" value="${platform.java.tmp}"/>
+        <j2seproject1:property name="platform.javadoc.tmp" value="platforms.${platform.active}.javadoc"/>
+        <condition property="platform.javadoc" value="${platform.home}/bin/javadoc">
+            <equals arg1="${platform.javadoc.tmp}" arg2="$${platforms.${platform.active}.javadoc}"/>
+        </condition>
+        <property name="platform.javadoc" value="${platform.javadoc.tmp}"/>
+        <condition property="platform.invalid" value="true">
+            <or>
+                <contains string="${platform.javac}" substring="$${platforms."/>
+                <contains string="${platform.java}" substring="$${platforms."/>
+                <contains string="${platform.javadoc}" substring="$${platforms."/>
+            </or>
+        </condition>
+        <fail unless="platform.home">Must set platform.home</fail>
+        <fail unless="platform.bootcp">Must set platform.bootcp</fail>
+        <fail unless="platform.java">Must set platform.java</fail>
+        <fail unless="platform.javac">Must set platform.javac</fail>
+        <fail if="platform.invalid">
+ The J2SE Platform is not correctly set up.
+ Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. 
+ Either open the project in the IDE and setup the Platform with the same name or add it manually.
+ For example like this:
+     ant -Duser.properties.file=&lt;path_to_property_file&gt; jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
+  or ant -Dplatforms.${platform.active}.home=&lt;path_to_JDK_home&gt; jar (where no properties file is used) 
+  </fail>
         <available file="${manifest.file}" property="manifest.available"/>
         <condition property="splashscreen.available">
             <and>
@@ -138,10 +175,13 @@
         </condition>
         <condition property="have.sources">
             <or>
-                <available file="${src.compiletime.dir}"/>
-                <available file="${src.generated.dir}"/>
-                <available file="${src.app.dir}"/>
-                <available file="${src.samples.dir}"/>
+                <available file="${src.java.dir}"/>
+                <available file="${src.resources.dir}"/>
+                <available file="${src.java2.dir}"/>
+                <available file="${src.resources2.dir}"/>
+                <available file="${src.java3.dir}"/>
+                <available file="${src.java4.dir}"/>
+                <available file="${src.resources3.dir}"/>
             </or>
         </condition>
         <condition property="netbeans.home+have.tests">
@@ -189,15 +229,6 @@
         <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
             <length length="0" string="${endorsed.classpath}" when="greater"/>
         </condition>
-        <condition else="false" property="jdkBug6558476">
-            <and>
-                <matches pattern="1\.[56]" string="${java.specification.version}"/>
-                <not>
-                    <os family="unix"/>
-                </not>
-            </and>
-        </condition>
-        <property name="javac.fork" value="${jdkBug6558476}"/>
         <property name="jar.index" value="false"/>
         <property name="jar.index.metainf" value="${jar.index}"/>
         <property name="copylibs.rebase" value="true"/>
@@ -229,10 +260,13 @@
         <!-- You can override this target in the ../build.xml file. -->
     </target>
     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
-        <fail unless="src.compiletime.dir">Must set src.compiletime.dir</fail>
-        <fail unless="src.generated.dir">Must set src.generated.dir</fail>
-        <fail unless="src.app.dir">Must set src.app.dir</fail>
-        <fail unless="src.samples.dir">Must set src.samples.dir</fail>
+        <fail unless="src.java.dir">Must set src.java.dir</fail>
+        <fail unless="src.resources.dir">Must set src.resources.dir</fail>
+        <fail unless="src.java2.dir">Must set src.java2.dir</fail>
+        <fail unless="src.resources2.dir">Must set src.resources2.dir</fail>
+        <fail unless="src.java3.dir">Must set src.java3.dir</fail>
+        <fail unless="src.java4.dir">Must set src.java4.dir</fail>
+        <fail unless="src.resources3.dir">Must set src.resources3.dir</fail>
         <fail unless="build.dir">Must set build.dir</fail>
         <fail unless="dist.dir">Must set dist.dir</fail>
         <fail unless="build.classes.dir">Must set build.classes.dir</fail>
@@ -253,7 +287,7 @@
     </target>
     <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.compiletime.dir}:${src.generated.dir}:${src.app.dir}:${src.samples.dir}" name="srcdir"/>
+            <attribute default="${src.java.dir}:${src.resources.dir}:${src.java2.dir}:${src.resources2.dir}:${src.java3.dir}:${src.java4.dir}:${src.resources3.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -268,7 +302,7 @@
                 <property location="${build.dir}/empty" name="empty.dir"/>
                 <mkdir dir="${empty.dir}"/>
                 <mkdir dir="@{apgeneratedsrcdir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
                     <src>
                         <dirset dir="@{gensrcdir}" erroronmissingdir="false">
                             <include name="*"/>
@@ -293,7 +327,7 @@
     </target>
     <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.compiletime.dir}:${src.generated.dir}:${src.app.dir}:${src.samples.dir}" name="srcdir"/>
+            <attribute default="${src.java.dir}:${src.resources.dir}:${src.java2.dir}:${src.resources2.dir}:${src.java3.dir}:${src.java4.dir}:${src.resources3.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -307,7 +341,7 @@
             <sequential>
                 <property location="${build.dir}/empty" name="empty.dir"/>
                 <mkdir dir="${empty.dir}"/>
-                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
                     <src>
                         <dirset dir="@{gensrcdir}" erroronmissingdir="false">
                             <include name="*"/>
@@ -325,7 +359,7 @@
     </target>
     <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
         <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.compiletime.dir}:${src.generated.dir}:${src.app.dir}:${src.samples.dir}" name="srcdir"/>
+            <attribute default="${src.java.dir}:${src.resources.dir}:${src.java2.dir}:${src.resources2.dir}:${src.java3.dir}:${src.java4.dir}:${src.resources3.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <sequential>
@@ -387,7 +421,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
                     <syspropertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -410,7 +444,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <batchtest todir="${build.test.results.dir}">
                         <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
                             <filename name="${test.binarytestincludes}"/>
@@ -442,7 +476,7 @@
                 </condition>
                 <union id="test.set"/>
                 <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
-                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Ensemble8" testname="TestNG tests" workingDir="${work.dir}">
+                <testng classfilesetref="test.set" failureProperty="tests.failed" jvm="${platform.java}" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Ensemble8" testname="TestNG tests" workingDir="${work.dir}">
                     <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
                     <propertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -522,7 +556,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
                     <syspropertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -547,7 +581,7 @@
             <element name="customize" optional="true"/>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
-                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
                     <batchtest todir="${build.test.results.dir}">
                         <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
                             <filename name="${test.binarytestincludes}"/>
@@ -724,6 +758,9 @@
                     <classpath>
                         <path path="@{classpath}"/>
                     </classpath>
+                    <bootclasspath>
+                        <path path="${platform.bootcp}"/>
+                    </bootclasspath>
                 </nbjpdastart>
             </sequential>
         </macrodef>
@@ -739,7 +776,9 @@
         </macrodef>
     </target>
     <target name="-init-debug-args">
-        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <exec executable="${platform.java}" outputproperty="version-output">
+            <arg value="-version"/>
+        </exec>
         <condition property="have-jdk-older-than-1.4">
             <or>
                 <contains string="${version-output}" substring="java version &quot;1.0"/>
@@ -764,7 +803,7 @@
             <attribute default="${debug.classpath}" name="classpath"/>
             <element name="customize" optional="true"/>
             <sequential>
-                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                <java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                     <jvmarg line="${debug-args-line}"/>
                     <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
@@ -791,7 +830,7 @@
             <attribute default="jvm" name="jvm"/>
             <element name="customize" optional="true"/>
             <sequential>
-                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                <java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                     <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
                     <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
@@ -913,15 +952,18 @@
                 <include name="*"/>
             </dirset>
         </pathconvert>
-        <j2seproject3:depend srcdir="${src.compiletime.dir}:${src.generated.dir}:${src.app.dir}:${src.samples.dir}:${build.generated.subdirs}"/>
+        <j2seproject3:depend srcdir="${src.java.dir}:${src.resources.dir}:${src.java2.dir}:${src.resources2.dir}:${src.java3.dir}:${src.java4.dir}:${src.resources3.dir}:${build.generated.subdirs}"/>
     </target>
     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
         <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
         <copy todir="${build.classes.dir}">
-            <fileset dir="${src.compiletime.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.generated.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.app.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
-            <fileset dir="${src.samples.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.java.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.resources.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.java2.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.resources2.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.java3.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.java4.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.resources3.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
         </copy>
     </target>
     <target if="has.persistence.xml" name="-copy-persistence-xml">
@@ -942,7 +984,7 @@
     <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile/>
-        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.compiletime.dir}:${src.generated.dir}:${src.app.dir}:${src.samples.dir}"/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.java.dir}:${src.resources.dir}:${src.java2.dir}:${src.resources2.dir}:${src.java3.dir}:${src.java4.dir}:${src.resources3.dir}"/>
     </target>
     <target name="-post-compile-single">
         <!-- Empty placeholder for easier customization. -->
@@ -981,7 +1023,7 @@
             <path path="${run.classpath}"/>
             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
         </pathconvert>
-        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+        <echo level="info">${platform.java} -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
     </target>
     <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
         <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
@@ -1008,7 +1050,7 @@
         <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
         <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
-        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+        <echo level="info">${platform.java} -jar "${dist.jar.resolved}"</echo>
     </target>
     <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
         <delete>
@@ -1199,20 +1241,29 @@
                 </not>
             </and>
         </condition>
-        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" executable="${platform.javadoc}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
             <classpath>
                 <path path="${javac.classpath}"/>
             </classpath>
-            <fileset dir="${src.compiletime.dir}" excludes="*.java,${excludes}" includes="${includes}">
+            <fileset dir="${src.java.dir}" excludes="*.java,${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
-            <fileset dir="${src.generated.dir}" excludes="*.java,${excludes}" includes="${includes}">
+            <fileset dir="${src.resources.dir}" excludes="*.java,${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
-            <fileset dir="${src.app.dir}" excludes="*.java,${excludes}" includes="${includes}">
+            <fileset dir="${src.java2.dir}" excludes="*.java,${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
-            <fileset dir="${src.samples.dir}" excludes="*.java,${excludes}" includes="${includes}">
+            <fileset dir="${src.resources2.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.java3.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.java4.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.resources3.dir}" excludes="*.java,${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
@@ -1222,16 +1273,25 @@
             <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
         </javadoc>
         <copy todir="${dist.javadoc.dir}">
-            <fileset dir="${src.compiletime.dir}" excludes="${excludes}" includes="${includes}">
+            <fileset dir="${src.java.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
-            <fileset dir="${src.generated.dir}" excludes="${excludes}" includes="${includes}">
+            <fileset dir="${src.resources.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
-            <fileset dir="${src.app.dir}" excludes="${excludes}" includes="${includes}">
+            <fileset dir="${src.java2.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
-            <fileset dir="${src.samples.dir}" excludes="${excludes}" includes="${includes}">
+            <fileset dir="${src.resources2.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.java3.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.java4.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.resources3.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
--- a/apps/samples/Ensemble8/nbproject/genfiles.properties	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/samples/Ensemble8/nbproject/genfiles.properties	Tue Jul 09 09:36:39 2013 -0700
@@ -3,6 +3,6 @@
 build.xml.stylesheet.CRC32=28e38971@1.56.1.46
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=134533ca
-nbproject/build-impl.xml.script.CRC32=aa7c6be7
+nbproject/build-impl.xml.data.CRC32=8d0eded5
+nbproject/build-impl.xml.script.CRC32=67848eb1
 nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
--- a/apps/samples/Ensemble8/nbproject/project.properties	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/samples/Ensemble8/nbproject/project.properties	Tue Jul 09 09:36:39 2013 -0700
@@ -27,6 +27,7 @@
 dist.javadoc.dir=${dist.dir}/javadoc
 endorsed.classpath=
 excludes=
+file.reference.ant-javafx.jar=/Users/debram/projects/jdk8b96/jdk1.8.0.jdk/Contents/Home/lib/ant-javafx.jar
 file.reference.jfxrt.jar=../../../../artifacts/sdk/rt/lib/ext/jfxrt.jar
 file.reference.lucene-core-3.2.0.jar=lib/lucene-core-3.2.0.jar
 file.reference.lucene-grouping-3.2.0.jar=lib/lucene-grouping-3.2.0.jar
@@ -35,6 +36,7 @@
 jar.compress=true
 jar.index=${jnlp.enabled}
 javac.classpath=\
+    .:\
     ${file.reference.lucene-core-3.2.0.jar}:\
     ${file.reference.lucene-grouping-3.2.0.jar}:\
     ${file.reference.jfxrt.jar}
@@ -42,7 +44,8 @@
 javac.compilerargs=
 javac.deprecation=false
 javac.processorpath=\
-    ${javac.classpath}
+    ${javac.classpath}:\
+    ${file.reference.ant-javafx.jar}
 javac.source=1.7
 javac.target=1.7
 javac.test.classpath=\
@@ -61,6 +64,9 @@
 javadoc.use=true
 javadoc.version=false
 javadoc.windowtitle=
+jnlp.applet.class=ensemble.samples.swing.swinginterop.SwingInterop
+jnlp.applet.height=300
+jnlp.applet.width=300
 jnlp.codebase.type=no.codebase
 jnlp.descriptor=application
 jnlp.enabled=false
@@ -74,7 +80,7 @@
 manifest.file=manifest.mf
 meta.inf.dir=${src.dir}/META-INF
 mkdist.disabled=true
-platform.active=default_platform
+platform.active=JDK_1.8
 run.classpath=\
     ${javac.classpath}:\
     ${build.classes.dir}
@@ -86,7 +92,10 @@
     ${javac.test.classpath}:\
     ${build.test.classes.dir}
 source.encoding=UTF-8
-src.app.dir=src/app
-src.compiletime.dir=src/compiletime
-src.generated.dir=src/generated
-src.samples.dir=src/samples
+src.java.dir=src/app/java
+src.java2.dir=src/generated/java
+src.java3.dir=src/compiletime/java
+src.java4.dir=src/samples/java
+src.resources.dir=src/app/resources
+src.resources2.dir=src/generated/resources
+src.resources3.dir=src/samples/resources
--- a/apps/samples/Ensemble8/nbproject/project.xml	Sun Jul 07 19:34:28 2013 -0700
+++ b/apps/samples/Ensemble8/nbproject/project.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -4,11 +4,15 @@
     <configuration>
         <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
             <name>Ensemble8</name>
+            <explicit-platform explicit-source-supported="true"/>
             <source-roots>
-                <root id="src.compiletime.dir"/>
-                <root id="src.generated.dir"/>
-                <root id="src.app.dir"/>
-                <root id="src.samples.dir"/>
+                <root id="src.java.dir"/>
+                <root id="src.resources.dir"/>
+                <root id="src.java2.dir"/>
+                <root id="src.resources2.dir"/>
+                <root id="src.java3.dir"/>
+                <root id="src.java4.dir"/>
+                <root id="src.resources3.dir"/>
             </source-roots>
             <test-roots/>
         </data>
--- a/build.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/build.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -96,18 +96,6 @@
 }
 
 /**
- * Converts the simple name of a library to the full name. For example, on mac
- * the simple name "glass" becomes "libglass.dylib". On Linux or Solaris, it would
- * be "libglass.so", and on Windows "glass.dll".
- *
- * @param name The simple name of the library
- * @return The name of the shared library file
- */
-String library(String name) {
-    return "${IS_WINDOWS ? '' : 'lib'}$name.${IS_WINDOWS ? 'dll' : IS_MAC ? 'dylib' : 'so'}"
-}
-
-/**
  * Converts cygwin style paths to windows style paths, but with a forward slash.
  * This method is safe to call from any platform, and will only do work if
  * called on Windows (in all other cases it simply returns the supplied path.
@@ -649,13 +637,22 @@
     // For each compile target, create a javah / cc / link triplet
     compileTargets { t ->
         def targetProperties = project.rootProject.ext[t.upper]
+        def library = targetProperties.library
         def properties = targetProperties.get(name)
         def nativeDir = file("$nativeRootDir/${t.name}")
         def headerDir = file("$headerRootDir/${t.name}")
         def javahTask = project.task("javah${t.capital}${capitalName}", type: JavaHeaderTask, dependsOn: project.classes, group: "Build") {
             description = "Generates JNI Headers for ${name} for ${t.name}"
-            source(project.sourceSets.main.output.classesDir)
-            classpath = project.files(project.sourceSets.main.output.classesDir)
+            if (properties.javahSource == null) {
+                source(project.sourceSets.main.output.classesDir)
+            } else {
+                source(properties.javahSource)
+            }
+            if (properties.javahClasspath == null) {
+                classpath = project.files(project.sourceSets.main.output.classesDir)
+            } else {
+                classpath = project.files(properties.javahClasspath)
+            }
             if (rootProject.BINARY_STUB != null) classpath += rootProject.BINARY_STUB
             output = headerDir
             include(properties.javahInclude)
@@ -691,6 +688,16 @@
                 linkTask.dependsOn rcTask;
             }
         }
+
+        def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
+        if (useLipo) {
+            def lipoTask = project.task("lipo${t.capital}$capitalName", type: LipoTask, dependsOn: javahTask, group: "Build") {
+                description = "Creates native fat library for $name for ${t.name}"
+                libDir = file("$libRootDir/${t.name}")
+                lib = file("$libRootDir/${t.name}/${library(properties.lib)}")
+            }
+            nativeTask.dependsOn(lipoTask)
+        }
     }
 }
 
@@ -753,8 +760,8 @@
 
 allprojects {
     // We want to configure all projects as java projects and use the same compile settings
-    // etc, except for the root project which we just want to ignore (and for now media and web...)
-    if (project == rootProject || project.name == "media" || project.name == "web") return
+    // etc, except for the root project which we just want to ignore (and for now media)
+    if (project == rootProject || project.name == "media") return
     // All of our projects are java projects
     apply plugin: "java"
     sourceCompatibility = 1.8
@@ -1043,6 +1050,7 @@
         def upperTarget = t.upper
         def capitalTarget = t.capital
         def properties = rootProject.ext[upperTarget];
+        def library = properties.library
 
         def ccTask = task("compileDecoraNativeShaders$capitalTarget", type: CCTask, dependsOn: generateDecoraNativeHeaders) {
             description = "Compiles Decora SSE natives"
@@ -1128,30 +1136,28 @@
     // available in some known location. Maybe in the future the Gradle plugins to each
     // of the IDEs will be good enough that we won't need this hack anymore.
     classes << {
-        // Copy all of the download libraries to .libs for the sake of the IDEs
-        File libsDir = rootProject.file(".libs");
-        if (!libsDir.exists()) {
-            libsDir.mkdirs();
-            for (File f : [configurations.compile.files, configurations.antlr3.files].flatten()) {
-                copy {
-                    into libsDir
-                    from f.getParentFile()
-                    include "**/plugin.jar"
-                    include "**/antlr-3.1.3.jar"
-                    include "**/stringtemplate-3.2.jar"
-                    include "**/antlr-runtime-3.1.3.jar"
-                    includeEmptyDirs = false
-                }
-                // Have to rename the swt jar because it is some platform specific name but
-                // for the sake of the IDEs we need to have a single stable name that works
-                // on every platform
-                copy {
-                    into libsDir
-                    from f.getParentFile()
-                    include "**/*swt*.jar"
-                    includeEmptyDirs = false
-                    rename ".*swt.*jar", "swt\\.jar"
-                }
+        // Copy all of the download libraries to the libs directory for the sake of the IDEs
+        File libsDir = rootProject.file("build/libs");
+        libsDir.mkdirs();
+        for (File f : [configurations.compile.files, configurations.antlr3.files].flatten()) {
+            copy {
+                into libsDir
+                from f.getParentFile()
+                include "**/plugin.jar"
+                include "**/antlr-3.1.3.jar"
+                include "**/stringtemplate-3.2.jar"
+                include "**/antlr-runtime-3.1.3.jar"
+                includeEmptyDirs = false
+            }
+            // Have to rename the swt jar because it is some platform specific name but
+            // for the sake of the IDEs we need to have a single stable name that works
+            // on every platform
+            copy {
+                into libsDir
+                from f.getParentFile()
+                include "**/*swt*.jar"
+                includeEmptyDirs = false
+                rename ".*swt.*jar", "swt-debug\\.jar"
             }
         }
     }
@@ -1236,7 +1242,7 @@
 
     dependencies {
         compile BUILD_SRC, project(":base"), project(":graphics"),
-                project(":controls"), project(":swt"), project(":swing")
+                project(":controls"), project(":swt"), project(":swing"), project(":web")
         testCompile project(":graphics").sourceSets.stub.output
     }
     test {
@@ -1432,18 +1438,16 @@
     jar.dependsOn buildJavaFXPackager
 
     classes << {
-        // Copy all of the download libraries to .libs for the sake of the IDEs
-        File libsDir = rootProject.file(".libs");
+        // Copy all of the download libraries to libs directory for the sake of the IDEs
+        File libsDir = rootProject.file("build/libs");
         File antLib = new File(libsDir, "ant-1.8.2.jar")
-        if (!antLib.exists()) {
-            libsDir.mkdirs();
-            for (File f : configurations.compile.files) {
-                copy {
-                    into libsDir
-                    from f.getParentFile()
-                    include "**/ant-1.8.2.jar"
-                    includeEmptyDirs = false
-                }
+        libsDir.mkdirs();
+        for (File f : configurations.compile.files) {
+            copy {
+                into libsDir
+                from f.getParentFile()
+                include "**/ant-1.8.2.jar"
+                includeEmptyDirs = false
             }
         }
     }
@@ -1526,7 +1530,7 @@
     executable = JAVADOC
     def projectsToDocument = [
             project(":base"), project(":graphics"), project(":controls"),
-            project(":swing"), project(":swt"), project(":fxml")]
+            project(":swing"), project(":swt"), project(":fxml"), project(":web")]
     source(projectsToDocument.collect({
         [it.sourceSets.main.java, "$it.buildDir/generated-src/builders"]
     }));
@@ -1640,6 +1644,7 @@
 
 compileTargets { t ->
     def targetProperties = project.ext[t.upper]
+    def library = targetProperties.library
     // The jfxrt task is responsible for creating the jfxrt.jar. A developer may
     // have multiple SDK's on their system at any one time, depending on which
     // cross compiles they have done. For example, I might have:
@@ -1670,6 +1675,13 @@
              "modules/graphics/build/resources/jsl-prism");
         if (COMPILE_SWING) from ("modules/swing/build/classes/main", "modules/swing/build/resources/main")
         if (COMPILE_SWT) from ("modules/swt/build/classes/main", "modules/swt/build/resources/main")
+        if (t.name == 'android') {
+            from ("modules/web/build/classes/android", "modules/web/build/resources/android")
+        } else if (t.name == 'ios') {
+            from ("modules/web/build/classes/ios", "modules/web/build/resources/ios")
+        } else {
+            from ("modules/web/build/classes/main", "modules/web/build/resources/main")
+        }
         exclude("js/**/*", // er...
                 "PrismLoaderBackend*", // More decora stuff
                 "**/*.stg",    // any glue files for decora must be excluded
@@ -1691,24 +1703,32 @@
             // TODO instead of using copy everywhere, I probably want to use "sync" instead?
             // Copy all of the .dll / .so / .dylib native libraries into build/sdk/rt/lib/
             copy {
-                from("modules/graphics/build/libs/jsl-decora/${t.name}/${library(targetProperties.decora.lib)}",
-                     "modules/graphics/build/libs/prism/${t.name}/${library(targetProperties.prism.lib)}",
-                     "modules/graphics/build/libs/prismSW/${t.name}/${library(targetProperties.prismSW.lib)}",
-                     "modules/graphics/build/libs/font/${t.name}/${library(targetProperties.font.lib)}",
-                     "modules/graphics/build/libs/iio/${t.name}/${library(targetProperties.iio.lib)}");
-                def es2Variants = targetProperties.prismES2.containsKey("variants") ? targetProperties.prismES2.variants : [""];
-                es2Variants.each { variant ->
-                    def variantProperties = variant == "" ? targetProperties.prismES2 : targetProperties.prismES2.get(variant)
-                    from ("modules/graphics/build/libs/prismES2/${t.name}/${library(variantProperties.lib)}");
-                }
-                def glassVariants = targetProperties.glass.containsKey("variants") ? targetProperties.glass.variants : [""];
-                glassVariants.each { variant ->
-                    def variantProperties = variant == "" ? targetProperties.glass : targetProperties.glass.get(variant)
-                    from ("modules/graphics/build/libs/glass/${t.name}/${library(variantProperties.lib)}");
+                def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
+                from("modules/graphics/build/libs/jsl-decora/${t.name}/${library(targetProperties.decora.lib)}")
+                ['font', 'prism', 'prismSW', 'prismES2', 'glass', 'iio'].each { lib ->
+                    def variants = targetProperties[lib].containsKey('variants') && !useLipo ? targetProperties[lib].variants : [null]
+                    variants.each { variant ->
+                        def variantProperties = variant ? targetProperties[lib][variant] : targetProperties[lib]
+                        println "modules/graphics/build/libs/$lib/$t.name/${library(variantProperties.lib)}"
+                        from ("modules/graphics/build/libs/$lib/$t.name/${library(variantProperties.lib)}")
+                    }
                 }
                 if (IS_WINDOWS) {
                     from ("modules/graphics/build/libs/prismD3D/${t.name}/${library(targetProperties.prismD3D.lib)}");
-                    rename("lib(.*).dll", "\$1.dll");
+                }
+                if (COMPILE_WEBKIT) {
+                    from ("modules/web/build/libs/${library('jfxwebkit')}")
+                    if (IS_WINDOWS) {
+                        from ("modules/web/src/main/native/WebKitLibraries/import/runtime")
+                    }
+                } else {
+                    if (IS_MAC && COMPILE_TARGETS != "ios") from ("$LIBRARY_STUB/libjfxwebkit.dylib")
+                    else if (IS_WINDOWS) {
+                        from ("$LIBRARY_STUB/jfxwebkit.dll")
+                        from ("$LIBRARY_STUB/libxml2.dll")
+                        from ("$LIBRARY_STUB/libxslt.dll")
+                    }
+                    else from ("$LIBRARY_STUB/libjfxwebkit.so")
                 }
                 def libDest = targetProperties.libDest
                 into ("build/${t.name}-sdk/rt/$libDest")
@@ -1765,6 +1785,18 @@
         dependsOn(jfxrtTask)
         dependsOn(javadoc)
     }
+
+    def generateSymbols = targetProperties.containsKey('generateSymbols') ? targetProperties.generateSymbols : false
+    if (generateSymbols) {
+        def exportedSymbolsTask = project.task("exportedSymbols${t.capital}", type: ExportedSymbolsTask, dependsOn: sdkTask, group: "Build") {
+            description = "Generates exported symbols file for iOS build (from .a libraries)"
+            def libDirName = "build/${t.name}-sdk/rt/$targetProperties.libDest"
+            libDir = file("$libDirName")
+            outputFile = file("$libDirName/exported.symbols")
+        }
+        sdk.dependsOn(exportedSymbolsTask)
+    }
+
     sdk.dependsOn(sdkTask)
 }
 
@@ -1878,7 +1910,7 @@
 
 allprojects {
     apply plugin: 'idea'
-    if (project == rootProject || project.name == "media" || project.name == "web") return
+    if (project == rootProject || project.name == "media") return
 
     // Also need to un-exclude the build-dir since we put stuff in it, and then re-exclude other stuff
     if (rootProject.BINARY_STUB != null) {
@@ -2267,15 +2299,6 @@
                     it.enabled = false
                 }
             }
-
-            if (BUILD_CLOSED && srcdir.exists()) {
-                def cptask = project.task('copyAppsArtifacts', type: Copy ) {
-                    dependsOn project.getPath() + ":jar"
-                    from project.jar.archivePath
-                    into "$rootProject.jfxArtifactsDir/apps/ga-samples"
-                }
-                rootProject.apps.dependsOn(cptask)
-            }
         }
     }
 }
@@ -2294,3 +2317,217 @@
 if (BUILD_CLOSED) {
     apply from: supplementalBuildFile
 }
+
+// This project has to be defined after [supplementalBuildFile]
+// because it depends on media tasks
+project(":web") {
+    def platform = IS_MAC ? "mac" :
+            IS_WINDOWS ? (IS_64 ? "win-amd64" : "win-i586") :
+                IS_64 ? "linux-amd64" : "linux-i586"
+                
+    if (COMPILE_WEBKIT) {
+        configurations {
+            webkit
+        }
+        dependencies {
+            compile project(":base"), project(":graphics"), project(":controls")
+            webkit group: "com.sun.webkit", name: "webview-deps",
+                   version: "1.0", classifier: "$platform", ext: "zip"
+        }
+    }
+
+    compileJava.enabled = COMPILE_WEBKIT
+    if (BUILD_CLOSED && COMPILE_GSTREAMER) {
+        compileJava.dependsOn compileMediaJava
+        compileJava.classpath += files(
+                "../media/build/classes/main",
+                "$jfxTopDir/media/jfxmedia/dist/jfxmedia.jar")
+    }
+    compileJava.exclude "com/sun/javafx/webkit/drt/**/*"
+
+    test {
+        classpath += files("../../../artifacts/sdk/rt/lib/ext/jfxrt.jar")
+        doFirst {
+            classpath.each { p ->
+                print "Test CLASSPATH: ${p.getPath()}\n"
+            }
+        }
+    }
+    
+    task generateHeaders(dependsOn: compileJava) {
+        doLast {
+            def classpath = files("$buildDir/classes/main",
+                                  project(":graphics").sourceSets.main.output.classesDir)
+            def dest = file("src/main/build/javah");
+            mkdir dest;
+            exec {
+                commandLine("$JAVAH", "-J-Djava.ext.dirs=", "-d", "$dest",
+                            "-classpath", "${classpath.asPath}");
+                args("java.lang.Character",
+                     "java.net.IDN",
+                     "com.sun.webkit.ContextMenu",
+                     "com.sun.webkit.ContextMenuItem",
+                     "com.sun.webkit.CursorManager",
+                     "com.sun.webkit.PageCache",
+                     "com.sun.webkit.PopupMenu",
+                     "com.sun.webkit.SharedBuffer",
+                     "com.sun.webkit.WebPage",
+                     "com.sun.webkit.LoadListenerClient",
+                     "com.sun.webkit.event.WCFocusEvent",
+                     "com.sun.webkit.event.WCKeyEvent",
+                     "com.sun.webkit.event.WCMouseEvent",
+                     "com.sun.webkit.event.WCMouseWheelEvent",
+                     "com.sun.webkit.graphics.GraphicsDecoder",
+                     "com.sun.webkit.graphics.RenderMediaControls",
+                     "com.sun.webkit.graphics.RenderTheme",
+                     "com.sun.webkit.graphics.ScrollBarTheme",
+                     "com.sun.webkit.graphics.WCMediaPlayer",
+                     "com.sun.webkit.graphics.WCGraphicsManager",
+                     "com.sun.webkit.graphics.WCRenderQueue",
+                     "com.sun.webkit.graphics.WCPath",
+                     "com.sun.webkit.graphics.WCPathIterator",
+                     "com.sun.webkit.Timer",
+                     "com.sun.webkit.WCFrameView",
+                     "com.sun.webkit.WCPasteboard",
+                     "com.sun.webkit.WCPluginWidget",
+                     "com.sun.webkit.dom.JSObject",
+                     "com.sun.webkit.network.SocketStreamHandle",
+                     "com.sun.webkit.network.URLLoader",
+                     "com.sun.webkit.text.TextBreakIterator",
+                     "com.sun.webkit.text.TextNormalizer");
+            }
+        }
+    }
+
+    def webkitOutputDir = "src/main/native/WebKitBuild/$CONF"
+
+    task compileNative(dependsOn: generateHeaders) {
+        doLast {
+            ant.unzip(src:  configurations.webkit.files.iterator().next(),
+                      dest: "src/main/native/WebKitLibraries")
+            exec {
+                println "Webkit configuration to use: $CONF"
+                workingDir("src/main/native")
+                commandLine("perl", "Tools/Scripts/set-webkit-configuration", "--$CONF")
+            }
+            exec {
+                workingDir("src/main/native")
+                if (IS_WINDOWS) {
+                    String qtDir = cygpath(System.getenv().get("QTSDK_DIR"))
+                    Map environmentSettings = new HashMap(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
+                    environmentSettings["JAVA_HOME"] = JAVA_HOME
+                    environmentSettings["PATH"] = "$WINDOWS_VS_PATH;$qtDir/bin;$qtDir/qt/bin"
+                    environmentSettings["QMAKESPEC"] = "win32-msvc2008"
+                    environment(environmentSettings)
+                    /* To build with ICU:
+                    1. Download http://javaweb.us.oracle.com/jcg/fx-webrevs/RT-17164/WebKitLibrariesICU.zip
+                    and unzip it to WebKitLibraries folder.
+                    2. Copy DLLs from
+                    WebKitLibrariesICU.zip\WebKitLibraries\import\runtime
+                    to %windir%\system32
+                    3. Uncomment the line below
+                     */
+                    // args("--icu-unicode")
+                } else if (IS_MAC) {
+                    environment([
+                        "QMAKESPEC"      : "macx-g++",
+                        "QMAKE_CFLAGS"   : "-m64",
+                        "QMAKE_LFLAGS"   : "-m64",
+                        "JAVA_HOME"      : JDK_HOME
+                    ])
+                // TODO need to re-enable. It looks like linux doesn't ever build
+                // webkit at all which is also not right.
+                // } else if (IS_LINUX && COMPILE_TARGETS != "linux") {
+                // We need some way to detect cross build here. The CompileTarget
+                // enum from rt/build.gradle is out of scope here, so I cannot write
+                //     COMPILE_TARGET != CompileTarget.LINUX
+                // Once web module is open sourced, this target will be moved into
+                // rt/build.gradle, thus eliminating the problem.
+                // For now, work around it with a name check.
+                //            } else if (IS_LINUX && (! "LINUX".equals(COMPILE_TARGET.name()))) {
+                //                // Linux cross build
+                //                mkdir "$webkitOutputDir"
+                //                File qmakeSpec = new File("$webkitOutputDir/qmake.conf")
+                //                qmakeSpec.append(
+                //"""TARGET_PLATFORM         = unix
+                //include(/usr/share/qt4/mkspecs/common/linux.conf)
+                //include(/usr/share/qt4/mkspecs/common/g++.conf)
+                //include(/usr/share/qt4/mkspecs/common/qws.conf)
+                //QMAKE_CC                = $crosstools.gcc.bin
+                //QMAKE_CXX               = $crosstools.gpp.bin
+                //QMAKE_LINK              = $crosstools.gpp.bin
+                //QMAKE_LINK_SHLIB        = $crosstools.gpp.bin
+                //QMAKE_AR                = $crosstools.ar.bin cqs
+                //QMAKE_OBJCOPY           = $crosstools.objcopy.bin
+                //QMAKE_STRIP             = $crosstools.strip.bin
+                //load(qt_config)""")
+                //                environment([
+                //                    "QMAKESPEC" : webkitOutputDir,
+                //                    "WK_CFLAGS" : crosstools.extra_cflags,
+                //                    "WK_LFLAGS" : crosstools.extra_ldflags,
+                //                    "PATH"      : "$cross.tools/bin:$PATH",
+                //                ])
+                //                args("--nocache")
+                } else {
+                    environment([
+                        "JAVA_HOME"   : JDK_HOME
+                    ])
+                }
+                commandLine("perl", "Tools/Scripts/build-webkit", "--java", "--imageio")
+            }
+            copy {
+                /// Reuse the library lambda here
+                from "$webkitOutputDir/lib/libjfxwebkit.so"
+                from "$webkitOutputDir/lib/libjfxwebkit.dylib"
+                from "$webkitOutputDir/lib/jfxwebkit.dll"
+                into "build/libs"
+            }
+        }
+    }
+    
+    task compileGenerated(type: JavaCompile, dependsOn: compileNative) {
+        def gensrcDir = "$webkitOutputDir/WebCore/generated/java"
+        doFirst {
+            copy {
+                from "src/main/native/Source/WebCore/bindings/java/EventListenerImpl.java"
+                into "$gensrcDir/com/sun/webkit/dom"
+            }
+        }
+        classpath = files("$buildDir",
+                          project(":graphics").sourceSets.main.output.classesDir)
+        source gensrcDir
+        destinationDir = file("$buildDir/classes/main")
+        doLast {
+            copy {
+                from gensrcDir
+                into "build/resources/main"
+                exclude "**/*.java"
+            }
+        }
+    }
+
+    task copyClassesFromBinaryStub << {
+        copy {
+            from zipTree(BINARY_STUB.getSingleFile())
+            into "build/classes/main"
+            include("javafx/scene/web/**",
+                "com/sun/javafx/scene/web/**",
+                "com/sun/webkit/**",
+                "com/sun/javafx/webkit/**",
+                "netscape/javascript/**",
+                "com/sun/javafx/sg/prism/NGWebView*")
+        }
+    }
+
+    jar.dependsOn (COMPILE_WEBKIT ? compileGenerated : copyClassesFromBinaryStub)
+    
+    clean << {
+        project.delete(
+            "src/main/build",
+            "$webkitOutputDir",
+            "src/main/native/WebKitBuild/Tools",
+            "src/main/native/WebKitBuild/classes",
+            "src/main/native/dist",
+            "src/main/native/WebKitLibraries/import")
+    }
+}
--- a/buildSrc/.classpath	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -3,13 +3,12 @@
   <classpathentry kind="src" path="build/generated-src/antlr"/>
   <classpathentry kind="src" path="src/main/java"/>
   <classpathentry kind="src" path="src/test/java"/>
-  <classpathentry kind="lib" exported="true" path="../.libs/ant-1.8.2.jar"/>
-  <classpathentry kind="lib" exported="true" path="../.libs/antlr-3.1.3.jar"/>
-  <classpathentry kind="lib" exported="true" path="../.libs/antlr-runtime-3.1.3.jar"/>
-  <classpathentry kind="lib" exported="true" path="../.libs/plugin.jar"/>
-  <classpathentry kind="lib" exported="true" path="../.libs/stringtemplate-3.2.jar"/>
-  <classpathentry kind="lib" exported="true" path="../.libs/swt.jar"/>
-  <classpathentry kind="lib" exported="true" path="../../caches/sdk/rt/lib/ext/jfxrt.jar"/>
+  <classpathentry kind="lib" exported="true" path="../build/libs/ant-1.8.2.jar"/>
+  <classpathentry kind="lib" exported="true" path="../build/libs/antlr-3.1.3.jar"/>
+  <classpathentry kind="lib" exported="true" path="../build/libs/antlr-runtime-3.1.3.jar"/>
+  <classpathentry kind="lib" exported="true" path="../build/libs/plugin.jar"/>
+  <classpathentry kind="lib" exported="true" path="../build/libs/stringtemplate-3.2.jar"/>
+  <classpathentry kind="lib" exported="true" path="../build/libs/swt-debug.jar"/>
   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
   <classpathentry kind="output" path="bin"/>
--- a/buildSrc/android.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/android.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -46,13 +46,22 @@
     return "android-" + max
 }
 
-ext.ANDROID = [:]
-
 def closedDir = file("$projectDir/../rt-closed")
 
 defineProperty("ANDROID_CROSS_TOOLS_VER", "arm-linux-androideabi-4.4.3")
 defineProperty("ARM_ARCH", "armeabi")//armeabi-v7
 
+ANDROID = [:]
+ANDROID.compileSwing = false;
+ANDROID.compileSWT = false;
+ANDROID.compileFXPackager = false;
+ANDROID.compileDesignTime = false;
+ANDROID.glassPlatform = "android"
+ANDROID.armArch = "${ARM_ARCH}"
+ANDROID.libDest = "lib/${ANDROID.armArch}"
+ANDROID.jfxdvklib = "jfxdvk.jar"
+ANDROID.library = { name -> return "lib${name}.so" as String }
+
 // Look for the the Android SDK & NDK to use, as well as the compiler stuff
 def sdk = project.hasProperty("ANDROID_SDK") ? getLatestPlatform("$ANDROID_SDK") : null;
 def ndk = project.hasProperty("ANDROID_NDK") ? getLatestPlatform("$ANDROID_NDK") : null;
@@ -87,17 +96,17 @@
         sourceCompatibility = JavaVersion.VERSION_1_6
         targetCompatibility = JavaVersion.VERSION_1_6
         options.bootClasspath = "${ANDROID_SDK}/platforms/${ANDROID_SDK_TARGET}/android.jar"
-        classpath = files("build/classes/main")
-        destinationDir = file("build/classes/main")
+        classpath = files("build/classes/android")
+        destinationDir = file("build/classes/android")
         dependencyCacheDir = file("build/dependency-cache")
-        source "src/main/android"
+        source "src/android/java"
     }
 
     task jarDalvikLibs(type: Jar, group: "Build", dependsOn: compileDalvikLibs) {
         description = "Creates jfxdvk.jar with all dalvik based classes."
         archiveName = "jfxdvk.jar"
         includeEmptyDirs = false
-        from("build/classes/main")
+        from("build/classes/android")
         include("com/oracle/dalvik/**/*")
         dependsOn(compileDalvikLibs)
     }
@@ -114,12 +123,14 @@
                 def props = project.ext["ANDROID"]
                 copy {
                     from(
-                         "modules/graphics/build/libs/vmlauncher/android/${library(props.vmlauncher.lib)}",
-                         "modules/graphics/build/libs/surface/android/${library(props.surface.lib)}",
-                         "modules/graphics/build/libs/${props.jfxdvklib}"
-                    );
-                    def libDest = props.libDest
-                    into ("build/android-sdk/dalvik")
+                         "modules/graphics/build/libs/vmlauncher/android/${props.library(props.vmlauncher.lib)}",
+                         "modules/graphics/build/libs/surface/android/${props.library(props.surface.lib)}"
+                    )                    
+                    into ("build/android-sdk/dalvik/${props.libDest}")
+                }
+                copy {
+                    from ("modules/graphics/build/libs/${props.jfxdvklib}")
+                    into ("build/android-sdk/dalvik/lib")
                 }
             }
         }
@@ -129,65 +140,67 @@
 project(":web") {
     apply plugin: 'java'
 
-    sourceSets {
-        android {
-            java {
-                //srcDir 'src/android/java'
-                srcDir '${closedDir}/javafx-android/webnode/src'
-            }
-        }
-    }
-
     compileJava {
         enabled = false
     }
 
     afterEvaluate {
-        configure(compileAndroidJava, { t ->
-                t.classpath = files(
-                    project(":graphics").sourceSets.main.output.classesDir,
-                    project(":base").sourceSets.main.output.classesDir
-                )
-                t.dependsOn(project(":graphics").classes, project(":base").classes)
-            })
+        if (!BUILD_CLOSED) {
+            logger.warn("OpenJFX build. Skipping webkit build on Android.")
+            return
+        }
+        def compileWebJavaAndroid = task("compileWebJavaAndroid",
+            type: JavaCompile, group: "Build") {
+            
+            dependsOn(project(":graphics").classes, project(":base").classes)
+            description = "Task compiles web component for Android."
+            classpath = files(
+                project(":graphics").sourceSets.main.output.classesDir,
+                project(":base").sourceSets.main.output.classesDir
+            )
+            destinationDir = file("modules/web/build/classes/android")
+            dependencyCacheDir = file("modules/web/build/dependency-cache")
+            source file("${closedDir}/javafx-android/webnode/src")
+        }
+
+        def jarWebJavaAndroid = task("jarWebJavaAndroid",
+            type: Jar, group: "Build") {
+            description = "Creates web.jar for Android."
+            dependsOn(compileWebJavaAndroid)
+            archiveName = "web.jar"
+            includeEmptyDirs = false
+            destinationDir = project.file("build/libs/android")
+            from("build/classes/android")
+        }
 
         addNative(project, "webview")
         addNative(project, "dvkwebview")
-        javahAndroidWebview.dependsOn(compileAndroidJava)
-        javahAndroidDvkwebview.dependsOn(compileAndroidJava)
+        javahAndroidWebview.dependsOn(compileWebJavaAndroid)
+        javahAndroidDvkwebview.dependsOn(compileWebJavaAndroid)
 
         jfxrtAndroid {
             from "modules/web/build/classes/android"
         }
 
-        sdkAndroid << {
-            def props = project.ext["ANDROID"]
-            copy {
-                from(
-                     "modules/web/build/libs/webview/android/${library(props.webview.lib)}"
-                )
-                def libDest = props.libDest
-                into ("build/android-sdk/rt/$libDest")
-            }
-            copy {
-                from(
-                    "modules/web/build/libs/dvkwebview/android/${library(props.dvkwebview.lib)}"
-                )
-                def libDest = props.libDest
-                into ("build/android-sdk/dalvik")
+        sdkAndroid  {
+            dependsOn(jarWebJavaAndroid)
+            doLast {
+                def props = project.ext["ANDROID"]
+                copy {
+                    from(
+                         "modules/web/build/libs/dvkwebview/android/${props.library(props.dvkwebview.lib)}"
+                    )                    
+                    into ("build/android-sdk/dalvik/${props.libDest}")
+                }
+                copy {
+                    from ("modules/web/build/libs/webview/android/${props.library(props.webview.lib)}")
+                    into ("build/android-sdk/rt/${props.libDest}")
+                }
             }
         }
     }
 }
 
-ANDROID.compileSwing = false;
-ANDROID.compileSWT = false;
-ANDROID.compileFXPackager = false;
-ANDROID.compileDesignTime = false;
-ANDROID.glassPlatform = "android"
-ANDROID.armArch = "${ARM_ARCH}"
-ANDROID.libDest = "lib/${ANDROID.armArch}"
-ANDROID.jfxdvklib = "jfxdvk.jar"
 
 ANDROID.jfxrtJarExcludes = [
     "**/*.hlsl",
@@ -225,8 +238,9 @@
 android.use.egl=true
 android.com.sun.javafx.isEmbedded=true
 """
+def sysroot = "${ANDROID_NDK}/platforms/${ANDROID_NDK_TARGET}/arch-arm"
 
-def ccFlags = ["-std=c99", "-DANDROID", "-c", "-nostdlib", "-DANDROID_NDK"]
+def ccFlags = ["--sysroot=$sysroot","-std=c99", "-DANDROID", "-c", "-nostdlib", "-DANDROID_NDK"]
 def ccOptFlags = ["-fpic", "-ffunction-sections", "-funwind-tables","-fstack-protector",
                   "-Os", "-O2", "-fno-strict-aliasing", "-finline-limit=64", "-fomit-frame-pointer"]
 def ccWarnFlags = ["-Wa,--noexecstack", "-Wno-psabi"]
@@ -235,24 +249,25 @@
 def ccDebugFlags = [IS_DEBUG ? "-DDEBUG" : "-DNDEBUG"]
 def ccDefaultIncludeFlags = ["-I${ANDROID_NDK}/platforms/${ANDROID_NDK_TARGET}/arch-arm/usr/include"]
 
-def linkFlags = ["--sysroot=${ANDROID_NDK}/platforms/${ANDROID_NDK_TARGET}/arch-arm",
+def linkFlags = ["--sysroot=$sysroot",
                  "-Wl,--no-undefined", "-Wl,-z,noexecstack", "-lc", "-lm", "-shared",
                  "-L${ANDROID_NDK}/platforms/${ANDROID_NDK_TARGET}/arch-arm/usr/lib"]
 
 
 ANDROID.vmlauncher = [:]
-ANDROID.vmlauncher.classpath =
-files("${ANDROID_SDK}/platforms/${ANDROID_SDK_TARGET}/android.jar",
-      "modules/graphics/build/classes/main")
+ANDROID.vmlauncher.classpath = files("${ANDROID_SDK}/platforms/${ANDROID_SDK_TARGET}/android.jar",
+                                     "modules/graphics/build/classes/android")
 
-ANDROID.vmlauncher.javahClasspath = "${ANDROID_SDK}/platforms/${ANDROID_SDK_TARGET}/android.jar"
+ANDROID.vmlauncher.javahSource = files("modules/graphics/build/classes/android")
+ANDROID.vmlauncher.javahClasspath = files("modules/graphics/build/classes/android",
+                                          "${ANDROID_SDK}/platforms/${ANDROID_SDK_TARGET}/android.jar")
 ANDROID.vmlauncher.javahInclude = [
     "com/oracle/dalvik/*"
 ]
 ANDROID.vmlauncher.nativeSource = [
-    file("modules/graphics/src/main/native-android/VMLauncher.c"),
-    file("modules/graphics/src/main/native-android/NativePipeReader.c"),
-    file("modules/graphics/src/main/native-android/DalvikProxySelector.c")
+    file("modules/graphics/src/android/native/VMLauncher.c"),
+    file("modules/graphics/src/android/native/NativePipeReader.c"),
+    file("modules/graphics/src/android/native/DalvikProxySelector.c")
 ]
 ANDROID.vmlauncher.compiler = compiler
 ANDROID.vmlauncher.linker = linker
@@ -276,7 +291,8 @@
 ANDROID.surface.linkFlags = [linkFlags, "-ldl", "-landroid", "-llog"].flatten()
 
 ANDROID.webview = [:]
-ANDROID.webview.sourceSet = "android"
+ANDROID.webview.javahSource = files("modules/web/build/classes/android")
+ANDROID.webview.javahClasspath = files("modules/web/build/classes/android")
 ANDROID.webview.javahInclude = [
     "com/sun/webkit/NativeWebView.class"
 ]
@@ -292,7 +308,8 @@
 ANDROID.webview.linkFlags = [linkFlags, "-ldl", "-llog"].flatten()
 
 ANDROID.dvkwebview = [:]
-ANDROID.dvkwebview.sourceSet = "android"
+ANDROID.dvkwebview.javahSource = files("modules/web/build/classes/android")
+ANDROID.dvkwebview.javahClasspath = files("modules/web/build/classes/android")
 ANDROID.dvkwebview.javahInclude = [
     "com/sun/webkit/NativeWebView.class"
 ]
--- a/buildSrc/armv6hf.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/armv6hf.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -42,6 +42,9 @@
     return;
 }
 
+// Lambda for naming the generated libs
+ARMV6HF.library = { name -> return "lib${name}.so" as String }
+
 // alias for this platform in legacy artifacts
 ARMV6HF.artifactsName = "armv6hf-vfp"
 
--- a/buildSrc/armv6sf.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/armv6sf.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -41,6 +41,9 @@
     return;
 }
 
+// Lambda for naming the generated libs
+ARMV6SF.library = { name -> return "lib${name}.so" as String }
+
 // alias for this platform in legacy artifacts
 ARMV6SF.artifactsName = "armv6-vfp"
 
--- a/buildSrc/ios.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/ios.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -29,11 +29,23 @@
 IOS.canBuild = IS_MAC
 if (!IOS.canBuild) return;
 
+IOS.artifactsName = "ios"
+
 IOS.compileSwing = false;
 IOS.compileSWT = false;
 IOS.compileFXPackager = false;
 IOS.compileDesignTime = false;
 
+defineProperty("USE_LIPO", "false")
+defineProperty("GENERATE_SYMBOLS", "false")
+if (USE_LIPO instanceof String) IOS.useLipo = Boolean.parseBoolean(USE_LIPO)
+if (GENERATE_SYMBOLS instanceof String) IOS.generateSymbols = Boolean.parseBoolean(GENERATE_SYMBOLS)
+
+defineProperty("IOS_VERSION", "6.1")
+
+// Lambda for naming the generated libs
+IOS.library = { name -> return "lib${name}.a" as String }
+
 IOS.libDest = "lib"
 
 IOS.jfxrtJarExcludes = [
@@ -70,19 +82,20 @@
 def iPhoneSim = "iPhoneSimulator"
 
 String sdkPath(String platform) {
-    return "/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}6.1.sdk";
+    return "/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${IOS_VERSION}.sdk";
 }
 
 def linkFlags = [
     "-static",
     "-framework", "Foundation",
     "-framework", "CoreGraphics",
+    "-framework", "CoreText",
     "-framework", "UIKit",
     "-framework", "QuartzCore",
     "-framework", "OpenGLES"].flatten()
 
 def ccFlags = [
-    "-miphoneos-version-min=6.1", "-fmessage-length=0", "-std=c99", "-fno-common",
+    "-miphoneos-version-min=6.0", "-fmessage-length=0", "-std=c99", "-fno-common",
     "-Wall", "-fno-strict-aliasing", "-fwrapv", "-fpascal-strings", "-fobjc-abi-version=2", "-fobjc-legacy-dispatch",
     "-I$JDK_HOME/include", "-I$JDK_HOME/include/darwin", "-c",
     IS_DEBUG ? "-DDEBUG" : ["-O3", "-DNDEBUG"]].flatten()
@@ -122,6 +135,7 @@
 IOS.decora.lib = "decora-sse-${archArm}"
 
 IOS.prism = [:]
+IOS.prism.lib = "prism-common"
 IOS.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
 IOS.prism.variants = ["arm", "x86"];
 
@@ -142,6 +156,7 @@
 IOS.prism.x86.lib = "prism-common-${archX86}"
 
 IOS.prismSW = [:]
+IOS.prismSW.lib = "prism-sw"
 IOS.prismSW.javahInclude = ["com/sun/pisces/**/*"]
 IOS.prismSW.variants = ["arm", "x86"];
 
@@ -162,6 +177,7 @@
 IOS.prismSW.x86.lib = "prism-sw-${archX86}"
 
 IOS.iio = [:]
+IOS.iio.lib = "javafx-iio"
 IOS.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
 IOS.iio.variants = ["arm", "x86"];
 
@@ -185,6 +201,7 @@
 IOS.iio.x86.lib = "javafx-iio-${archX86}"
 
 IOS.prismES2 = [:]
+IOS.prismES2.lib = "prism-es2"
 IOS.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
 IOS.prismES2.variants = ["arm", "x86"];
 
@@ -210,6 +227,7 @@
 
 def closedDir = file("$projectDir/../rt-closed")
 IOS.font = [:]
+IOS.font.lib = "javafx-font"
 IOS.font.javahInclude = [
         "com/sun/javafx/font/**/*",
         "com/sun/javafx/text/**/*"]
@@ -232,6 +250,7 @@
 IOS.font.x86.lib = "javafx-font-${archX86}"
 
 IOS.fontT2K = [:]
+IOS.fontT2K.lib = "javafx-font-t2k"
 IOS.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
 IOS.fontT2K.variants = ["arm", "x86"];
 
@@ -253,3 +272,79 @@
 IOS.fontT2K.x86.linker = linker
 IOS.fontT2K.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
 IOS.fontT2K.x86.lib = "javafx-font-t2k-${archX86}"
+
+IOS.webview = [:]
+IOS.webview.lib = "javafx-ios-webnode"
+IOS.webview.javahInclude = ["javafx/scene/web/*"]
+IOS.webview.variants = ["arm", "x86"];
+
+IOS.webview.arm = [:]
+IOS.webview.arm.nativeSource = file("$closedDir/javafx-ios-webnode/native")
+IOS.webview.arm.compiler = compiler
+IOS.webview.arm.ccFlags = [ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
+IOS.webview.arm.linker = linker
+IOS.webview.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
+IOS.webview.arm.lib = "javafx-ios-webnode-${archArm}"
+
+IOS.webview.x86 = [:]
+IOS.webview.x86.nativeSource = [IOS.webview.arm.nativeSource].flatten()
+IOS.webview.x86.compiler = compiler
+IOS.webview.x86.ccFlags = [ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
+IOS.webview.x86.linker = linker
+IOS.webview.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
+IOS.webview.x86.lib = "javafx-ios-webnode-${archX86}"
+
+project(":web") {
+    if (BUILD_CLOSED) {
+        apply plugin: 'java'
+
+        compileJava {
+            enabled = false
+        }
+
+        afterEvaluate {
+            def compileWebJavaIos = task("compileWebJavaIos",
+                type: JavaCompile, group: "Build") {
+
+                dependsOn(project(":graphics").classes, project(":base").classes)
+                description = "Task compiles web component for iOS."
+                classpath = files(
+                    project(":controls").sourceSets.main.output.classesDir,
+                    project(":graphics").sourceSets.main.output.classesDir,
+                    project(":base").sourceSets.main.output.classesDir
+                )
+                destinationDir = file("modules/web/build/classes/ios")
+                dependencyCacheDir = file("modules/web/build/dependency-cache")
+                source file("$closedDir/javafx-ios-webnode/src")
+            }
+
+            def jarWebJavaIos = task("jarWebJavaIos",
+                type: Jar, group: "Build") {
+                description = "Creates web.jar for iOS."
+                dependsOn(compileWebJavaIos)
+                archiveName = "web.jar"
+                includeEmptyDirs = false
+                destinationDir = project.file("build/libs/ios")
+                from("build/classes/ios")
+            }
+
+            addNative(project, "webview")
+            javahIosWebview.dependsOn(compileWebJavaIos)
+
+            jfxrtIos {
+                from "modules/web/build/classes/ios"
+            }
+
+            sdkIos  {
+                dependsOn(jarWebJavaIos)
+                doLast {
+                    def props = project.ext["IOS"]
+                    copy {
+                        from ("modules/web/build/libs/webview/ios/${props.library(props.webview.lib)}")
+                        into ("build/ios-sdk/rt/${props.libDest}")
+                    }
+                }
+            }
+        }
+    }
+}
--- a/buildSrc/linux.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/linux.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -66,6 +66,9 @@
     "com/sun/prism/es2/MacGL*",
 ]
 
+// Lambda for naming the generated libs
+LINUX.library = { name -> return "lib${name}.so" as String }
+
 // A set of common parameters to use for both compiling and linking
 def commonFlags = [
         "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
--- a/buildSrc/mac.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/mac.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -34,6 +34,9 @@
 MAC.compileFXPackager = true;
 MAC.compileDesignTime = true;
 
+// Lambda for naming the generated libs
+MAC.library = { name -> return "lib${name}.dylib" as String }
+
 MAC.libDest = "lib"
 MAC.jfxrtJarExcludes = [
     "**/*.hlsl",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/ExportedSymbolsTask.groovy	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.tasks.InputDirectory
+import org.gradle.api.tasks.OutputFile
+import org.gradle.api.tasks.TaskAction
+
+class ExportedSymbolsTask extends DefaultTask {
+    @OutputFile File outputFile;
+    @InputDirectory File libDir;
+
+
+    @TaskAction void generateExportedSymbols() {
+        // Get symbols only from .a libraries
+        List<String> libNames = [];
+        List<File> files = libDir.listFiles();
+        files.each { file ->
+            if (!file.isDirectory() && file.getName().endsWith(".a")) {
+                libNames.add(file.getAbsolutePath())
+            }
+        }
+
+        def baos = new ByteArrayOutputStream();
+
+        // Execute nm on .a libraries
+        project.exec({
+            commandLine("nm", "-jg");
+            args(libNames);
+            setStandardOutput(baos);
+        });
+
+        def bais = new ByteArrayInputStream(baos.toByteArray());
+
+        outputFile.withWriter { out ->
+            bais.eachLine { line ->
+                // Remove unnecessary lines
+                line = (line =~ /^(?!(_Java|_JNI_)).*$/).replaceFirst("");
+                line = (line =~ /^(_Java|_JNI_).*(.eh)$/).replaceFirst("");
+
+                if (!line.isEmpty()) {
+                    out.writeLine(line);
+                }
+            }
+        }
+
+        baos.close();
+        bais.close();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/LipoTask.groovy	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.tasks.InputDirectory
+import org.gradle.api.tasks.OutputFile
+import org.gradle.api.tasks.TaskAction
+
+
+class LipoTask extends DefaultTask {
+    @InputDirectory File libDir;
+    @OutputFile File lib;
+    @TaskAction void compile() {
+        List<String> libNames = [];
+        List<File> files = libDir.listFiles();
+        files.each { file ->
+            String fileName = file.getName();
+            // process only thin libraries
+            if (!file.isDirectory() && (fileName.indexOf("armv7") != -1 || fileName.indexOf("i386") != -1)) {
+                libNames.add(file.getAbsolutePath())
+            }
+        }
+        // Create a fat library (.a)
+        project.exec({
+            commandLine("lipo", "-create", "-output", "$lib");
+            args(libNames);
+        });
+    }
+}
+
--- a/buildSrc/win.gradle	Sun Jul 07 19:34:28 2013 -0700
+++ b/buildSrc/win.gradle	Tue Jul 09 09:36:39 2013 -0700
@@ -33,6 +33,9 @@
 WIN.compileFXPackager = true;
 WIN.compileDesignTime = true;
 
+// Lambda for naming the generated libs
+WIN.library = { name -> return "${name}.dll" as String }
+
 WIN.libDest = "bin"
 WIN.jfxrtJarExcludes = [
     "com/sun/glass/events/mac",
@@ -56,7 +59,7 @@
 ]
 
 def ccFlags = ["/nologo", "/W3", "/EHsc", "/c",
-        "/D_STATIC_CPP_LIB", "/D_DISABLE_DEPRECATE_STATIC_CPPLIB", "/DINLINE=__inline",
+        "/D_STATIC_CPPLIB", "/D_DISABLE_DEPRECATE_STATIC_CPPLIB", "/DINLINE=__inline",
         "/DUNICODE", "/D_UNICODE", "/DWIN32", "/DIAL", "/D_LITTLE_ENDIAN", "/DWIN32_LEAN_AND_MEAN",
         "/I$JDK_HOME/include", "/I$JDK_HOME/include/win32", "/arch:SSE", "/fp:fast",
         IS_DEBUG ? ["/MDd", "/Od", "/Zi", "/DDEBUG"] : ["/O2", "/MD"]].flatten();
--- a/idea/.idea/.name	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/.idea/.name	Tue Jul 09 09:36:39 2013 -0700
@@ -1,1 +1,1 @@
-javafx
\ No newline at end of file
+rt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idea/.idea/gradle.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleSettings">
+    <option name="linkedProjectPath" value="" />
+    <option name="useAutoImport" value="false" />
+  </component>
+</project>
+
--- a/idea/.idea/misc.xml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/.idea/misc.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -3,6 +3,7 @@
   <component name="EntryPointsManager">
     <entry_points version="2.0" />
   </component>
+  <component name="IdProvider" IDEtalkID="9BC0DE4049720C1246C2D3B835C6F7C3" />
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/out" />
   </component>
--- a/idea/.idea/modules.xml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/.idea/modules.xml	Tue Jul 09 09:36:39 2013 -0700
@@ -2,6 +2,9 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
+      <module fileurl="file://$PROJECT_DIR$/3DViewer.iml" filepath="$PROJECT_DIR$/3DViewer.iml" />
+      <module fileurl="file://$PROJECT_DIR$/Ensemble8.iml" filepath="$PROJECT_DIR$/Ensemble8.iml" />
+      <module fileurl="file://$PROJECT_DIR$/Modena.iml" filepath="$PROJECT_DIR$/Modena.iml" />
       <module fileurl="file://$PROJECT_DIR$/base.iml" filepath="$PROJECT_DIR$/base.iml" />
       <module fileurl="file://$PROJECT_DIR$/buildSrc.iml" filepath="$PROJECT_DIR$/buildSrc.iml" />
       <module fileurl="file://$PROJECT_DIR$/builders.iml" filepath="$PROJECT_DIR$/builders.iml" />
@@ -11,8 +14,8 @@
       <module fileurl="file://$PROJECT_DIR$/fxml.iml" filepath="$PROJECT_DIR$/fxml.iml" />
       <module fileurl="file://$PROJECT_DIR$/fxpackager.iml" filepath="$PROJECT_DIR$/fxpackager.iml" />
       <module fileurl="file://$PROJECT_DIR$/graphics.iml" filepath="$PROJECT_DIR$/graphics.iml" />
-      <module fileurl="file://$PROJECT_DIR$/javafx.iml" filepath="$PROJECT_DIR$/javafx.iml" />
       <module fileurl="file://$PROJECT_DIR$/media.iml" filepath="$PROJECT_DIR$/media.iml" />
+      <module fileurl="file://$PROJECT_DIR$/rt.iml" filepath="$PROJECT_DIR$/rt.iml" />
       <module fileurl="file://$PROJECT_DIR$/rt-closed.iml" filepath="$PROJECT_DIR$/rt-closed.iml" />
       <module fileurl="file://$PROJECT_DIR$/swing.iml" filepath="$PROJECT_DIR$/swing.iml" />
       <module fileurl="file://$PROJECT_DIR$/swt.iml" filepath="$PROJECT_DIR$/swt.iml" />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idea/3DViewer.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="EclipseModuleManager">
+    <libelement value="jar://$MODULE_DIR$/../apps/experiments/3DViewer/build/libs/3DViewer.jar!/" />
+    <src_description expected_position="0">
+      <src_folder value="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/main/java" expected_position="0" />
+      <src_folder value="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/test/java" expected_position="1" />
+      <src_folder value="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/main/resources" expected_position="2" />
+      <src_folder value="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/test/resources" expected_position="3" />
+    </src_description>
+  </component>
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../apps/experiments/3DViewer">
+      <sourceFolder url="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/main/resources" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/test/java" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/experiments/3DViewer/src/test/resources" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/../apps/experiments/3DViewer/build" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="3DViewer.jar">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../apps/experiments/3DViewer/build/libs/3DViewer.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idea/Ensemble8.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="EclipseModuleManager">
+    <libelement value="jar://$MODULE_DIR$/../apps/samples/Ensemble8/lib/lucene-core-3.2.0.jar!/" />
+    <libelement value="jar://$MODULE_DIR$/../apps/samples/Ensemble8/lib/lucene-grouping-3.2.0.jar!/" />
+    <src_description expected_position="0">
+      <src_folder value="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/app/java" expected_position="0" />
+      <src_folder value="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/app/resources" expected_position="1" />
+      <src_folder value="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/samples/java" expected_position="2" />
+      <src_folder value="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/samples/resources" expected_position="3" />
+      <src_folder value="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/compiletime/java" expected_position="4" />
+      <src_folder value="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/generated/java" expected_position="5" />
+      <src_folder value="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/generated/resources" expected_position="6" />
+    </src_description>
+  </component>
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../apps/samples/Ensemble8">
+      <sourceFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/app/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/app/resources" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/samples/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/samples/resources" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/compiletime/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/generated/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/src/generated/resources" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../apps/samples/Ensemble8/build" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="lucene-core-3.2.0.jar">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../apps/samples/Ensemble8/lib/lucene-core-3.2.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="lucene-grouping-3.2.0.jar">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../apps/samples/Ensemble8/lib/lucene-grouping-3.2.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idea/Modena.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,15 @@
+<?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/experiments/Modena">
+      <sourceFolder url="file://$MODULE_DIR$/../apps/experiments/Modena/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../apps/experiments/Modena/src/main/resources" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/../apps/experiments/Modena/build" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="rt" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- a/idea/buildSrc.iml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/buildSrc.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module type="JAVA_MODULE" version="4">
   <component name="EclipseModuleManager">
-    <libelement value="jar://$MODULE_DIR$/../.libs/ant-1.8.2.jar!/" />
-    <libelement value="jar://$MODULE_DIR$/../.libs/antlr-3.1.3.jar!/" />
-    <libelement value="jar://$MODULE_DIR$/../.libs/antlr-runtime-3.1.3.jar!/" />
-    <libelement value="jar://$MODULE_DIR$/../.libs/stringtemplate-3.2.jar!/" />
-    <libelement value="jar://$MODULE_DIR$/../.libs/swt.jar!/" />
+    <libelement value="jar://$MODULE_DIR$/../build/libs/ant-1.8.2.jar!/" />
+    <libelement value="jar://$MODULE_DIR$/../build/libs/antlr-3.1.3.jar!/" />
+    <libelement value="jar://$MODULE_DIR$/../build/libs/antlr-runtime-3.1.3.jar!/" />
+    <libelement value="jar://$MODULE_DIR$/../build/libs/stringtemplate-3.2.jar!/" />
+    <libelement value="jar://$MODULE_DIR$/../build/libs/swt-debug.jar!/" />
     <src_description expected_position="0">
       <src_folder value="file://$MODULE_DIR$/../buildSrc/build/generated-src/antlr" expected_position="0" />
       <src_folder value="file://$MODULE_DIR$/../buildSrc/src/main/java" expected_position="1" />
@@ -31,7 +31,7 @@
     <orderEntry type="module-library" exported="">
       <library name="ant-1.8.2.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../.libs/ant-1.8.2.jar!/" />
+          <root url="jar://$MODULE_DIR$/../build/libs/ant-1.8.2.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
@@ -40,7 +40,7 @@
     <orderEntry type="module-library" exported="">
       <library name="antlr-3.1.3.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../.libs/antlr-3.1.3.jar!/" />
+          <root url="jar://$MODULE_DIR$/../build/libs/antlr-3.1.3.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
@@ -49,7 +49,7 @@
     <orderEntry type="module-library" exported="">
       <library name="antlr-runtime-3.1.3.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../.libs/antlr-runtime-3.1.3.jar!/" />
+          <root url="jar://$MODULE_DIR$/../build/libs/antlr-runtime-3.1.3.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
@@ -58,22 +58,21 @@
     <orderEntry type="module-library" exported="">
       <library name="stringtemplate-3.2.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../.libs/stringtemplate-3.2.jar!/" />
+          <root url="jar://$MODULE_DIR$/../build/libs/stringtemplate-3.2.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="swt.jar">
+      <library name="swt-debug.jar">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../.libs/swt.jar!/" />
+          <root url="jar://$MODULE_DIR$/../build/libs/swt-debug.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="inheritedJdk" />
     <orderEntry type="module-library" exported="">
       <library name="junit4">
         <CLASSES>
@@ -83,6 +82,7 @@
         <SOURCES />
       </library>
     </orderEntry>
+    <orderEntry type="inheritedJdk" />
   </component>
 </module>
 
--- a/idea/builders.iml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/builders.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -11,6 +11,7 @@
     <content url="file://$MODULE_DIR$/../modules/builders">
       <excludeFolder url="file://$MODULE_DIR$/../modules/builders/build" />
     </content>
+    <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module-library" exported="">
       <library name="builders.jar">
         <CLASSES>
@@ -22,14 +23,7 @@
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="base" exported="" />
-    <orderEntry type="module" module-name="controls" exported="" />
-    <orderEntry type="module" module-name="graphics" exported="" />
-    <orderEntry type="module" module-name="swing" exported="" />
-    <orderEntry type="module" module-name="swt" exported="" />
     <orderEntry type="inheritedJdk" />
-    <orderEntry type="module" module-name="web" exported="" />
   </component>
 </module>
 
--- a/idea/deploy.iml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/deploy.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -19,7 +19,7 @@
       <excludeFolder url="file://$MODULE_DIR$/../../deploy/javafx-deploy-samples/src/helloworld" />
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module-library">
+    <orderEntry type="module-library" exported="">
       <library name="plugin_exports.jar">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../deploy/cache/plugin_exports.jar!/" />
@@ -28,8 +28,8 @@
         <SOURCES />
       </library>
     </orderEntry>
+    <orderEntry type="module" module-name="rt" exported="" />
     <orderEntry type="inheritedJdk" />
-    <orderEntry type="module" module-name="controls" exported="" />
   </component>
 </module>
 
--- a/idea/graphics.iml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/graphics.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -19,11 +19,10 @@
       <excludeFolder url="file://$MODULE_DIR$/../modules/graphics/build/resources" />
       <excludeFolder url="file://$MODULE_DIR$/../modules/graphics/build/tmp" />
     </content>
+    <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="base" exported="" />
+    <orderEntry type="module" module-name="builders" exported="" />
     <orderEntry type="inheritedJdk" />
-    <orderEntry type="module" module-name="builders" exported="" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="rt-closed" exported="" />
   </component>
 </module>
 
--- a/idea/javafx.iml	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?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$/..">
-      <excludeFolder url="file://$MODULE_DIR$/../.gradle" />
-      <excludeFolder url="file://$MODULE_DIR$/../.libs" />
-    </content>
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="inheritedJdk" />
-  </component>
-</module>
-
--- a/idea/media.iml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/media.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -2,15 +2,9 @@
 <module type="JAVA_MODULE" version="4">
   <component name="NewModuleRootManager" inherit-compiler-output="true">
     <exclude-output />
-    <content url="file://$MODULE_DIR$/../modules/media">
-      <sourceFolder url="file://$MODULE_DIR$/../modules/media/jfxmedia/src" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/../modules/media/test/demos/JavaTestApps/src" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/../modules/media/test/perf/JFXMediaSystemTestApp/src" isTestSource="false" />
-    </content>
+    <content url="file://$MODULE_DIR$/../modules/media" />
+    <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="rt-closed" exported="" />
-    <orderEntry type="module" module-name="controls" exported="" />
   </component>
 </module>
 
--- a/idea/rt-closed.iml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/rt-closed.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -111,20 +111,8 @@
       <excludeFolder url="file://$MODULE_DIR$/../../rt-closed/javafx-android" />
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="graphics" />
-    <orderEntry type="module" module-name="web" />
-    <orderEntry type="module" module-name="fxml" />
-    <orderEntry type="module" module-name="media" />
-    <orderEntry type="module-library">
-      <library name="jfxmedia.jar">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../caches/sdk/build/lib/desktop/jfxmedia.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module" module-name="deploy" />
+    <orderEntry type="module" module-name="deploy" exported="" />
+    <orderEntry type="module" module-name="rt" exported="" />
     <orderEntry type="inheritedJdk" />
   </component>
 </module>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idea/rt.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,19 @@
+<?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$/..">
+      <excludeFolder url="file://$MODULE_DIR$/../.gradle" />
+      <excludeFolder url="file://$MODULE_DIR$/../build/libs" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="fxml" exported="" />
+    <orderEntry type="module" module-name="fxpackager" exported="" />
+    <orderEntry type="module" module-name="swt" exported="" />
+    <orderEntry type="module" module-name="swing" exported="" />
+    <orderEntry type="module" module-name="media" exported="" />
+    <orderEntry type="module" module-name="web" exported="" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- a/idea/web.iml	Sun Jul 07 19:34:28 2013 -0700
+++ b/idea/web.iml	Tue Jul 09 09:36:39 2013 -0700
@@ -5,12 +5,22 @@
     <content url="file://$MODULE_DIR$/../modules/web">
       <sourceFolder url="file://$MODULE_DIR$/../modules/web/src/main/java" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/../modules/web/src/main/native/WebKitBuild/Release/WebCore/generated/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../modules/web/src/main/resources" isTestSource="false" />
       <excludeFolder url="file://$MODULE_DIR$/../modules/web/build" />
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="graphics" exported="" />
     <orderEntry type="module" module-name="controls" exported="" />
     <orderEntry type="module" module-name="media" exported="" />
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../caches/sdk/rt/lib/ext/jfxrt.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
     <orderEntry type="inheritedJdk" />
   </component>
 </module>
--- a/modules/base/.classpath	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/base/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -1,9 +1,23 @@
 <classpath>
-  <classpathentry kind="src" path="build/generated-src/version-info"/>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java"/>
-  <classpathentry exported="true" kind="src" path="/buildSrc"/>
-  <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="output" path="bin"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
-  <classpathentry kind="output" path="bin"/>
+  <classpathentry kind="src" exported="true" path="src/main/java"/>
+  <classpathentry kind="src" exported="true" path="src/test/java">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/main/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/test/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="build/generated-src/version-info"/>
+  <classpathentry kind="src" exported="true" path="/buildSrc"/>
 </classpath>
--- a/modules/base/src/main/java/com/sun/javafx/binding/ExpressionHelper.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/base/src/main/java/com/sun/javafx/binding/ExpressionHelper.java	Tue Jul 09 09:36:39 2013 -0700
@@ -249,7 +249,7 @@
                             final InvalidationListener[] oldListeners = invalidationListeners;
                             if (locked) {
                                 invalidationListeners = new InvalidationListener[invalidationListeners.length];
-                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, invalidationListeners, index, numMoved);
@@ -309,7 +309,7 @@
                             final ChangeListener<? super T>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new ChangeListener[changeListeners.length];
-                                System.arraycopy(oldListeners, 0, changeListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, changeListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, changeListeners, index, numMoved);
--- a/modules/base/src/main/java/com/sun/javafx/collections/ListListenerHelper.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/base/src/main/java/com/sun/javafx/collections/ListListenerHelper.java	Tue Jul 09 09:36:39 2013 -0700
@@ -224,7 +224,7 @@
                             final InvalidationListener[] oldListeners = invalidationListeners;
                             if (locked) {
                                 invalidationListeners = new InvalidationListener[invalidationListeners.length];
-                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, invalidationListeners, index, numMoved);
@@ -281,7 +281,7 @@
                             final ListChangeListener<? super E>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new ListChangeListener[changeListeners.length];
-                                System.arraycopy(oldListeners, 0, changeListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, changeListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, changeListeners, index, numMoved);
--- a/modules/base/src/main/java/com/sun/javafx/collections/MapListenerHelper.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/base/src/main/java/com/sun/javafx/collections/MapListenerHelper.java	Tue Jul 09 09:36:39 2013 -0700
@@ -223,7 +223,7 @@
                             final InvalidationListener[] oldListeners = invalidationListeners;
                             if (locked) {
                                 invalidationListeners = new InvalidationListener[invalidationListeners.length];
-                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, invalidationListeners, index, numMoved);
@@ -280,7 +280,7 @@
                             final MapChangeListener<? super K, ? super V>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new MapChangeListener[changeListeners.length];
-                                System.arraycopy(oldListeners, 0, changeListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, changeListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, changeListeners, index, numMoved);
--- a/modules/base/src/main/java/com/sun/javafx/collections/SetListenerHelper.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/base/src/main/java/com/sun/javafx/collections/SetListenerHelper.java	Tue Jul 09 09:36:39 2013 -0700
@@ -223,7 +223,7 @@
                             final InvalidationListener[] oldListeners = invalidationListeners;
                             if (locked) {
                                 invalidationListeners = new InvalidationListener[invalidationListeners.length];
-                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, invalidationListeners, index, numMoved);
@@ -280,7 +280,7 @@
                             final SetChangeListener<? super E>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new SetChangeListener[changeListeners.length];
-                                System.arraycopy(oldListeners, 0, changeListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, changeListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, changeListeners, index, numMoved);
--- a/modules/controls/.classpath	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/controls/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -1,10 +1,22 @@
 <classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/main/resources"/>
-  <classpathentry kind="src" path="src/test/java"/>
-  <classpathentry kind="src" path="src/test/resources"/>
-  <classpathentry exported="true" kind="src" path="/graphics"/>
-  <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="output" path="bin"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+  <classpathentry kind="src" exported="true" path="src/main/java"/>
+  <classpathentry kind="src" exported="true" path="src/test/java">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/main/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/test/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="/graphics"/>
 </classpath>
--- a/modules/designTime/.classpath	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/designTime/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -1,8 +1,22 @@
 <classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java"/>
-  <classpathentry exported="true" kind="src" path="/graphics"/>
-  <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="output" path="bin"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+  <classpathentry kind="src" exported="true" path="src/main/java"/>
+  <classpathentry kind="src" exported="true" path="src/test/java">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/main/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/test/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="/graphics"/>
 </classpath>
--- a/modules/designTime/src/main/java/com/sun/javafx/beans/design/author/AbstractDesignInfo.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/designTime/src/main/java/com/sun/javafx/beans/design/author/AbstractDesignInfo.java	Tue Jul 09 09:36:39 2013 -0700
@@ -29,7 +29,6 @@
 
 /**
  *
- * @author Richard
  */
 public abstract class AbstractDesignInfo<T> implements DesignInfo<T> {
     private Class<T> type;
@@ -37,7 +36,6 @@
 
     protected AbstractDesignInfo(Class<T> type) {
         this.type = type;
-        metaData = new BeanMetaData<T>(type);
     }
 
     @Override public Class<T> getBeanClass() {
@@ -45,6 +43,9 @@
     }
 
     protected final BeanMetaData getMetaData() {
+        if(metaData == null){
+            metaData = new BeanMetaData<>(type);
+        }
         return metaData;
     }
 }
--- a/modules/fxml/.classpath	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/fxml/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -1,9 +1,22 @@
 <classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/test/java"/>
-  <classpathentry kind="src" path="src/test/resources"/>
-  <classpathentry exported="true" kind="src" path="/controls"/>
-  <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="output" path="bin"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+  <classpathentry kind="src" exported="true" path="src/main/java"/>
+  <classpathentry kind="src" exported="true" path="src/test/java">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/main/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/test/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="/controls"/>
 </classpath>
--- a/modules/fxpackager/.classpath	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/fxpackager/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -1,8 +1,22 @@
 <classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/main/resources"/>
-  <classpathentry exported="true" kind="src" path="/graphics"/>
-  <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="output" path="bin"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
-  <classpathentry kind="output" path="bin"/>
+  <classpathentry kind="src" exported="true" path="src/main/java"/>
+  <classpathentry kind="src" exported="true" path="src/test/java">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/main/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/test/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="/graphics"/>
 </classpath>
--- a/modules/graphics/.classpath	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/graphics/.classpath	Tue Jul 09 09:36:39 2013 -0700
@@ -1,22 +1,29 @@
 <classpath>
-  <classpathentry kind="src" path="src/main/java"/>
-  <classpathentry kind="src" path="src/main/resources"/>
-  <classpathentry kind="src" path="src/stub/java"/>
-  <classpathentry kind="src" path="src/stub/resources"/>
-  <classpathentry kind="src" path="src/test/java"/>
-  <classpathentry kind="src" path="src/test/resources"/>
-  <classpathentry exported="true" kind="src" path="/base"/>
-  <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="output" path="bin"/>
-  <classpathentry kind="src" exported="true" path="/builders"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+  <classpathentry kind="src" exported="true" path="src/main/java"/>
+  <classpathentry kind="src" exported="true" path="src/test/java">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/main/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/test/resources">
+  <attributes>
+      <attribute name="optional" value="true"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="src" exported="true" path="src/stub/java"/>
+  <classpathentry kind="src" exported="true" path="src/stub/resources"/>
   <classpathentry kind="src" exported="true" path="build/generated-src/jsl-decora"/>
   <classpathentry kind="src" exported="true" path="build/generated-src/jsl-prism"/>
   <classpathentry kind="src" exported="true" path="build/resources/jsl-decora"/>
   <classpathentry kind="src" exported="true" path="build/resources/jsl-prism"/>
-  <classpathentry kind="src" exported="true" path="/rt-closed">
-    <attributes>
-      <attribute name="optional" value="true"/>
-    </attributes>
-  </classpathentry>
-  <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+  <classpathentry kind="src" exported="true" path="/base"/>
+  <classpathentry kind="src" exported="true" path="/builders"/>
 </classpath>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/AppDataInstaller.java	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2013, 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.oracle.dalvik;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import android.util.Log;
+import android.content.res.AssetManager;
+
+public class AppDataInstaller {
+    private static final String TAG = "AppDataInstaller";
+    
+   String       storageDir;
+    AssetManager assetManager;
+
+    public AppDataInstaller(String storageDir, AssetManager assetManager) {
+        this.storageDir = storageDir;
+        this.assetManager = assetManager;
+    }
+
+    public void handleAssetZipFile(String zipFileName, String dstDirName) {
+
+        try {
+            // Open the ZipInputStream
+            InputStream is = assetManager.open(zipFileName);
+            ZipInputStream zis = new ZipInputStream(is);
+
+            // Loop through all the files and folders
+            ZipEntry entry = null;
+            while ((entry = zis.getNextEntry()) != null) {
+                String innerFileName = dstDirName + File.separator 
+                    + entry.getName();
+                File innerFile = new File(innerFileName);
+                if (innerFile.exists()) {
+                    innerFile.delete();
+                }
+
+                if (entry.isDirectory()) {
+                    innerFile.mkdirs();
+                } else {
+                    // Create a file output stream
+                    FileOutputStream outputStream = 
+                        new FileOutputStream(innerFileName);
+                    final int BUFFER_SIZE = 2048;
+                    BufferedOutputStream bufferedOutputStream = 
+                        new BufferedOutputStream(outputStream, BUFFER_SIZE);
+
+                    // Write output
+                    int count = 0;
+                    byte[] data = new byte[BUFFER_SIZE];
+                    while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {
+                        bufferedOutputStream.write(data, 0, count);
+                    }
+
+                    // Flush and close the buffers
+                    bufferedOutputStream.flush();
+                    bufferedOutputStream.close();
+                }
+
+                // Close the current entry
+                zis.closeEntry();
+            }
+            zis.close();
+        } catch (IOException e) {
+            Log.v(TAG, "handleAssetZipFile: IOException: " + e);
+            e.printStackTrace();
+        }
+    }
+
+    public void copyAssetsTree(String src, String dst) {
+        // scan assets
+        Log.v(TAG, "AppDataInstaller.copyAssetsTree(): copyDir: src=" 
+                           + src + " dst=" + dst);
+
+        try {
+            String[] fileList = assetManager.list(src);
+            Log.v(TAG, "Sample.onCreate: # of assets in " + src 
+                               + ": " + fileList.length);
+            if (fileList.length <= 0) {
+                // file
+                Log.v(TAG, "copyAssetsTree: Copy file " + src
+                                   + " to " + dst);
+
+                // TODO: copy
+                InputStream is = assetManager.open(src);
+                File dstFile = new File(dst);
+                OutputStream os = new FileOutputStream(dstFile);
+                final int BUFFER_SIZE = 2048;
+                BufferedOutputStream bufferedOutputStream = 
+                    new BufferedOutputStream(os, BUFFER_SIZE);
+
+                byte[] buf = new byte[BUFFER_SIZE];
+                int len;
+                while ((len = is.read(buf)) > 0) {
+                    bufferedOutputStream.write(buf, 0, len);
+                }
+                is.close();
+                // os.close();
+                bufferedOutputStream.flush();
+                bufferedOutputStream.close();
+            } else {
+                // dir
+                // create target directory
+                Log.v(TAG, 
+                     "copyAssetsTree: Creating dir: " + dst);
+                File dstFile = new File(dst);
+                if (dstFile.exists()) {
+                    if (dstFile.isDirectory()) {
+                        Log.v(TAG,
+                             "copyAssetsTree: " + dst + " already exists");
+                    } else {
+                        Log.v(TAG,
+                             "copyAssetsTree: " + dst + " exists but is not a dierctory");
+                        return;
+                    }
+                } else {
+                    if (!dstFile.mkdirs()) {
+                        Log.v(TAG,
+                             "copyAssetsTree: Failed creating dir: " + dst);
+                        return;
+                    } else {
+                    }
+                }
+
+                final String ZIPPED_RENAMED_JPG_SUFFIX = ".ZIPPED.RENAMED.jpg";
+                final String RENAMED_JPG_SUFFIX = ".RENAMED.jpg";
+                for (String fileName: fileList) {
+                    if (fileName.endsWith(ZIPPED_RENAMED_JPG_SUFFIX)) {
+                        String newSrc = src + "/" + fileName;
+                        handleAssetZipFile(newSrc, dst);
+                    } else if (fileName.length() > RENAMED_JPG_SUFFIX.length() 
+                               && fileName.endsWith(RENAMED_JPG_SUFFIX)) {
+                        String newSrc = src + "/" + fileName;
+                        String newDst = dst + "/" 
+                            + fileName.substring(0, fileName.length()
+                                                 - RENAMED_JPG_SUFFIX.length());
+                        copyAssetsTree(newSrc, newDst);
+                    } else { // normal file
+                        String newSrc = src + "/" + fileName;
+                        String newDst = dst + "/" + fileName;
+                        copyAssetsTree(newSrc, newDst);
+                    }
+                }
+            }
+        } catch (IOException e) {
+            Log.v(TAG,
+                 "copyAssetsTree: IOException: " + e);
+            e.printStackTrace();
+        }
+    }
+
+    public void install() {
+        String doneFileName = storageDir + "/installation.done";
+        File doneFile = new File(doneFileName);
+
+        if (doneFile.exists()) {
+            Log.v(TAG,
+                 "install: JVM data already installed. Skipping");
+        } else {
+            Log.v(TAG,
+                 "install: Installing JVM data");
+            copyAssetsTree("storage", storageDir);
+
+            // write done flag
+            Log.v(TAG,
+                 "install: Write file " + doneFileName);
+            try {
+                OutputStream os = new FileOutputStream(doneFile);
+                os.write(1);
+                os.close();
+            } catch (FileNotFoundException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/FXActivity.java	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2013 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.oracle.dalvik;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.graphics.PixelFormat;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.Surface;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.FrameLayout;
+
+public class FXActivity extends Activity implements SurfaceHolder.Callback, 
+        SurfaceHolder.Callback2 {
+	
+    private static final String TAG     = "FXActivity";
+    private static final String TAG_JVM = "JVM";
+    private static final String JAR     = ".jar";
+    
+    private static final String META_DATA_MAIN_CLASS = "main.class";
+    private static final String META_DATA_JVM_ARGS   = "jvm.args";
+    private static final String META_DATA_APP_ARGS   = "app.args";
+    private static final String META_DATA_DEBUG_PORT = "debug.port";
+    private static final String ANDROID_WEBVIEW = "android_webview";
+    private static final String GLASS_LENS_ANDROID = "glass-lens-android";
+
+    static {        
+        System.loadLibrary("vmlauncher");
+    }
+    private static FXActivity instance;
+    private static FrameLayout mViewGroup;
+    private static SurfaceView mView;
+
+    private String            appDataDir;
+    private String            storageDir;    
+    private NativePipeReader  reader;
+    private InputMethodManager imm;   
+    private String ldPath;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+            super.onCreate(savedInstanceState);
+
+        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        getWindow().setSoftInputMode(
+                WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED
+                | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
+        getWindow().setFormat(PixelFormat.RGBA_8888);
+
+        imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+
+        mView = new InternalSurfaceView(this);
+        mView.getHolder().addCallback(this);        
+        mViewGroup = new FrameLayout(this);
+        mViewGroup.addView(mView);
+        setContentView(mViewGroup);
+        instance = this;
+        reader = NativePipeReader.getDefaultReader(textListener);
+        reader.start();
+        initDirInfo();
+        installJVMIfNeeded();
+        System.loadLibrary(GLASS_LENS_ANDROID);
+        System.loadLibrary(ANDROID_WEBVIEW);
+    }
+
+    public static FXActivity getInstance() {
+        return instance;
+    }
+
+    public String getLDPath() {
+        if (appDataDir == null) {
+            appDataDir = this.getApplicationInfo().dataDir;
+        }
+        if (ldPath == null) {
+            ldPath = appDataDir + "/lib";
+        }
+        return ldPath;
+    }
+
+    public static ViewGroup getViewGroup() {
+        return mViewGroup;
+    }    
+	
+    @Override
+    public void surfaceCreated(SurfaceHolder holder) {
+            _surfaceChanged(holder.getSurface());
+    }
+
+    @Override
+    public void surfaceChanged(SurfaceHolder holder, int format, int width,
+                    int height) {
+            _surfaceChanged(holder.getSurface(), format, width, height);
+
+    }
+
+    @Override
+    public void surfaceDestroyed(SurfaceHolder holder) {
+            _surfaceChanged(null);
+    }
+
+    @Override
+    public void surfaceRedrawNeeded(SurfaceHolder holder) {
+            _surfaceRedrawNeeded(holder.getSurface());		
+    }
+
+    private native void _surfaceChanged(Surface surface);
+
+    private native void _surfaceChanged(Surface surface, int format, int width, int height);
+
+    private native void _surfaceRedrawNeeded(Surface surface);
+
+    private void showIME() {
+        mView.requestFocus();
+        imm.showSoftInput(mView, 0);
+    }
+
+    private void hideIME() {
+        mView.requestFocus();
+        imm.hideSoftInputFromWindow(mView.getWindowToken(), 0);
+    }
+
+    private void installJVMIfNeeded() {
+        new InstallerTask().execute();
+    }
+	
+    private void runJVM() {
+        Log.i(TAG, "Launch JVM + application");
+        JvmArgs args = new JvmArgs(appDataDir);
+        VMLauncher.initialize(args.getJavaHome());
+        VMLauncher.runOnDebugPort(args.getDebugPort(),
+                                  args.getArgArray());
+    }
+	
+    private class InstallerTask extends AsyncTask<Void, Void, Void> {
+        protected Void doInBackground(Void... args) {
+           Log.i(TAG, "Installing JVM");
+            AppDataInstaller installer = 
+                new AppDataInstaller(storageDir,
+                    FXActivity.this.getApplicationContext().getAssets());
+            installer.install();
+            return null;
+        }
+    protected void onPostExecute(Void result) {
+            runJVM();
+        }
+    }
+	
+    private NativePipeReader.OnTextReceivedListener textListener = 
+            new NativePipeReader.OnTextReceivedListener() {
+                public void onTextReceived(String text) {
+                    Log.v(TAG_JVM, text);
+                }
+            };
+
+    private void initDirInfo() {
+        if (appDataDir == null) {
+            appDataDir = this.getApplicationInfo().dataDir;
+        }
+        storageDir = appDataDir + "/storage";
+    }
+	
+    private class JvmArgs {
+        private List<String> argList = new ArrayList<String>();
+        private String javaHome;
+
+        public JvmArgs(String appDir) {
+            String jvmRunCommand =
+                   "-Djava.library.path="
+                     + appDir + "/lib|"
+                     + "-Djava.home="
+                     + appDir + "/storage/jvm|"
+                     + "-Dsun.boot.library.path="
+                     + appDir + "/storage/jvm/lib|"
+                     + "-cp|"
+                     + getClasspath(appDir)
+                     + "|"                                         
+                     + "-Djavafx.platform=android|"
+                     + "-Djavafx.runtime.path="
+                     + appDir +"/storage/lib|"
+                     + getCustomJVMArgs()
+                     + "|"
+                     + getMainClass()
+                     + "|"
+                     + getApplicationArgs();
+
+            createArgList(jvmRunCommand);
+        }
+
+        private String[] listFiles(String dir, final String suffix) {
+            File dirf = new File(dir);
+            if (!dirf.exists()) {
+                return new String[]{};
+            }
+            String[] files = dirf.list(new FilenameFilter() {           
+                @Override
+                public boolean accept(File dir, String filename) {      
+                    return filename.endsWith(suffix);
+                }
+            });
+            return files;
+        }
+
+        private String getClasspath(String appDir) {
+            final String libDir = appDir + "/storage/lib/";
+            String[] libfiles = listFiles(libDir, JAR);
+            if (libfiles.length == 0) {
+                return "";
+            }
+            StringBuilder sb = new StringBuilder();
+            for(String file: libfiles) {
+                sb.append(libDir);
+                sb.append(file);
+                sb.append(File.pathSeparatorChar);
+            }
+            int len = sb.length();
+            return sb.substring(0, len - 1);
+        }
+
+        private String getMainClass() {
+             return getMetadata().getString(META_DATA_MAIN_CLASS);
+        }
+
+        private String getCustomJVMArgs() {
+             return getMetadata().getString(META_DATA_JVM_ARGS);
+        }
+
+        private String getApplicationArgs() {
+             return getMetadata().getString(META_DATA_APP_ARGS);
+        }
+
+        private int getDebugPort() {            
+             return getMetadata().getInt(META_DATA_DEBUG_PORT, 0);
+        }
+
+        private Bundle getMetadata() {
+            try {
+                ActivityInfo ai = FXActivity.this.getPackageManager().getActivityInfo(
+                        getIntent().getComponent(), PackageManager.GET_META_DATA);
+                return ai.metaData;
+
+            } catch(NameNotFoundException e) {
+                throw new RuntimeException("Error getting activity info", e);
+            }
+        }
+
+        public void createArgList(String args) {
+            if (args != null) {
+                String sep = (args.contains("|")) ? "\\|" : " ";
+                for (String arg : args.split(sep)) {
+                    arg = arg.trim();
+                    if (arg.length() > 0) {
+                        this.argList.add(arg);
+                        if (javaHome == null) {
+                            String[] pair = arg.split("\\=");
+                            Log.v(TAG, "arg = " + arg);
+                            Log.v(TAG, "pair.length = " + pair.length);
+                            if (pair.length == 2) {
+                                if ("-Djava.home".equals(pair[0])) {
+                                    Log.v(TAG, "Setting javaHome to " + pair[1]);
+                                    javaHome = pair[1];
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        
+        public String[] getArgArray() {
+            return argList.toArray(new String[0]);
+        }
+
+        public String getJavaHome() {
+           return javaHome;
+        }
+    }
+	
+    class InternalSurfaceView extends SurfaceView {
+
+        public InternalSurfaceView(Context context) {
+            super(context);
+            setFocusableInTouchMode(true);
+        }
+
+        @Override
+        public boolean dispatchTouchEvent(MotionEvent event) {
+            onTouchEventNative(event.getAction(), (int) event.getX(), (int) event.getY());
+            return true;
+        }
+
+        @Override
+        public boolean dispatchKeyEvent(KeyEvent event) {
+            onKeyEventNative(event.getAction(), event.getKeyCode(), event.getCharacters());
+            return true;
+        }
+
+        private native void onTouchEventNative(int action, int absx, int absy);
+
+        private native void onKeyEventNative(int action, int keycode, String characters);
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/InternalWebView.java	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2013 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.oracle.dalvik;
+
+import android.graphics.Bitmap;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.webkit.WebChromeClient;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.FrameLayout;
+import java.util.ArrayList;
+import java.util.List;
+
+public class InternalWebView {
+
+    public final static int PAGE_STARTED = 0;
+    public final static int PAGE_FINISHED = 1;
+    public final static int PAGE_REDIRECTED = 2;
+    public final static int LOAD_FAILED = 5;
+    public final static int LOAD_STOPPED = 6;
+    public final static int CONTENT_RECEIVED = 10;
+    public final static int TITLE_RECEIVED = 11;
+    public final static int ICON_RECEIVED = 12;
+    public final static int CONTENTTYPE_RECEIVED = 13;
+    public final static int DOCUMENT_AVAILABLE = 14;
+    public final static int RESOURCE_STARTED = 20;
+    public final static int RESOURCE_REDIRECTED = 21;
+    public final static int RESOURCE_FINISHED = 22;
+    public final static int RESOURCE_FAILED = 23;
+    public final static int PROGRESS_CHANGED = 30;
+    private static final String TAG = "InternalWebView";
+    private static List<InternalWebView> views = new ArrayList<InternalWebView>();
+    private static int idcounter = 0;
+    private boolean isLayedOut = false;
+    private boolean initialized = false;
+    private int internalID;
+    private int x, y, width, height;
+    private WebView nativeWebView;
+    private String url, content;
+    private String contentType = "text/html";
+    private String encoding = "base64";
+    private boolean visible;
+
+    public InternalWebView() {
+        this.internalID = ++idcounter;
+        views.add(0, this);
+    }
+
+    public int getInternalID() {
+        return this.internalID;
+    }
+
+    private void initialize() {
+        nativeWebView = new WebView(FXActivity.getInstance()) {
+            @Override
+            protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+                setMeasuredDimension(width, height);
+            }
+        };
+        nativeWebView.setWebViewClient(new WebViewClient() {
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                view.loadUrl(url);
+                return true;
+            }
+
+            @Override
+            public void onPageStarted(WebView view, String url, Bitmap favicon) {
+                fireLoadEvent(0, PAGE_STARTED, url, contentType, -1, -1);
+            }
+
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                fireLoadEvent(0, PAGE_FINISHED, url, contentType, -1, -1);
+            }
+
+            @Override
+            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
+                fireLoadEvent(0, LOAD_FAILED, failingUrl, contentType, -1, errorCode);
+            }
+        });
+
+        nativeWebView.setWebChromeClient(new WebChromeClient() {
+            @Override
+            public void onProgressChanged(WebView view, int newProgress) {
+                fireLoadEvent(0, PROGRESS_CHANGED, url, contentType, newProgress, -1);
+            }
+        });
+
+        WebSettings settings = nativeWebView.getSettings();
+        settings.setSupportZoom(true);
+        settings.setJavaScriptEnabled(true);
+
+        initialized = true;        
+    }
+
+    private void fireLoadEvent(int frameID, int state, String url,
+            String content_type, int progress, int errorCode) {
+        _fireLoadEvent(this.internalID, frameID, state,
+                url == null ? "" : url,
+                content_type == null ? "" : content_type,
+                progress, errorCode);
+    }
+
+    private static int indexOf(long id) {
+        int i = 0;
+        for (InternalWebView wvp : views) {
+            if (id == wvp.internalID) {
+                return i;
+            }
+            i++;
+        }
+        return -1;
+    }
+
+    private static InternalWebView getViewByID(int id) {
+        for (InternalWebView wvp : views) {
+            if (id == wvp.internalID) {
+                return wvp;
+            }
+        }
+        throw new RuntimeException("No InternalWebView with id: " + id);
+    }
+
+    static void createNew() {
+        FXActivity.getInstance().runOnUiThread(new Runnable() {
+            public void run() {
+                new InternalWebView().getInternalID();
+            }
+        });
+    }
+
+    static void loadUrl(int id, String url) {
+        final InternalWebView iwv = InternalWebView.getViewByID(id);
+        iwv.setContent(null, null);
+        iwv.setUrl(url);
+        if (iwv.initialized && iwv.isLayedOut) {
+            FXActivity.getInstance().runOnUiThread(new Runnable() {
+                public void run() {
+                    int c = FXActivity.getViewGroup().getChildCount();                    
+                    iwv.nativeWebView.loadUrl(iwv.url);
+                }
+            });
+        }
+    }
+
+    static void loadContent(int id, String content, String contentType) {
+        final InternalWebView iwv = InternalWebView.getViewByID(id);
+        iwv.setUrl(null);
+        iwv.setContent(content, contentType);
+        if (iwv.initialized && iwv.isLayedOut) {
+            FXActivity.getInstance().runOnUiThread(new Runnable() {
+                public void run() {                    
+                    iwv.nativeWebView.loadData(iwv.content, iwv.contentType, iwv.encoding);
+                }
+            });
+        }
+    }
+
+    static void setEncoding(int id, String encoding) {
+        final InternalWebView iwv = InternalWebView.getViewByID(id);
+        iwv.setEncoding(encoding);
+    }
+
+    static void moveAndResize(int id, int x, int y, final int w, final int h) {
+        final boolean move;
+        final boolean resize;        
+
+        if (w == 0 || h == 0) {
+            return;
+        }
+
+        final InternalWebView iwv = InternalWebView.getViewByID(id);
+        if (iwv == null) {
+            return;
+        }
+        if (iwv.x == x
+                && iwv.y == y
+                && iwv.width == w
+                && iwv.height == h) {
+            return;
+        }
+
+        move = (iwv.x != x || iwv.y != y);
+        if (move) {
+            iwv.x = x;
+            iwv.y = y;
+        }
+        resize = (iwv.width != w || iwv.height != h);
+        if (resize) {
+            iwv.width = w;
+            iwv.height = h;
+        }
+        if (!iwv.visible) {
+            return;
+        }
+        
+        if (!iwv.isLayedOut) {
+            iwv.isLayedOut = true;
+            FXActivity.getInstance().runOnUiThread(new Runnable() {
+                public void run() {
+                    if (!iwv.initialized) {
+                        iwv.initialize();
+                    }
+                    FrameLayout.LayoutParams layout = new FrameLayout.LayoutParams(
+                            ViewGroup.LayoutParams.WRAP_CONTENT,
+                            ViewGroup.LayoutParams.WRAP_CONTENT,
+                            Gravity.NO_GRAVITY);
+                    layout.leftMargin = iwv.x;
+                    layout.topMargin = iwv.y;
+//                    iwv.nativeWebView.setTranslationX(iwv.x);
+//                    iwv.nativeWebView.setTranslationY(iwv.y);
+                    FXActivity.getViewGroup().addView(iwv.nativeWebView, layout);
+                    Log.v(TAG, String.format("WebView added to ViewGroup [x: %d, y: %d , w: %d h: %d]",
+                            iwv.x, iwv.y, iwv.width, iwv.height));
+                    if (iwv.contentType == null || iwv.contentType.length() == 0) {
+                        iwv.contentType = "text/html";
+                    }
+                    if (iwv.url != null && iwv.url.length() > 0) {
+                        Log.v(TAG, "Loading url: " + iwv.url);
+                        iwv.nativeWebView.loadUrl(iwv.url);
+                    } else if (iwv.content != null) {                        
+                        Log.v(TAG, String.format("Loading content: %s\ncontent type: %s\nencoding: %s",
+                                iwv.content, iwv.contentType, iwv.encoding));
+                        iwv.nativeWebView.loadData(iwv.content, iwv.contentType, iwv.encoding);
+                    }
+                }
+            });
+
+        }// end of not initialized
+        else {
+            FXActivity.getInstance().runOnUiThread(new Runnable() {
+                public void run() {
+                    if (move) {
+                        FrameLayout.LayoutParams layout =
+                                (FrameLayout.LayoutParams) iwv.nativeWebView.getLayoutParams();
+                        layout.leftMargin = iwv.x;
+                        layout.topMargin = iwv.y;
+                        FXActivity.getViewGroup().updateViewLayout(iwv.nativeWebView, layout);
+//                        iwv.nativeWebView.setTranslationX(iwv.x);
+//                        iwv.nativeWebView.setTranslationY(iwv.y);
+                    }
+                    if (move || resize) {
+                        iwv.nativeWebView.invalidate();
+                    }                    
+                }
+            });
+        }        
+    }
+
+    static void setVisible(int id, final boolean visible) {
+        final InternalWebView iwv = InternalWebView.getViewByID(id);
+        if (iwv == null) {
+            return;
+        }
+        if (!iwv.initialized) {
+            iwv.visible = visible;
+            return;
+        }
+        FXActivity.getInstance().runOnUiThread(new Runnable() {
+            public void run() {
+                iwv.nativeWebView.setVisibility(visible ? View.VISIBLE : View.GONE);
+                if (visible) {
+                    iwv.nativeWebView.invalidate();
+                }
+            }
+        });
+    }
+
+    static void dispose(int id) {
+        final InternalWebView iwv = InternalWebView.getViewByID(id);
+        InternalWebView.setVisible(id, false);
+
+        FXActivity.getInstance().runOnUiThread(new Runnable() {
+            public void run() {
+                iwv.nativeWebView.stopLoading();
+                iwv.nativeWebView.destroy();
+            }
+        });
+        views.remove(iwv);
+    }
+
+    private void setUrl(String url) {
+        this.url = url;
+    }
+
+    private void setContent(String content, String contentType) {
+        this.content = content;
+        this.contentType = contentType;
+    }
+
+    private void setEncoding(String encoding) {
+        this.encoding = encoding;
+    }
+
+    private native void _fireLoadEvent(int id, int frameID, int state, String url,
+            String contentType, int progress, int errorCode);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/MainActivity.java	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2013 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.oracle.dalvik;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+import android.app.Activity;
+import android.app.NativeActivity;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.graphics.PixelFormat;
+import android.graphics.drawable.ColorDrawable;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
+
+
+public class MainActivity extends NativeActivity {
+
+    public static final String  TAG     = "MainActivity";
+    private static final String TAG_JVM = "JVM";
+    private static final String JAR     = ".jar";
+
+    private static final String META_DATA_MAIN_CLASS = "main.class";
+    private static final String META_DATA_JVM_ARGS   = "jvm.args";
+    private static final String META_DATA_APP_ARGS   = "app.args";
+    private static final String META_DATA_DEBUG_PORT = "debug.port";
+
+    private String                  appDataDir;
+    private String                  storageDir;    
+    private NativePipeReader        reader;
+    
+    private ViewGroup mViewGroup;
+    private View      mView;
+
+    static {
+        // load npr and vmlauncher
+        System.loadLibrary("vmlauncher");
+    }
+        
+    private NativePipeReader.OnTextReceivedListener textListener = 
+            new NativePipeReader.OnTextReceivedListener() {
+                public void onTextReceived(String text) {
+                    Log.v(TAG_JVM, text);
+                }
+            };
+
+    private void initDirInfo() {
+        appDataDir = this.getApplicationInfo().dataDir;
+        storageDir = appDataDir + "/storage";
+    }
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        getWindow().setFormat(PixelFormat.RGBA_8888);
+        getWindow().setSoftInputMode(
+                WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED
+              | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
+
+        mViewGroup = (ViewGroup)getWindow().getDecorView()
+                    .findViewById(Window.ID_ANDROID_CONTENT);
+        mView = mViewGroup.getChildAt(0);
+        mView.setFocusableInTouchMode(true);
+
+        reader = NativePipeReader.getDefaultReader(textListener);
+        reader.start();
+        initDirInfo();
+        installJVMIfNeeded();
+    }
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+    	if (event.getAction() == KeyEvent.ACTION_MULTIPLE) {
+    		if (event.getKeyCode() == KeyEvent.KEYCODE_UNKNOWN) {
+    			Log.w(TAG, "KeyEvent (MULTIPLE) :" + event.getCharacters());
+    			Log.w(TAG, "Predictive text (T9) not supported!");
+    		}
+    	}
+    	return super.dispatchKeyEvent(event);
+    }
+    
+    private void installJVMIfNeeded() {
+        new InstallerTask().execute();
+    }
+
+    private void runJVM() {
+        Log.i(TAG, "Launch JVM + application");
+        JvmArgs args = new JvmArgs(appDataDir);
+        VMLauncher.initialize(args.getJavaHome());
+        VMLauncher.runOnDebugPort(args.getDebugPort(),
+                                  args.getArgArray());
+    }
+
+    private class InstallerTask extends AsyncTask<Void, Void, Void> {
+        protected Void doInBackground(Void... args) {
+           Log.i(TAG, "Installing JVM");
+            AppDataInstaller installer = 
+                new AppDataInstaller(storageDir,
+                                     MainActivity.this.getApplicationContext().getAssets());
+            installer.install();
+            return null;
+        }
+        protected void onPostExecute(Void result) {
+           Log.i(TAG, "JVM Installed");
+            runJVM();
+        }
+    }
+
+
+    private class JvmArgs {
+        private List<String> argList = new ArrayList<String>();
+        private String javaHome;
+
+        public JvmArgs(String appDir) {
+            String jvmRunCommand =
+                   "-Djava.library.path="
+                     + appDir + "/lib|"
+                     + "-Djava.home="
+                     + appDir + "/storage/jvm|"
+                     + "-Dsun.boot.library.path="
+                     + appDir + "/storage/jvm/lib|"
+                     + "-cp|"
+                     + getClasspath(appDir)
+                     + "|"                                         
+                     + "-Djavafx.platform=android|"
+                     + "-Djavafx.runtime.path="
+                     + appDir +"/storage/lib|"
+                     + getCustomJVMArgs()
+                     + "|"
+                     + getMainClass()
+                     + "|"
+                     + getApplicationArgs();
+
+            createArgList(jvmRunCommand);
+        }
+
+        private String[] listFiles(String dir, final String suffix) {
+           File dirf = new File(dir);
+           if (!dirf.exists()) {
+               return new String[]{};
+           }
+           String[] files = dirf.list(new FilenameFilter() {           
+               @Override
+               public boolean accept(File dir, String filename) {      
+                   return filename.endsWith(suffix);
+               }
+           });
+           return files;
+       }
+
+       private String getClasspath(String appDir) {
+           final String libDir = appDir + "/storage/lib/";
+           String[] libfiles = listFiles(libDir, JAR);
+           if (libfiles.length == 0) {
+               return "";
+           }
+           StringBuilder sb = new StringBuilder();
+           for(String file: libfiles) {
+               sb.append(libDir);
+               sb.append(file);
+               sb.append(File.pathSeparatorChar);
+           }
+           int len = sb.length();
+           return sb.substring(0, len - 1);
+       }
+
+       private String getMainClass() {
+           return getMetadata().getString(META_DATA_MAIN_CLASS);
+       }
+
+       private String getCustomJVMArgs() {
+           return getMetadata().getString(META_DATA_JVM_ARGS);
+       }
+
+       private String getApplicationArgs() {
+           return getMetadata().getString(META_DATA_APP_ARGS);
+       }
+
+       private int getDebugPort() {            
+           return getMetadata().getInt(META_DATA_DEBUG_PORT, 0);
+       }
+
+       private Bundle getMetadata() {
+           try {
+               ActivityInfo ai = MainActivity.this.getPackageManager().getActivityInfo(
+                       getIntent().getComponent(), PackageManager.GET_META_DATA);
+               return ai.metaData;
+               
+           } catch(NameNotFoundException e) {
+               throw new RuntimeException("Error getting activity info", e);
+           }
+       }
+
+        public void createArgList(String args) {
+            if (args != null) {
+                String sep = (args.contains("|")) ? "\\|" : " ";
+                for (String arg : args.split(sep)) {
+                    arg = arg.trim();
+                    if (arg.length() > 0) {
+                        this.argList.add(arg);
+                        if (javaHome == null) {
+                            String[] pair = arg.split("\\=");
+                            Log.v(TAG, "arg = " + arg);
+                            Log.v(TAG, "pair.length = " + pair.length);
+                            if (pair.length == 2) {
+                                if ("-Djava.home".equals(pair[0])) {
+                                    Log.v(TAG, "Setting javaHome to " + pair[1]);
+                                    javaHome = pair[1];
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        public String[] getArgArray() {
+            return argList.toArray(new String[0]);
+        }
+
+        public String getJavaHome() {
+           return javaHome;
+        }
+
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/NativePipeReader.java	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2013, 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.oracle.dalvik;
+
+import android.os.Handler;
+
+public class NativePipeReader extends Thread { 
+   
+    /**
+     * onTextReceived 
+     * callback to return read text from pipe 
+     * called on the same thread that NativePipeReader was 
+     * created on.
+     * 
+     * @param text
+     */
+    public interface OnTextReceivedListener {
+        public void onTextReceived(String text);
+    }
+
+    public interface Client extends OnTextReceivedListener {
+        /**
+         * initPipe 
+         * called to set up pipe and redirect 
+         * 
+         * @return int, fd of output end of pipe
+         */
+        public int initPipe();
+
+
+        public void onTextReceived(String text);
+
+        /**
+         * cleanupPipe 
+         * called after last data is read from pipe and thread 
+         * is about to exit
+         *
+         */
+        public void cleanupPipe();
+    }
+
+    private Client client;
+    private Handler handler;
+
+    public NativePipeReader(Client client) {
+        this.client = client;
+        this.handler = new Handler();    
+    }
+
+    private volatile boolean stop = false;
+
+    public void stopReading() {
+        stop = true;
+    }
+
+    public void run() {
+        int fd = client.initPipe();
+        while (!stop) {
+            String text = readPipe(fd);
+            if (text.length() > 0) {
+                // only notify client if we
+                // actually got something
+                client.onTextReceived(text);
+            }
+        }
+        client.cleanupPipe();
+    }
+
+    public static NativePipeReader 
+    getDefaultReader(OnTextReceivedListener listener) {
+        return new NativePipeReader(
+                                   new StdoutStderrClient(listener));
+    }
+
+    /**
+     * readPipe 
+     * native method to read text from the 
+     * pipe. 
+     * this method may(should) block
+     * 
+     * @return String 
+     */
+    private native String readPipe(int fd);
+
+    private static class StdoutStderrClient implements Client {
+
+        Handler handler;
+        OnTextReceivedListener listener;
+
+        public StdoutStderrClient(OnTextReceivedListener listener) {
+            this.handler = new Handler();
+            this.listener = listener;
+        }
+
+        private native int nativeInitPipe();
+        private native void nativeCleanupPipe();
+
+        /**
+         * initPipe
+         * called to set up pipe and redirect
+         *
+         * @return int, fd of read end of pipe
+         */
+        public int initPipe() {
+            return nativeInitPipe();
+        }
+
+        /**
+         * onTextReceived
+         * callback to return read text from pipe
+         * called on the same thread that NativePipeReader was
+         * created on.
+         *
+         * @param text
+         */
+        public void onTextReceived(final String text) {
+            handler.post(new Runnable() {
+                             public void run() {
+                                 listener.onTextReceived(text); 
+                             }
+                         });
+        }
+
+        /**
+         * cleanupPipe
+         * called after last data is read from pipe and thread
+         * is about to exit
+         */
+        public void cleanupPipe() {
+            nativeCleanupPipe();
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/VMLauncher.java	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2013, 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.oracle.dalvik;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.ArrayList;
+
+import android.util.Log;
+
+public class VMLauncher extends Thread {
+
+   private static final String TAG = "VMLauncher";
+    private static String sJavaHome;
+
+    private String[] args;
+
+    public static void initialize(String javaHome) {
+        if (javaHome != null) {
+            sJavaHome = javaHome;
+            loadNativeLibraries();
+        } else {
+            throw new NullPointerException();
+        }
+    }
+    
+    // java libs are located at architecture dependent 
+    // paths
+    // i386 for x86 arch
+    // arm  for ARM arch
+    public static String getJvmArch() {
+        String rawarch = System.getProperty("os.arch");
+        if (rawarch != null && rawarch.contains("86")) {
+            return "i386";
+        }
+        return "arm";
+    }
+
+    private static void loadNativeLibraries() {
+        System.load(sJavaHome + "/lib/" + getJvmArch() + "/client/libjvm.so");
+        System.load(sJavaHome + "/lib/" + getJvmArch() + "/jli/libjli.so");
+    }
+    
+    private static String getCmdLine() {
+        // /proc/self/cmdline contains apk
+        // package name
+        StringBuilder builder = new StringBuilder();
+        try {
+            Reader reader = new FileReader("/proc/self/cmdline");
+            int c = 0;
+            while ((c = reader.read()) > 0) {
+                builder.append((char)c);
+            }
+            reader.close();
+        } catch (Exception e) {
+            builder = new StringBuilder("dalvik.package");
+        }
+        return builder.toString();        
+    }
+
+    private static void listDirToStandardOut(String dirpath) {
+        File dir = new File(dirpath);
+        try {
+            for (File file : dir.listFiles()) {
+                if (file.isDirectory()) {
+                    listDirToStandardOut(file.getAbsolutePath());
+                }
+            }
+        } catch (Exception e) {
+            Log.e(TAG, "Exception listing dir " + dir);
+        }
+    }
+
+    private VMLauncher(String[] args) {
+        super("JVM");
+        this.args = args;
+    }
+
+    public void run()
+    {
+        launchJVM(this.args);
+    }
+
+    private static void startJavaInBackground(String[] args)
+    {
+        new VMLauncher(args).start();
+    }
+
+    public static void runOnDebugPort(Integer debugPort,
+                                      String[] args)
+    {
+        ArrayList<String> localArrayList = new ArrayList();
+        
+        // need to add apk pkg name to head of arg list
+        localArrayList.add(getCmdLine()); 
+        
+        if (debugPort.intValue() > 0) {
+            localArrayList.add("-Xdebug");
+            localArrayList.add("-agentlib:jdwp=server=y,suspend=y,transport=dt_socket,address=" + debugPort);
+        }
+
+        for (String arg : args) {
+            localArrayList.add(arg);
+        }
+
+        String[] processedArgs = localArrayList.toArray(new String[0]);
+
+        for (String arg : processedArgs) {
+            Log.v(TAG, "Processed JVM arg : " + arg);
+        }
+
+        startJavaInBackground(processedArgs);
+    }
+
+    private static native int launchJVM(String[] args);
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/net/DalvikProxySelector.java	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2013, 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.oracle.dalvik.net;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.SocketAddress;
+import java.net.InetSocketAddress;
+import java.net.URI;
+
+
+public class DalvikProxySelector {
+    private String[] args;
+
+    private DalvikProxySelector(String[] args){
+        this.args = args;
+    }
+
+    //Result host and port are returned in a string in the format host:port
+    public static String[] getProxyForURL(String target) {
+        String[] proxyInfo = new String[0];
+        List<String> proxies = new ArrayList<String>();
+        URI uri = null;
+        try {
+            ProxySelector defaultProxySelector = ProxySelector.getDefault();
+            uri = new URI(target);
+            List<Proxy> proxyList = defaultProxySelector.select(uri);
+
+            Proxy proxy = proxyList.get(0);
+            if (proxy.equals(Proxy.NO_PROXY)) {
+                System.out.println("DalvikProxySelector.getProxyForURL(): No proxy found");
+                return null;
+            }
+            SocketAddress address = proxy.address();
+            InetSocketAddress inetSocketAddress = (InetSocketAddress) address;
+            String host = inetSocketAddress.getHostName();
+            int port = inetSocketAddress.getPort();
+            if (host == null) {
+                System.out.println("DalvikProxySelector.getProxyForURL(): No proxy found");
+                return null;
+            }
+
+            proxies.add(host);                      // even index, host
+            proxies.add(Integer.toString(port));    // odd index, port
+
+            System.out.println("DalvikProxySelector.getProxyForURL(): host=" + host + " port=" + port);
+            return proxies.toArray(new String[0]);
+        } catch (Exception e) {
+            System.out.println("DalvikProxySelector.getProxyForURL(): exception(ignored): " + e.toString());
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/native/DalvikProxySelector.c	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+
+#include <jni.h>
+#include <android/log.h>
+#include "DalvikProxySelector.h"
+
+static jclass dalvikProxySelectorClass;
+static jmethodID getProxyMethodId;
+
+static jclass initDalvikProxySelectorClass(JNIEnv* env) {
+    jclass localClass = (*env)->FindClass(env, "com/oracle/dalvik/net/DalvikProxySelector");
+    dalvikProxySelectorClass = (jclass) (*env)->NewGlobalRef(env,localClass);
+    __android_log_print(3, "DalvikProxySelector", ">>> after FindClass DalvikProxySelectorClass = %x", dalvikProxySelectorClass);
+    if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
+        __android_log_print(3, "DalvikProxySelector", ">>> initDalvikProxySelectorClass: ExceptionCheck = JNI_TRUE");
+        (*env)->ExceptionDescribe(env);
+        (*env)->ExceptionClear(env);
+    }
+    return dalvikProxySelectorClass;
+}
+
+static jmethodID initGetProxyMethod(JNIEnv* env, jclass clazz) {
+    getProxyMethodId = (*env)->GetStaticMethodID(env, clazz, "getProxyForURL", "(Ljava/lang/String;)[Ljava/lang/String;");
+    __android_log_print(3, "DalvikProxySelector", ">>> getProxyForURL: after GetStaticMethodID");
+    if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
+        __android_log_print(3, "DalvikProxySelector", ">>> initGetProxyMethod: ExceptionCheck = JNI_TRUE");
+        (*env)->ExceptionDescribe(env);
+        (*env)->ExceptionClear(env);
+    }
+    return getProxyMethodId;
+}
+
+void initDalvikProxySelectorData(JNIEnv* env) {
+    jclass clazz = initDalvikProxySelectorClass(env);
+    initGetProxyMethod(env, clazz);
+}
+
+jclass getDalvikProxySelectorClass(void) {
+    return dalvikProxySelectorClass;
+}
+
+jmethodID getDPSGetProxyMethodID(void) {
+    return getProxyMethodId;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/native/DalvikProxySelector.h	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+
+#ifndef DALVIK_PROXY_SELECTOR_H
+#define DALVIK_PROXY_SELECTOR_H
+#include <jni.h>
+
+void initDalvikProxySelectorData(JNIEnv* env);
+jclass getDalvikProxySelectorClass(void);
+jmethodID getDPSGetProxyMethodID(void);
+
+#endif // DALVIK_PROXY_SELECTOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/native/NativePipeReader.c	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+#include <unistd.h>
+#include <stdio.h>
+#include <android/log.h>
+#include "com_oracle_dalvik_NativePipeReader.h"
+#include "com_oracle_dalvik_NativePipeReader_StdoutStderrClient.h"
+
+#define NPR_BUF_SIZE 128
+static char buffer[NPR_BUF_SIZE + 1];
+static int readfd = -1;
+
+/*
+ * Class:     com_oracle_dalvik_NativePipeReader
+ * Method:    readPipe
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_oracle_dalvik_NativePipeReader_readPipe
+  (JNIEnv *env, jobject thiz, jint fd) {
+    int bytesread = -1;
+    if (fd >= 0) {
+        // read data from pipe (should block)
+        // __android_log_print(3, "NPR", "Calling read(%d)\n", fd);
+        bytesread = read((int)fd, buffer, NPR_BUF_SIZE);
+    }
+    if (bytesread > -1) {
+        buffer[bytesread] = '\0';
+        return (*env)->NewStringUTF(env, buffer);
+    } else {
+        buffer[0] = '\0';
+    }
+    // __android_log_print(3, "NPR", "Bytes read from pipe = %d\n", bytesread);
+    return (*env)->NewStringUTF(env, buffer);
+}
+
+/*
+ * Class:     com_oracle_dalvik_NativePipeReader_StdoutStderrClient
+ * Method:    nativeInitPipe
+ * Signature: ()I 
+ *  
+ * create a new pipe attaching stdout and stderr to the WRITE end 
+ *  
+ */
+JNIEXPORT jint JNICALL Java_com_oracle_dalvik_NativePipeReader_00024StdoutStderrClient_nativeInitPipe
+  (JNIEnv *env, jobject thiz) {
+    int fd[2];
+    int status = pipe(fd);
+    if (status >= 0) {
+        readfd = fd[0];
+        // we have the pipe now connect stdout/stderr
+        status = dup2(fd[1], STDOUT_FILENO); // connect stdin
+        // __android_log_print(3, "NPR", "connected stdout to pipe %d status = %d\n", fd[1], status);
+        status = dup2(fd[1], STDERR_FILENO); // connect sterr
+        if (status >= 0) {
+            status = fd[0];
+        }
+    }
+    // __android_log_print(3, "NPR", "nativeInitPipe f0 = %d f1 = %d status = =%d", fd[0], fd[1], status);
+    printf("nativeInitPipe f0 = %d f1 = %d status = =%d", fd[0], fd[1], status);
+    return status;
+}
+
+/*
+ * Class:     com_oracle_dalvik_NativePipeReader_StdoutStderrClient
+ * Method:    nativeCleanupPipe
+ * Signature: ()V 
+ *  
+ * Return stdout and stderr to previous settings and 
+ * shut down pipe 
+ *  
+ */
+JNIEXPORT void JNICALL Java_com_oracle_dalvik_NativePipeReader_00024StdoutStderrClient_nativeCleanupPipe
+  (JNIEnv *env, jobject thiz) {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/android/native/VMLauncher.c	Tue Jul 09 09:36:39 2013 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+#include <jni.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <android/log.h>
+#include <dlfcn.h>
+#include "DalvikProxySelector.h"
+#include "com_oracle_dalvik_VMLauncher.h"
+
+#define FULL_VERSION "1.7.0_04-ea-b19"
+#define DOT_VERSION "1.7.0_04"
+
+typedef jint JNI_CreateJavaVM_func(JavaVM **pvm, void **penv, void *args);
+
+typedef jint JLI_Launch_func(int argc, char ** argv, /* main argc, argc */
+        int jargc, const char** jargv,          /* java args */
+        int appclassc, const char** appclassv,  /* app classpath */
+        const char* fullversion,                /* full version defined */
+        const char* dotversion,                 /* dot version defined */
+        const char* pname,                      /* program name */
+        const char* lname,                      /* launcher name */
+        jboolean javaargs,                      /* JAVA_ARGS */
+        jboolean cpwildcard,                    /* classpath wildcard*/
+        jboolean javaw,                         /* windows-only javaw */
+        jint ergo                               /* ergonomics class policy */
+);
+
+JavaVM *dalvikJavaVMPtr = NULL;
+JNIEnv *dalvikJNIEnvPtr = NULL;
+
+jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+    //Save dalvik global JavaVM pointer
+    dalvikJavaVMPtr = vm;
+    __android_log_print(3,"JVM", "JNI_OnLoad calling GetEnv()");
+    JNIEnv* env = NULL;
+    (*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4);
+    __android_log_print(3,"JVM", "JNI_OnLoad calling initDalvikProxySelectorData()");
+    initDalvikProxySelectorData(env);
+    __android_log_print(3,"JVM", "JNI_OnLoad returning()");
+    return JNI_VERSION_1_4;
+}
+
+static void logArgs(int argc, char** argv) {
+    int i;
+    
+    for (i = 0; i < argc; i++) {
+        __android_log_print(3,"JVM", "arg[%d]: %s", i, argv[i]);
+    }
+}
+
+static jint launchJVM(int argc, char** argv) {
+    logArgs(argc, argv);
+
+   void* libjli = dlopen("libjli.so", RTLD_LAZY | RTLD_GLOBAL);
+        __android_log_print(3,"JVM", "JLI lib = %x", (int)libjli);
+   if (NULL == libjli) {
+       return 0;
+   }
+        __android_log_print(3,"JVM", "Found JLI lib");
+
+   JLI_Launch_func *pJLI_Launch =
+          (JLI_Launch_func *)dlsym(libjli, "JLI_Launch");
+
+        __android_log_print(3,"JVM", "JLI_Launch = 0x%x", *(int*)&pJLI_Launch);
+
+   if (NULL == pJLI_Launch) {
+        __android_log_print(3,"JVM", "JLI_Launch = NULL");
+       return 0;
+   }
+
+        __android_log_print(3,"JVM", "Calling JLI_Launch");
+   return pJLI_Launch(argc, argv, 0, NULL, 0, NULL, FULL_VERSION,
+                          DOT_VERSION, *argv, *argv, JNI_FALSE, JNI_FALSE,
+                          JNI_FALSE, 0);
+}
+
+/*
+ * Class:     com_oracle_embedded_launcher_VMLauncher
+ * Method:    launchJVM
+ * Signature: ([Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_com_oracle_dalvik_VMLauncher_launchJVM
+  (JNIEnv *env, jclass clazz, jobjectArray argsArray) {
+   jint res = 0;
+   char **argv = NULL;
+   int i;
+
+        // Save dalvik JNIEnv pointer for JVM launch thread
+        dalvikJNIEnvPtr = env;
+
+        if (argsArray == NULL) {
+          __android_log_print(3,"LaunchJVM", " args array null, returning ");
+       //handle error
+       return 0;
+   }
+
+   int argc = (*env)->GetArrayLength(env, argsArray);
+
+   argv = calloc( (argc+1), sizeof(jbyte*) );
+
+   //copy args
+   for (i = 0; i < argc; i++) {
+       jstring stringElement = (jstring) (*env)->GetObjectArrayElement(env, argsArray, i);
+       const jbyte *ansiString = (*env)->GetStringUTFChars(env, stringElement, NULL);
+       if (ansiString == NULL) {
+           //handle error
+           return 0;
+       }
+       argv[i] = calloc( (strlen(ansiString)+1), sizeof(jbyte) );
+       if (argv[i] == NULL) {
+           //handle error
+           return 0;
+       }
+       strcpy(argv[i], ansiString);
+       (*env)->ReleaseStringUTFChars(env, stringElement, (const char*)ansiString);
+   }
+   //add NULL element
+   argv[argc] = NULL;
+        __android_log_print(3,"LaunchJVM", " Done processing args ");
+
+   res = launchJVM(argc, argv);
+
+   //free args
+   for (i = 0; i < argc; i++) {
+       free(argv[i]);
+   }
+   free(argv);
+
+   return res;
+}
+
+
--- a/modules/graphics/src/main/android/com/oracle/dalvik/AppDataInstaller.java	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2013, 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.oracle.dalvik;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import android.util.Log;
-import android.content.res.AssetManager;
-
-public class AppDataInstaller {
-    private static final String TAG = "AppDataInstaller";
-    
-   String       storageDir;
-    AssetManager assetManager;
-
-    public AppDataInstaller(String storageDir, AssetManager assetManager) {
-        this.storageDir = storageDir;
-        this.assetManager = assetManager;
-    }
-
-    public void handleAssetZipFile(String zipFileName, String dstDirName) {
-
-        try {
-            // Open the ZipInputStream
-            InputStream is = assetManager.open(zipFileName);
-            ZipInputStream zis = new ZipInputStream(is);
-
-            // Loop through all the files and folders
-            ZipEntry entry = null;
-            while ((entry = zis.getNextEntry()) != null) {
-                String innerFileName = dstDirName + File.separator 
-                    + entry.getName();
-                File innerFile = new File(innerFileName);
-                if (innerFile.exists()) {
-                    innerFile.delete();
-                }
-
-                if (entry.isDirectory()) {
-                    innerFile.mkdirs();
-                } else {
-                    // Create a file output stream
-                    FileOutputStream outputStream = 
-                        new FileOutputStream(innerFileName);
-                    final int BUFFER_SIZE = 2048;
-                    BufferedOutputStream bufferedOutputStream = 
-                        new BufferedOutputStream(outputStream, BUFFER_SIZE);
-
-                    // Write output
-                    int count = 0;
-                    byte[] data = new byte[BUFFER_SIZE];
-                    while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {
-                        bufferedOutputStream.write(data, 0, count);
-                    }
-
-                    // Flush and close the buffers
-                    bufferedOutputStream.flush();
-                    bufferedOutputStream.close();
-                }
-
-                // Close the current entry
-                zis.closeEntry();
-            }
-            zis.close();
-        } catch (IOException e) {
-            Log.v(TAG, "handleAssetZipFile: IOException: " + e);
-            e.printStackTrace();
-        }
-    }
-
-    public void copyAssetsTree(String src, String dst) {
-        // scan assets
-        Log.v(TAG, "AppDataInstaller.copyAssetsTree(): copyDir: src=" 
-                           + src + " dst=" + dst);
-
-        try {
-            String[] fileList = assetManager.list(src);
-            Log.v(TAG, "Sample.onCreate: # of assets in " + src 
-                               + ": " + fileList.length);
-            if (fileList.length <= 0) {
-                // file
-                Log.v(TAG, "copyAssetsTree: Copy file " + src
-                                   + " to " + dst);
-
-                // TODO: copy
-                InputStream is = assetManager.open(src);
-                File dstFile = new File(dst);
-                OutputStream os = new FileOutputStream(dstFile);
-                final int BUFFER_SIZE = 2048;
-                BufferedOutputStream bufferedOutputStream = 
-                    new BufferedOutputStream(os, BUFFER_SIZE);
-
-                byte[] buf = new byte[BUFFER_SIZE];
-                int len;
-                while ((len = is.read(buf)) > 0) {
-                    bufferedOutputStream.write(buf, 0, len);
-                }
-                is.close();
-                // os.close();
-                bufferedOutputStream.flush();
-                bufferedOutputStream.close();
-            } else {
-                // dir
-                // create target directory
-                Log.v(TAG, 
-                     "copyAssetsTree: Creating dir: " + dst);
-                File dstFile = new File(dst);
-                if (dstFile.exists()) {
-                    if (dstFile.isDirectory()) {
-                        Log.v(TAG,
-                             "copyAssetsTree: " + dst + " already exists");
-                    } else {
-                        Log.v(TAG,
-                             "copyAssetsTree: " + dst + " exists but is not a dierctory");
-                        return;
-                    }
-                } else {
-                    if (!dstFile.mkdirs()) {
-                        Log.v(TAG,
-                             "copyAssetsTree: Failed creating dir: " + dst);
-                        return;
-                    } else {
-                    }
-                }
-
-                final String ZIPPED_RENAMED_JPG_SUFFIX = ".ZIPPED.RENAMED.jpg";
-                final String RENAMED_JPG_SUFFIX = ".RENAMED.jpg";
-                for (String fileName: fileList) {
-                    if (fileName.endsWith(ZIPPED_RENAMED_JPG_SUFFIX)) {
-                        String newSrc = src + "/" + fileName;
-                        handleAssetZipFile(newSrc, dst);
-                    } else if (fileName.length() > RENAMED_JPG_SUFFIX.length() 
-                               && fileName.endsWith(RENAMED_JPG_SUFFIX)) {
-                        String newSrc = src + "/" + fileName;
-                        String newDst = dst + "/" 
-                            + fileName.substring(0, fileName.length()
-                                                 - RENAMED_JPG_SUFFIX.length());
-                        copyAssetsTree(newSrc, newDst);
-                    } else { // normal file
-                        String newSrc = src + "/" + fileName;
-                        String newDst = dst + "/" + fileName;
-                        copyAssetsTree(newSrc, newDst);
-                    }
-                }
-            }
-        } catch (IOException e) {
-            Log.v(TAG,
-                 "copyAssetsTree: IOException: " + e);
-            e.printStackTrace();
-        }
-    }
-
-    public void install() {
-        String doneFileName = storageDir + "/installation.done";
-        File doneFile = new File(doneFileName);
-
-        if (doneFile.exists()) {
-            Log.v(TAG,
-                 "install: JVM data already installed. Skipping");
-        } else {
-            Log.v(TAG,
-                 "install: Installing JVM data");
-            copyAssetsTree("storage", storageDir);
-
-            // write done flag
-            Log.v(TAG,
-                 "install: Write file " + doneFileName);
-            try {
-                OutputStream os = new FileOutputStream(doneFile);
-                os.write(1);
-                os.close();
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-}
--- a/modules/graphics/src/main/android/com/oracle/dalvik/FXActivity.java	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 2013 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.oracle.dalvik;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.List;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.graphics.PixelFormat;
-import android.os.AsyncTask;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.FrameLayout;
-
-public class FXActivity extends Activity implements SurfaceHolder.Callback, 
-        SurfaceHolder.Callback2 {
-	
-    private static final String TAG     = "FXActivity";
-    private static final String TAG_JVM = "JVM";
-    private static final String JAR     = ".jar";
-    
-    private static final String META_DATA_MAIN_CLASS = "main.class";
-    private static final String META_DATA_JVM_ARGS   = "jvm.args";
-    private static final String META_DATA_APP_ARGS   = "app.args";
-    private static final String META_DATA_DEBUG_PORT = "debug.port";
-    private static final String ANDROID_WEBVIEW = "android_webview";
-    private static final String GLASS_LENS_ANDROID = "glass-lens-android";
-
-    static {        
-        System.loadLibrary("vmlauncher");
-    }
-    private static FXActivity instance;
-    private static FrameLayout mViewGroup;
-    private static SurfaceView mView;
-
-    private String            appDataDir;
-    private String            storageDir;    
-    private NativePipeReader  reader;
-    private InputMethodManager imm;   
-    private String ldPath;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-            super.onCreate(savedInstanceState);
-
-        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
-        getWindow().setSoftInputMode(
-                WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED
-                | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
-        getWindow().setFormat(PixelFormat.RGBA_8888);
-
-        imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
-
-        mView = new InternalSurfaceView(this);
-        mView.getHolder().addCallback(this);        
-        mViewGroup = new FrameLayout(this);
-        mViewGroup.addView(mView);
-        setContentView(mViewGroup);
-        instance = this;
-        reader = NativePipeReader.getDefaultReader(textListener);
-        reader.start();
-        initDirInfo();
-        installJVMIfNeeded();
-        System.loadLibrary(GLASS_LENS_ANDROID);
-        System.loadLibrary(ANDROID_WEBVIEW);
-    }
-
-    public static FXActivity getInstance() {
-        return instance;
-    }
-
-    public String getLDPath() {
-        if (appDataDir == null) {
-            appDataDir = this.getApplicationInfo().dataDir;
-        }
-        if (ldPath == null) {
-            ldPath = appDataDir + "/lib";
-        }
-        return ldPath;
-    }
-
-    public static ViewGroup getViewGroup() {
-        return mViewGroup;
-    }    
-	
-    @Override
-    public void surfaceCreated(SurfaceHolder holder) {
-            _surfaceChanged(holder.getSurface());
-    }
-
-    @Override
-    public void surfaceChanged(SurfaceHolder holder, int format, int width,
-                    int height) {
-            _surfaceChanged(holder.getSurface(), format, width, height);
-
-    }
-
-    @Override
-    public void surfaceDestroyed(SurfaceHolder holder) {
-            _surfaceChanged(null);
-    }
-
-    @Override
-    public void surfaceRedrawNeeded(SurfaceHolder holder) {
-            _surfaceRedrawNeeded(holder.getSurface());		
-    }
-
-    private native void _surfaceChanged(Surface surface);
-
-    private native void _surfaceChanged(Surface surface, int format, int width, int height);
-
-    private native void _surfaceRedrawNeeded(Surface surface);
-
-    private void showIME() {
-        mView.requestFocus();
-        imm.showSoftInput(mView, 0);
-    }
-
-    private void hideIME() {
-        mView.requestFocus();
-        imm.hideSoftInputFromWindow(mView.getWindowToken(), 0);
-    }
-
-    private void installJVMIfNeeded() {
-        new InstallerTask().execute();
-    }
-	
-    private void runJVM() {
-        Log.i(TAG, "Launch JVM + application");
-        JvmArgs args = new JvmArgs(appDataDir);
-        VMLauncher.initialize(args.getJavaHome());
-        VMLauncher.runOnDebugPort(args.getDebugPort(),
-                                  args.getArgArray());
-    }
-	
-    private class InstallerTask extends AsyncTask<Void, Void, Void> {
-        protected Void doInBackground(Void... args) {
-           Log.i(TAG, "Installing JVM");
-            AppDataInstaller installer = 
-                new AppDataInstaller(storageDir,
-                    FXActivity.this.getApplicationContext().getAssets());
-            installer.install();
-            return null;
-        }
-    protected void onPostExecute(Void result) {
-            runJVM();
-        }
-    }
-	
-    private NativePipeReader.OnTextReceivedListener textListener = 
-            new NativePipeReader.OnTextReceivedListener() {
-                public void onTextReceived(String text) {
-                    Log.v(TAG_JVM, text);
-                }
-            };
-
-    private void initDirInfo() {
-        if (appDataDir == null) {
-            appDataDir = this.getApplicationInfo().dataDir;
-        }
-        storageDir = appDataDir + "/storage";
-    }
-	
-    private class JvmArgs {
-        private List<String> argList = new ArrayList<String>();
-        private String javaHome;
-
-        public JvmArgs(String appDir) {
-            String jvmRunCommand =
-                   "-Djava.library.path="
-                     + appDir + "/lib|"
-                     + "-Djava.home="
-                     + appDir + "/storage/jvm|"
-                     + "-Dsun.boot.library.path="
-                     + appDir + "/storage/jvm/lib|"
-                     + "-cp|"
-                     + getClasspath(appDir)
-                     + "|"                                         
-                     + "-Djavafx.platform=android|"
-                     + "-Djavafx.runtime.path="
-                     + appDir +"/storage/lib|"
-                     + getCustomJVMArgs()
-                     + "|"
-                     + getMainClass()
-                     + "|"
-                     + getApplicationArgs();
-
-            createArgList(jvmRunCommand);
-        }
-
-        private String[] listFiles(String dir, final String suffix) {
-            File dirf = new File(dir);
-            if (!dirf.exists()) {
-                return new String[]{};
-            }
-            String[] files = dirf.list(new FilenameFilter() {           
-                @Override
-                public boolean accept(File dir, String filename) {      
-                    return filename.endsWith(suffix);
-                }
-            });
-            return files;
-        }
-
-        private String getClasspath(String appDir) {
-            final String libDir = appDir + "/storage/lib/";
-            String[] libfiles = listFiles(libDir, JAR);
-            if (libfiles.length == 0) {
-                return "";
-            }
-            StringBuilder sb = new StringBuilder();
-            for(String file: libfiles) {
-                sb.append(libDir);
-                sb.append(file);
-                sb.append(File.pathSeparatorChar);
-            }
-            int len = sb.length();
-            return sb.substring(0, len - 1);
-        }
-
-        private String getMainClass() {
-             return getMetadata().getString(META_DATA_MAIN_CLASS);
-        }
-
-        private String getCustomJVMArgs() {
-             return getMetadata().getString(META_DATA_JVM_ARGS);
-        }
-
-        private String getApplicationArgs() {
-             return getMetadata().getString(META_DATA_APP_ARGS);
-        }
-
-        private int getDebugPort() {            
-             return getMetadata().getInt(META_DATA_DEBUG_PORT, 0);
-        }
-
-        private Bundle getMetadata() {
-            try {
-                ActivityInfo ai = FXActivity.this.getPackageManager().getActivityInfo(
-                        getIntent().getComponent(), PackageManager.GET_META_DATA);
-                return ai.metaData;
-
-            } catch(NameNotFoundException e) {
-                throw new RuntimeException("Error getting activity info", e);
-            }
-        }
-
-        public void createArgList(String args) {
-            if (args != null) {
-                String sep = (args.contains("|")) ? "\\|" : " ";
-                for (String arg : args.split(sep)) {
-                    arg = arg.trim();
-                    if (arg.length() > 0) {
-                        this.argList.add(arg);
-                        if (javaHome == null) {
-                            String[] pair = arg.split("\\=");
-                            Log.v(TAG, "arg = " + arg);
-                            Log.v(TAG, "pair.length = " + pair.length);
-                            if (pair.length == 2) {
-                                if ("-Djava.home".equals(pair[0])) {
-                                    Log.v(TAG, "Setting javaHome to " + pair[1]);
-                                    javaHome = pair[1];
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        
-        public String[] getArgArray() {
-            return argList.toArray(new String[0]);
-        }
-
-        public String getJavaHome() {
-           return javaHome;
-        }
-    }
-	
-    class InternalSurfaceView extends SurfaceView {
-
-        public InternalSurfaceView(Context context) {
-            super(context);
-            setFocusableInTouchMode(true);
-        }
-
-        @Override
-        public boolean dispatchTouchEvent(MotionEvent event) {
-            onTouchEventNative(event.getAction(), (int) event.getX(), (int) event.getY());
-            return true;
-        }
-
-        @Override
-        public boolean dispatchKeyEvent(KeyEvent event) {
-            onKeyEventNative(event.getAction(), event.getKeyCode(), event.getCharacters());
-            return true;
-        }
-
-        private native void onTouchEventNative(int action, int absx, int absy);
-
-        private native void onKeyEventNative(int action, int keycode, String characters);
-
-    }
-
-}
--- a/modules/graphics/src/main/android/com/oracle/dalvik/InternalWebView.java	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,324 +0,0 @@
-/*
- * Copyright (c) 2013 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.oracle.dalvik;
-
-import android.graphics.Bitmap;
-import android.util.Log;
-import android.view.Gravity;
-import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.WebChromeClient;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.widget.FrameLayout;
-import java.util.ArrayList;
-import java.util.List;
-
-public class InternalWebView {
-
-    public final static int PAGE_STARTED = 0;
-    public final static int PAGE_FINISHED = 1;
-    public final static int PAGE_REDIRECTED = 2;
-    public final static int LOAD_FAILED = 5;
-    public final static int LOAD_STOPPED = 6;
-    public final static int CONTENT_RECEIVED = 10;
-    public final static int TITLE_RECEIVED = 11;
-    public final static int ICON_RECEIVED = 12;
-    public final static int CONTENTTYPE_RECEIVED = 13;
-    public final static int DOCUMENT_AVAILABLE = 14;
-    public final static int RESOURCE_STARTED = 20;
-    public final static int RESOURCE_REDIRECTED = 21;
-    public final static int RESOURCE_FINISHED = 22;
-    public final static int RESOURCE_FAILED = 23;
-    public final static int PROGRESS_CHANGED = 30;
-    private static final String TAG = "InternalWebView";
-    private static List<InternalWebView> views = new ArrayList<InternalWebView>();
-    private static int idcounter = 0;
-    private boolean isLayedOut = false;
-    private boolean initialized = false;
-    private int internalID;
-    private int x, y, width, height;
-    private WebView nativeWebView;
-    private String url, content;
-    private String contentType = "text/html";
-    private String encoding = "base64";
-    private boolean visible;
-
-    public InternalWebView() {
-        this.internalID = ++idcounter;
-        views.add(0, this);
-    }
-
-    public int getInternalID() {
-        return this.internalID;
-    }
-
-    private void initialize() {
-        nativeWebView = new WebView(FXActivity.getInstance()) {
-            @Override
-            protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-                setMeasuredDimension(width, height);
-            }
-        };
-        nativeWebView.setWebViewClient(new WebViewClient() {
-            @Override
-            public boolean shouldOverrideUrlLoading(WebView view, String url) {
-                view.loadUrl(url);
-                return true;
-            }
-
-            @Override
-            public void onPageStarted(WebView view, String url, Bitmap favicon) {
-                fireLoadEvent(0, PAGE_STARTED, url, contentType, -1, -1);
-            }
-
-            @Override
-            public void onPageFinished(WebView view, String url) {
-                fireLoadEvent(0, PAGE_FINISHED, url, contentType, -1, -1);
-            }
-
-            @Override
-            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
-                fireLoadEvent(0, LOAD_FAILED, failingUrl, contentType, -1, errorCode);
-            }
-        });
-
-        nativeWebView.setWebChromeClient(new WebChromeClient() {
-            @Override
-            public void onProgressChanged(WebView view, int newProgress) {
-                fireLoadEvent(0, PROGRESS_CHANGED, url, contentType, newProgress, -1);
-            }
-        });
-
-        WebSettings settings = nativeWebView.getSettings();
-        settings.setSupportZoom(true);
-        settings.setJavaScriptEnabled(true);
-
-        initialized = true;        
-    }
-
-    private void fireLoadEvent(int frameID, int state, String url,
-            String content_type, int progress, int errorCode) {
-        _fireLoadEvent(this.internalID, frameID, state,
-                url == null ? "" : url,
-                content_type == null ? "" : content_type,
-                progress, errorCode);
-    }
-
-    private static int indexOf(long id) {
-        int i = 0;
-        for (InternalWebView wvp : views) {
-            if (id == wvp.internalID) {
-                return i;
-            }
-            i++;
-        }
-        return -1;
-    }
-
-    private static InternalWebView getViewByID(int id) {
-        for (InternalWebView wvp : views) {
-            if (id == wvp.internalID) {
-                return wvp;
-            }
-        }
-        throw new RuntimeException("No InternalWebView with id: " + id);
-    }
-
-    static void createNew() {
-        FXActivity.getInstance().runOnUiThread(new Runnable() {
-            public void run() {
-                new InternalWebView().getInternalID();
-            }
-        });
-    }
-
-    static void loadUrl(int id, String url) {
-        final InternalWebView iwv = InternalWebView.getViewByID(id);
-        iwv.setContent(null, null);
-        iwv.setUrl(url);
-        if (iwv.initialized && iwv.isLayedOut) {
-            FXActivity.getInstance().runOnUiThread(new Runnable() {
-                public void run() {
-                    int c = FXActivity.getViewGroup().getChildCount();                    
-                    iwv.nativeWebView.loadUrl(iwv.url);
-                }
-            });
-        }
-    }
-
-    static void loadContent(int id, String content, String contentType) {
-        final InternalWebView iwv = InternalWebView.getViewByID(id);
-        iwv.setUrl(null);
-        iwv.setContent(content, contentType);
-        if (iwv.initialized && iwv.isLayedOut) {
-            FXActivity.getInstance().runOnUiThread(new Runnable() {
-                public void run() {                    
-                    iwv.nativeWebView.loadData(iwv.content, iwv.contentType, iwv.encoding);
-                }
-            });
-        }
-    }
-
-    static void setEncoding(int id, String encoding) {
-        final InternalWebView iwv = InternalWebView.getViewByID(id);
-        iwv.setEncoding(encoding);
-    }
-
-    static void moveAndResize(int id, int x, int y, final int w, final int h) {
-        final boolean move;
-        final boolean resize;        
-
-        if (w == 0 || h == 0) {
-            return;
-        }
-
-        final InternalWebView iwv = InternalWebView.getViewByID(id);
-        if (iwv == null) {
-            return;
-        }
-        if (iwv.x == x
-                && iwv.y == y
-                && iwv.width == w
-                && iwv.height == h) {
-            return;
-        }
-
-        move = (iwv.x != x || iwv.y != y);
-        if (move) {
-            iwv.x = x;
-            iwv.y = y;
-        }
-        resize = (iwv.width != w || iwv.height != h);
-        if (resize) {
-            iwv.width = w;
-            iwv.height = h;
-        }
-        if (!iwv.visible) {
-            return;
-        }
-        
-        if (!iwv.isLayedOut) {
-            iwv.isLayedOut = true;
-            FXActivity.getInstance().runOnUiThread(new Runnable() {
-                public void run() {
-                    if (!iwv.initialized) {
-                        iwv.initialize();
-                    }
-                    FrameLayout.LayoutParams layout = new FrameLayout.LayoutParams(
-                            ViewGroup.LayoutParams.WRAP_CONTENT,
-                            ViewGroup.LayoutParams.WRAP_CONTENT,
-                            Gravity.NO_GRAVITY);
-                    layout.leftMargin = iwv.x;
-                    layout.topMargin = iwv.y;
-//                    iwv.nativeWebView.setTranslationX(iwv.x);
-//                    iwv.nativeWebView.setTranslationY(iwv.y);
-                    FXActivity.getViewGroup().addView(iwv.nativeWebView, layout);
-                    Log.v(TAG, String.format("WebView added to ViewGroup [x: %d, y: %d , w: %d h: %d]",
-                            iwv.x, iwv.y, iwv.width, iwv.height));
-                    if (iwv.contentType == null || iwv.contentType.length() == 0) {
-                        iwv.contentType = "text/html";
-                    }
-                    if (iwv.url != null && iwv.url.length() > 0) {
-                        Log.v(TAG, "Loading url: " + iwv.url);
-                        iwv.nativeWebView.loadUrl(iwv.url);
-                    } else if (iwv.content != null) {                        
-                        Log.v(TAG, String.format("Loading content: %s\ncontent type: %s\nencoding: %s",
-                                iwv.content, iwv.contentType, iwv.encoding));
-                        iwv.nativeWebView.loadData(iwv.content, iwv.contentType, iwv.encoding);
-                    }
-                }
-            });
-
-        }// end of not initialized
-        else {
-            FXActivity.getInstance().runOnUiThread(new Runnable() {
-                public void run() {
-                    if (move) {
-                        FrameLayout.LayoutParams layout =
-                                (FrameLayout.LayoutParams) iwv.nativeWebView.getLayoutParams();
-                        layout.leftMargin = iwv.x;
-                        layout.topMargin = iwv.y;
-                        FXActivity.getViewGroup().updateViewLayout(iwv.nativeWebView, layout);
-//                        iwv.nativeWebView.setTranslationX(iwv.x);
-//                        iwv.nativeWebView.setTranslationY(iwv.y);
-                    }
-                    if (move || resize) {
-                        iwv.nativeWebView.invalidate();
-                    }                    
-                }
-            });
-        }        
-    }
-
-    static void setVisible(int id, final boolean visible) {
-        final InternalWebView iwv = InternalWebView.getViewByID(id);
-        if (iwv == null) {
-            return;
-        }
-        if (!iwv.initialized) {
-            iwv.visible = visible;
-            return;
-        }
-        FXActivity.getInstance().runOnUiThread(new Runnable() {
-            public void run() {
-                iwv.nativeWebView.setVisibility(visible ? View.VISIBLE : View.GONE);
-                if (visible) {
-                    iwv.nativeWebView.invalidate();
-                }
-            }
-        });
-    }
-
-    static void dispose(int id) {
-        final InternalWebView iwv = InternalWebView.getViewByID(id);
-        InternalWebView.setVisible(id, false);
-
-        FXActivity.getInstance().runOnUiThread(new Runnable() {
-            public void run() {
-                iwv.nativeWebView.stopLoading();
-                iwv.nativeWebView.destroy();
-            }
-        });
-        views.remove(iwv);
-    }
-
-    private void setUrl(String url) {
-        this.url = url;
-    }
-
-    private void setContent(String content, String contentType) {
-        this.content = content;
-        this.contentType = contentType;
-    }
-
-    private void setEncoding(String encoding) {
-        this.encoding = encoding;
-    }
-
-    private native void _fireLoadEvent(int id, int frameID, int state, String url,
-            String contentType, int progress, int errorCode);
-}
--- a/modules/graphics/src/main/android/com/oracle/dalvik/MainActivity.java	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 2013 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.oracle.dalvik;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.List;
-
-import android.app.Activity;
-import android.app.NativeActivity;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.graphics.PixelFormat;
-import android.graphics.drawable.ColorDrawable;
-import android.os.AsyncTask;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
-
-
-public class MainActivity extends NativeActivity {
-
-    public static final String  TAG     = "MainActivity";
-    private static final String TAG_JVM = "JVM";
-    private static final String JAR     = ".jar";
-
-    private static final String META_DATA_MAIN_CLASS = "main.class";
-    private static final String META_DATA_JVM_ARGS   = "jvm.args";
-    private static final String META_DATA_APP_ARGS   = "app.args";
-    private static final String META_DATA_DEBUG_PORT = "debug.port";
-
-    private String                  appDataDir;
-    private String                  storageDir;    
-    private NativePipeReader        reader;
-    
-    private ViewGroup mViewGroup;
-    private View      mView;
-
-    static {
-        // load npr and vmlauncher
-        System.loadLibrary("vmlauncher");
-    }
-        
-    private NativePipeReader.OnTextReceivedListener textListener = 
-            new NativePipeReader.OnTextReceivedListener() {
-                public void onTextReceived(String text) {
-                    Log.v(TAG_JVM, text);
-                }
-            };
-
-    private void initDirInfo() {
-        appDataDir = this.getApplicationInfo().dataDir;
-        storageDir = appDataDir + "/storage";
-    }
-
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        getWindow().setFormat(PixelFormat.RGBA_8888);
-        getWindow().setSoftInputMode(
-                WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED
-              | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
-
-        mViewGroup = (ViewGroup)getWindow().getDecorView()
-                    .findViewById(Window.ID_ANDROID_CONTENT);
-        mView = mViewGroup.getChildAt(0);
-        mView.setFocusableInTouchMode(true);
-
-        reader = NativePipeReader.getDefaultReader(textListener);
-        reader.start();
-        initDirInfo();
-        installJVMIfNeeded();
-    }
-
-    @Override
-    public boolean dispatchKeyEvent(KeyEvent event) {
-    	if (event.getAction() == KeyEvent.ACTION_MULTIPLE) {
-    		if (event.getKeyCode() == KeyEvent.KEYCODE_UNKNOWN) {
-    			Log.w(TAG, "KeyEvent (MULTIPLE) :" + event.getCharacters());
-    			Log.w(TAG, "Predictive text (T9) not supported!");
-    		}
-    	}
-    	return super.dispatchKeyEvent(event);
-    }
-    
-    private void installJVMIfNeeded() {
-        new InstallerTask().execute();
-    }
-
-    private void runJVM() {
-        Log.i(TAG, "Launch JVM + application");
-        JvmArgs args = new JvmArgs(appDataDir);
-        VMLauncher.initialize(args.getJavaHome());
-        VMLauncher.runOnDebugPort(args.getDebugPort(),
-                                  args.getArgArray());
-    }
-
-    private class InstallerTask extends AsyncTask<Void, Void, Void> {
-        protected Void doInBackground(Void... args) {
-           Log.i(TAG, "Installing JVM");
-            AppDataInstaller installer = 
-                new AppDataInstaller(storageDir,
-                                     MainActivity.this.getApplicationContext().getAssets());
-            installer.install();
-            return null;
-        }
-        protected void onPostExecute(Void result) {
-           Log.i(TAG, "JVM Installed");
-            runJVM();
-        }
-    }
-
-
-    private class JvmArgs {
-        private List<String> argList = new ArrayList<String>();
-        private String javaHome;
-
-        public JvmArgs(String appDir) {
-            String jvmRunCommand =
-                   "-Djava.library.path="
-                     + appDir + "/lib|"
-                     + "-Djava.home="
-                     + appDir + "/storage/jvm|"
-                     + "-Dsun.boot.library.path="
-                     + appDir + "/storage/jvm/lib|"
-                     + "-cp|"
-                     + getClasspath(appDir)
-                     + "|"                                         
-                     + "-Djavafx.platform=android|"
-                     + "-Djavafx.runtime.path="
-                     + appDir +"/storage/lib|"
-                     + getCustomJVMArgs()
-                     + "|"
-                     + getMainClass()
-                     + "|"
-                     + getApplicationArgs();
-
-            createArgList(jvmRunCommand);
-        }
-
-        private String[] listFiles(String dir, final String suffix) {
-           File dirf = new File(dir);
-           if (!dirf.exists()) {
-               return new String[]{};
-           }
-           String[] files = dirf.list(new FilenameFilter() {           
-               @Override
-               public boolean accept(File dir, String filename) {      
-                   return filename.endsWith(suffix);
-               }
-           });
-           return files;
-       }
-
-       private String getClasspath(String appDir) {
-           final String libDir = appDir + "/storage/lib/";
-           String[] libfiles = listFiles(libDir, JAR);
-           if (libfiles.length == 0) {
-               return "";
-           }
-           StringBuilder sb = new StringBuilder();
-           for(String file: libfiles) {
-               sb.append(libDir);
-               sb.append(file);
-               sb.append(File.pathSeparatorChar);
-           }
-           int len = sb.length();
-           return sb.substring(0, len - 1);
-       }
-
-       private String getMainClass() {
-           return getMetadata().getString(META_DATA_MAIN_CLASS);
-       }
-
-       private String getCustomJVMArgs() {
-           return getMetadata().getString(META_DATA_JVM_ARGS);
-       }
-
-       private String getApplicationArgs() {
-           return getMetadata().getString(META_DATA_APP_ARGS);
-       }
-
-       private int getDebugPort() {            
-           return getMetadata().getInt(META_DATA_DEBUG_PORT, 0);
-       }
-
-       private Bundle getMetadata() {
-           try {
-               ActivityInfo ai = MainActivity.this.getPackageManager().getActivityInfo(
-                       getIntent().getComponent(), PackageManager.GET_META_DATA);
-               return ai.metaData;
-               
-           } catch(NameNotFoundException e) {
-               throw new RuntimeException("Error getting activity info", e);
-           }
-       }
-
-        public void createArgList(String args) {
-            if (args != null) {
-                String sep = (args.contains("|")) ? "\\|" : " ";
-                for (String arg : args.split(sep)) {
-                    arg = arg.trim();
-                    if (arg.length() > 0) {
-                        this.argList.add(arg);
-                        if (javaHome == null) {
-                            String[] pair = arg.split("\\=");
-                            Log.v(TAG, "arg = " + arg);
-                            Log.v(TAG, "pair.length = " + pair.length);
-                            if (pair.length == 2) {
-                                if ("-Djava.home".equals(pair[0])) {
-                                    Log.v(TAG, "Setting javaHome to " + pair[1]);
-                                    javaHome = pair[1];
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        public String[] getArgArray() {
-            return argList.toArray(new String[0]);
-        }
-
-        public String getJavaHome() {
-           return javaHome;
-        }
-
-   }
-}
--- a/modules/graphics/src/main/android/com/oracle/dalvik/NativePipeReader.java	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2013, 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.oracle.dalvik;
-
-import android.os.Handler;
-
-public class NativePipeReader extends Thread { 
-   
-    /**
-     * onTextReceived 
-     * callback to return read text from pipe 
-     * called on the same thread that NativePipeReader was 
-     * created on.
-     * 
-     * @param text
-     */
-    public interface OnTextReceivedListener {
-        public void onTextReceived(String text);
-    }
-
-    public interface Client extends OnTextReceivedListener {
-        /**
-         * initPipe 
-         * called to set up pipe and redirect 
-         * 
-         * @return int, fd of output end of pipe
-         */
-        public int initPipe();
-
-
-        public void onTextReceived(String text);
-
-        /**
-         * cleanupPipe 
-         * called after last data is read from pipe and thread 
-         * is about to exit
-         *
-         */
-        public void cleanupPipe();
-    }
-
-    private Client client;
-    private Handler handler;
-
-    public NativePipeReader(Client client) {
-        this.client = client;
-        this.handler = new Handler();    
-    }
-
-    private volatile boolean stop = false;
-
-    public void stopReading() {
-        stop = true;
-    }
-
-    public void run() {
-        int fd = client.initPipe();
-        while (!stop) {
-            String text = readPipe(fd);
-            if (text.length() > 0) {
-                // only notify client if we
-                // actually got something
-                client.onTextReceived(text);
-            }
-        }
-        client.cleanupPipe();
-    }
-
-    public static NativePipeReader 
-    getDefaultReader(OnTextReceivedListener listener) {
-        return new NativePipeReader(
-                                   new StdoutStderrClient(listener));
-    }
-
-    /**
-     * readPipe 
-     * native method to read text from the 
-     * pipe. 
-     * this method may(should) block
-     * 
-     * @return String 
-     */
-    private native String readPipe(int fd);
-
-    private static class StdoutStderrClient implements Client {
-
-        Handler handler;
-        OnTextReceivedListener listener;
-
-        public StdoutStderrClient(OnTextReceivedListener listener) {
-            this.handler = new Handler();
-            this.listener = listener;
-        }
-
-        private native int nativeInitPipe();
-        private native void nativeCleanupPipe();
-
-        /**
-         * initPipe
-         * called to set up pipe and redirect
-         *
-         * @return int, fd of read end of pipe
-         */
-        public int initPipe() {
-            return nativeInitPipe();
-        }
-
-        /**
-         * onTextReceived
-         * callback to return read text from pipe
-         * called on the same thread that NativePipeReader was
-         * created on.
-         *
-         * @param text
-         */
-        public void onTextReceived(final String text) {
-            handler.post(new Runnable() {
-                             public void run() {
-                                 listener.onTextReceived(text); 
-                             }
-                         });
-        }
-
-        /**
-         * cleanupPipe
-         * called after last data is read from pipe and thread
-         * is about to exit
-         */
-        public void cleanupPipe() {
-            nativeCleanupPipe();
-        }
-    }
-}
-
--- a/modules/graphics/src/main/android/com/oracle/dalvik/VMLauncher.java	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2013, 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.oracle.dalvik;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.ArrayList;
-
-import android.util.Log;
-
-public class VMLauncher extends Thread {
-
-   private static final String TAG = "VMLauncher";
-    private static String sJavaHome;
-
-    private String[] args;
-
-    public static void initialize(String javaHome) {
-        if (javaHome != null) {
-            sJavaHome = javaHome;
-            loadNativeLibraries();
-        } else {
-            throw new NullPointerException();
-        }
-    }
-    
-    // java libs are located at architecture dependent 
-    // paths
-    // i386 for x86 arch
-    // arm  for ARM arch
-    public static String getJvmArch() {
-        String rawarch = System.getProperty("os.arch");
-        if (rawarch != null && rawarch.contains("86")) {
-            return "i386";
-        }
-        return "arm";
-    }
-
-    private static void loadNativeLibraries() {
-        System.load(sJavaHome + "/lib/" + getJvmArch() + "/client/libjvm.so");
-        System.load(sJavaHome + "/lib/" + getJvmArch() + "/jli/libjli.so");
-    }
-    
-    private static String getCmdLine() {
-        // /proc/self/cmdline contains apk
-        // package name
-        StringBuilder builder = new StringBuilder();
-        try {
-            Reader reader = new FileReader("/proc/self/cmdline");
-            int c = 0;
-            while ((c = reader.read()) > 0) {
-                builder.append((char)c);
-            }
-            reader.close();
-        } catch (Exception e) {
-            builder = new StringBuilder("dalvik.package");
-        }
-        return builder.toString();        
-    }
-
-    private static void listDirToStandardOut(String dirpath) {
-        File dir = new File(dirpath);
-        try {
-            for (File file : dir.listFiles()) {
-                if (file.isDirectory()) {
-                    listDirToStandardOut(file.getAbsolutePath());
-                }
-            }
-        } catch (Exception e) {
-            Log.e(TAG, "Exception listing dir " + dir);
-        }
-    }
-
-    private VMLauncher(String[] args) {
-        super("JVM");
-        this.args = args;
-    }
-
-    public void run()
-    {
-        launchJVM(this.args);
-    }
-
-    private static void startJavaInBackground(String[] args)
-    {
-        new VMLauncher(args).start();
-    }
-
-    public static void runOnDebugPort(Integer debugPort,
-                                      String[] args)
-    {
-        ArrayList<String> localArrayList = new ArrayList();
-        
-        // need to add apk pkg name to head of arg list
-        localArrayList.add(getCmdLine()); 
-        
-        if (debugPort.intValue() > 0) {
-            localArrayList.add("-Xdebug");
-            localArrayList.add("-agentlib:jdwp=server=y,suspend=y,transport=dt_socket,address=" + debugPort);
-        }
-
-        for (String arg : args) {
-            localArrayList.add(arg);
-        }
-
-        String[] processedArgs = localArrayList.toArray(new String[0]);
-
-        for (String arg : processedArgs) {
-            Log.v(TAG, "Processed JVM arg : " + arg);
-        }
-
-        startJavaInBackground(processedArgs);
-    }
-
-    private static native int launchJVM(String[] args);
-
-}
\ No newline at end of file
--- a/modules/graphics/src/main/android/com/oracle/dalvik/net/DalvikProxySelector.java	Sun Jul 07 19:34:28 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, 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.oracle.dalvik.net;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.net.Proxy;
-import java.net.ProxySelector;
-import java.net.SocketAddress;
-import java.net.InetSocketAddress;
-import java.net.URI;
-
-
-public class DalvikProxySelector {
-    private String[] args;
-
-    private DalvikProxySelector(String[] args){
-        this.args = args;
-    }
-
-    //Result host and port are returned in a string in the format host:port
-    public static String[] getProxyForURL(String target) {
-        String[] proxyInfo = new String[0];
-        List<String> proxies = new ArrayList<String>();
-        URI uri = null;
-        try {
-            ProxySelector defaultProxySelector = ProxySelector.getDefault();
-            uri = new URI(target);
-            List<Proxy> proxyList = defaultProxySelector.select(uri);
-
-            Proxy proxy = proxyList.get(0);
-            if (proxy.equals(Proxy.NO_PROXY)) {
-                System.out.println("DalvikProxySelector.getProxyForURL(): No proxy found");
-                return null;
-            }
-            SocketAddress address = proxy.address();
-            InetSocketAddress inetSocketAddress = (InetSocketAddress) address;
-            String host = inetSocketAddress.getHostName();
-            int port = inetSocketAddress.getPort();
-            if (host == null) {
-                System.out.println("DalvikProxySelector.getProxyForURL(): No proxy found");
-                return null;
-            }
-
-            proxies.add(host);                      // even index, host
-            proxies.add(Integer.toString(port));    // odd index, port
-
-            System.out.println("DalvikProxySelector.getProxyForURL(): host=" + host + " port=" + port);
-            return proxies.toArray(new String[0]);
-        } catch (Exception e) {
-            System.out.println("DalvikProxySelector.getProxyForURL(): exception(ignored): " + e.toString());
-            return null;
-        }
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacSystemClipboard.java	Sun Jul 07 19:34:28 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/mac/MacSystemClipboard.java	Tue Jul 09 09:36:39 2013 -0700
@@ -30,11 +30,11 @@
 import java.net.URL;
 import java.nio.ByteBuffer;
 import java.nio.IntBuffer;
+import java.nio.file.FileSystems;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import com.sun.glass.ui.Application;
 import com.sun.glass.ui.Clipboard;
 import com.sun.glass.ui.Pixels;
@@ -48,7 +48,7 @@
     
     // if true we'll synthesize a file list
     static final boolean SUPPORT_10_5_API = true;
-    
+
     // if true we'll force the synthesized file list into 1st item as Plain text,
     // regardless of whether such attribute already exists or not
     static final boolean SUPPORT_10_5_API_FORCE = false;
@@ -101,32 +101,10 @@
                 switch (mime) {
                     case URI_TYPE:
                     {
-                        // synthesize list of urls as seperate pasteboard items (Mac OS 10.6 style)
-                        String split[] = ((String) object).split("\n");
-                        int count = 0;
-                        for (String string : split) {
-                            if (!string.startsWith("#")) {
-                                // exclude comments: http://www.ietf.org/rfc/rfc2483.txt
-                                count++;
-                            }
-                        }
-                        if (count > 0) {
-                            itemList = new HashMap[count];
-                            count = 0;
-                            for (String file : split) {
-                                if (!file.startsWith("#")) {
-                                    // exclude comments: http://www.ietf.org/rfc/rfc2483.txt
-                                    URI uri = createUri(file, MacSystemClipboard.BAD_URI_MSG);
-                                    String utf = MacPasteboard.UtfUrl;
-                                    if (uri.getScheme() == null) {
-                                        utf = MacPasteboard.UtfFileUrl;
-                                        uri = createUri(MacSystemClipboard.FILE_SCHEME, uri.getPath(), MacSystemClipboard.BAD_URI_MSG);
-                                    }
-                                    itemList[count] = new HashMap<>();
-                                    itemList[count].put(utf, uri.toASCIIString());
-                                    count++;
-                                }
-                            }
+                        List<HashMap<String, Object>> items = putToItemList(((String) object).split("\n"), true);
+                        if (!items.isEmpty()) {
+