src/share/classes/javax/swing/text/html/CSS.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2008, 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 --- 1,7 ---- /* ! * 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,130 **** --- 121,131 ---- * * @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,1570 **** --- 1562,1572 ---- * 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,1648 **** --- 1641,1651 ---- * 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,1804 **** --- 1798,1808 ---- * 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,1973 **** --- 1968,1978 ---- float value; boolean index; LengthUnit lu; } + @SuppressWarnings("serial") // Same-version serialization only static class FontFamily extends CssValue { /** * Returns the font family to use. */
*** 2061,2070 **** --- 2066,2076 ---- } String family; } + @SuppressWarnings("serial") // Same-version serialization only static class FontWeight extends CssValue { int getValue() { return weight; }
*** 2123,2132 **** --- 2129,2139 ---- } int weight; } + @SuppressWarnings("serial") // Same-version serialization only static class ColorValue extends CssValue { /** * Returns the color to use. */
*** 2182,2191 **** --- 2189,2199 ---- } Color c; } + @SuppressWarnings("serial") // Same-version serialization only static class BorderStyle extends CssValue { CSS.Value getValue() { return style; }
*** 2234,2243 **** --- 2242,2252 ---- // 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,2380 **** --- 2380,2390 ---- /** * 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,2419 **** --- 2420,2430 ---- /** * 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,2442 **** --- 2444,2454 ---- /** * 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,2587 **** --- 2590,2600 ---- /** * 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,2626 **** --- 2630,2640 ---- /** * 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));