|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.steadystate.css.dom.CSSValueImpl
public class CSSValueImpl
The CSSValueImpl class can represent either a
CSSPrimitiveValue or a CSSValueList so that
the type can successfully change when using setCssText.
TO DO:
Float unit conversions,
A means of checking valid primitive types for properties
| 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_URI |
| Fields inherited from interface org.w3c.dom.css.CSSValue |
|---|
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST |
| Constructor Summary | |
|---|---|
CSSValueImpl(LexicalUnit value)
|
|
CSSValueImpl(LexicalUnit value,
boolean forcePrimitive)
Constructor |
|
| Method Summary | |
|---|---|
Counter |
getCounterValue()
This method is used to get the Counter value. |
java.lang.String |
getCssText()
A string representation of the current value. |
short |
getCssValueType()
A code defining the type of the value as defined above. |
float |
getFloatValue(short unitType)
This method is used to get a float value in a specified unit. |
int |
getLength()
The number of CSSValues in the list. |
short |
getPrimitiveType()
The type of the value as defined by the constants specified above. |
Rect |
getRectValue()
This method is used to get the Rect value. |
RGBColor |
getRGBColorValue()
This method is used to get the RGB color. |
java.lang.String |
getStringValue()
TODO: return a value for a list type |
CSSValue |
item(int index)
Used to retrieve a CSSValue by ordinal index. |
void |
setCssText(java.lang.String cssText)
|
void |
setFloatValue(short unitType,
float floatValue)
A method to set the float value with a specified unit. |
void |
setStringValue(short stringType,
java.lang.String stringValue)
A method to set the string value with the specified unit. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CSSValueImpl(LexicalUnit value,
boolean forcePrimitive)
public CSSValueImpl(LexicalUnit value)
| Method Detail |
|---|
public java.lang.String getCssText()
CSSValue
getCssText in interface CSSValue
public void setCssText(java.lang.String cssText)
throws org.w3c.dom.DOMException
setCssText in interface CSSValueorg.w3c.dom.DOMExceptionpublic short getCssValueType()
CSSValue
getCssValueType in interface CSSValuepublic short getPrimitiveType()
CSSPrimitiveValue
getPrimitiveType in interface CSSPrimitiveValue
public void setFloatValue(short unitType,
float floatValue)
throws org.w3c.dom.DOMException
CSSPrimitiveValueDOMException will be raised.
setFloatValue in interface CSSPrimitiveValueunitType - A unit code as defined above. The unit code can only
be a float unit type (i.e. CSS_NUMBER,
CSS_PERCENTAGE, CSS_EMS,
CSS_EXS, CSS_PX, CSS_CM,
CSS_MM, CSS_IN, CSS_PT,
CSS_PC, CSS_DEG, CSS_RAD,
CSS_GRAD, CSS_MS, CSS_S,
CSS_HZ, CSS_KHZ,
CSS_DIMENSION).floatValue - The new float value.
org.w3c.dom.DOMException - INVALID_ACCESS_ERR: Raised if the attached property doesn't support
the float value or the unit type.
public float getFloatValue(short unitType)
throws org.w3c.dom.DOMException
CSSPrimitiveValueDOMException is raised.
getFloatValue in interface CSSPrimitiveValueunitType - A unit code to get the float value. The unit code can
only be a float unit type (i.e. CSS_NUMBER,
CSS_PERCENTAGE, CSS_EMS,
CSS_EXS, CSS_PX, CSS_CM,
CSS_MM, CSS_IN, CSS_PT,
CSS_PC, CSS_DEG, CSS_RAD,
CSS_GRAD, CSS_MS, CSS_S,
CSS_HZ, CSS_KHZ,
CSS_DIMENSION).
org.w3c.dom.DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float
value or if the float value can't be converted into the specified
unit.
public void setStringValue(short stringType,
java.lang.String stringValue)
throws org.w3c.dom.DOMException
CSSPrimitiveValueDOMException will be raised.
setStringValue in interface CSSPrimitiveValuestringType - A string code as defined above. The string code can
only be a string unit type (i.e. CSS_STRING,
CSS_URI, CSS_IDENT, and
CSS_ATTR).stringValue - The new string value.
org.w3c.dom.DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string
value or if the string value can't be converted into the specified
unit.
public java.lang.String getStringValue()
throws org.w3c.dom.DOMException
getStringValue in interface CSSPrimitiveValueprimitiveType can only be a string unit type (i.e.
CSS_STRING, CSS_URI,
CSS_IDENT and CSS_ATTR).
org.w3c.dom.DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string
value.
public Counter getCounterValue()
throws org.w3c.dom.DOMException
CSSPrimitiveValueDOMException is
raised. Modification to the corresponding style property can be
achieved using the Counter interface.
getCounterValue in interface CSSPrimitiveValueorg.w3c.dom.DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a
Counter value (e.g. this is not CSS_COUNTER).
public Rect getRectValue()
throws org.w3c.dom.DOMException
CSSPrimitiveValueDOMException is raised.
Modification to the corresponding style property can be achieved
using the Rect interface.
getRectValue in interface CSSPrimitiveValueorg.w3c.dom.DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect
value. (e.g. this is not CSS_RECT).
public RGBColor getRGBColorValue()
throws org.w3c.dom.DOMException
CSSPrimitiveValueDOMException is raised.
Modification to the corresponding style property can be achieved
using the RGBColor interface.
getRGBColorValue in interface CSSPrimitiveValueorg.w3c.dom.DOMException - INVALID_ACCESS_ERR: Raised if the attached property can't return a
RGB color value (e.g. this is not CSS_RGBCOLOR).public int getLength()
CSSValueListCSSValues in the list. The range of valid
values of the indices is 0 to length-1
inclusive.
getLength in interface CSSValueListpublic CSSValue item(int index)
CSSValueListCSSValue by ordinal index. The order in
this collection represents the order of the values in the CSS style
property. If index is greater than or equal to the number of values
in the list, this returns null.
item in interface CSSValueListCSSValue at the index position
in the CSSValueList, or null if that is
not a valid index.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||