modules/graphics/src/main/java/com/sun/javafx/css/ParsedValueImpl.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization

@@ -24,11 +24,14 @@
  */
 
 package com.sun.javafx.css;
 
 import javafx.css.ParsedValue;
+import javafx.css.Size;
+import javafx.css.SizeUnits;
 import javafx.css.StyleConverter;
+import javafx.css.StyleConverter.StringStore;
 import javafx.scene.paint.Color;
 import javafx.scene.text.Font;
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;

@@ -44,20 +47,20 @@
      /**
      * If value references another property, then the real value needs to
      * be looked up.
      */
     final private boolean lookup;
-    public final boolean isLookup() { return lookup; }
+    @Override public final boolean isLookup() { return lookup; }
 
     /**
      * If value is itself a ParsedValueImpl or sequence of values, and should any of
      * those values need to be looked up, then this flag is set. This
      * does not mean that this particular value needs to be looked up, but
      * that this value contains a value that needs to be looked up.
      */
     final private boolean containsLookups;
-    public final boolean isContainsLookups() { return containsLookups; }
+    @Override public final boolean isContainsLookups() { return containsLookups; }
 
     private static boolean getContainsLookupsFlag(Object obj) {
 
         // Assume the value does not contain lookups
         boolean containsLookupsFlag = false;

@@ -429,18 +432,15 @@
     public final void writeBinary(DataOutputStream os, StringStore stringStore)
         throws IOException {
 
         os.writeBoolean(lookup);
 
-        if (converter instanceof StyleConverterImpl) {
+        if (converter != null) {
             os.writeBoolean(true);
-            ((StyleConverterImpl)converter).writeBinary(os, stringStore);
+            converter.writeBinary(os, stringStore);
         } else {
             os.writeBoolean(false);
-            if (converter != null) {
-                System.err.println("cannot writeBinary " + converter.getClass().getName());
-            }
         }
 
         if (value instanceof ParsedValue) {
             os.writeByte(VALUE);
             final ParsedValue pv = (ParsedValue)value;

@@ -563,11 +563,11 @@
             throws IOException {
 
         final boolean lookup = is.readBoolean();
         final boolean hasType = is.readBoolean();
 
-        final StyleConverter converter = (hasType) ? StyleConverterImpl.readBinary(is, strings) : null;
+        final StyleConverter converter = (hasType) ? StyleConverter.readBinary(is, strings) : null;
 
         final int valType = is.readByte();
 
         if (valType == VALUE) {
             final ParsedValueImpl value = ParsedValueImpl.readBinary(bssVersion, is, strings);

@@ -683,11 +683,11 @@
             String str = strings[is.readShort()];
             try {
                 URL url = new URL(str);
                 return new ParsedValueImpl(url, converter, lookup);
             } catch (MalformedURLException malf) {
-                throw new InternalError("Excpeption in Value.readBinary: " + malf);
+                throw new InternalError("Exception in Value.readBinary: " + malf);
             }
 
         } else if (valType == NULL_VALUE) {
             return new ParsedValueImpl(null, converter, lookup);