changeset 4261:0183efecff61

RT-31566: Remove use of Builders from graphics module
author Richard Bair <richard.bair@oracle.com>
date Wed, 10 Jul 2013 23:46:27 -0700
parents 142f5a3007a6
children 11d12ec5d040
files .idea/graphics.iml modules/graphics/src/stub/java/com/sun/javafx/css/PaintTypeTest.java modules/graphics/src/stub/java/javafx/scene/paint/ColorTest.java modules/graphics/src/stub/java/javafx/scene/paint/LinearGradientTest.java modules/graphics/src/stub/java/javafx/scene/paint/RadialGradientTest.java modules/graphics/src/stub/java/javafx/stage/StageTest.java
diffstat 6 files changed, 253 insertions(+), 342 deletions(-) [+]
line wrap: on
line diff
--- a/.idea/graphics.iml	Wed Jul 10 22:02:06 2013 -0700
+++ b/.idea/graphics.iml	Wed Jul 10 23:46:27 2013 -0700
@@ -21,7 +21,6 @@
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="base" exported="" />
-    <orderEntry type="module" module-name="builders" exported="" />
     <orderEntry type="inheritedJdk" />
   </component>
 </module>
--- a/modules/graphics/src/stub/java/com/sun/javafx/css/PaintTypeTest.java	Wed Jul 10 22:02:06 2013 -0700
+++ b/modules/graphics/src/stub/java/com/sun/javafx/css/PaintTypeTest.java	Wed Jul 10 23:46:27 2013 -0700
@@ -25,10 +25,6 @@
 
 package com.sun.javafx.css;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
 import javafx.css.ParsedValue;
 import javafx.scene.paint.Color;
 import javafx.scene.paint.CycleMethod;
@@ -37,14 +33,11 @@
 import javafx.scene.paint.RadialGradient;
 import javafx.scene.paint.Stop;
 import javafx.scene.text.Font;
-
-import org.junit.Test;
-
 import com.sun.javafx.css.converters.PaintConverter;
 import com.sun.javafx.css.parser.CSSParser;
 import com.sun.javafx.css.parser.StopConverter;
-import javafx.scene.paint.LinearGradientBuilder;
-import javafx.scene.paint.RadialGradientBuilder;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 
 public class PaintTypeTest {
@@ -201,37 +194,27 @@
         ParsedValue value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "radial-gradient(focus-angle 90deg, focus-distance 50%, radius 50, red, green, blue)");
         RadialGradient result = (RadialGradient)((Paint[])value.convert(null))[0];
-        RadialGradientBuilder builder = RadialGradientBuilder.create();
-        RadialGradient expResult =
-            builder.focusAngle(90)
-                   .focusDistance(.5)
-                   .radius(50)
-                   .proportional(false)
-                   .stops(new Stop(0, Color.RED),
-                          new Stop(.5, Color.GREEN),
-                          new Stop(1.0,Color.BLUE))
-            .build();
-        assertEquals(expResult,result);
+        RadialGradient expected = new RadialGradient(90, .5, 0, 0, 50,
+                false, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0,Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "radial-gradient(focus-angle 1.5708rad, focus-distance 50%, radius 50, red, green, blue)");
         result = (RadialGradient)((Paint[])value.convert(null))[0];
-        assertEquals(expResult,result);
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "radial-gradient(center 0% 10%, radius 50%, reflect, red, green, blue)");
         result = (RadialGradient)((Paint[])value.convert(null))[0];
-        builder = RadialGradientBuilder.create();
-        expResult =
-            builder.centerX(0).centerY(.1)
-                   .radius(.5)
-                   .proportional(true)
-                   .cycleMethod(CycleMethod.REFLECT)
-                   .stops(new Stop(0, Color.RED),
-                          new Stop(.5, Color.GREEN),
-                          new Stop(1.0,Color.BLUE))
-            .build();
-        assertEquals(expResult,result);
+        expected = new RadialGradient(0, 0, 0, .1, .5,
+                true, CycleMethod.REFLECT,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0,Color.BLUE));
+        assertEquals(expected,result);
     }
 
     @Test
@@ -245,71 +228,92 @@
         ParsedValue value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to top, red, green, blue)");
         LinearGradient result = (LinearGradient)((Paint[])value.convert(null))[0];
-        LinearGradientBuilder builder = LinearGradientBuilder.create();
-        LinearGradient expResult =
-            builder.startX(0).endX(0).startY(1).endY(0)
-                   .proportional(true)
-                   .stops(new Stop(0, Color.RED),
-                          new Stop(.5, Color.GREEN),
-                          new Stop(1.0,Color.BLUE))
-            .build();
-        assertEquals(expResult,result);
+        LinearGradient expected = new LinearGradient(0, 1, 0, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to bottom, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        expResult = builder.startX(0).endX(0).startY(0).endY(1).build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(0, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to left, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        expResult = builder.startX(1).endX(0).startY(0).endY(0).build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(1, 0, 0, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to right, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        expResult = builder.startX(0).endX(1).startY(0).endY(0).build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(0, 0, 1, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to bottom left, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        expResult = builder.startX(1).endX(0).startY(0).endY(1).build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(1, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to bottom right, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        expResult = builder.startX(0).endX(1).startY(0).endY(1).build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(0, 0, 1, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to top left, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        expResult = builder.startX(1).endX(0).startY(1).endY(0).build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(1, 1, 0, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(to top right, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        expResult = builder.startX(0).endX(1).startY(1).endY(0).build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(0, 1, 1, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
 
         value = CSSParser.getInstance().parseExpr("-fx-background-color",
                 "linear-gradient(from 10% 10% to 90% 90%, reflect, red, green, blue)");
         result = (LinearGradient)((Paint[])value.convert(null))[0];
-        builder = LinearGradientBuilder.create();
-        expResult =
-            builder.startX(.1).endX(.9).startY(.1).endY(.9)
-                   .proportional(true)
-                   .cycleMethod(CycleMethod.REFLECT)
-                   .stops(new Stop(0, Color.RED),
-                          new Stop(.5, Color.GREEN),
-                          new Stop(1.0,Color.BLUE))
-            .build();
-        assertEquals(expResult,result);
+        expected = new LinearGradient(.1, .1, .9, .9,
+                true, CycleMethod.REFLECT,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.GREEN),
+                new Stop(1.0, Color.BLUE));
+        assertEquals(expected,result);
   }
 
 }
--- a/modules/graphics/src/stub/java/javafx/scene/paint/ColorTest.java	Wed Jul 10 22:02:06 2013 -0700
+++ b/modules/graphics/src/stub/java/javafx/scene/paint/ColorTest.java	Wed Jul 10 23:46:27 2013 -0700
@@ -25,18 +25,16 @@
 
 package javafx.scene.paint;
 
+import javafx.animation.Interpolatable;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import com.sun.javafx.Utils;
+import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import javafx.animation.Interpolatable;
-
-import org.junit.Test;
-
-import com.sun.javafx.Utils;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
 
 public class ColorTest {
     
@@ -956,31 +954,4 @@
     //function testOfTheWayHandlesLargeNumbers() {
         // TODO What should happen for numbers > 1?
     //}
-
-    @Test
-    public void testBuilderDefaultOpacity() {
-        Color color = ColorBuilder.create().red(0.125).green(0.25).blue(0.5).build();
-        assertEquals(0.125, color.getRed(), 0);
-        assertEquals(0.25, color.getGreen(), 0);
-        assertEquals(0.5, color.getBlue(), 0);
-        assertEquals(1, color.getOpacity(), 0);
-    }
-
-    @Test
-    public void testBuilderDefaultEverything() {
-        Color color = ColorBuilder.create().build();
-        assertEquals(0, color.getRed(), 0);
-        assertEquals(0, color.getGreen(), 0);
-        assertEquals(0, color.getBlue(), 0);
-        assertEquals(1, color.getOpacity(), 0);
-    }
-
-    @Test
-    public void testBuilderExplicitEverything() {
-        Color color = ColorBuilder.create().blue(0.5).red(0.75).green(0.875).opacity(0.625).build();
-        assertEquals(0.5, color.getBlue(), 0);
-        assertEquals(0.75, color.getRed(), 0);
-        assertEquals(0.875, color.getGreen(), 0);
-        assertEquals(0.625, color.getOpacity(), 0);
-    }
 }
--- a/modules/graphics/src/stub/java/javafx/scene/paint/LinearGradientTest.java	Wed Jul 10 22:02:06 2013 -0700
+++ b/modules/graphics/src/stub/java/javafx/scene/paint/LinearGradientTest.java	Wed Jul 10 23:46:27 2013 -0700
@@ -25,7 +25,10 @@
 
 package javafx.scene.paint;
 
+import java.util.Arrays;
+import java.util.List;
 import com.sun.javafx.tk.Toolkit;
+import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -33,11 +36,6 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.Test;
-
 public class LinearGradientTest {
 
     private final Color color1 = Color.rgb(0, 0, 0);
@@ -282,22 +280,20 @@
 
     @Test
     public void testValueOfCycleMethod() {
-        LinearGradient actual =
-                LinearGradient.valueOf("linear-gradient(repeat, red  0%, blue  30%,black 100%)");
-        LinearGradientBuilder builder =
-                LinearGradientBuilder.create().startX(0).startY(0).endX(0).endY(1)
-                .proportional(true)
-                .cycleMethod(CycleMethod.REPEAT)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK));
-        LinearGradient expected = builder.build();
+        LinearGradient actual = LinearGradient.valueOf("linear-gradient(repeat, red  0%, blue  30%,black 100%)");
+        LinearGradient expected = new LinearGradient(0, 0, 0, 1,
+                true, CycleMethod.REPEAT,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
-        actual =
-                LinearGradient.valueOf("linear-gradient(reflect, red  0%, blue 30%, black 100%)");
-        builder.cycleMethod(CycleMethod.REFLECT);
-        expected = builder.build();
+        actual = LinearGradient.valueOf("linear-gradient(reflect, red  0%, blue 30%, black 100%)");
+        expected = new LinearGradient(0, 0, 0, 1,
+                true, CycleMethod.REFLECT,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -305,20 +301,20 @@
     public void testValueOfFromTo() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(from 10% 20% to 30% 40%, red  0%, blue  30%,black 100%)");
-        LinearGradientBuilder builder =
-                LinearGradientBuilder.create().startX(0.1).startY(0.2).endX(0.3).endY(0.4)
-                .proportional(true)
-                .cycleMethod(CycleMethod.NO_CYCLE)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK));
-        LinearGradient expected = builder.build();
+        LinearGradient expected = new LinearGradient(0.1, 0.2, 0.3, 0.4,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 LinearGradient.valueOf("linear-gradient(from 10px 20px to 30px 40px, red  0%, blue 30%, black 100%)");
-        builder.startX(10).startY(20).endX(30).endY(40).proportional(false);
-        expected = builder.build();
+        expected = new LinearGradient(10, 20, 30, 40,
+                false, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -326,44 +322,56 @@
     public void testValueOfTo() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(to top, red  0%, blue  30%,black 100%)");
-        LinearGradientBuilder builder =
-                LinearGradientBuilder.create().startX(0).startY(1).endX(0).endY(0)
-                .proportional(true)
-                .cycleMethod(CycleMethod.NO_CYCLE)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK));
-        LinearGradient expected = builder.build();
+        LinearGradient expected = new LinearGradient(0, 1, 0, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 LinearGradient.valueOf("linear-gradient(to bottom, red  0%, blue  30%,black 100%)");
-        builder.startX(0).startY(0).endX(0).endY(1);
-        expected = builder.build();
+        expected = new LinearGradient(0, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 LinearGradient.valueOf("linear-gradient(to left, red  0%, blue  30%,black 100%)");
-        builder.startX(1).startY(0).endX(0).endY(0);
-        expected = builder.build();
+        expected = new LinearGradient(1, 0, 0, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 LinearGradient.valueOf("linear-gradient(to right, red  0%, blue  30%,black 100%)");
-        builder.startX(0).startY(0).endX(1).endY(0);
-        expected = builder.build();
+        expected = new LinearGradient(0, 0, 1, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 LinearGradient.valueOf("linear-gradient(to bottom left, red  0%, blue  30%,black 100%)");
-        builder.startX(1).startY(0).endX(0).endY(1);
-        expected = builder.build();
+        expected = new LinearGradient(1, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 LinearGradient.valueOf("linear-gradient(to right top, red  0%, blue  30%,black 100%)");
-        builder.startX(0).startY(1).endX(1).endY(0);
-        expected = builder.build();
+        expected = new LinearGradient(0, 1, 1, 0,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
     
@@ -371,13 +379,11 @@
     public void testValueOfRelativeValues() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(from 0% 0% to 100% 100%, red  0% , blue 30%,  black 100%)");
-        LinearGradient expected =
-                LinearGradientBuilder.create().startX(0).startY(0).endX(1).endY(1)
-                .proportional(true)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        LinearGradient expected = new LinearGradient(0, 0, 1, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
     
@@ -385,13 +391,11 @@
     public void testValueOfAbsoluteValues() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(from 100px 0 to 200px 0px, red 0px, blue 50px,  black 100px)");
-        LinearGradient expected =
-                LinearGradientBuilder.create().startX(100).startY(0).endX(200).endY(0)
-                .proportional(false)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.5, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        LinearGradient expected = new LinearGradient(100, 0, 200, 0,
+                false, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
     
@@ -399,12 +403,10 @@
     public void testValueOfColor() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(rgb(0,0,255), rgb(255, 0, 0))");
-        LinearGradient expected =
-                LinearGradientBuilder.create().startX(0).startY(0).endX(0).endY(1)
-                .proportional(true)
-                .stops(new Stop(0, Color.BLUE),
-                       new Stop(1.0, Color.RED))
-                .build();
+        LinearGradient expected = new LinearGradient(0, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.BLUE),
+                new Stop(1.0, Color.RED));
         assertEquals(expected, actual);
     }
 
@@ -412,13 +414,11 @@
     public void testValueOfDefaultsToBottom() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(red  0%, blue 30%, black 100%)");
-        LinearGradient expected =
-                LinearGradientBuilder.create().startX(0).startY(0).endX(0).endY(1)
-                .proportional(true)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        LinearGradient expected = new LinearGradient(0, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -426,14 +426,12 @@
     public void testValueOfStopsNormalizeLargerValues() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(red  10%, blue 9%, red 8%, black 100%)");
-        LinearGradient expected =
-                LinearGradientBuilder.create().startX(0).startY(0).endX(0).endY(1)
-                .proportional(true)
-                .stops(new Stop(0.1, Color.RED),
-                       new Stop(0.1, Color.BLUE),
-                       new Stop(0.1, Color.RED),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        LinearGradient expected = new LinearGradient(0, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0.1, Color.RED),
+                new Stop(0.1, Color.BLUE),
+                new Stop(0.1, Color.RED),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 }
--- a/modules/graphics/src/stub/java/javafx/scene/paint/RadialGradientTest.java	Wed Jul 10 22:02:06 2013 -0700
+++ b/modules/graphics/src/stub/java/javafx/scene/paint/RadialGradientTest.java	Wed Jul 10 23:46:27 2013 -0700
@@ -25,7 +25,10 @@
 
 package javafx.scene.paint;
 
+import java.util.Arrays;
+import java.util.List;
 import com.sun.javafx.tk.Toolkit;
+import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -33,11 +36,6 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.Test;
-
 public class RadialGradientTest {
 
     private final Color color1 = Color.rgb(0, 0, 0);
@@ -188,17 +186,11 @@
 
     @Test
     public void testBuilder() {
-        RadialGradient gradient = RadialGradientBuilder.create()
-                .centerX(2.0)
-                .centerY(3.0)
-                .cycleMethod(CycleMethod.REPEAT)
-                .focusAngle(23)
-                .focusDistance(24)
-                .proportional(false)
-                .radius(17)
-                .stops(StopBuilder.create().color(Color.RED).offset(0).build(),
-                       StopBuilder.create().color(Color.BLUE).offset(1).build())
-                .build();
+        RadialGradient gradient = new RadialGradient(
+                23, 24, 2.0, 3.0, 17,
+                false, CycleMethod.REPEAT,
+                new Stop(0, Color.RED),
+                new Stop(1, Color.BLUE));
         assertEquals(2.0, gradient.getCenterX(), 0);
         assertEquals(3.0, gradient.getCenterY(), 0);
         assertSame(CycleMethod.REPEAT, gradient.getCycleMethod());
@@ -305,13 +297,12 @@
     public void testValueOfRelativeValues() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(radius 100%, red  0% , blue 30%,  black 100%)");
-        RadialGradient expected =
-                RadialGradientBuilder.create().radius(1)
-                .proportional(true)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                0, 0, 0, 0, 1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -319,13 +310,12 @@
     public void testValueOfAbsoluteValues() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(center 10px 10, radius 100, red 0px, blue 50px,  black 100px)");
-        RadialGradient expected =
-                RadialGradientBuilder.create().centerX(10).centerY(10).radius(100)
-                .proportional(false)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.5, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                0, 0, 10, 10, 100,
+                false, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.5, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -333,16 +323,12 @@
     public void testValueOfDefaults() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(radius 10%, red  0%, blue 30%, black 100%)");
-        RadialGradient expected =
-                RadialGradientBuilder.create().centerX(0).centerY(0)
-                .focusAngle(0).focusDistance(0)
-                .radius(0.1)
-                .proportional(true)
-                .cycleMethod(CycleMethod.NO_CYCLE)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                0, 0, 0, 0, .1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -350,16 +336,12 @@
     public void testValueOfCenter() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(center 20% 40%, radius 10%, red  0%, blue 30%, black 100%)");
-        RadialGradient expected =
-                RadialGradientBuilder.create().centerX(0.2).centerY(0.4)
-                .focusAngle(0).focusDistance(0)
-                .radius(0.1)
-                .proportional(true)
-                .cycleMethod(CycleMethod.NO_CYCLE)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                0, 0, .2, .4, .1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -367,34 +349,42 @@
     public void testValueOfFocusAngle() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(focus-angle 45deg, radius 10%, red  0%, blue 30%, black 100%)");
-        RadialGradientBuilder builder =
-                RadialGradientBuilder.create().centerX(0).centerY(0)
-                .focusAngle(45).focusDistance(0)
-                .radius(0.1)
-                .proportional(true)
-                .cycleMethod(CycleMethod.NO_CYCLE)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK));
-        RadialGradient expected = builder.build();
+        RadialGradient expected = new RadialGradient(
+                45, 0, 0, 0, .1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 RadialGradient.valueOf("radial-gradient(focus-angle 3.1415926535rad, radius 10%, red  0%, blue 30%, black 100%)");
-        builder.focusAngle(180);
-        expected = builder.build();
+        expected = new RadialGradient(
+                180, 0, 0, 0, .1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected.getFocusAngle(), actual.getFocusAngle(), 1e-5);
 
         actual =
                 RadialGradient.valueOf("radial-gradient(focus-angle 0.5turn, radius 10%, red  0%, blue 30%, black 100%)");
-        builder.focusAngle(180);
-        expected = builder.build();
+        expected = new RadialGradient(
+                180, 0, 0, 0, .1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
 
         actual =
                 RadialGradient.valueOf("radial-gradient(focus-angle 1grad, radius 10%, red  0%, blue 30%, black 100%)");
-        builder.focusAngle(0.9);
-        expected = builder.build();
+        expected = new RadialGradient(
+                .9, 0, 0, 0, .1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -402,16 +392,12 @@
     public void testValueOfFocusDistance() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(focus-distance 20%, radius 10%, red  0%, blue 30%, black 100%)");
-        RadialGradient expected =
-                RadialGradientBuilder.create().centerX(0).centerY(0)
-                .focusAngle(0).focusDistance(0.2)
-                .radius(0.1)
-                .proportional(true)
-                .cycleMethod(CycleMethod.NO_CYCLE)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                0, .2, 0, 0, .1,
+                true, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -419,22 +405,22 @@
     public void testValueOfCycleMethod() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(radius 10%, repeat, red 0%, blue 30%, black 100%)");
-        RadialGradientBuilder builder =
-                RadialGradientBuilder.create().centerX(0).centerY(0)
-                .focusAngle(0).focusDistance(0)
-                .radius(0.1)
-                .proportional(true)
-                .cycleMethod(CycleMethod.REPEAT)
-                .stops(new Stop(0, Color.RED),
-                       new Stop(.3, Color.BLUE),
-                       new Stop(1.0, Color.BLACK));
-        RadialGradient expected = builder.build();
+        RadialGradient expected = new RadialGradient(
+                0, 0, 0, 0, .1,
+                true, CycleMethod.REPEAT,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
         
         actual =
                 RadialGradient.valueOf("radial-gradient(radius 10%, reflect, red 0%, blue 30%, black 100%)");
-        builder.cycleMethod(CycleMethod.REFLECT);
-        expected = builder.build();
+        expected = new RadialGradient(
+                0, 0, 0, 0, .1,
+                true, CycleMethod.REFLECT,
+                new Stop(0, Color.RED),
+                new Stop(.3, Color.BLUE),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -442,16 +428,12 @@
     public void testValueOfSpecifyAll() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(focus-angle 45deg, focus-distance 20%, center 25% 25%, radius 50%, reflect, gray, darkgray 75%, dimgray)");
-        RadialGradient expected =
-                RadialGradientBuilder.create().centerX(.25).centerY(0.25).radius(0.5)
-                .proportional(true)
-                .cycleMethod(CycleMethod.REFLECT)
-                .focusAngle(45)
-                .focusDistance(0.2)
-                .stops(new Stop(0, Color.GRAY),
-                       new Stop(0.75, Color.DARKGRAY),
-                       new Stop(1.0, Color.DIMGRAY))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                45, .2, .25, .25, .5,
+                true, CycleMethod.REFLECT,
+                new Stop(0, Color.GRAY),
+                new Stop(.75, Color.DARKGRAY),
+                new Stop(1.0, Color.DIMGRAY));
         assertEquals(expected, actual);
     }
 
@@ -459,14 +441,13 @@
     public void testValueOfStopsNormalizeLargerValues() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(radius 10, red  10%, blue 9%, red 8%, black 100%)");
-        RadialGradient expected =
-                RadialGradientBuilder.create().centerX(0).centerY(0).radius(10)
-                .proportional(false)
-                .stops(new Stop(0.1, Color.RED),
-                       new Stop(0.1, Color.BLUE),
-                       new Stop(0.1, Color.RED),
-                       new Stop(1.0, Color.BLACK))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                0, 0, 0, 0, 10,
+                false, CycleMethod.NO_CYCLE,
+                new Stop(0.1, Color.RED),
+                new Stop(0.1, Color.BLUE),
+                new Stop(0.1, Color.RED),
+                new Stop(1.0, Color.BLACK));
         assertEquals(expected, actual);
     }
 
@@ -474,12 +455,11 @@
     public void testValueOfColor() {
         RadialGradient actual =
                 RadialGradient.valueOf("radial-gradient(radius 10, rgb(0,0,255), rgb(255, 0,  0))");
-        RadialGradient expected =
-                RadialGradientBuilder.create().centerX(0).centerY(0).radius(10)
-                .proportional(false)
-                .stops(new Stop(0, Color.BLUE),
-                       new Stop(1.0, Color.RED))
-                .build();
+        RadialGradient expected = new RadialGradient(
+                0, 0, 0, 0, 10,
+                false, CycleMethod.NO_CYCLE,
+                new Stop(0, Color.BLUE),
+                new Stop(1.0, Color.RED));
         assertEquals(expected, actual);
     }
 }
--- a/modules/graphics/src/stub/java/javafx/stage/StageTest.java	Wed Jul 10 22:02:06 2013 -0700
+++ b/modules/graphics/src/stub/java/javafx/stage/StageTest.java	Wed Jul 10 23:46:27 2013 -0700
@@ -25,22 +25,18 @@
 
 package javafx.stage;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertSame;
 import javafx.scene.Group;
 import javafx.scene.Scene;
-import javafx.scene.image.Image;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
 import com.sun.javafx.pgstub.StubStage;
 import com.sun.javafx.pgstub.StubToolkit;
 import com.sun.javafx.pgstub.StubToolkit.ScreenConfiguration;
 import com.sun.javafx.tk.Toolkit;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
 
 public class StageTest {
 
@@ -167,43 +163,6 @@
         assertEquals(3, peer.numTimesSetSizeAndLocation - initialNumTimesSetSizeAndLocation);
     }
 
-    /**
-     * Test that StageBuilder includes all the expected properties (RT-13594, RT-13595).
-     */
-    public @Test void testStageBuilder() {
-        Scene scene = new Scene(new Group());
-        StageBuilder<?> builder = StageBuilder.create();
-        // Usually builder calls are chained but because this is a test we write each one on its own line
-        // so that if one of them fails to compile or throws an exception we can easily see which one it was.
-        builder.focused(false);
-        builder.fullScreen(false);
-        builder.height(100);
-        builder.width(200);
-        builder.iconified(false);
-        builder.icons(new Image[0]);
-        builder.opacity(0.5);
-        builder.resizable(false);
-        builder.title("yes");
-        builder.x(300);
-        builder.y(400);
-        builder.scene(scene);
-
-        Stage stage = builder.build();
-        stage.show();
-        assertFalse(stage.isFocused());
-        assertFalse(stage.isFullScreen());
-        assertEquals(100.0, stage.getHeight(), 0);
-        assertEquals(200.0, stage.getWidth(), 0);
-        assertFalse(stage.isIconified());
-        assertEquals(0, stage.getIcons().size());
-        assertEquals(0.5, stage.getOpacity(), 0);
-        assertEquals(false, stage.isResizable());
-        assertEquals("yes", stage.getTitle());
-        assertEquals(300.0, stage.getX(), 0);
-        assertEquals(400.0, stage.getY(), 0);
-        assertSame(scene, stage.getScene());
-    }
-
     @Test
     public void testSecondCenterOnScreenNotIgnored() {
         s.centerOnScreen();