|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.parser.style.AbstractCSSValue | +--org.apache.batik.parser.style.CSSFloatValue
This class represents CSS float values
Field Summary | |
protected float |
floatValue
The float value |
protected static java.lang.String[] |
UNITS
The unit types representations |
protected short |
unitType
The unit type |
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 | |
CSSFloatValue(short unitType,
float floatValue)
Creates a new value. |
Method Summary | |
java.lang.String |
getCssText()
DOM: Implements CSSValue.getCssText() . |
short |
getCssValueType()
DOM: Implements CSSValue.getCssValueType() . |
float |
getFloatValue(short unitType)
DOM: Implements CSSPrimitiveValue.getFloatValue(short) . |
short |
getPrimitiveType()
DOM: Implements CSSPrimitiveValue.getPrimitiveType() . |
protected java.lang.String |
getUnitRepresentation(short unitType)
Returns the representation for the given unit type. |
protected float |
toCentimeters()
Converts the current value into centimeters. |
protected float |
toDegrees()
Converts the current value into degrees. |
protected float |
toGradians()
Converts the current value into gradians. |
protected float |
toHertz()
Converts the current value into Hertz. |
protected float |
toInches()
Converts the current value into inches. |
protected float |
tokHertz()
Converts the current value into kHertz. |
protected float |
toMillimeters()
Converts the current value into millimeters. |
protected float |
toMilliseconds()
Converts the current value into milliseconds. |
protected float |
toPicas()
Converts the current value into picas. |
protected float |
toPoints()
Converts the current value into points. |
protected float |
toRadians()
Converts the current value into radians. |
protected float |
toSeconds()
Converts the current value into seconds. |
Methods inherited from class org.apache.batik.parser.style.AbstractCSSValue |
getCounterValue, getLength, getRectValue, getRGBColorValue, getStringValue, item, setCssText, setFloatValue, setStringValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String[] UNITS
protected float floatValue
protected short unitType
Constructor Detail |
public CSSFloatValue(short unitType, float floatValue)
Method Detail |
public short getCssValueType()
CSSValue.getCssValueType()
.public short getPrimitiveType()
CSSPrimitiveValue.getPrimitiveType()
.getPrimitiveType
in class AbstractCSSValue
public java.lang.String getCssText()
CSSValue.getCssText()
.org.w3c.dom.css.CSSValue
DOMException
- SYNTAX_ERR: Raised if the specified CSS string value has a syntax
error (according to the attached property) or is unparsable.
public float getFloatValue(short unitType) throws DOMException
CSSPrimitiveValue.getFloatValue(short)
.getFloatValue
in class AbstractCSSValue
org.w3c.dom.css.CSSPrimitiveValue
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
).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.protected java.lang.String getUnitRepresentation(short unitType) throws DOMException
unitType
- The unit type like specified in the CSSPrimitiveValue
interface.protected float toCentimeters()
protected float toInches()
protected float toMillimeters()
protected float toPoints()
protected float toPicas()
protected float toDegrees()
protected float toRadians()
protected float toGradians()
protected float toMilliseconds()
protected float toSeconds()
protected float toHertz()
protected float tokHertz()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |