< prev index next >
src/java.desktop/share/classes/javax/swing/text/html/CSS.java
Print this page
*** 733,745 ****
}
}
}
/**
! * Sets the base font size. <code>sz</code> is a CSS value, and is
* not necessarily the point size. Use getPointSize to determine the
! * point size corresponding to <code>sz</code>.
*/
void setBaseFontSize(int sz) {
if (sz < 1)
baseFontSize = 0;
else if (sz > 7)
--- 733,745 ----
}
}
}
/**
! * Sets the base font size. {@code sz} is a CSS value, and is
* not necessarily the point size. Use getPointSize to determine the
! * point size corresponding to {@code sz}.
*/
void setBaseFontSize(int sz) {
if (sz < 1)
baseFontSize = 0;
else if (sz > 7)
*** 773,784 ****
int getBaseFontSize() {
return baseFontSize;
}
/**
! * Parses the CSS property <code>key</code> with value
! * <code>value</code> placing the result in <code>att</code>.
*/
void addInternalCSSValue(MutableAttributeSet attr,
CSS.Attribute key, String value) {
if (key == CSS.Attribute.FONT) {
ShorthandFontParser.parseShorthandFont(this, value, attr);
--- 773,784 ----
int getBaseFontSize() {
return baseFontSize;
}
/**
! * Parses the CSS property {@code key} with value
! * {@code value} placing the result in {@code att}.
*/
void addInternalCSSValue(MutableAttributeSet attr,
CSS.Attribute key, String value) {
if (key == CSS.Attribute.FONT) {
ShorthandFontParser.parseShorthandFont(this, value, attr);
*** 821,833 ****
}
}
}
/**
! * Gets the internal CSS representation of <code>value</code> which is
! * a CSS value of the CSS attribute named <code>key</code>. The receiver
! * should not modify <code>value</code>, and the first <code>count</code>
* strings are valid.
*/
Object getInternalCSSValue(CSS.Attribute key, String value) {
CssValue conv = (CssValue) valueConvertor.get(key);
Object r = conv.parseCssValue(value);
--- 821,833 ----
}
}
}
/**
! * Gets the internal CSS representation of {@code value} which is
! * a CSS value of the CSS attribute named {@code key}. The receiver
! * should not modify {@code value}, and the first {@code count}
* strings are valid.
*/
Object getInternalCSSValue(CSS.Attribute key, String value) {
CssValue conv = (CssValue) valueConvertor.get(key);
Object r = conv.parseCssValue(value);
*** 854,864 ****
return null;
}
/**
* Converts the passed in CSS value to a StyleConstants value.
! * <code>key</code> identifies the CSS attribute being mapped.
*/
Object cssValueToStyleConstantsValue(StyleConstants key, Object value) {
if (value instanceof CssValue) {
return ((CssValue)value).toStyleConstants(key, null);
}
--- 854,864 ----
return null;
}
/**
* Converts the passed in CSS value to a StyleConstants value.
! * {@code key} identifies the CSS attribute being mapped.
*/
Object cssValueToStyleConstantsValue(StyleConstants key, Object value) {
if (value instanceof CssValue) {
return ((CssValue)value).toStyleConstants(key, null);
}
*** 866,876 ****
}
/**
* Returns the font for the values in the passed in AttributeSet.
* It is assumed the keys will be CSS.Attribute keys.
! * <code>sc</code> is the StyleContext that will be messaged to get
* the font once the size, name and style have been determined.
*/
Font getFont(StyleContext sc, AttributeSet a, int defaultSize, StyleSheet ss) {
ss = getStyleSheet(ss);
int size = getFontSize(a, defaultSize, ss);
--- 866,876 ----
}
/**
* Returns the font for the values in the passed in AttributeSet.
* It is assumed the keys will be CSS.Attribute keys.
! * {@code sc} is the StyleContext that will be messaged to get
* the font once the size, name and style have been determined.
*/
Font getFont(StyleContext sc, AttributeSet a, int defaultSize, StyleSheet ss) {
ss = getStyleSheet(ss);
int size = getFontSize(a, defaultSize, ss);
*** 928,938 ****
/**
* Takes a set of attributes and turn it into a color
* specification. This might be used to specify things
* like brighter, more hue, etc.
! * This will return null if there is no value for <code>key</code>.
*
* @param key CSS.Attribute identifying where color is stored.
* @param a the set of attributes
* @return the color
*/
--- 928,938 ----
/**
* Takes a set of attributes and turn it into a color
* specification. This might be used to specify things
* like brighter, more hue, etc.
! * This will return null if there is no value for {@code key}.
*
* @param key CSS.Attribute identifying where color is stored.
* @param a the set of attributes
* @return the color
*/
*** 967,978 ****
}
return 0;
}
/**
! * Returns the length of the attribute in <code>a</code> with
! * key <code>key</code>.
*/
float getLength(AttributeSet a, CSS.Attribute key, StyleSheet ss) {
ss = getStyleSheet(ss);
LengthValue lv = (LengthValue) a.getAttribute(key);
boolean isW3CLengthUnits = (ss == null) ? false : ss.isW3CLengthUnits();
--- 967,978 ----
}
return 0;
}
/**
! * Returns the length of the attribute in {@code a} with
! * key {@code key}.
*/
float getLength(AttributeSet a, CSS.Attribute key, StyleSheet ss) {
ss = getStyleSheet(ss);
LengthValue lv = (LengthValue) a.getAttribute(key);
boolean isW3CLengthUnits = (ss == null) ? false : ss.isW3CLengthUnits();
*** 1234,1266 ****
System.arraycopy(Attribute.allAttributes, 0, keys, 0, Attribute.allAttributes.length);
return keys;
}
/**
! * Translates a string to a <code>CSS.Attribute</code> object.
! * This will return <code>null</code> if there is no attribute
* by the given name.
*
* @param name the name of the CSS attribute to fetch the
* typesafe enumeration for
! * @return the <code>CSS.Attribute</code> object,
! * or <code>null</code> if the string
* doesn't represent a valid attribute key
*/
public static final Attribute getAttribute(String name) {
return attributeMap.get(name);
}
/**
! * Translates a string to a <code>CSS.Value</code> object.
! * This will return <code>null</code> if there is no value
* by the given name.
*
* @param name the name of the CSS value to fetch the
* typesafe enumeration for
! * @return the <code>CSS.Value</code> object,
! * or <code>null</code> if the string
* doesn't represent a valid CSS value name; this does
* not mean that it doesn't represent a valid CSS value
*/
static final Value getValue(String name) {
return valueMap.get(name);
--- 1234,1266 ----
System.arraycopy(Attribute.allAttributes, 0, keys, 0, Attribute.allAttributes.length);
return keys;
}
/**
! * Translates a string to a {@code CSS.Attribute} object.
! * This will return {@code null} if there is no attribute
* by the given name.
*
* @param name the name of the CSS attribute to fetch the
* typesafe enumeration for
! * @return the {@code CSS.Attribute} object,
! * or {@code null} if the string
* doesn't represent a valid attribute key
*/
public static final Attribute getAttribute(String name) {
return attributeMap.get(name);
}
/**
! * Translates a string to a {@code CSS.Value} object.
! * This will return {@code null} if there is no value
* by the given name.
*
* @param name the name of the CSS value to fetch the
* typesafe enumeration for
! * @return the {@code CSS.Value} object,
! * or {@code null} if the string
* doesn't represent a valid CSS value name; this does
* not mean that it doesn't represent a valid CSS value
*/
static final Value getValue(String name) {
return valueMap.get(name);
*** 1271,1281 ****
// Conversion related methods/classes
//
/**
* Returns a URL for the given CSS url string. If relative,
! * <code>base</code> is used as the parent. If a valid URL can not
* be found, this will not throw a MalformedURLException, instead
* null will be returned.
*/
static URL getURL(URL base, String cssString) {
if (cssString == null) {
--- 1271,1281 ----
// Conversion related methods/classes
//
/**
* Returns a URL for the given CSS url string. If relative,
! * {@code base} is used as the parent. If a valid URL can not
* be found, this will not throw a MalformedURLException, instead
* null will be returned.
*/
static URL getURL(URL base, String cssString) {
if (cssString == null) {
*** 1422,1432 ****
color = hexToColor(str); // sometimes get specified without leading #
return color;
}
/**
! * Parses a String in the format <code>rgb(r, g, b)</code> where
* each of the Color components is either an integer, or a floating number
* with a % after indicating a percentage value of 255. Values are
* constrained to fit with 0-255. The resulting Color is returned.
*/
private static Color parseRGB(String string) {
--- 1422,1432 ----
color = hexToColor(str); // sometimes get specified without leading #
return color;
}
/**
! * Parses a String in the format {@code rgb(r, g, b)} where
* each of the Color components is either an integer, or a floating number
* with a % after indicating a percentage value of 255. Values are
* constrained to fit with 0-255. The resulting Color is returned.
*/
private static Color parseRGB(String string) {
*** 1440,1451 ****
return new Color(red, green, blue);
}
/**
! * Returns the next integer value from <code>string</code> starting
! * at <code>index[0]</code>. The value can either can an integer, or
* a percentage (floating number ending with %), in which case it is
* multiplied by 255.
*/
private static int getColorComponent(String string, int[] index) {
int length = string.length();
--- 1440,1451 ----
return new Color(red, green, blue);
}
/**
! * Returns the next integer value from {@code string} starting
! * at {@code index[0]}. The value can either can an integer, or
* a percentage (floating number ending with %), in which case it is
* multiplied by 255.
*/
private static int getColorComponent(String string, int[] index) {
int length = string.length();
*** 1504,1514 ****
return getIndexOfSize(pt, sizeMap);
}
/**
! * @return an array of all the strings in <code>value</code>
* that are separated by whitespace.
*/
static String[] parseStrings(String value) {
int current, last;
int length = (value == null) ? 0 : value.length();
--- 1504,1514 ----
return getIndexOfSize(pt, sizeMap);
}
/**
! * @return an array of all the strings in {@code value}
* that are separated by whitespace.
*/
static String[] parseStrings(String value) {
int current, last;
int length = (value == null) ? 0 : value.length();
*** 1781,1814 ****
Object parseHtmlValue(String value) {
return parseCssValue(value);
}
/**
! * Converts a <code>StyleConstants</code> attribute value to
* a CSS attribute value. If there is no conversion,
! * returns <code>null</code>. By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param value the value of a <code>StyleConstants</code>
* attribute to be converted
* @return the CSS value that represents the
! * <code>StyleConstants</code> value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
return null;
}
/**
* Converts a CSS attribute value to a
! * <code>StyleConstants</code>
* value. If there is no conversion, returns
! * <code>null</code>.
* By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param v the view containing <code>AttributeSet</code>
! * @return the <code>StyleConstants</code> attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return null;
}
--- 1781,1814 ----
Object parseHtmlValue(String value) {
return parseCssValue(value);
}
/**
! * Converts a {@code StyleConstants} attribute value to
* a CSS attribute value. If there is no conversion,
! * returns {@code null}. By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @param value the value of a {@code StyleConstants}
* attribute to be converted
* @return the CSS value that represents the
! * {@code StyleConstants} value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
return null;
}
/**
* Converts a CSS attribute value to a
! * {@code StyleConstants}
* value. If there is no conversion, returns
! * {@code null}.
* By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @param v the view containing {@code AttributeSet}
! * @return the {@code StyleConstants} attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return null;
}
*** 1849,1867 ****
sv.svalue = value;
return sv;
}
/**
! * Converts a <code>StyleConstants</code> attribute value to
* a CSS attribute value. If there is no conversion
! * returns <code>null</code>.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param value the value of a <code>StyleConstants</code>
* attribute to be converted
* @return the CSS value that represents the
! * <code>StyleConstants</code> value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
if (key == StyleConstants.Italic) {
if (value.equals(Boolean.TRUE)) {
return parseCssValue("italic");
--- 1849,1867 ----
sv.svalue = value;
return sv;
}
/**
! * Converts a {@code StyleConstants} attribute value to
* a CSS attribute value. If there is no conversion
! * returns {@code null}.
*
! * @param key the {@code StyleConstants} attribute
! * @param value the value of a {@code StyleConstants}
* attribute to be converted
* @return the CSS value that represents the
! * {@code StyleConstants} value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
if (key == StyleConstants.Italic) {
if (value.equals(Boolean.TRUE)) {
return parseCssValue("italic");
*** 1911,1926 ****
return null;
}
/**
* Converts a CSS attribute value to a
! * <code>StyleConstants</code> value.
! * If there is no conversion, returns <code>null</code>.
* By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @return the <code>StyleConstants</code> attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
if (key == StyleConstants.Italic) {
if (svalue.indexOf("italic") >= 0) {
--- 1911,1926 ----
return null;
}
/**
* Converts a CSS attribute value to a
! * {@code StyleConstants} value.
! * If there is no conversion, returns {@code null}.
* By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @return the {@code StyleConstants} attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
if (key == StyleConstants.Italic) {
if (svalue.indexOf("italic") >= 0) {
*** 2117,2135 ****
}
return fs;
}
/**
! * Converts a <code>StyleConstants</code> attribute value to
* a CSS attribute value. If there is no conversion
! * returns <code>null</code>. By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param value the value of a <code>StyleConstants</code>
* attribute to be converted
* @return the CSS value that represents the
! * <code>StyleConstants</code> value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
if (value instanceof Number) {
FontSize fs = new FontSize();
--- 2117,2135 ----
}
return fs;
}
/**
! * Converts a {@code StyleConstants} attribute value to
* a CSS attribute value. If there is no conversion
! * returns {@code null}. By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @param value the value of a {@code StyleConstants}
* attribute to be converted
* @return the CSS value that represents the
! * {@code StyleConstants} value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
if (value instanceof Number) {
FontSize fs = new FontSize();
*** 2140,2155 ****
}
return parseCssValue(value.toString());
}
/**
! * Converts a CSS attribute value to a <code>StyleConstants</code>
! * value. If there is no conversion, returns <code>null</code>.
* By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @return the <code>StyleConstants</code> attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
if (v != null) {
return Integer.valueOf(getValue(v.getAttributes(), null));
--- 2140,2155 ----
}
return parseCssValue(value.toString());
}
/**
! * Converts a CSS attribute value to a {@code StyleConstants}
! * value. If there is no conversion, returns {@code null}.
* By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @return the {@code StyleConstants} attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
if (v != null) {
return Integer.valueOf(getValue(v.getAttributes(), null));
*** 2228,2258 ****
// TBD
return parseCssValue(value);
}
/**
! * Converts a <code>StyleConstants</code> attribute value to
* a CSS attribute value. If there is no conversion
! * returns <code>null</code>. By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param value the value of a <code>StyleConstants</code>
* attribute to be converted
* @return the CSS value that represents the
! * <code>StyleConstants</code> value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
return parseCssValue(value.toString());
}
/**
! * Converts a CSS attribute value to a <code>StyleConstants</code>
! * value. If there is no conversion, returns <code>null</code>.
* By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @return the <code>StyleConstants</code> attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return family;
}
--- 2228,2258 ----
// TBD
return parseCssValue(value);
}
/**
! * Converts a {@code StyleConstants} attribute value to
* a CSS attribute value. If there is no conversion
! * returns {@code null}. By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @param value the value of a {@code StyleConstants}
* attribute to be converted
* @return the CSS value that represents the
! * {@code StyleConstants} value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
return parseCssValue(value.toString());
}
/**
! * Converts a CSS attribute value to a {@code StyleConstants}
! * value. If there is no conversion, returns {@code null}.
* By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @return the {@code StyleConstants} attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return family;
}
*** 2284,2317 ****
}
return fw;
}
/**
! * Converts a <code>StyleConstants</code> attribute value to
* a CSS attribute value. If there is no conversion
! * returns <code>null</code>. By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param value the value of a <code>StyleConstants</code>
* attribute to be converted
* @return the CSS value that represents the
! * <code>StyleConstants</code> value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
if (value.equals(Boolean.TRUE)) {
return parseCssValue("bold");
}
return parseCssValue("normal");
}
/**
! * Converts a CSS attribute value to a <code>StyleConstants</code>
! * value. If there is no conversion, returns <code>null</code>.
* By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @return the <code>StyleConstants</code> attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return (weight > 500) ? Boolean.TRUE : Boolean.FALSE;
}
--- 2284,2317 ----
}
return fw;
}
/**
! * Converts a {@code StyleConstants} attribute value to
* a CSS attribute value. If there is no conversion
! * returns {@code null}. By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @param value the value of a {@code StyleConstants}
* attribute to be converted
* @return the CSS value that represents the
! * {@code StyleConstants} value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
if (value.equals(Boolean.TRUE)) {
return parseCssValue("bold");
}
return parseCssValue("normal");
}
/**
! * Converts a CSS attribute value to a {@code StyleConstants}
! * value. If there is no conversion, returns {@code null}.
* By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @return the {@code StyleConstants} attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return (weight > 500) ? Boolean.TRUE : Boolean.FALSE;
}
*** 2348,2381 ****
Object parseHtmlValue(String value) {
return parseCssValue(value);
}
/**
! * Converts a <code>StyleConstants</code> attribute value to
* a CSS attribute value. If there is no conversion
! * returns <code>null</code>. By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param value the value of a <code>StyleConstants</code>
* attribute to be converted
* @return the CSS value that represents the
! * <code>StyleConstants</code> value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
ColorValue colorValue = new ColorValue();
colorValue.c = (Color)value;
colorValue.svalue = colorToHex(colorValue.c);
return colorValue;
}
/**
! * Converts a CSS attribute value to a <code>StyleConstants</code>
! * value. If there is no conversion, returns <code>null</code>.
* By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @return the <code>StyleConstants</code> attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return c;
}
--- 2348,2381 ----
Object parseHtmlValue(String value) {
return parseCssValue(value);
}
/**
! * Converts a {@code StyleConstants} attribute value to
* a CSS attribute value. If there is no conversion
! * returns {@code null}. By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @param value the value of a {@code StyleConstants}
* attribute to be converted
* @return the CSS value that represents the
! * {@code StyleConstants} value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
ColorValue colorValue = new ColorValue();
colorValue.c = (Color)value;
colorValue.svalue = colorToHex(colorValue.c);
return colorValue;
}
/**
! * Converts a CSS attribute value to a {@code StyleConstants}
! * value. If there is no conversion, returns {@code null}.
* By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @return the {@code StyleConstants} attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return c;
}
*** 2463,2473 ****
return getValue(0, isW3CLengthUnits);
}
/**
* Returns the length (span) to use. If the value represents
! * a percentage, it is scaled based on <code>currentValue</code>.
*/
float getValue(float currentValue) {
return getValue(currentValue, false);
}
float getValue(float currentValue, boolean isW3CLengthUnits) {
--- 2463,2473 ----
return getValue(0, isW3CLengthUnits);
}
/**
* Returns the length (span) to use. If the value represents
! * a percentage, it is scaled based on {@code currentValue}.
*/
float getValue(float currentValue) {
return getValue(currentValue, false);
}
float getValue(float currentValue, boolean isW3CLengthUnits) {
*** 2527,2560 ****
value = "1";
}
return parseCssValue(value);
}
/**
! * Converts a <code>StyleConstants</code> attribute value to
* a CSS attribute value. If there is no conversion,
! * returns <code>null</code>. By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @param value the value of a <code>StyleConstants</code>
* attribute to be converted
* @return the CSS value that represents the
! * <code>StyleConstants</code> value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
LengthValue v = new LengthValue();
v.svalue = value.toString();
v.span = ((Float)value).floatValue();
return v;
}
/**
! * Converts a CSS attribute value to a <code>StyleConstants</code>
! * value. If there is no conversion, returns <code>null</code>.
* By default, there is no conversion.
*
! * @param key the <code>StyleConstants</code> attribute
! * @return the <code>StyleConstants</code> attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return new Float(getValue(false));
}
--- 2527,2560 ----
value = "1";
}
return parseCssValue(value);
}
/**
! * Converts a {@code StyleConstants} attribute value to
* a CSS attribute value. If there is no conversion,
! * returns {@code null}. By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @param value the value of a {@code StyleConstants}
* attribute to be converted
* @return the CSS value that represents the
! * {@code StyleConstants} value
*/
Object fromStyleConstants(StyleConstants key, Object value) {
LengthValue v = new LengthValue();
v.svalue = value.toString();
v.span = ((Float)value).floatValue();
return v;
}
/**
! * Converts a CSS attribute value to a {@code StyleConstants}
! * value. If there is no conversion, returns {@code null}.
* By default, there is no conversion.
*
! * @param key the {@code StyleConstants} attribute
! * @return the {@code StyleConstants} attribute value that
* represents the CSS attribute value
*/
Object toStyleConstants(StyleConstants key, View v) {
return new Float(getValue(false));
}
*** 2961,2972 ****
* for the other font properties. This expands the properties, placing
* them in the attributeset.
*/
static class ShorthandFontParser {
/**
! * Parses the shorthand font string <code>value</code>, placing the
! * result in <code>attr</code>.
*/
static void parseShorthandFont(CSS css, String value,
MutableAttributeSet attr) {
// font is of the form:
// [ <font-style> || <font-variant> || <font-weight> ]? <font-size>
--- 2961,2972 ----
* for the other font properties. This expands the properties, placing
* them in the attributeset.
*/
static class ShorthandFontParser {
/**
! * Parses the shorthand font string {@code value}, placing the
! * result in {@code attr}.
*/
static void parseShorthandFont(CSS css, String value,
MutableAttributeSet attr) {
// font is of the form:
// [ <font-style> || <font-variant> || <font-weight> ]? <font-size>
*** 3103,3114 ****
/**
* Parses the background property into its intrinsic values.
*/
static class ShorthandBackgroundParser {
/**
! * Parses the shorthand font string <code>value</code>, placing the
! * result in <code>attr</code>.
*/
static void parseShorthandBackground(CSS css, String value,
MutableAttributeSet attr) {
String[] strings = parseStrings(value);
int count = strings.length;
--- 3103,3114 ----
/**
* Parses the background property into its intrinsic values.
*/
static class ShorthandBackgroundParser {
/**
! * Parses the shorthand font string {@code value}, placing the
! * result in {@code attr}.
*/
static void parseShorthandBackground(CSS css, String value,
MutableAttributeSet attr) {
String[] strings = parseStrings(value);
int count = strings.length;
*** 3209,3220 ****
* Used to parser margin and padding.
*/
static class ShorthandMarginParser {
/**
* Parses the shorthand margin/padding/border string
! * <code>value</code>, placing the result in <code>attr</code>.
! * <code>names</code> give the 4 instrinsic property names.
*/
static void parseShorthandMargin(CSS css, String value,
MutableAttributeSet attr,
CSS.Attribute[] names) {
String[] strings = parseStrings(value);
--- 3209,3220 ----
* Used to parser margin and padding.
*/
static class ShorthandMarginParser {
/**
* Parses the shorthand margin/padding/border string
! * {@code value}, placing the result in {@code attr}.
! * {@code names} give the 4 instrinsic property names.
*/
static void parseShorthandMargin(CSS css, String value,
MutableAttributeSet attr,
CSS.Attribute[] names) {
String[] strings = parseStrings(value);
< prev index next >