src/share/classes/javax/swing/text/html/CSS.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -121,10 +121,11 @@
*
* @author Timothy Prinzing
* @author Scott Violet
* @see StyleSheet
*/
+@SuppressWarnings("serial") // Same-version serialization only
public class CSS implements Serializable {
/**
* Definitions to be used as a key on AttributeSet's
* that might hold CSS attributes. Since this is a
@@ -1561,10 +1562,11 @@
* converts the StyleConstants attribute to a
* CSS.Attribute, and then calls the toStyleConstants
* method to convert the CSS value to a StyleConstants
* value.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
static class CssValue implements Serializable {
/**
* Convert a CSS value string to the internal format
* (for fast processing) used in the attribute sets.
@@ -1639,10 +1641,11 @@
* StyleConstants by default. This class represents the
* value as a string (via the superclass), but
* provides StyleConstants conversion support for the
* CSS attributes that are held as strings.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
static class StringValue extends CssValue {
/**
* Convert a CSS value string to the internal format
* (for fast processing) used in the attribute sets.
@@ -1795,10 +1798,11 @@
* percentage, depending upon the ending of the
* associated string.
* If the type is Integer, the value is specified
* in terms of a size index.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
class FontSize extends CssValue {
/**
* Returns the size in points. This is ultimately
* what we need for the purpose of creating/fetching
@@ -1964,10 +1968,11 @@
float value;
boolean index;
LengthUnit lu;
}
+ @SuppressWarnings("serial") // Same-version serialization only
static class FontFamily extends CssValue {
/**
* Returns the font family to use.
*/
@@ -2061,10 +2066,11 @@
}
String family;
}
+ @SuppressWarnings("serial") // Same-version serialization only
static class FontWeight extends CssValue {
int getValue() {
return weight;
}
@@ -2123,10 +2129,11 @@
}
int weight;
}
+ @SuppressWarnings("serial") // Same-version serialization only
static class ColorValue extends CssValue {
/**
* Returns the color to use.
*/
@@ -2182,10 +2189,11 @@
}
Color c;
}
+ @SuppressWarnings("serial") // Same-version serialization only
static class BorderStyle extends CssValue {
CSS.Value getValue() {
return style;
}
@@ -2234,10 +2242,11 @@
// CSS.Values are static, don't archive it.
transient private CSS.Value style;
}
+ @SuppressWarnings("serial") // Same-version serialization only
static class LengthValue extends CssValue {
/**
* if this length value may be negative.
*/
@@ -2371,10 +2380,11 @@
/**
* BorderWidthValue is used to model BORDER_XXX_WIDTH and adds support
* for the thin/medium/thick values.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
static class BorderWidthValue extends LengthValue {
BorderWidthValue(String svalue, int index) {
this.svalue = svalue;
span = values[index];
percentage = false;
@@ -2410,10 +2420,11 @@
/**
* Handles uniquing of CSS values, like lists, and background image
* repeating.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
static class CssValueMapper extends CssValue {
Object parseCssValue(String value) {
Object retValue = cssValueToInternalValueMap.get(value);
if (retValue == null) {
retValue = cssValueToInternalValueMap.get(value.toLowerCase());
@@ -2433,10 +2444,11 @@
/**
* Used for background images, to represent the position.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
static class BackgroundPosition extends CssValue {
float horizontalPosition;
float verticalPosition;
// bitmask: bit 0, horizontal relative, bit 1 horizontal relative to
// font size, 2 vertical relative to size, 3 vertical relative to
@@ -2578,10 +2590,11 @@
/**
* Used for BackgroundImages.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
static class BackgroundImage extends CssValue {
private boolean loadedImage;
private ImageIcon image;
Object parseCssValue(String value) {
@@ -2617,10 +2630,11 @@
/**
* Parses a length value, this is used internally, and never added
* to an AttributeSet or returned to the developer.
*/
+ @SuppressWarnings("serial") // Same-version serialization only
static class LengthUnit implements Serializable {
static Hashtable<String, Float> lengthMapping = new Hashtable<String, Float>(6);
static Hashtable<String, Float> w3cLengthMapping = new Hashtable<String, Float>(6);
static {
lengthMapping.put("pt", new Float(1f));