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,34 ****
--- 24,37 ----
*/
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,63 ****
/**
* If value references another property, then the real value needs to
* be looked up.
*/
final private boolean lookup;
! 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; }
private static boolean getContainsLookupsFlag(Object obj) {
// Assume the value does not contain lookups
boolean containsLookupsFlag = false;
--- 47,66 ----
/**
* If value references another property, then the real value needs to
* be looked up.
*/
final private boolean 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;
! @Override public final boolean isContainsLookups() { return containsLookups; }
private static boolean getContainsLookupsFlag(Object obj) {
// Assume the value does not contain lookups
boolean containsLookupsFlag = false;
*** 429,446 ****
public final void writeBinary(DataOutputStream os, StringStore stringStore)
throws IOException {
os.writeBoolean(lookup);
! if (converter instanceof StyleConverterImpl) {
os.writeBoolean(true);
! ((StyleConverterImpl)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;
--- 432,446 ----
public final void writeBinary(DataOutputStream os, StringStore stringStore)
throws IOException {
os.writeBoolean(lookup);
! if (converter != null) {
os.writeBoolean(true);
! converter.writeBinary(os, stringStore);
} else {
os.writeBoolean(false);
}
if (value instanceof ParsedValue) {
os.writeByte(VALUE);
final ParsedValue pv = (ParsedValue)value;
*** 563,573 ****
throws IOException {
final boolean lookup = is.readBoolean();
final boolean hasType = is.readBoolean();
! final StyleConverter converter = (hasType) ? StyleConverterImpl.readBinary(is, strings) : null;
final int valType = is.readByte();
if (valType == VALUE) {
final ParsedValueImpl value = ParsedValueImpl.readBinary(bssVersion, is, strings);
--- 563,573 ----
throws IOException {
final boolean lookup = is.readBoolean();
final boolean hasType = is.readBoolean();
! 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,693 ****
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);
}
} else if (valType == NULL_VALUE) {
return new ParsedValueImpl(null, converter, lookup);
--- 683,693 ----
String str = strings[is.readShort()];
try {
URL url = new URL(str);
return new ParsedValueImpl(url, converter, lookup);
} catch (MalformedURLException malf) {
! throw new InternalError("Exception in Value.readBinary: " + malf);
}
} else if (valType == NULL_VALUE) {
return new ParsedValueImpl(null, converter, lookup);