diff -r 9bca30471396 src/com/sun/stylesheet/javafx/FXObjectStyleSupport.java --- a/src/com/sun/stylesheet/javafx/FXObjectStyleSupport.java Tue Nov 18 09:06:03 2008 -0800 +++ b/src/com/sun/stylesheet/javafx/FXObjectStyleSupport.java Sat Dec 13 16:20:50 2008 -0500 @@ -91,13 +91,35 @@ import java.util.WeakHashMap; */ public class FXObjectStyleSupport implements StyleSupport { static FXContext reflect = FXContext.getInstance(); - private static FXClassType GROUP = reflect.findClass("javafx.scene.Group"); - private static FXClassType CONTROL = reflect.findClass("javafx.scene.control.Control"); - private static FXClassType SCENE = reflect.findClass("javafx.scene.Scene"); - private static FXClassType NODE = reflect.findClass("javafx.scene.Node"); - private static FXClassType CUSTOM_NODE = reflect.findClass("javafx.scene.CustomNode"); + final private static FXClassType GROUP = reflect.findClass("javafx.scene.Group"); + final private static FXClassType CONTROL = reflect.findClass("javafx.scene.control.Control"); + final private static FXClassType SCENE = reflect.findClass("javafx.scene.Scene"); + final private static FXClassType NODE = reflect.findClass("javafx.scene.Node"); + final private static FXClassType CUSTOM_NODE = reflect.findClass("javafx.scene.CustomNode"); - + final private static ObjectLiteralConverter OBJECT_LITERAL_CONVERTER = new ObjectLiteralConverter(); + final private static FXType FXTYPE_SKIN = new FXType("javafx.scene.control.Skin"); + final private static SkinConverter SKIN_CONVERTER = new SkinConverter(); + final private static FXType FXTYPE_PAINT = new FXType("javafx.scene.paint.Paint"); + + final private static TypeConverter PAINT_CONVERTER; + final private static FXType FXTYPE_COLOR = new FXType("javafx.scene.paint.Color"); + final private static com.sun.stylesheet.javafx.ColorConverter COLOR_CONVERTER = new com.sun.stylesheet.javafx.ColorConverter(); + final private static FXType FXTYPE_FONT = new FXType("javafx.scene.text.Font"); + final private static FontConverter FONT_CONVERTER = new FontConverter(); + final private static com.sun.stylesheet.javafx.ColorInterpolator COLOR_INTERPRETER = new com.sun.stylesheet.javafx.ColorInterpolator(); + final private static FXType LINEAR_GRADIENT = new FXType("javafx.scene.paint.LinearGradient"); + final private static com.sun.stylesheet.javafx.LinearGradientInterpolator LINEAR_GRADIENT_INTERPOLATOR = new com.sun.stylesheet.javafx.LinearGradientInterpolator(); + + static { + try { + PAINT_CONVERTER = (TypeConverter) Class.forName("com.sun.stylesheet.javafx.PaintConverter").newInstance(); + } + catch (Exception e) { + throw new RuntimeException(e); + } + } + /** * All class names which selectors should match. */ @@ -119,19 +141,20 @@ public class FXObjectStyleSupport implem public static void registerTypeManagerSupport() { try { TypeManager.registerTypeConverter(TypeManager.getType(com.sun.javafx.runtime.FXObject.class), - new ObjectLiteralConverter()); - TypeManager.registerTypeConverter(new FXType("javafx.scene.control.Skin"), - new SkinConverter()); - TypeManager.registerTypeConverter(new FXType("javafx.scene.paint.Paint"), - (TypeConverter) Class.forName("com.sun.stylesheet.javafx.PaintConverter").newInstance()); - TypeManager.registerTypeConverter(new FXType("javafx.scene.paint.Color"), - new com.sun.stylesheet.javafx.ColorConverter()); - TypeManager.registerTypeConverter(new FXType("javafx.scene.text.Font"), - new FontConverter()); - TypeManager.registerInterpolator(new FXType("javafx.scene.paint.Color"), - new com.sun.stylesheet.javafx.ColorInterpolator()); - TypeManager.registerInterpolator(new FXType("javafx.scene.paint.LinearGradient"), - new com.sun.stylesheet.javafx.LinearGradientInterpolator()); + OBJECT_LITERAL_CONVERTER); //new ObjectLiteralConverter()); + TypeManager.registerTypeConverter(FXTYPE_SKIN, //new FXType("javafx.scene.control.Skin"), + SKIN_CONVERTER); //new SkinConverter()); + TypeManager.registerTypeConverter(FXTYPE_PAINT, //new FXType("javafx.scene.paint.Paint"), + //(TypeConverter) Class.forName("com.sun.stylesheet.javafx.PaintConverter").newInstance()); + PAINT_CONVERTER); + TypeManager.registerTypeConverter(FXTYPE_COLOR, //new FXType("javafx.scene.paint.Color"), + COLOR_CONVERTER);//new com.sun.stylesheet.javafx.ColorConverter()); + TypeManager.registerTypeConverter(FXTYPE_FONT,//new FXType("javafx.scene.text.Font"), + FONT_CONVERTER);//new FontConverter()); + TypeManager.registerInterpolator(FXTYPE_COLOR,//new FXType("javafx.scene.paint.Color"), + COLOR_INTERPRETER);//new com.sun.stylesheet.javafx.ColorInterpolator()); + TypeManager.registerInterpolator(LINEAR_GRADIENT,//new FXType("javafx.scene.paint.LinearGradient"), + LINEAR_GRADIENT_INTERPOLATOR);//new com.sun.stylesheet.javafx.LinearGradientInterpolator()); TypeManager.registerStyleSupport(TypeManager.getType(com.sun.javafx.runtime.FXObject.class), FXObjectStyleSupport.class); }