changeset 1698:7a0b0ca81d0b 8.0-b54

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/MASTER/rt
author leifs
date Tue, 28 Aug 2012 16:03:14 -0700
parents 191956ebf1ff e0abb4b9d652
children 6055633307f9 179b696beb69 ab7b9a0278be b7a1a890ed1b
files javafx-ui-controls/src/javafx/scene/control/Control.java
diffstat 32 files changed, 966 insertions(+), 215 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-charts/src/javafx/scene/chart/LineChart.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-charts/src/javafx/scene/chart/LineChart.java	Tue Aug 28 16:03:14 2012 -0700
@@ -369,7 +369,10 @@
             // create list of all nodes we need to fade out
             final List<Node> nodes = new ArrayList<Node>();
             nodes.add(series.getNode());
-            for (Data d: series.getData()) nodes.add(d.getNode());
+            if (getCreateSymbols()) { // RT-22124 
+                // done need to fade the symbols if createSymbols is false
+                for (Data d: series.getData()) nodes.add(d.getNode());
+            }
             // fade out old and symbols
             KeyValue[] startValues = new KeyValue[nodes.size()];
             KeyValue[] endValues = new KeyValue[nodes.size()];
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-charts/test/javafx/scene/chart/LineChartTest.java	Tue Aug 28 16:03:14 2012 -0700
@@ -0,0 +1,79 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package javafx.scene.chart;
+
+/**
+ *
+ * @author paru
+ */
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import javafx.collections.*;
+
+import com.sun.javafx.pgstub.StubToolkit;
+import com.sun.javafx.tk.Toolkit;
+
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.Group;
+import javafx.stage.Stage;
+import javafx.scene.shape.*;
+
+import org.junit.Ignore;
+
+
+public class LineChartTest extends ChartTestBase {
+
+    private Scene scene;
+    private StubToolkit toolkit;
+    private Stage stage;
+    LineChart<Number,Number> lineChart;
+    final XYChart.Series<Number, Number> series1 = new XYChart.Series<Number, Number>();
+    
+    @Override protected Chart createChart() {
+        final NumberAxis xAxis = new NumberAxis();
+        final NumberAxis yAxis = new NumberAxis();
+        lineChart = new LineChart<Number,Number>(xAxis,yAxis);
+        xAxis.setLabel("X Axis");
+        yAxis.setLabel("Y Axis");
+        lineChart.setTitle("HelloLineChart");
+        // add starting data
+        ObservableList<XYChart.Data> data = FXCollections.observableArrayList();
+        series1.getData().add(new XYChart.Data(10d, 10d));
+        series1.getData().add(new XYChart.Data(25d, 20d));
+        series1.getData().add(new XYChart.Data(30d, 15d));
+        series1.getData().add(new XYChart.Data(50d, 15d));
+        series1.getData().add(new XYChart.Data(80d, 10d));
+        return lineChart;
+    }
+    
+    private StringBuffer getSeriesLineFromPlot() {
+        ObservableList<Node> childrenList = lineChart.getPlotChildren();
+        StringBuffer sb = new StringBuffer();
+        for (Node n : childrenList) {
+            if (n instanceof Path && "chart-series-line".equals(n.getStyleClass().get(0))) {
+                Path line = (Path)n;
+                sb = computeSVGPath(line);
+                return sb;
+            }
+        }
+        return sb;
+    }
+    
+     @Test
+    public void testSeriesRemoveWithCreateSymbolsFalse() {
+        startApp();
+        lineChart.getData().addAll(series1);
+        pulse();
+        lineChart.setCreateSymbols(false);
+        System.out.println("Line Path = "+getSeriesLineFromPlot());
+        if (!lineChart.getData().isEmpty()) {
+            lineChart.getData().remove(0);
+            pulse();
+            StringBuffer sb = getSeriesLineFromPlot();
+            assertEquals(sb.toString(), "");
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-charts/test/javafx/scene/chart/PieChartTest.java	Tue Aug 28 16:03:14 2012 -0700
@@ -0,0 +1,41 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package javafx.scene.chart;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+/**
+ *
+ * @author paru
+ */
+public class PieChartTest extends ChartTestBase {
+
+    ObservableList<PieChart.Data> data;
+    PieChart pc;
+    
+    @Override
+    protected Chart createChart() {
+        data = FXCollections.observableArrayList();
+        pc = new PieChart();
+        return pc;
+    }
+    
+    @Test
+    public void testLabelsVisibleFalse_RT24106() {
+        data.add(new PieChart.Data("Sun", 20));
+        data.add(new PieChart.Data("IBM", 12));
+        data.add(new PieChart.Data("HP", 25));
+        data.add(new PieChart.Data("Dell", 22));
+        data.add(new PieChart.Data("Apple", 30));
+        pc.setLabelsVisible(false);
+        pc.getData().addAll(data);
+        assertEquals(false, pc.getLabelsVisible());
+    }
+    
+    
+}
--- a/javafx-ui-common/src/com/sun/javafx/css/CompoundSelector.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/CompoundSelector.java	Tue Aug 28 16:03:14 2012 -0700
@@ -341,5 +341,61 @@
         }
         return new CompoundSelector(selectors, relationships);
     }
+    
+    @Override public String writeJava() {
+        final String NEW_LINE = Rule.NEW_LINE;
+        final String INDENT = Rule.INDENT;
+        final String TWO_INDENT = Rule.TWO_INDENT;
+        final String FIVE_INDENT = TWO_INDENT + TWO_INDENT + INDENT;
+        
+        StringBuilder sb = new StringBuilder();
+        sb.append(NEW_LINE);
+        sb.append(TWO_INDENT);
+        sb.append(TWO_INDENT);
+        sb.append("new CompoundSelector(");
+        sb.append(NEW_LINE);
+        
+        sb.append(FIVE_INDENT);
+        sb.append("Arrays.<SimpleSelector>asList(");
+        sb.append(NEW_LINE);
+        
+        for (int i = 0; i < selectors.size(); i++) {
+            Selector sel = selectors.get(i);
+            
+            sb.append(INDENT);
+            sb.append(FIVE_INDENT);
+            sb.append(sel.writeJava());
+            
+            if (i < (selectors.size() - 1)) {
+                sb.append(", ");
+                sb.append(NEW_LINE);
+            }
+        }
+        
+        sb.append("), ");
+        
+        sb.append(NEW_LINE);
+        sb.append(FIVE_INDENT);
+        sb.append("Arrays.<Combinator>asList(");
+        sb.append(NEW_LINE);
+        
+        for (int i = 0; i < relationships.size(); i++) {
+            Combinator com = relationships.get(i);
+            
+            sb.append(INDENT);
+            sb.append(FIVE_INDENT);
+            sb.append("Combinator.");
+            sb.append(com.name());
+            
+            if (i < (relationships.size() - 1)) {
+                sb.append(", ");
+                sb.append(NEW_LINE);
+            }
+        }
+        
+        sb.append("))");
+        
+        return sb.toString();
+    }
 }
 
--- a/javafx-ui-common/src/com/sun/javafx/css/Declaration.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/Declaration.java	Tue Aug 28 16:03:14 2012 -0700
@@ -124,5 +124,18 @@
         final boolean important = is.readBoolean();
         return new Declaration(propertyName, parsedValue, important);
     }
+    
+    public String writeJava() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("new Declaration(\"");
+        sb.append(getProperty());
+        sb.append("\", ");
+        sb.append(getParsedValue().writeJava());
+        sb.append(", ");
+        sb.append(isImportant());
+        sb.append(")"); 
+        
+        return sb.toString();
+    }
 }
 
--- a/javafx-ui-common/src/com/sun/javafx/css/ParentStyleManager.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/ParentStyleManager.java	Tue Aug 28 16:03:14 2012 -0700
@@ -121,8 +121,8 @@
                 // If an exception occurred while loading one of the stylesheets
                 // then we will simply print warning into system.err and skip the
                 // stylesheet, allowing other stylesheets to attempt to load
-                if (LOGGER.isLoggable(PlatformLogger.WARNING)) {
-                    LOGGER.warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
+                if (getLogger().isLoggable(PlatformLogger.WARNING)) {
+                    getLogger().warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
                 }
 
             }
--- a/javafx-ui-common/src/com/sun/javafx/css/ParsedValue.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/ParsedValue.java	Tue Aug 28 16:03:14 2012 -0700
@@ -698,4 +698,117 @@
         }
     }
 
+    public String writeJava() {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append("new ParsedValue("); 
+
+        // ---- Value
+        if (value instanceof ParsedValue) {
+            sb.append(((ParsedValue)value).writeJava());
+        } else if (value instanceof ParsedValue[]) {
+            final ParsedValue[] values = (ParsedValue[])value;
+            sb.append("new ParsedValue[] {");
+            
+            for (int v=0; v<values.length; v++) {
+                if (values[v] != null) {
+                    sb.append(((ParsedValue)values[v]).writeJava());
+                } else {
+                    sb.append("null");
+                }
+                
+                if (v < (values.length - 1)) {
+                    sb.append(", ");
+                }
+            }
+            
+            sb.append("}");
+        } else if (value instanceof ParsedValue[][]) {
+            final ParsedValue[][] layers = (ParsedValue[][])value;
+            sb.append("new ParsedValue[][] {");
+            
+            for (int l=0; l<layers.length; l++) {
+                final ParsedValue[] values = layers[l];
+                sb.append("new ParsedValue[] {");
+                
+                for (int v=0; v<values.length; v++) {
+                    if (values[v] != null) {
+                        sb.append(((ParsedValue)values[v]).writeJava());
+                    } else {
+                        sb.append("null");
+                    }
+                    
+                    if (v < (values.length - 1)) {
+                        sb.append(", ");
+                    }
+                }
+                
+                sb.append("}");
+            }
+            
+            sb.append("}");
+        } else if (value instanceof Color) {
+            final Color c = (Color)value;
+            sb.append("new Color(");
+            sb.append(c.getRed());
+            sb.append(", ");
+            sb.append(c.getGreen());
+            sb.append(", ");
+            sb.append(c.getBlue());
+            sb.append(", ");
+            sb.append(c.getOpacity());
+            sb.append(")");
+        } else if (value instanceof Enum) {
+            final Enum e = (Enum)value;
+            sb.append(e.getClass().getName());
+            sb.append(".");
+            sb.append(e);
+        } else if (value instanceof Boolean) {
+            final Boolean b = (Boolean)value;
+            sb.append(b);
+        } else if (value instanceof Size) {
+            final Size size = (Size)value;
+            final double sz = size.getValue();
+            sb.append("new Size(");
+            sb.append(sz);
+            sb.append(", SizeUnits.");
+            sb.append(size.getUnits().name());
+            sb.append(")");
+        } else if (value instanceof String) {
+            String str = (String)value;
+            if (! str.startsWith("\"")) sb.append("\"");
+            sb.append(str);
+            if (! str.endsWith("\"")) sb.append("\"");
+        } else if (value instanceof URL) {
+            URL url = (URL)value;
+            String urlString = url.toString();
+            
+            // convert all escaped slashes (\\) into \, and then convert all
+            // backslashes into escaped versions.
+            urlString = urlString.replace("\\\\", "\\");
+            urlString = urlString.replace("\\", "\\\\");
+            
+            sb.append("\"");
+            sb.append(urlString);
+            sb.append("\"");
+        } else if (value == null) {
+            sb.append("null");
+        } else {
+            throw new InternalError("cannot writeJava " + this);
+        }
+        
+        // --- Style Converter
+        sb.append(", ");
+        String styleConverterString = getConverter() == null ? "null" : getConverter().writeJava();
+        sb.append(styleConverterString);
+        
+        // --- IsLookup
+        sb.append(", ");
+        sb.append(isLookup());
+        
+        // close ParsedValue constructor
+        sb.append(")"); 
+        
+        return sb.toString();
+    }
 }
--- a/javafx-ui-common/src/com/sun/javafx/css/Rule.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/Rule.java	Tue Aug 28 16:03:14 2012 -0700
@@ -29,6 +29,7 @@
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import javafx.collections.ListChangeListener.Change;
 import javafx.collections.ObservableList;
@@ -53,11 +54,17 @@
         protected void onChanged(Change<Declaration> c) {
             while (c.next()) {
                 if (c.wasAdded()) {
-                    for(Declaration decl : c.getAddedSubList()) {
+                    List<Declaration> added = c.getAddedSubList();
+                    for(int i = 0, max = added.size(); i < max; i++) {
+                        Declaration decl = added.get(i);
                         decl.rule = Rule.this;
                     }
-                } else if (c.wasRemoved()) {
-                    for(Declaration decl : c.getRemoved()) {
+                }
+                
+                if (c.wasRemoved()) {
+                    List<Declaration> removed = c.getRemoved();
+                    for(int i = 0, max = removed.size(); i < max; i++) {
+                        Declaration decl = removed.get(i);
                         if (decl.rule == Rule.this) decl.rule = null;
                     }
                 }
@@ -193,4 +200,48 @@
         return new Rule(selectors, declarations);
     }
 
+    public static final String NEW_LINE = "\r\n";
+    public static final String INDENT = "    ";
+    public static final String TWO_INDENT = "        ";
+    
+    String writeJava() throws IOException {
+        final String THREE_INDENT = INDENT + TWO_INDENT;
+        final String FOUR_INDENT = TWO_INDENT + TWO_INDENT;
+        
+        StringBuilder sb = new StringBuilder();
+        sb.append("new Rule(");
+        sb.append(NEW_LINE);
+        
+        // selectors
+        sb.append(THREE_INDENT);
+        sb.append("Arrays.<Selector>asList(");
+        for (int i = 0; i < selectors.size(); i++) {
+            Selector sel = selectors.get(i);
+            sb.append(sel.writeJava());
+            
+            if (i < (selectors.size() - 1)) {
+                sb.append(", ");
+            }
+        }
+        sb.append("), ");
+        
+        // declarations
+        sb.append(NEW_LINE);
+        sb.append(THREE_INDENT);
+        sb.append("Arrays.<Declaration>asList(");
+        for (int i = 0; i < declarations.size(); i++) {
+            Declaration decl = declarations.get(i);
+            
+            sb.append(NEW_LINE);
+            sb.append(FOUR_INDENT);
+            sb.append(decl.writeJava());
+            
+            if (i < (declarations.size() - 1)) {
+                sb.append(", ");
+            }
+        }
+        sb.append("))");
+        
+        return sb.toString();
+    }
 }
--- a/javafx-ui-common/src/com/sun/javafx/css/SceneStyleManager.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/SceneStyleManager.java	Tue Aug 28 16:03:14 2012 -0700
@@ -228,8 +228,8 @@
                     // If an exception occurred while loading one of the stylesheets
                     // then we will simply print warning into system.err and skip the
                     // stylesheet, allowing other stylesheets to attempt to load
-                    if (LOGGER.isLoggable(PlatformLogger.WARNING)) {
-                        LOGGER.warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
+                    if (getLogger().isLoggable(PlatformLogger.WARNING)) {
+                        getLogger().warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
                     }
                     // no telling what condition stylesheet is in. make it null
                     stylesheet = null;
--- a/javafx-ui-common/src/com/sun/javafx/css/Selector.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/Selector.java	Tue Aug 28 16:03:14 2012 -0700
@@ -93,6 +93,8 @@
         else
             return CompoundSelector.readBinary(is,strings);
     }
+    
+    protected abstract String writeJava();
 
     public static Selector createSelector(final String cssSelector) {
         if (cssSelector == null || cssSelector.length() == 0) {
--- a/javafx-ui-common/src/com/sun/javafx/css/SimpleSelector.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/SimpleSelector.java	Tue Aug 28 16:03:14 2012 -0700
@@ -362,4 +362,53 @@
         }
         return new SimpleSelector(name, styleClasses, pseudoclasses, id);
     }
+
+    @Override public String writeJava() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("new SimpleSelector(\"");
+        sb.append(getName());
+        sb.append("\", ");
+        
+        // styleclasses
+        if (getStyleClasses().isEmpty()) {
+            sb.append("null");
+        } else {
+            sb.append("Arrays.<String>asList(");
+            for (int i = 0, max = getStyleClasses().size(); i < max; i++) {
+                sb.append("\"");
+                sb.append(getStyleClasses().get(i));
+                sb.append("\"");
+
+                if (i < (max - 1)) {
+                    sb.append(", ");
+                }
+            }
+            sb.append(")");
+        }
+        
+        sb.append(", ");
+        
+        // pseudoclasses
+        if (getPseudoclasses().isEmpty()) {
+            sb.append("null");
+        } else {
+            sb.append("Arrays.<String>asList(");
+            for (int i = 0, max = getPseudoclasses().size(); i < max; i++) {
+                sb.append("\"");
+                sb.append(getPseudoclasses().get(i));
+                sb.append("\"");
+
+                if (i < (max - 1)) {
+                    sb.append(", ");
+                }
+            }
+            sb.append(")");
+        }
+        
+        sb.append(", \"");
+        sb.append(getId());
+        sb.append("\")");
+        
+        return sb.toString();
+    }
 }
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleConverter.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleConverter.java	Tue Aug 28 16:03:14 2012 -0700
@@ -122,124 +122,128 @@
         }
         return tmap.get(cname);
     }
+    
+    public String writeJava() {
+        return getClass().getCanonicalName() + ".getInstance()";
+    }
 
 
     // package for unit test purposes
-    static StyleConverter getInstance(final Class converterClass) {
+    public static StyleConverter getInstance(final Class converterClass) {
 
         StyleConverter styleConverter = null;
         // TODO: giant if-then-else block
-        if (com.sun.javafx.css.StyleConverter.class.equals(converterClass)) {
+        if (com.sun.javafx.css.StyleConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.StyleConverter.getInstance();
 
-        } else if (com.sun.javafx.css.converters.BooleanConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.BooleanConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.BooleanConverter.getInstance();
 
-        } else if (com.sun.javafx.css.converters.ColorConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.ColorConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.ColorConverter.getInstance();
 
-        } else if (com.sun.javafx.css.converters.CursorConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.CursorConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.CursorConverter.getInstance();
 
-        } else if (com.sun.javafx.css.converters.EffectConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.EffectConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.EffectConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.EffectConverter.DropShadowConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.EffectConverter.DropShadowConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.EffectConverter.DropShadowConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.EffectConverter.InnerShadowConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.EffectConverter.InnerShadowConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.EffectConverter.InnerShadowConverter.getInstance();
 
         // enum is handled differently
 
-        } else if (com.sun.javafx.css.converters.FontConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.FontConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.FontConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.FontConverter.StyleConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.FontConverter.StyleConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.FontConverter.StyleConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.FontConverter.WeightConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.FontConverter.WeightConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.FontConverter.WeightConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.FontConverter.SizeConverter.class.equals(converterClass)) {
+        } else if (com.sun.javafx.css.converters.FontConverter.SizeConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.FontConverter.SizeConverter.getInstance();
 
-        }  else if (com.sun.javafx.css.converters.InsetsConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.InsetsConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.InsetsConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.InsetsConverter.SequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.InsetsConverter.SequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.InsetsConverter.SequenceConverter.getInstance();
 
-        }  else if (com.sun.javafx.css.converters.PaintConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.PaintConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.PaintConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.PaintConverter.SequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.PaintConverter.SequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.PaintConverter.SequenceConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.PaintConverter.LinearGradientConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.PaintConverter.LinearGradientConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.PaintConverter.LinearGradientConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.PaintConverter.RadialGradientConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.PaintConverter.RadialGradientConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.PaintConverter.RadialGradientConverter.getInstance();
 
-        }  else if (com.sun.javafx.css.converters.SizeConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.SizeConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.SizeConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.SizeConverter.SequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.SizeConverter.SequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.SizeConverter.SequenceConverter.getInstance();
 
-        }  else if (com.sun.javafx.css.converters.StringConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.StringConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.StringConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.StringConverter.SequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.StringConverter.SequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.StringConverter.SequenceConverter.getInstance();
 
-        }  else if (com.sun.javafx.css.converters.URLConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.URLConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.URLConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.URLConverter.SequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.converters.URLConverter.SequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.converters.URLConverter.SequenceConverter.getInstance();
 
         // Region stuff
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundFillConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BackgroundFillConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BackgroundFillConverter.getInstance();
 
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImageConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BackgroundImageConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BackgroundImageConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundPositionConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundPositionConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundPositionConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundRepeatConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundRepeatConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundRepeatConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundSizeConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundSizeConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundSizeConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundPositionConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundPositionConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundPositionConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundSizeConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundSizeConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundSizeConverter.getInstance();
 
-        }  else if (com.sun.javafx.scene.layout.region.BorderImageConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BorderImageConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BorderImageConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BorderImage.RepeatConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BorderImage.RepeatConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BorderImage.RepeatConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BorderImage.SliceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BorderImage.SliceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BorderImage.SliceConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BorderImage.SliceSequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.BorderImage.SliceSequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.BorderImage.SliceSequenceConverter.getInstance();
 
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorderConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.StrokeBorderConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.StrokeBorderConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderPaintConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderPaintConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.BorderPaintConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleSequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleSequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleSequenceConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderPaintConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderPaintConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderPaintConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderStyleConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderStyleConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderStyleConverter.getInstance();
 
-        }  else if (com.sun.javafx.scene.layout.region.Margins.Converter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.Margins.Converter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.Margins.Converter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.Margins.SequenceConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.scene.layout.region.Margins.SequenceConverter.class == converterClass) {
             styleConverter = com.sun.javafx.scene.layout.region.Margins.SequenceConverter.getInstance();
 
         // parser stuff
-        }  else if (com.sun.javafx.css.parser.DeriveColorConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.parser.DeriveColorConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.parser.DeriveColorConverter.getInstance();
-        }  else if (com.sun.javafx.css.parser.DeriveSizeConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.parser.DeriveSizeConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.parser.DeriveSizeConverter.getInstance();
-        }  else if (com.sun.javafx.css.parser.LadderConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.parser.LadderConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.parser.LadderConverter.getInstance();
-        }  else if (com.sun.javafx.css.parser.StopConverter.class.equals(converterClass)) {
+        }  else if (com.sun.javafx.css.parser.StopConverter.class == converterClass) {
             styleConverter = com.sun.javafx.css.parser.StopConverter.getInstance();
         }
 
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Tue Aug 28 16:03:14 2012 -0700
@@ -106,7 +106,13 @@
 
 abstract public class StyleManager<T> {
 
-    protected final static PlatformLogger LOGGER = com.sun.javafx.Logging.getCSSLogger();
+    private static PlatformLogger LOGGER;
+    protected static PlatformLogger getLogger() {
+        if (LOGGER == null) {
+            LOGGER = com.sun.javafx.Logging.getCSSLogger();
+        }
+        return LOGGER;
+    }
 
     /**
      * Return the StyleManager for the given Scene, or null if the scene
@@ -339,8 +345,8 @@
         try {
             return loadStylesheetUnPrivileged(fname);
         } catch (java.security.AccessControlException ace) {
-            if (LOGGER.isLoggable(PlatformLogger.INFO)) {
-                LOGGER.info("Could not load the stylesheet, trying with FilePermissions : " + fname);
+            if (getLogger().isLoggable(PlatformLogger.INFO)) {
+                getLogger().info("Could not load the stylesheet, trying with FilePermissions : " + fname);
             }
 
             /*
@@ -522,8 +528,8 @@
                         );
                     errors.add(error);
                 }
-                if (LOGGER.isLoggable(PlatformLogger.WARNING)) {
-                    LOGGER.warning(
+                if (getLogger().isLoggable(PlatformLogger.WARNING)) {
+                    getLogger().warning(
                         String.format("Resource \"%s\" not found.", fname)
                     );
                 }
@@ -538,8 +544,8 @@
                     );
                 errors.add(error);
             }
-            if (LOGGER.isLoggable(PlatformLogger.INFO)) {
-                LOGGER.info("Could not find stylesheet: " + fname);//, fnfe);
+            if (getLogger().isLoggable(PlatformLogger.INFO)) {
+                getLogger().info("Could not find stylesheet: " + fname);//, fnfe);
             }
         } catch (IOException ioe) {
                 if (errors != null) {
@@ -549,8 +555,8 @@
                         );
                     errors.add(error);
                 }
-            if (LOGGER.isLoggable(PlatformLogger.INFO)) {
-                LOGGER.info("Could not load stylesheet: " + fname);//, ioe);
+            if (getLogger().isLoggable(PlatformLogger.INFO)) {
+                getLogger().info("Could not load stylesheet: " + fname);//, ioe);
             }
         }
         return null;
--- a/javafx-ui-common/src/com/sun/javafx/css/Stylesheet.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/css/Stylesheet.java	Tue Aug 28 16:03:14 2012 -0700
@@ -26,12 +26,7 @@
 package com.sun.javafx.css;
 
 import com.sun.javafx.collections.TrackableObservableList;
-import java.io.BufferedInputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
@@ -53,7 +48,7 @@
  * {@link #reapply}.
  *
  */
-final public class Stylesheet {
+public class Stylesheet {
 
     public enum Origin {
         USER_AGENT,
@@ -189,7 +184,7 @@
         os.writeShort(rules.size());
         for (Rule r : rules) r.writeBinary(os,stringStore);
     }
-
+    
     // protected for unit testing 
     /** @treatAsPrivate public to allow unit testing */
     public void readBinary(DataInputStream is, String[] strings)
@@ -255,7 +250,93 @@
         // return stylesheet
         return stylesheet;
     }
+    
+    public void writeJava(final PrintWriter writer, String className) throws IOException {
+        final String NEW_LINE = Rule.NEW_LINE;
+        final String INDENT = Rule.INDENT;
+        final String TWO_INDENT = Rule.TWO_INDENT;
+        
+        final int RULES_PER_METHOD = 50;
+        final int NUMBER_OF_METHODS = (rules.size() / RULES_PER_METHOD);
+
+        writer.write("import com.sun.javafx.css.*;" + NEW_LINE);
+        writer.write("import com.sun.javafx.css.parser.*;" + NEW_LINE);
+        writer.write("import java.util.*;" + NEW_LINE);
+        writer.write("import javafx.scene.paint.*;" + NEW_LINE);
+        
+        writer.write(NEW_LINE);
+        writer.write("public class " + className + " extends Stylesheet {");
+        writer.write(NEW_LINE);
+        writer.write(NEW_LINE);
+        
+        writer.write(INDENT);
+        writer.write("public ");
+        writer.write(className);
+        writer.write("() {");
+        writer.write(NEW_LINE);
+        
+        writer.write(TWO_INDENT);
+        writer.write("final List<Rule> rules = getRules();");
+        writer.write(NEW_LINE);
+        
+        for (int i = 0, max = NUMBER_OF_METHODS; i <= max; i++) {
+            writer.write(TWO_INDENT);
+            writer.write("loadRules");
+            writer.write(i+"");
+            writer.write("(rules);");
+            writer.write(NEW_LINE);
+        }
+        
+        // close the constructor
+        writer.write(INDENT);
+        writer.write("}");
+        writer.write(NEW_LINE);
+        writer.write(NEW_LINE);
+        
+        // get all the rules strings
+        String[] rulesStrings = new String[rules.size()];
+        for (int j = 0; j < rules.size(); j++) {
+            Rule r = rules.get(j);
+            rulesStrings[j] = r.writeJava();
+        }
+        
+        // write out methods
+        for (int i = 0; i <= NUMBER_OF_METHODS; i++) {
+            writer.write(INDENT);
+            writer.write("private final void loadRules");
+            writer.write(i+"");
+            writer.write("(final List<Rule> rules) {");
+            writer.write(NEW_LINE);
+            
+            writer.write(TWO_INDENT);
+            writer.write("Collections.addAll(rules, ");
+            writer.write(NEW_LINE);
+            
+            for (int j = 0; j < RULES_PER_METHOD; j++) {
+                int pos = i * RULES_PER_METHOD + j;
+                if (pos == rulesStrings.length) break;
+                
+                writer.write(TWO_INDENT);
+                writer.write(rulesStrings[pos]);
+                
+                if ((j < RULES_PER_METHOD - 1) && (pos < (rulesStrings.length - 1))) {
+                    writer.write(", ");
+                    writer.write(NEW_LINE);
+                }
+            }
+            
+            writer.write(NEW_LINE);
+            writer.write(TWO_INDENT);
+            writer.write(");");
+            
+            writer.write(NEW_LINE);
+            writer.write(INDENT);
+            writer.write("}");
+            writer.write(NEW_LINE);
+            writer.write(NEW_LINE);
+        }
+        
+        // close class
+        writer.write("}");
+    }
 }
-
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/css/parser/Css2Java.java	Tue Aug 28 16:03:14 2012 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.javafx.css.parser;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import com.sun.javafx.css.Stylesheet;
+import java.io.*;
+
+/** Css2Java <input file> [<package name> <output file name>]
+ * java -classpath <sdk desktop lib path>/javafx-ui-common.jar com.sun.javafx.css.parser.Css2Java input.css full.package.name output.java
+ *  If no output file is given, then the input file name is used with an extension of 'java'
+ */
+public class Css2Java {
+    public static void main(String args[]) throws Exception {
+        
+        if ( args.length < 1) throw new IllegalArgumentException("expected <input file> [<package name> <output file name>] as arguments");
+
+        try {
+            String ifname = args[0];
+            String packageName = (args.length > 1 ? args[1] : null);
+            String ofname = (args.length > 2) ?
+                args[2] : ifname.substring(0, ifname.lastIndexOf('.')+1).concat("java");
+            
+            convertToJava(ifname, ofname, packageName);
+        } catch (Exception e) {
+            System.err.println(e.toString());
+            e.printStackTrace(System.err);
+            System.exit(-1);
+        } 
+    }
+
+    public static void convertToJava(String ifname, String ofname, String packageName) throws IOException {
+        final URL urlIn = new java.net.URL("file", null, ifname);
+
+        CSSParser.EXIT_ON_ERROR = true;
+        Stylesheet stylesheet = CSSParser.getInstance().parse(urlIn);
+
+        File outFile = new File(ofname);
+        PrintWriter writer = new PrintWriter(outFile);
+        
+        if (packageName != null && ! packageName.isEmpty()) {
+            writer.write("package ");
+            writer.write(packageName);
+            writer.write(";");
+            writer.write("\r\n\r\n");
+        }
+        
+        String className = outFile.getName();
+        className = className.substring(0, className.indexOf("."));
+        stylesheet.writeJava(writer, className);
+        writer.flush();
+        writer.close();
+    }
+}
--- a/javafx-ui-controls/build-common.xml	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/build-common.xml	Tue Aug 28 16:03:14 2012 -0700
@@ -1,15 +1,59 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project name="javafx-ui-controls-common" default="jar" basedir=".">
 
+    <path id="class-path-ref">
+      <pathelement location="${rt.dist.root.dir}/javafx-ui-common/dist/javafx-ui-common.jar"/>
+      <pathelement location="${runtime.dist.root.dir}/javafx-beans/dist/javafx-beans.jar"/>
+      <pathelement location="${runtime.dist.root.dir}/javafx-anim/dist/javafx-anim.jar"/>
+      <pathelement location="${runtime.dist.root.dir}/javafx-common/dist/javafx-common.jar"/>
+      <pathelement location="${runtime.dist.root.dir}/javafx-logging/dist/javafx-logging.jar"/>
+      <pathelement location="${JFXRT_HOME}/jfxrt.jar"/>
+    </path>
+
+    <!-- .css -> .bss -->
     <target name="check-binary-css">
-        <uptodate property="binaryCssUpToDate" targetfile="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.bss">
+      <uptodate property="binaryCssUpToDate" targetfile="${basedir}/${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.bss">
+        <srcfiles dir="${basedir}/${src.dir}/com/sun/javafx/scene/control/skin/caspian" includes="*.css"/>
+      </uptodate>
+    </target>
+
+
+    <target name="-pre-init" depends="check-binary-css, compile-java-css" unless="binaryCssUpToDate">
+      <mkdir dir="${basedir}/${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian"/>
+
+      <!-- compile all .css files in the build dir to .bss files, for faster startup -->
+      <java classname="com.sun.javafx.css.parser.Css2Bin" fork="true" failonerror="true" classpathref="class-path-ref">
+        <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
+        <arg value="${basedir}/${src.dir}/com/sun/javafx/scene/control/skin/caspian/caspian.css"/>
+        <arg value="${basedir}/${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.bss"/>
+      </java>
+      <java classname="com.sun.javafx.css.parser.Css2Bin" fork="true" failonerror="true" classpathref="class-path-ref">
+        <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
+        <arg value="${basedir}/${src.dir}/com/sun/javafx/scene/control/skin/caspian/highcontrast.css"/>
+        <arg value="${basedir}/${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/highcontrast.bss"/>
+      </java>
+      <java classname="com.sun.javafx.css.parser.Css2Bin" fork="true" failonerror="true" classpathref="class-path-ref">
+        <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
+        <arg value="${basedir}/${src.dir}/com/sun/javafx/scene/control/skin/caspian/embedded.css"/>
+        <arg value="${basedir}/${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/embedded.bss"/>
+      </java>
+      <java classname="com.sun.javafx.css.parser.Css2Bin" fork="true" failonerror="true" classpathref="class-path-ref">
+        <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
+        <arg value="${basedir}/${src.dir}/com/sun/javafx/scene/control/skin/caspian/embedded-qvga.css"/>
+        <arg value="${basedir}/${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/embedded-qvga.bss"/>
+      </java>
+    </target>
+
+    <!-- .css -> .java -->
+    <target name="check-java-css">
+        <uptodate property="javaCssUpToDate" targetfile="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.java">
             <srcfiles dir="${src.dir}/com/sun/javafx/scene/control/skin/caspian" includes="caspian.css"/>
         </uptodate>
     </target> 
 
-    <target name="-pre-init" depends="check-binary-css" unless="binaryCssUpToDate">
+    <target name="compile-java-css" depends="check-java-css" unless="javaCssUpToDate">
         <mkdir dir="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian"/>
-        <java classname="com.sun.javafx.css.parser.Css2Bin" fork="true" failonerror="true">
+        <java classname="com.sun.javafx.css.parser.Css2Java" fork="true" failonerror="true">
           <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
           <classpath> 
             <pathelement location="${rt.dist.root.dir}/javafx-ui-common/dist/javafx-ui-common.jar"/>
@@ -20,10 +64,12 @@
             <pathelement location="${JFXRT_HOME}/jfxrt.jar"/>
           </classpath> 
           <arg value="${src.dir}/com/sun/javafx/scene/control/skin/caspian/caspian.css"/>
-          <arg value="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.bss"/>
+          <arg value="com.sun.javafx.scene.control.skin.caspian"/>
+          <arg value="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/Caspian.java"/>
         </java>
     </target>
-
+    
+    <!-- misc -->
     <target name="debug-test-file" depends="jar">
         <echo message="${run.test.classpath}" />
         <debug-selected-file-in-test/>
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java	Tue Aug 28 16:03:14 2012 -0700
@@ -61,9 +61,11 @@
 import com.sun.javafx.PlatformUtil;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
+import javafx.beans.value.WeakChangeListener;
 import javafx.collections.ListChangeListener;
 import javafx.collections.ListChangeListener.Change;
 import javafx.collections.ObservableList;
+import javafx.collections.WeakListChangeListener;
 import javafx.scene.control.*;
 import javafx.util.Callback;
 
@@ -266,7 +268,7 @@
     
     private boolean selectionChanging = false;
     
-    private ListChangeListener<Integer> selectedIndicesListener = new ListChangeListener<Integer>() {
+    private final ListChangeListener<Integer> selectedIndicesListener = new ListChangeListener<Integer>() {
         @Override public void onChanged(ListChangeListener.Change c) {
             while (c.next()) {
                 // there are no selected items, so lets clear out the anchor
@@ -304,41 +306,55 @@
             }
         }
     };
+    
+    private final ChangeListener<ObservableList<T>> itemsListener = new ChangeListener<ObservableList<T>>() {
+        @Override public void changed(ObservableValue ov, 
+                    ObservableList oldValue, 
+                    ObservableList newValue) {
+            if (oldValue != null) {
+                oldValue.removeListener(weakItemsListListener);
+            } if (newValue != null) {
+                newValue.addListener(weakItemsListListener);
+            }
+        }
+    };
+    
+    private final ChangeListener<MultipleSelectionModel<T>> selectionModelListener = new ChangeListener<MultipleSelectionModel<T>>() {
+        @Override public void changed(
+                    ObservableValue<? extends MultipleSelectionModel<T>> observable, 
+                    MultipleSelectionModel<T> oldValue, 
+                    MultipleSelectionModel<T> newValue) {
+            if (oldValue != null) {
+                oldValue.getSelectedIndices().removeListener(weakSelectedIndicesListener);
+            }
+            if (newValue != null) {
+                newValue.getSelectedIndices().addListener(weakSelectedIndicesListener);
+            }
+        }
+    };
+    
+    private final WeakChangeListener<ObservableList<T>> weakItemsListener = 
+            new WeakChangeListener<ObservableList<T>>(itemsListener);
+    private final WeakListChangeListener<Integer> weakSelectedIndicesListener = 
+            new WeakListChangeListener<Integer>(selectedIndicesListener);
+    private final WeakListChangeListener weakItemsListListener = 
+            new WeakListChangeListener(itemsListListener);
+    private final WeakChangeListener<MultipleSelectionModel<T>> weakSelectionModelListener = 
+            new WeakChangeListener<MultipleSelectionModel<T>>(selectionModelListener);
+    
 
     public ListViewBehavior(ListView control) {
         super(control);
         
-        control.itemsProperty().addListener(new ChangeListener<ObservableList<T>>() {
-            @Override public void changed(ObservableValue ov, 
-                        ObservableList oldValue, 
-                        ObservableList newValue) {
-                if (oldValue != null) {
-                    oldValue.removeListener(itemsListListener);
-                } if (newValue != null) {
-                    newValue.addListener(itemsListListener);
-                }
-            }
-        });
+        control.itemsProperty().addListener(weakItemsListener);
         if (control.getItems() != null) {
-            control.getItems().addListener(itemsListListener);
+            control.getItems().addListener(weakItemsListListener);
         }
         
         // Fix for RT-16565
-        getControl().selectionModelProperty().addListener(new ChangeListener<MultipleSelectionModel<T>>() {
-            @Override
-            public void changed(ObservableValue<? extends MultipleSelectionModel<T>> observable, 
-                        MultipleSelectionModel<T> oldValue, 
-                        MultipleSelectionModel<T> newValue) {
-                if (oldValue != null) {
-                    oldValue.getSelectedIndices().removeListener(selectedIndicesListener);
-                }
-                if (newValue != null) {
-                    newValue.getSelectedIndices().addListener(selectedIndicesListener);
-                }
-            }
-        });
+        getControl().selectionModelProperty().addListener(weakSelectionModelListener);
         if (control.getSelectionModel() != null) {
-            control.getSelectionModel().getSelectedIndices().addListener(selectedIndicesListener);
+            control.getSelectionModel().getSelectedIndices().addListener(weakSelectedIndicesListener);
         }
     }
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TableViewBehavior.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TableViewBehavior.java	Tue Aug 28 16:03:14 2012 -0700
@@ -59,7 +59,9 @@
 import com.sun.javafx.PlatformUtil;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
+import javafx.beans.value.WeakChangeListener;
 import javafx.collections.ListChangeListener;
+import javafx.collections.WeakListChangeListener;
 import javafx.scene.control.*;
 import javafx.util.Callback;
 
@@ -241,7 +243,7 @@
     
     private boolean selectionChanging = false;
     
-    private ListChangeListener<TablePosition> selectedCellsListener = new ListChangeListener<TablePosition>() {
+    private final ListChangeListener<TablePosition> selectedCellsListener = new ListChangeListener<TablePosition>() {
         @Override public void onChanged(ListChangeListener.Change c) {
             while (c.next()) {
                 TableView.TableViewSelectionModel sm = getControl().getSelectionModel();
@@ -286,24 +288,32 @@
             }
         }
     };
+    
+    private final ChangeListener<TableView.TableViewSelectionModel<T>> selectionModelListener = 
+            new ChangeListener<TableView.TableViewSelectionModel<T>>() {
+        @Override
+        public void changed(ObservableValue<? extends TableView.TableViewSelectionModel<T>> observable, 
+                    TableView.TableViewSelectionModel<T> oldValue, 
+                    TableView.TableViewSelectionModel<T> newValue) {
+            if (oldValue != null) {
+                oldValue.getSelectedCells().removeListener(weakSelectedCellsListener);
+            }
+            if (newValue != null) {
+                newValue.getSelectedCells().addListener(weakSelectedCellsListener);
+            }
+        }
+    };
+    
+    private final WeakListChangeListener<TablePosition> weakSelectedCellsListener = 
+            new WeakListChangeListener<TablePosition>(selectedCellsListener);
+    private final WeakChangeListener<TableView.TableViewSelectionModel<T>> weakSelectionModelListener = 
+            new WeakChangeListener<TableView.TableViewSelectionModel<T>>(selectionModelListener);
 
     public TableViewBehavior(TableView control) {
         super(control);
         
         // Fix for RT-16565
-        getControl().selectionModelProperty().addListener(new ChangeListener<TableView.TableViewSelectionModel<T>>() {
-            @Override
-            public void changed(ObservableValue<? extends TableView.TableViewSelectionModel<T>> observable, 
-                        TableView.TableViewSelectionModel<T> oldValue, 
-                        TableView.TableViewSelectionModel<T> newValue) {
-                if (oldValue != null) {
-                    oldValue.getSelectedCells().removeListener(selectedCellsListener);
-                }
-                if (newValue != null) {
-                    newValue.getSelectedCells().addListener(selectedCellsListener);
-                }
-            }
-        });
+        getControl().selectionModelProperty().addListener(weakSelectionModelListener);
         if (getControl().getSelectionModel() != null) {
             getControl().getSelectionModel().getSelectedCells().addListener(selectedCellsListener);
         }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeViewBehavior.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/TreeViewBehavior.java	Tue Aug 28 16:03:14 2012 -0700
@@ -40,7 +40,9 @@
 import com.sun.javafx.PlatformUtil;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
+import javafx.beans.value.WeakChangeListener;
 import javafx.collections.ListChangeListener;
+import javafx.collections.WeakListChangeListener;
 import javafx.scene.input.KeyCode;
 import javafx.util.Callback;
 
@@ -213,7 +215,7 @@
     
     private boolean selectionChanging = false;
     
-    private ListChangeListener<Integer> selectedIndicesListener = new ListChangeListener<Integer>() {
+    private final ListChangeListener<Integer> selectedIndicesListener = new ListChangeListener<Integer>() {
         @Override public void onChanged(ListChangeListener.Change c) {
             while (c.next()) {
                 // there are no selected items, so lets clear out the anchor
@@ -239,26 +241,33 @@
             }
         }
     };
+    
+    private final ChangeListener<MultipleSelectionModel<TreeItem<T>>> selectionModelListener = 
+            new ChangeListener<MultipleSelectionModel<TreeItem<T>>>() {
+        @Override public void changed(ObservableValue<? extends MultipleSelectionModel<TreeItem<T>>> observable, 
+                    MultipleSelectionModel<TreeItem<T>> oldValue, 
+                    MultipleSelectionModel<TreeItem<T>> newValue) {
+            if (oldValue != null) {
+                oldValue.getSelectedIndices().removeListener(weakSelectedIndicesListener);
+            }
+            if (newValue != null) {
+                newValue.getSelectedIndices().addListener(weakSelectedIndicesListener);
+            }
+        }
+    };
+    
+    private final WeakListChangeListener<Integer> weakSelectedIndicesListener = 
+            new WeakListChangeListener<Integer>(selectedIndicesListener);
+    private final WeakChangeListener<MultipleSelectionModel<TreeItem<T>>> weakSelectionModelListener =
+            new WeakChangeListener<MultipleSelectionModel<TreeItem<T>>>(selectionModelListener);
 
     public TreeViewBehavior(TreeView control) {
         super(control);
         
         // Fix for RT-16565
-        getControl().selectionModelProperty().addListener(new ChangeListener<MultipleSelectionModel<TreeItem<T>>>() {
-            @Override
-            public void changed(ObservableValue<? extends MultipleSelectionModel<TreeItem<T>>> observable, 
-                        MultipleSelectionModel<TreeItem<T>> oldValue, 
-                        MultipleSelectionModel<TreeItem<T>> newValue) {
-                if (oldValue != null) {
-                    oldValue.getSelectedIndices().removeListener(selectedIndicesListener);
-                }
-                if (newValue != null) {
-                    newValue.getSelectedIndices().addListener(selectedIndicesListener);
-                }
-            }
-        });
+        getControl().selectionModelProperty().addListener(weakSelectionModelListener);
         if (control.getSelectionModel() != null) {
-            control.getSelectionModel().getSelectedIndices().addListener(selectedIndicesListener);
+            control.getSelectionModel().getSelectedIndices().addListener(weakSelectedIndicesListener);
         }
     }
     
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ColorPickerSkin.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ColorPickerSkin.java	Tue Aug 28 16:03:14 2012 -0700
@@ -42,6 +42,8 @@
 import javafx.scene.layout.StackPane;
 import javafx.scene.shape.Rectangle;
 import com.sun.javafx.scene.control.behavior.ColorPickerBehavior;
+import javafx.beans.InvalidationListener;
+import javafx.beans.Observable;
 import javafx.scene.control.ColorPicker;
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.value.WritableValue;
@@ -63,6 +65,14 @@
 //    private ColorPickerPanel popup = new ColorPickerPanel(Color.WHITE);
     BooleanProperty colorLabelVisible = new StyleableBooleanProperty(true) {
         
+        @Override public void invalidated() {
+            if (colorLabelVisible.get()) {
+                displayNode.setText(colorValueToWeb(((ColorPicker)getSkinnable()).getValue()));
+            } else {
+                displayNode.setText("");
+            }
+        }
+        
         @Override
         public Object getBean() {
             return ColorPickerSkin.this;
@@ -211,7 +221,7 @@
             // label graphic
             icon = new StackPane();
             icon.getStyleClass().add("picker-color");
-            colorRect = new Rectangle(16, 16);
+            colorRect = new Rectangle(12, 12);
             colorRect.getStyleClass().add("picker-color-rect");
             
             updateColor();
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Tue Aug 28 16:03:14 2012 -0700
@@ -408,7 +408,7 @@
             final MenuItem item = getItems().get(row);
             if ((item instanceof CustomMenuItem && ((CustomMenuItem) item).getContent() == null) ||
                     item instanceof SeparatorMenuItem)  continue;
-            if ( item != null && item.getText().length() > len) {
+            if ( item != null && item.getText() != null && item.getText().length() > len) {
                 index = row;
                 len =  item.getText().length();
             }
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/PaginationSkin.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/PaginationSkin.java	Tue Aug 28 16:03:14 2012 -0700
@@ -716,7 +716,7 @@
 
         layoutInArea(currentStackPane, left, top, w, stackPaneHeight, 0, HPos.CENTER, VPos.CENTER);
         layoutInArea(nextStackPane, left, top, w, stackPaneHeight, 0, HPos.CENTER, VPos.CENTER);
-        layoutInArea(navigation, left, stackPaneHeight, h, navigationHeight, 0, HPos.CENTER, VPos.CENTER);
+        layoutInArea(navigation, left, stackPaneHeight, w, navigationHeight, 0, HPos.CENTER, VPos.CENTER);
     }
 
     class NavigationControl extends StackPane {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ProgressBarSkin.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ProgressBarSkin.java	Tue Aug 28 16:03:14 2012 -0700
@@ -62,7 +62,7 @@
      *                                                                         *
      **************************************************************************/
 
-    private StackPane bar;
+    private Bar bar;
     private StackPane track;
     private Rectangle clipRectangle;
 
@@ -221,7 +221,7 @@
                 }
                 
                 if (indeterminateTimeline != null) {
-                    if (getSkinnable().isVisible() && getSkinnable().getScene() != null) {
+                    if (getSkinnable().impl_isTreeVisible() && getSkinnable().getScene() != null) {
                         indeterminateTimeline.play();
                     }
                     else {
@@ -248,7 +248,9 @@
                     if (getSkinnable().getScene() != null && getSkinnable().isIndeterminate()) {
                         timelineNulled = false;
                         createIndeterminateTimeline();
-                        indeterminateTimeline.play();
+                        if (getSkinnable().impl_isTreeVisible()) {
+                            indeterminateTimeline.play();
+                        }
                         requestLayout();
                     }
                 }
@@ -284,12 +286,42 @@
         track = new StackPane();
         track.getStyleClass().setAll("track");
 
-        bar = new StackPane();
+        bar = new Bar(this);
         bar.getStyleClass().setAll("bar");
 
         getChildren().setAll(track, bar);
     }
 
+    void pauseBar(boolean pause) {
+        if (indeterminateTimeline != null) {
+            if (pause) {
+                indeterminateTimeline.pause();
+            }
+            else {
+                indeterminateTimeline.play();
+            }
+        }
+    }
+
+    class Bar extends StackPane {
+        ProgressBarSkin pbSkin;
+        Bar(ProgressBarSkin pb) {
+            super();
+            pbSkin = pb;
+            InvalidationListener treeVisibilityListener = new InvalidationListener() {
+                    @Override public void invalidated(Observable valueModel) {
+                        if (getSkinnable().impl_isTreeVisible()) {
+                            pbSkin.pauseBar(false);
+                        }
+                        else {
+                            pbSkin.pauseBar(true);
+                        }
+                    }
+                };
+            impl_treeVisibleProperty().addListener(treeVisibilityListener);
+        }
+    }
+
     private void createIndeterminateTimeline() {
         if (indeterminateTimeline != null) indeterminateTimeline.stop();
 
@@ -394,7 +426,7 @@
         // width might have changed so recreate our animation if needed
         if (isIndeterminate) {
             createIndeterminateTimeline();
-            if (getSkinnable().isVisible()) {
+            if (getSkinnable().impl_isTreeVisible()) {
                 indeterminateTimeline.play();
             }
         } else if (indeterminateTimeline != null) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ProgressIndicatorSkin.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ProgressIndicatorSkin.java	Tue Aug 28 16:03:14 2012 -0700
@@ -63,6 +63,9 @@
 import javafx.beans.property.ObjectProperty;
 import javafx.beans.value.WritableValue;
 
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+
 public class ProgressIndicatorSkin extends SkinBase<ProgressIndicator, ProgressIndicatorBehavior<ProgressIndicator>> {
 
     /***************************************************************************
@@ -115,7 +118,7 @@
                 }
                 
                 if (spinner != null) {
-                    if (getSkinnable().isVisible() && getSkinnable().getScene() != null) {
+                    if (getSkinnable().impl_isTreeVisible() && getSkinnable().getScene() != null) {
                         spinner.indeterminateTimeline.play();
                     }
                     else {
@@ -145,7 +148,9 @@
                         timelineNulled = false;
                         spinner = new IndeterminateSpinner(getSkinnable(), ProgressIndicatorSkin.this);
                         getChildren().add(spinner);
-                        spinner.indeterminateTimeline.play();
+                        if (getSkinnable().impl_isTreeVisible()) {
+                            spinner.indeterminateTimeline.play();
+                        }
                         requestLayout();
                     }
                 }
@@ -167,7 +172,7 @@
             spinner = new IndeterminateSpinner(control, this);
             getChildren().clear();
             getChildren().add(spinner);
-            if (getSkinnable().isVisible()) {
+            if (getSkinnable().impl_isTreeVisible()) {
                 spinner.indeterminateTimeline.play();
             }
         } else {
@@ -390,8 +395,8 @@
     static class IndeterminateSpinner extends Region {
 
         private ProgressIndicator control;
-        private ProgressIndicatorSkin skin;
-        private Group childrenG;
+        protected ProgressIndicatorSkin skin;
+        private IndicatorPaths pathsG;
         Scale scaleTransform;
         Rotate rotateTransform;
 
@@ -405,15 +410,15 @@
             skin.svgpaths = FXCollections.<SVGPath>observableArrayList();
             skin.setColors(skin.getProgressColor());
 
-            childrenG = new Group();
+            pathsG = new IndicatorPaths(this);
 
             scaleTransform = new Scale();
 
             rotateTransform = new Rotate();
             rotateTransform.setAngle(angle);
 
-            childrenG.getChildren().clear();
-            childrenG.getChildren().addAll(skin.svgpaths);
+            pathsG.getChildren().clear();
+            pathsG.getChildren().addAll(skin.svgpaths);
 
             indeterminateTimeline = new Timeline();
             indeterminateTimeline.setCycleCount(Timeline.INDEFINITE);
@@ -431,10 +436,42 @@
             indeterminateTimeline.getKeyFrames().addAll(keyframes);
 
             getChildren().clear();
-            getChildren().addAll(childrenG);
+            getChildren().addAll(pathsG);
             requestLayout();
         }
 
+        void pauseIndicator(boolean pause) {
+            if (indeterminateTimeline != null) {
+                if (pause) {
+                    indeterminateTimeline.pause();
+                }
+                else {
+                    indeterminateTimeline.play();
+                }
+            }
+        }
+
+
+    class IndicatorPaths extends Group {
+        IndeterminateSpinner piSkin;
+        IndicatorPaths(IndeterminateSpinner pi) {
+            super();
+            piSkin = pi;
+            InvalidationListener treeVisibilityListener = new InvalidationListener() {
+                    @Override public void invalidated(Observable valueModel) {
+                        if (piSkin.skin.getSkinnable().impl_isTreeVisible()) {
+                            piSkin.pauseIndicator(false);
+                        }
+                        else {
+                            piSkin.pauseIndicator(true);
+                        }
+                    }
+                };
+            impl_treeVisibleProperty().addListener(treeVisibilityListener);
+        }
+    }
+
+
         @Override protected void layoutChildren() {
             double radiusW = (control.getWidth() - (skin.getInsets().getLeft() + skin.getInsets().getRight())) / 2;
             double radiusH = (control.getHeight() - (skin.getInsets().getTop() + skin.getInsets().getBottom())) / 2;
@@ -446,14 +483,14 @@
             rotateTransform.setPivotX(radius);
             rotateTransform.setPivotY(radius);
 
-            childrenG.getTransforms().clear();
-            childrenG.getTransforms().addAll(scaleTransform, rotateTransform);
+            pathsG.getTransforms().clear();
+            pathsG.getTransforms().addAll(scaleTransform, rotateTransform);
 
             double diameter = radius*2;
-            childrenG.resize(diameter, diameter);
+            pathsG.resize(diameter, diameter);
 
-            childrenG.setLayoutX(skin.getInsets().getLeft()+(radiusW - radius));
-            childrenG.setLayoutY(skin.getInsets().getTop()+(radiusH - radius));
+            pathsG.setLayoutX(skin.getInsets().getLeft()+(radiusW - radius));
+            pathsG.setLayoutY(skin.getInsets().getTop()+(radiusH - radius));
         }
 
         private Timeline indeterminateTimeline;
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableRowSkin.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableRowSkin.java	Tue Aug 28 16:03:14 2012 -0700
@@ -41,7 +41,6 @@
 import javafx.collections.ObservableList;
 import javafx.geometry.Insets;
 import javafx.scene.Node;
-import javafx.scene.control.*;
 
 /**
  */
@@ -109,7 +108,7 @@
         if ("ITEM".equals(p)) {
             updateCells = true;
             requestLayout();
-            getSkinnable().layout();
+//            getSkinnable().layout();
         } else if ("TABLE_VIEW".equals(p)) {
             for (int i = 0; i < getChildren().size(); i++) {
                 Node n = getChildren().get(i);
@@ -144,7 +143,9 @@
                 new WeakListChangeListener(visibleLeafColumnsListener));
     }
     
-    private void doUpdateCheck() {
+    @Override protected void layoutChildren(double x, final double y,
+            final double w, final double h) {
+        
         if (isDirty) {
             recreateCells();
             updateCells(true);
@@ -153,11 +154,6 @@
             updateCells(false);
             updateCells = false;
         }
-    }
-
-    @Override protected void layoutChildren(double x, final double y,
-            final double w, final double h) {
-        doUpdateCheck();
         
         TableView<T> table = getSkinnable().getTableView();
         if (table == null) return;
@@ -287,8 +283,6 @@
     }
     
     @Override protected double computePrefWidth(double height) {
-        doUpdateCheck();
-        
         if (showColumns) {
             double prefWidth = 0.0F;
 
@@ -307,8 +301,6 @@
     }
     
     @Override protected double computePrefHeight(double width) {
-        doUpdateCheck();
-        
         if (showColumns) {
             // Support for RT-18467: making it easier to specify a height for
             // cells via CSS, where the desired height is less than the height
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TitledPaneSkin.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TitledPaneSkin.java	Tue Aug 28 16:03:14 2012 -0700
@@ -133,6 +133,8 @@
             clipRect.setWidth(getWidth());
         } else if ("HEIGHT".equals(property)) {
             clipRect.setHeight(getHeight());
+        } else if ("GRAPHIC_TEXT_GAP".equals(property)) {
+            titleRegion.requestLayout();            
         }
     }
 
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Aug 28 16:03:14 2012 -0700
@@ -206,15 +206,13 @@
         // lead to performance degradation until it is handled properly.
         if (countChanged) {
             layoutChildren();
-        }
 
-        // Fix for RT-13965: Without this line of code, the number of items in
-        // the sheet would constantly grow, leaking memory for the life of the
-        // application. This was especially apparent when the total number of
-        // cells changes - regardless of whether it became bigger or smaller.
-        sheetChildren.clear();
+            // Fix for RT-13965: Without this line of code, the number of items in
+            // the sheet would constantly grow, leaking memory for the life of the
+            // application. This was especially apparent when the total number of
+            // cells changes - regardless of whether it became bigger or smaller.
+            sheetChildren.clear();
 
-        if (countChanged) {
             Parent parent = getParent();
             if (parent != null) parent.requestLayout();
         }
@@ -1401,6 +1399,7 @@
         Callback<VirtualFlow,? extends IndexedCell> createCell = getCreateCell();
         if (accumCell == null && createCell != null) {
             accumCell = createCell.call(this);
+            accumCell.getProperties().put(NEW_CELL, null);
             accumCellParent.getChildren().setAll(accumCell);
         }
         setCellIndex(accumCell, index);
@@ -1500,8 +1499,9 @@
         if (cell == null) return;
 
         cell.updateIndex(index);
-        if (cell.isNeedsLayout() && cell.getScene() != null) {
+        if (cell.isNeedsLayout() && cell.getScene() != null && cell.getProperties().containsKey(NEW_CELL)) {
             cell.impl_processCSS(false);
+            cell.getProperties().remove(NEW_CELL);
         }
     }
 
@@ -1512,6 +1512,11 @@
      **************************************************************************/
 
     /**
+     * Indicates that this is a new cell and we need to process CSS for it.
+     */
+    private static final String NEW_CELL = "newcell";
+    
+    /**
      * Get a cell which can be used in the layout. This function will reuse
      * cells from the pile where possible, and will create new cells when
      * necessary.
@@ -1535,6 +1540,7 @@
                 cell = (prefIndex < pile.getFirst().getIndex())? pile.removeLast() : pile.removeFirst();
             } else {
                 cell = createCell.call(this);
+                cell.getProperties().put(NEW_CELL, null);
             }
         }
 
@@ -2097,7 +2103,6 @@
             }
 
             getStyleClass().add("clipped-container");
-            setManaged(false);
 
             // clipping
             clipRect = new Rectangle();
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css	Tue Aug 28 16:03:14 2012 -0700
@@ -2511,11 +2511,11 @@
  *                                                                             *
  ******************************************************************************/
 
-.split-pane .table-view { -fx-padding: 0px; }
-.split-pane .list-view { -fx-padding: 0px; }
-.split-pane .tree-view { -fx-padding: 0px; }
-.split-pane .scroll-pane { -fx-padding: 0px; }
-.split-pane .split-pane {
+.split-pane > * > * > .table-view { -fx-padding: 0px; }
+.split-pane > * > * > .list-view { -fx-padding: 0px; }
+.split-pane > * > * > .tree-view { -fx-padding: 0px; }
+.split-pane > * > * > .scroll-pane { -fx-padding: 0px; }
+.split-pane > * > * > .split-pane {
     -fx-background-insets: 0, 0;
     -fx-padding: 0;
  }
@@ -3471,7 +3471,7 @@
     -fx-arrows-visible: true;
     -fx-tooltip-visible: true;
     -fx-page-information-visible: true;
-    -fx-page-information-alignment: bottom;    
+    -fx-page-information-alignment: bottom;        
 }
 .pagination > .page {
     -fx-background-color: transparent;
@@ -3487,16 +3487,16 @@
     -fx-alignment: center;
 }
 
-.pagination > .pagination-control > .left-arrow-button{
+.pagination > .pagination-control > .control-box > .left-arrow-button{
     -fx-background-radius: 0;
     -fx-padding: 0.166667em 0.416em 0.25em 0.333em;
 }
-.pagination > .pagination-control > .right-arrow-button {
+.pagination > .pagination-control > .control-box > .right-arrow-button {
     -fx-background-radius: 0;
     -fx-padding: 0.166667em 0.333em 0.25em 0.416em;
 }
 
-.pagination > .pagination-control > .left-arrow {
+.pagination > .pagination-control .left-arrow {
     -fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
     -fx-background-insets: 1 0 -1 0, 0;
     -fx-padding: 0.375em 0.291em 0.375em 0.291em;
@@ -3504,7 +3504,7 @@
     -fx-scale-shape: true;
 }
 
-.pagination > .pagination-control > .right-arrow {
+.pagination > .pagination-control .right-arrow {
     -fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
     -fx-background-insets: 1 0 -1 0, 0;
     -fx-padding: 0.375em 0.291em 0.375em 0.291em;
@@ -3524,8 +3524,8 @@
     -fx-base: -fx-accent;
 }
 
-.pagination.bullet > .pagination-control > .left-arrow-button, 
-.pagination.bullet > .pagination-control > .right-arrow-button {
+.pagination.bullet > .pagination-control > .control-box > .left-arrow-button, 
+.pagination.bullet > .pagination-control > .control-box > .right-arrow-button {
     -fx-background-radius: 4em;
 }
 
--- a/javafx-ui-controls/src/javafx/scene/control/Control.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/Control.java	Tue Aug 28 16:03:14 2012 -0700
@@ -40,10 +40,7 @@
 import javafx.beans.property.SimpleObjectProperty;
 import javafx.beans.property.StringProperty;
 import javafx.beans.value.WritableValue;
-import javafx.geometry.BoundingBox;
-import javafx.geometry.Bounds;
 import javafx.scene.Node;
-import javafx.scene.Parent;
 import javafx.scene.layout.Region;
 
 import com.sun.javafx.logging.PlatformLogger;
@@ -221,6 +218,13 @@
             // clear out the styleable properties so that the list is rebuilt
             // next time they are requested.
             styleableProperties = null;
+            
+            // calling impl_reapplyCSS() as the styleable properties may now
+            // be different, as we will now be able to return styleable properties 
+            // belonging to the skin. If impl_reapplyCSS() is not called, the 
+            // impl_getStyleableProperties() method is never called, so the 
+            // skin properties are never exposed.
+            impl_reapplyCSS();
 
             // DEBUG: Log that we've changed the skin
             final PlatformLogger logger = Logging.getControlsLogger();
--- a/javafx-ui-controls/src/javafx/scene/control/IndexedCell.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/IndexedCell.java	Tue Aug 28 16:03:14 2012 -0700
@@ -76,10 +76,6 @@
         @Override protected void invalidated() {
             impl_pseudoClassStateChanged(PSEUDO_CLASS_EVEN);
             impl_pseudoClassStateChanged(PSEUDO_CLASS_ODD);
-            
-            // force the index to be calculated eagerly
-            get();
-            indexChanged();
         }
     };
 
--- a/javafx-ui-controls/src/javafx/scene/control/TableRow.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/TableRow.java	Tue Aug 28 16:03:14 2012 -0700
@@ -216,26 +216,37 @@
      *                                                                         *
      **************************************************************************/
 
+    private int oldIndex = -1;
+    
     /** {@inheritDoc} */
     @Override void indexChanged() {
+        int newIndex = getIndex();
+        
         super.indexChanged();
-        updateItem();
+        
+        // Below we check if the index has changed, but we always call updateItem,
+        // as the value in the given index may have changed.
+        updateItem(newIndex);
+        
+        if (oldIndex == newIndex) return;
+        oldIndex = newIndex;
+        
         updateSelection();
         updateFocus();
     }
     
-    private void updateItem() {
+    private void updateItem(int newIndex) {
         TableView<T> tv = getTableView();
         if (tv == null || tv.getItems() == null) return;
         
         List<T> items = tv.getItems();
 
         // Compute whether the index for this cell is for a real item
-        boolean valid = getIndex() >= 0 && getIndex() < items.size();
+        boolean valid = newIndex >= 0 && newIndex < items.size();
 
         // Cause the cell to update itself
         if (valid) {
-            T newItem = items.get(getIndex());
+            T newItem = items.get(newIndex);
             if (newItem == null || ! newItem.equals(getItem())) {
                 updateItem(newItem, false);
             }
--- a/javafx-ui-controls/src/javafx/scene/control/UAStylesheetLoader.java	Tue Aug 28 10:11:57 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/UAStylesheetLoader.java	Tue Aug 28 16:03:14 2012 -0700
@@ -48,7 +48,7 @@
     
     
     static void doLoad() {
-        Holder.stylesheetLoader.loadUAStylesheet();
+        UAStylesheetLoader.Holder.stylesheetLoader.loadUAStylesheet();
     }
     
     private void loadUAStylesheet() {
@@ -58,20 +58,24 @@
             AccessController.doPrivileged(new PrivilegedAction() {
                 @Override
                 public Object run() {
-                        URL url = LabelSkin.class.getResource("caspian/caspian.css");
-                        StyleManager.setDefaultUserAgentStylesheet(url.toExternalForm());
-                        
-                        if (com.sun.javafx.PlatformUtil.isEmbedded()) {
-                            url = LabelSkin.class.getResource("caspian/embedded.css");
+                    // Old approach:
+                    URL url = LabelSkin.class.getResource("caspian/caspian.css");
+                    StyleManager.setDefaultUserAgentStylesheet(url.toExternalForm());
+                    
+                    // New approach:
+                    // StyleManager.setDefaultUserAgentStylesheet(new Caspian());
+
+                    if (com.sun.javafx.PlatformUtil.isEmbedded()) {
+                        url = LabelSkin.class.getResource("caspian/embedded.css");
+                        StyleManager.addUserAgentStylesheet(url.toExternalForm());
+
+                        if (com.sun.javafx.Utils.isQVGAScreen()) {
+                            url = LabelSkin.class.getResource("caspian/embedded-qvga.css");
                             StyleManager.addUserAgentStylesheet(url.toExternalForm());
-                            
-                            if (com.sun.javafx.Utils.isQVGAScreen()) {
-                                url = LabelSkin.class.getResource("caspian/embedded-qvga.css");
-                                StyleManager.addUserAgentStylesheet(url.toExternalForm());
-                            }
                         }
-                        
-                        stylesheetLoaded = true;
+                    }
+
+                    stylesheetLoaded = true;
                     return null;
                 }
             });