org.apache.batik.css
Class CSSOMValue
java.lang.Object
|
+--org.apache.batik.css.CSSOMValue
- All Implemented Interfaces:
- CSSPrimitiveValue, CSSValue, CSSValueList
- Direct Known Subclasses:
- SVGCSSValue
- public class CSSOMValue
- extends java.lang.Object
- implements CSSPrimitiveValue, CSSValueList
This class implements the CSSValue
,
CSSPrimitiveValue
,
CSSValueList
interfaces.
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 |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
value
protected ImmutableValue value
- The value implementation.
factory
protected ValueFactory factory
- The value factory
listener
protected CSSValueChangeListener listener
- The value change listener.
CSSOMValue
public CSSOMValue(ValueFactory vf,
ImmutableValue v)
- Creates a new CSS value.
setCSSValueChangeListener
public void setCSSValueChangeListener(CSSValueChangeListener listener)
- Associates a listener to this value.
getImmutableValue
public ImmutableValue getImmutableValue()
- Returns the underlying immutable value.
createReadOnlyCopy
public CSSOMReadOnlyValue createReadOnlyCopy()
- Returns a read-only copy of this value.
equals
public boolean equals(java.lang.Object obj)
- Indicates whether some other object is "equal to" this one.
- Overrides:
equals
in class java.lang.Object
- Parameters:
obj
- the reference object with which to compare.
getCssText
public java.lang.String getCssText()
- DOM: Implements
CSSValue.getCssText()
.
- Specified by:
getCssText
in interface CSSValue
- Following copied from interface:
org.w3c.dom.css.CSSValue
- Throws:
DOMException
- SYNTAX_ERR: Raised if the specified CSS string value has a syntax
error (according to the attached property) or is unparsable.
INVALID_MODIFICATION_ERR: Raised if the specified CSS string
value represents a different type of values than the values allowed
by the CSS property.
NO_MODIFICATION_ALLOWED_ERR: Raised if this value is readonly.
setCssText
public void setCssText(java.lang.String cssText)
throws DOMException
- DOM: Implements
CSSValue.setCssText(String)
.
- Specified by:
setCssText
in interface CSSValue
- Following copied from interface:
org.w3c.dom.css.CSSValue
- Throws:
DOMException
- SYNTAX_ERR: Raised if the specified CSS string value has a syntax
error (according to the attached property) or is unparsable.
INVALID_MODIFICATION_ERR: Raised if the specified CSS string
value represents a different type of values than the values allowed
by the CSS property.
NO_MODIFICATION_ALLOWED_ERR: Raised if this value is readonly.
getCssValueType
public short getCssValueType()
- DOM: Implements
CSSValue.getCssValueType()
.
- Specified by:
getCssValueType
in interface CSSValue
getPrimitiveType
public short getPrimitiveType()
- DOM: Implements
CSSPrimitiveValue.getPrimitiveType()
.
- Specified by:
getPrimitiveType
in interface CSSPrimitiveValue
setFloatValue
public void setFloatValue(short unitType,
float floatValue)
throws DOMException
- DOM: Implements
CSSPrimitiveValue.setFloatValue(short,float)
.
- Specified by:
setFloatValue
in interface CSSPrimitiveValue
- Following copied from interface:
org.w3c.dom.css.CSSPrimitiveValue
- Parameters:
unitType
- 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.- Throws:
DOMException
- INVALID_ACCESS_ERR: Raised if the attached property doesn't support
the float value or the unit type.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
getFloatValue
public float getFloatValue(short unitType)
throws DOMException
- DOM: Implements
CSSPrimitiveValue.getFloatValue(short)
.
- Specified by:
getFloatValue
in interface CSSPrimitiveValue
- Following copied from interface:
org.w3c.dom.css.CSSPrimitiveValue
- Parameters:
unitType
- 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
).- Returns:
- The float value in the specified unit.
- Throws:
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.
setStringValue
public void setStringValue(short stringType,
java.lang.String stringValue)
throws DOMException
- DOM: Implements
CSSPrimitiveValue.setStringValue(short,String)
.
- Specified by:
setStringValue
in interface CSSPrimitiveValue
- Following copied from interface:
org.w3c.dom.css.CSSPrimitiveValue
- Parameters:
stringType
- 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.- Throws:
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.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
getStringValue
public java.lang.String getStringValue()
throws DOMException
- DOM: Implements
CSSPrimitiveValue.getStringValue()
.
- Specified by:
getStringValue
in interface CSSPrimitiveValue
- Following copied from interface:
org.w3c.dom.css.CSSPrimitiveValue
- Returns:
- The string value in the current unit. The current
primitiveType
can only be a string unit type (i.e.
CSS_STRING
, CSS_URI
,
CSS_IDENT
and CSS_ATTR
). - Throws:
DOMException
- INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string
value.
getCounterValue
public Counter getCounterValue()
throws DOMException
- DOM: Implements
CSSPrimitiveValue.getCounterValue()
.
- Specified by:
getCounterValue
in interface CSSPrimitiveValue
- Following copied from interface:
org.w3c.dom.css.CSSPrimitiveValue
- Returns:
- The Counter value.
- Throws:
DOMException
- INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a
Counter value (e.g. this is not CSS_COUNTER
).
getRectValue
public Rect getRectValue()
throws DOMException
- DOM: Implements
CSSPrimitiveValue.getRectValue()
.
- Specified by:
getRectValue
in interface CSSPrimitiveValue
- Following copied from interface:
org.w3c.dom.css.CSSPrimitiveValue
- Returns:
- The Rect value.
- Throws:
DOMException
- INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect
value. (e.g. this is not CSS_RECT
).
getRGBColorValue
public RGBColor getRGBColorValue()
throws DOMException
- DOM: Implements
CSSPrimitiveValue.getRGBColorValue()
.
- Specified by:
getRGBColorValue
in interface CSSPrimitiveValue
- Following copied from interface:
org.w3c.dom.css.CSSPrimitiveValue
- Returns:
- the RGB color value.
- Throws:
DOMException
- INVALID_ACCESS_ERR: Raised if the attached property can't return a
RGB color value (e.g. this is not CSS_RGBCOLOR
).
getLength
public int getLength()
- DOM: Implements
CSSValueList.getLength()
.
- Specified by:
getLength
in interface CSSValueList
item
public CSSValue item(int index)
- DOM: Implements
CSSValueList.item(int)
.
- Specified by:
item
in interface CSSValueList
- Following copied from interface:
org.w3c.dom.css.CSSValueList
- Parameters:
index
- Index into the collection.- Returns:
- The
CSSValue
at the index
position
in the CSSValueList
, or null
if that is
not a valid index.
Copyright © 2001 Apache Software Foundation. All Rights Reserved.