java.lang.Object
io.sf.carte.echosvg.css.dom.CSSOMValue
- All Implemented Interfaces:
CSSValue,CSSVal,Value,Serializable,Cloneable,CSSStyleValue
- Direct Known Subclasses:
CSSOMComputedStyle.ComputedCSSValue,CSSOMStyleDeclaration.StyleDeclarationValue,SVGStylableElement.PresentationAttributeValue
This class implements the
CSSStyleValue
interface.
Original author Stephane Hillion
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceTo provide the actual value.Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSValue
CSSValue.CssType, CSSValue.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ValueModificationHandlerThe modifications handler.protected CSSOMValue.ValueProviderThe associated value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Create and return a copy of this object.static floatconvertFloatValue(short unitType, Value value) Converts the actual float value to the given unit type.If this value is a color value, get it.If this value is a counter() or counters() value, get it.DOM: ImplementsCSSValue.getCssText().floatConvenience method that either returns the float value, if the value is numeric, or throws an exception.Convenience method that either returns an identifier or throws an exception.intIf this value is a list or contains components, the number ofCSSStyleValues in the list.Get the modification handler.If this value is a rect() value, get it.If this value can be used where a string is expected, get the value.shortGets the css unit as in CSS4J'sCSSUnit.Convenience method that either returns a String or URI or throws an exception.booleanisIdentifier(String internedIdent) Do this value represent the given identifier?item(int index) If this value is a list, give the item corresponding to the requested index.iterator()If this value is a list, return an iterator.voidsetCssText(String cssText) voidsetFloatValue(float floatValue) If this value is a unit value, set the float value.voidSets the modification handler of this value.protected static floattoCentimeters(Value value) Converts the current value into centimeters.protected static floatConverts the current value into degrees.protected static floattoGradians(Value value) Converts the current value into gradians.protected static floatConverts the current value into Hertz.protected static floatConverts the current value into inches.protected static floatConverts the current value into kHertz.protected static floattoMillimeters(Value value) Converts the current value into millimeters.protected static floattoMilliseconds(Value value) Converts the current value into milliseconds.protected static floatConverts the current value into picas.protected static floatConverts the current value into points.protected static floatConverts the current value into radians.protected static floatConverts the current value into seconds.toString()Serializes this value.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.sf.carte.echosvg.css.engine.value.CSSVal
matches, writeCssTextMethods inherited from interface io.sf.carte.doc.style.css.CSSValue
getMinifiedCssText, getMinifiedCssText, getPrecedingComments, getTrailingComments, isPrimitiveValueMethods inherited from interface io.sf.carte.echosvg.css.engine.value.Value
getIdentifier, isComponent
-
Field Details
-
valueProvider
The associated value. -
handler
The modifications handler.
-
-
Constructor Details
-
CSSOMValue
Creates a new CSSOMValue.
-
-
Method Details
-
setModificationHandler
Sets the modification handler of this value.- Specified by:
setModificationHandlerin interfaceValue- Parameters:
h- the modification handler.
-
getCssText
DOM: ImplementsCSSValue.getCssText().- Specified by:
getCssTextin interfaceCSSValue
-
setCssText
- Specified by:
setCssTextin interfaceCSSValue- Throws:
DOMException
-
getCssValueType
- Specified by:
getCssValueTypein interfaceCSSValue
-
getPrimitiveType
- Specified by:
getPrimitiveTypein interfaceCSSValue
-
setFloatValue
Description copied from interface:ValueIf this value is a unit value, set the float value.- Specified by:
setFloatValuein interfaceValue- Parameters:
floatValue- the new value, in the current unit.- Throws:
DOMException- if the value is not a unit value.
-
getFloatValue
Description copied from interface:CSSValConvenience method that either returns the float value, if the value is numeric, or throws an exception.- Specified by:
getFloatValuein interfaceCSSVal- Returns:
- the float value.
- Throws:
DOMException
-
convertFloatValue
Converts the actual float value to the given unit type. -
toCentimeters
Converts the current value into centimeters. -
toInches
Converts the current value into inches. -
toMillimeters
Converts the current value into millimeters. -
toPoints
Converts the current value into points. -
toPicas
Converts the current value into picas. -
toDegrees
Converts the current value into degrees. -
toRadians
Converts the current value into radians. -
toGradians
Converts the current value into gradians. -
toMilliseconds
Converts the current value into milliseconds. -
toSeconds
Converts the current value into seconds. -
toHertz
Converts the current value into Hertz. -
tokHertz
Converts the current value into kHertz. -
getIdentifierValue
Description copied from interface:CSSValConvenience method that either returns an identifier or throws an exception.- Specified by:
getIdentifierValuein interfaceCSSVal- Throws:
DOMException- INVALID_ACCESS_ERR: Raised if the value doesn't contain an identifier value.
-
isIdentifier
Description copied from interface:ValueDo this value represent the given identifier?- Specified by:
isIdentifierin interfaceValue- Parameters:
internedIdent- the interned identifier string.- Returns:
trueif the value is a component.
-
getUnitType
public short getUnitType()Description copied from interface:ValueGets the css unit as in CSS4J'sCSSUnit.If the value has no valid CSS unit, returns
CSSUnit.CSS_INVALID.- Specified by:
getUnitTypein interfaceValue- Returns:
- the css unit as in CSS4J's
CSSUnit.
-
getStringValue
Description copied from interface:CSSValIf this value can be used where a string is expected, get the value.- Specified by:
getStringValuein interfaceCSSVal- Returns:
- the string value, without the commas.
- Throws:
DOMException- INVALID_ACCESS_ERR: Raised if the value doesn't contain a String.
-
getModificationHandler
Description copied from interface:ValueGet the modification handler.- Specified by:
getModificationHandlerin interfaceValue- Returns:
- the modification handler, or
nullif there is no handler.
-
getURIValue
Description copied from interface:CSSValConvenience method that either returns a String or URI or throws an exception.- Specified by:
getURIValuein interfaceCSSVal- Throws:
DOMException- INVALID_ACCESS_ERR: Raised if the value doesn't contain a String nor a URI value.
-
getCounterValue
Description copied from interface:ValueIf this value is a counter() or counters() value, get it.- Specified by:
getCounterValuein interfaceValue- Returns:
- the counter() value.
- Throws:
DOMException- INVALID_ACCESS_ERR if this is not a counter() or counters() value.
-
getRectValue
Description copied from interface:ValueIf this value is a rect() value, get it.- Specified by:
getRectValuein interfaceValue- Returns:
- the rect() value.
- Throws:
DOMException- INVALID_ACCESS_ERR if this is not a rect() value.
-
getColorValue
Description copied from interface:ValueIf this value is a color value, get it.- Specified by:
getColorValuein interfaceValue- Returns:
- the color value.
- Throws:
DOMException- INVALID_ACCESS_ERR if this is not a color value.
-
getLength
public int getLength()Description copied from interface:CSSValIf this value is a list or contains components, the number ofCSSStyleValues in the list. The range of valid values of the indices is0tolength-1inclusive. -
item
Description copied from interface:ValueIf this value is a list, give the item corresponding to the requested index. If there is no item at such index, returnnullIf this object is not a list and the index is0, return itself. -
iterator
Description copied from interface:ValueIf this value is a list, return an iterator.- Specified by:
iteratorin interfaceValue- Returns:
- the iterator.
- Throws:
UnsupportedOperationException- if this value is not a list.
-
toString
Description copied from interface:CSSStyleValueSerializes this value.- Specified by:
toStringin interfaceCSSStyleValue- Overrides:
toStringin classObject- Returns:
- a parsable representation of this value.
-
clone
Description copied from interface:ValueCreate and return a copy of this object.If this object is unmodifiable, the clone will be modifiable.
-