Package org.xhtmlrenderer.css.value
Class FSCssValue
java.lang.Object
org.xhtmlrenderer.css.value.FSCssValue
- All Implemented Interfaces:
org.w3c.dom.css.CSSPrimitiveValue,org.w3c.dom.css.CSSValue
Implementation of a
CSSPrimitiveValue. The main
feature of this class is that on construction, values will be "normalized",
so that color idents (such as 'black') are converted to valid java.awt.Color
strings, and other idents are resolved as possible.- Author:
- empty
-
Field Summary
Fields inherited from interface org.w3c.dom.css.CSSPrimitiveValue
CSS_ATTR, CSS_CM, CSS_COUNTER, CSS_DEG, CSS_DIMENSION, CSS_EMS, CSS_EXS, CSS_GRAD, CSS_HZ, CSS_IDENT, CSS_IN, CSS_KHZ, CSS_MM, CSS_MS, CSS_NUMBER, CSS_PC, CSS_PERCENTAGE, CSS_PT, CSS_PX, CSS_RAD, CSS_RECT, CSS_RGBCOLOR, CSS_S, CSS_STRING, CSS_UNKNOWN, CSS_URIFields inherited from interface org.w3c.dom.css.CSSValue
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST -
Constructor Summary
ConstructorsConstructorDescriptionFSCssValue(org.w3c.dom.css.CSSPrimitiveValue primitive) FSCssValue(org.w3c.dom.css.CSSPrimitiveValue primitive, String newValue) Use a given CSSPrimitiveValue, with an overriding internal text value -
Method Summary
Modifier and TypeMethodDescriptionorg.w3c.dom.css.CounterNot supported.A string representation of the current value.shortA code defining the type of the value as defined above.floatgetFloatValue(short unitType) This method is used to get a float value in a specified unit.static FSCssValuegetNewIdentValue(String identValue) shortThe type of the value as defined by the constants specified above.org.w3c.dom.css.RectNot supported.org.w3c.dom.css.RGBColorNot supported.This method is used to get the string value.voidsetCssText(String cssText) Not supported, class is immutable.voidsetFloatValue(short unitType, float floatValue) Not supported, class is immutable.voidsetStringValue(short stringType, String stringValue) Not supported, class is immutable.toString()Returns the string representation of the instance, in this case, the CSS text value.
-
Constructor Details
-
FSCssValue
public FSCssValue(org.w3c.dom.css.CSSPrimitiveValue primitive) -
FSCssValue
Use a given CSSPrimitiveValue, with an overriding internal text value
-
-
Method Details
-
getNewIdentValue
-
toString
Returns the string representation of the instance, in this case, the CSS text value. -
setCssText
Not supported, class is immutable. Sets the string representation of the current value.- Specified by:
setCssTextin interfaceorg.w3c.dom.css.CSSValue- Parameters:
cssText- The new cssText value
-
setFloatValue
public void setFloatValue(short unitType, float floatValue) Not supported, class is immutable. A method to set the float value with a specified unit.- Specified by:
setFloatValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Parameters:
unitType- The new floatValue valuefloatValue- The new floatValue value
-
setStringValue
Not supported, class is immutable. A method to set the string value with the specified unit.- Specified by:
setStringValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Parameters:
stringType- The new stringValue valuestringValue- The new stringValue value
-
getCssText
A string representation of the current value.- Specified by:
getCssTextin interfaceorg.w3c.dom.css.CSSValue- Returns:
- The _cssText value
-
getCssValueType
public short getCssValueType()A code defining the type of the value as defined above.- Specified by:
getCssValueTypein interfaceorg.w3c.dom.css.CSSValue- Returns:
- The cssValueType value
-
getCounterValue
public org.w3c.dom.css.Counter getCounterValue()Not supported. This method is used to get the Counter value.- Specified by:
getCounterValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Returns:
- The counterValue value
-
getFloatValue
public float getFloatValue(short unitType) This method is used to get a float value in a specified unit.- Specified by:
getFloatValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue
-
getPrimitiveType
public short getPrimitiveType()The type of the value as defined by the constants specified above.- Specified by:
getPrimitiveTypein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Returns:
- The primitiveType value
-
getRectValue
public org.w3c.dom.css.Rect getRectValue()Not supported. This method is used to get the Rect value.- Specified by:
getRectValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Returns:
- The rectValue value
-
getRGBColorValue
public org.w3c.dom.css.RGBColor getRGBColorValue()Not supported. This method is used to get the RGB color.- Specified by:
getRGBColorValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Returns:
- The rGBColorValue value
-
getStringValue
This method is used to get the string value.- Specified by:
getStringValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Returns:
- The stringValue value
-