Package org.apache.batik.css.dom
Class CSSOMValue
- java.lang.Object
-
- org.apache.batik.css.dom.CSSOMValue
-
- All Implemented Interfaces:
org.w3c.dom.css.Counter,org.w3c.dom.css.CSSPrimitiveValue,org.w3c.dom.css.CSSValue,org.w3c.dom.css.CSSValueList,org.w3c.dom.css.Rect,org.w3c.dom.css.RGBColor
- Direct Known Subclasses:
CSSOMComputedStyle.ComputedCSSValue,CSSOMStyleDeclaration.StyleDeclarationValue,SVGStylableElement.PresentationAttributeValue
public class CSSOMValue extends java.lang.Object implements org.w3c.dom.css.CSSPrimitiveValue, org.w3c.dom.css.CSSValueList, org.w3c.dom.css.Counter, org.w3c.dom.css.Rect, org.w3c.dom.css.RGBColorThis class implements theCSSValue,CSSPrimitiveValue,CSSValueListinterfaces.- Version:
- $Id: CSSOMValue.java 1831635 2018-05-15 13:33:47Z ssteiner $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classCSSOMValue.AbstractComponentTo store a component.static classCSSOMValue.AbstractModificationHandlerThis class provides an abstract implementation of a ModificationHandler.protected classCSSOMValue.BlueComponentTo represents a blue component.protected classCSSOMValue.BottomComponentTo represents a bottom component.protected classCSSOMValue.FloatComponentTo store a Float component.protected classCSSOMValue.GreenComponentTo represents a green component.protected classCSSOMValue.LeftComponentTo represents a left component.protected classCSSOMValue.ListComponentTo represents a List component.static interfaceCSSOMValue.ModificationHandlerTo manage the modifications on a CSS value.protected classCSSOMValue.RedComponentTo represents a red component.protected classCSSOMValue.RightComponentTo represents a right component.protected classCSSOMValue.TopComponentTo represents a top component.static interfaceCSSOMValue.ValueProviderTo provides the actual value.
-
Field Summary
Fields Modifier and Type Field Description protected CSSOMValue.BlueComponentblueComponentThe blue component, if this value is a RGBColor.protected CSSOMValue.BottomComponentbottomComponentThe bottom component, if this value is a Rect.protected CSSOMValue.GreenComponentgreenComponentThe green component, if this value is a RGBColor.protected CSSOMValue.ModificationHandlerhandlerThe modifications handler.protected org.w3c.dom.css.CSSValue[]itemsThe list items.protected CSSOMValue.LeftComponentleftComponentThe left component, if this value is a Rect.protected CSSOMValue.RedComponentredComponentThe red component, if this value is a RGBColor.protected CSSOMValue.RightComponentrightComponentThe right component, if this value is a Rect.protected CSSOMValue.TopComponenttopComponentThe top component, if this value is a Rect.protected CSSOMValue.ValueProvidervalueProviderThe associated value.-
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
-
-
Constructor Summary
Constructors Constructor Description CSSOMValue(CSSOMValue.ValueProvider vp)Creates a new CSSOMValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static floatconvertFloatValue(short unitType, Value value)Converts the actual float value to the given unit type.org.w3c.dom.css.CSSPrimitiveValuegetBlue()DOM: ImplementsRGBColor.getBlue().org.w3c.dom.css.CSSPrimitiveValuegetBottom()DOM: ImplementsRect.getBottom().org.w3c.dom.css.CountergetCounterValue()DOM: ImplementsCSSPrimitiveValue.getCounterValue().java.lang.StringgetCssText()DOM: ImplementsCSSValue.getCssText().shortgetCssValueType()DOM: ImplementsCSSValue.getCssValueType().floatgetFloatValue(short unitType)DOM: ImplementsCSSPrimitiveValue.getFloatValue(short).org.w3c.dom.css.CSSPrimitiveValuegetGreen()DOM: ImplementsRGBColor.getGreen().java.lang.StringgetIdentifier()DOM: ImplementsCounter.getIdentifier().org.w3c.dom.css.CSSPrimitiveValuegetLeft()DOM: ImplementsRect.getLeft().intgetLength()DOM: ImplementsCSSValueList.getLength().java.lang.StringgetListStyle()DOM: ImplementsCounter.getListStyle().shortgetPrimitiveType()DOM: ImplementsCSSPrimitiveValue.getPrimitiveType().org.w3c.dom.css.RectgetRectValue()DOM: ImplementsCSSPrimitiveValue.getRectValue().org.w3c.dom.css.CSSPrimitiveValuegetRed()DOM: ImplementsRGBColor.getRed().org.w3c.dom.css.RGBColorgetRGBColorValue()DOM: ImplementsCSSPrimitiveValue.getRGBColorValue().org.w3c.dom.css.CSSPrimitiveValuegetRight()DOM: ImplementsRect.getRight().java.lang.StringgetSeparator()DOM: ImplementsCounter.getSeparator().java.lang.StringgetStringValue()DOM: ImplementsCSSPrimitiveValue.getStringValue().org.w3c.dom.css.CSSPrimitiveValuegetTop()DOM: ImplementsRect.getTop().org.w3c.dom.css.CSSValueitem(int index)DOM: ImplementsCSSValueList.item(int).voidsetCssText(java.lang.String cssText)DOM: ImplementsCSSValue.setCssText(String).voidsetFloatValue(short unitType, float floatValue)DOM: ImplementsCSSPrimitiveValue.setFloatValue(short,float).voidsetModificationHandler(CSSOMValue.ModificationHandler h)Sets the modification handler of this value.voidsetStringValue(short stringType, java.lang.String stringValue)DOM: ImplementsCSSPrimitiveValue.setStringValue(short,String).protected static floattoCentimeters(Value value)Converts the current value into centimeters.protected static floattoDegrees(Value value)Converts the current value into degrees.protected static floattoGradians(Value value)Converts the current value into gradians.protected static floattoHertz(Value value)Converts the current value into Hertz.protected static floattoInches(Value value)Converts the current value into inches.protected static floattokHertz(Value value)Converts 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 floattoPicas(Value value)Converts the current value into picas.protected static floattoPoints(Value value)Converts the current value into points.protected static floattoRadians(Value value)Converts the current value into radians.protected static floattoSeconds(Value value)Converts the current value into seconds.
-
-
-
Field Detail
-
valueProvider
protected CSSOMValue.ValueProvider valueProvider
The associated value.
-
handler
protected CSSOMValue.ModificationHandler handler
The modifications handler.
-
leftComponent
protected CSSOMValue.LeftComponent leftComponent
The left component, if this value is a Rect.
-
rightComponent
protected CSSOMValue.RightComponent rightComponent
The right component, if this value is a Rect.
-
bottomComponent
protected CSSOMValue.BottomComponent bottomComponent
The bottom component, if this value is a Rect.
-
topComponent
protected CSSOMValue.TopComponent topComponent
The top component, if this value is a Rect.
-
redComponent
protected CSSOMValue.RedComponent redComponent
The red component, if this value is a RGBColor.
-
greenComponent
protected CSSOMValue.GreenComponent greenComponent
The green component, if this value is a RGBColor.
-
blueComponent
protected CSSOMValue.BlueComponent blueComponent
The blue component, if this value is a RGBColor.
-
items
protected org.w3c.dom.css.CSSValue[] items
The list items.
-
-
Constructor Detail
-
CSSOMValue
public CSSOMValue(CSSOMValue.ValueProvider vp)
Creates a new CSSOMValue.
-
-
Method Detail
-
setModificationHandler
public void setModificationHandler(CSSOMValue.ModificationHandler h)
Sets the modification handler of this value.
-
getCssText
public java.lang.String getCssText()
DOM: ImplementsCSSValue.getCssText().- Specified by:
getCssTextin interfaceorg.w3c.dom.css.CSSValue
-
setCssText
public void setCssText(java.lang.String cssText) throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSValue.setCssText(String).- Specified by:
setCssTextin interfaceorg.w3c.dom.css.CSSValue- Throws:
org.w3c.dom.DOMException
-
getCssValueType
public short getCssValueType()
DOM: ImplementsCSSValue.getCssValueType().- Specified by:
getCssValueTypein interfaceorg.w3c.dom.css.CSSValue
-
getPrimitiveType
public short getPrimitiveType()
DOM: ImplementsCSSPrimitiveValue.getPrimitiveType().- Specified by:
getPrimitiveTypein interfaceorg.w3c.dom.css.CSSPrimitiveValue
-
setFloatValue
public void setFloatValue(short unitType, float floatValue) throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSPrimitiveValue.setFloatValue(short,float).- Specified by:
setFloatValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Throws:
org.w3c.dom.DOMException
-
getFloatValue
public float getFloatValue(short unitType) throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSPrimitiveValue.getFloatValue(short).- Specified by:
getFloatValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Throws:
org.w3c.dom.DOMException
-
convertFloatValue
public static float convertFloatValue(short unitType, Value value)Converts the actual float value to the given unit type.
-
toCentimeters
protected static float toCentimeters(Value value)
Converts the current value into centimeters.
-
toInches
protected static float toInches(Value value)
Converts the current value into inches.
-
toMillimeters
protected static float toMillimeters(Value value)
Converts the current value into millimeters.
-
toPoints
protected static float toPoints(Value value)
Converts the current value into points.
-
toPicas
protected static float toPicas(Value value)
Converts the current value into picas.
-
toDegrees
protected static float toDegrees(Value value)
Converts the current value into degrees.
-
toRadians
protected static float toRadians(Value value)
Converts the current value into radians.
-
toGradians
protected static float toGradians(Value value)
Converts the current value into gradians.
-
toMilliseconds
protected static float toMilliseconds(Value value)
Converts the current value into milliseconds.
-
toSeconds
protected static float toSeconds(Value value)
Converts the current value into seconds.
-
toHertz
protected static float toHertz(Value value)
Converts the current value into Hertz.
-
tokHertz
protected static float tokHertz(Value value)
Converts the current value into kHertz.
-
setStringValue
public void setStringValue(short stringType, java.lang.String stringValue) throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSPrimitiveValue.setStringValue(short,String).- Specified by:
setStringValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Throws:
org.w3c.dom.DOMException
-
getStringValue
public java.lang.String getStringValue() throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSPrimitiveValue.getStringValue().- Specified by:
getStringValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Throws:
org.w3c.dom.DOMException
-
getCounterValue
public org.w3c.dom.css.Counter getCounterValue() throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSPrimitiveValue.getCounterValue().- Specified by:
getCounterValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Throws:
org.w3c.dom.DOMException
-
getRectValue
public org.w3c.dom.css.Rect getRectValue() throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSPrimitiveValue.getRectValue().- Specified by:
getRectValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Throws:
org.w3c.dom.DOMException
-
getRGBColorValue
public org.w3c.dom.css.RGBColor getRGBColorValue() throws org.w3c.dom.DOMExceptionDOM: ImplementsCSSPrimitiveValue.getRGBColorValue().- Specified by:
getRGBColorValuein interfaceorg.w3c.dom.css.CSSPrimitiveValue- Throws:
org.w3c.dom.DOMException
-
getLength
public int getLength()
DOM: ImplementsCSSValueList.getLength().- Specified by:
getLengthin interfaceorg.w3c.dom.css.CSSValueList
-
item
public org.w3c.dom.css.CSSValue item(int index)
DOM: ImplementsCSSValueList.item(int).- Specified by:
itemin interfaceorg.w3c.dom.css.CSSValueList
-
getIdentifier
public java.lang.String getIdentifier()
DOM: ImplementsCounter.getIdentifier().- Specified by:
getIdentifierin interfaceorg.w3c.dom.css.Counter
-
getListStyle
public java.lang.String getListStyle()
DOM: ImplementsCounter.getListStyle().- Specified by:
getListStylein interfaceorg.w3c.dom.css.Counter
-
getSeparator
public java.lang.String getSeparator()
DOM: ImplementsCounter.getSeparator().- Specified by:
getSeparatorin interfaceorg.w3c.dom.css.Counter
-
getTop
public org.w3c.dom.css.CSSPrimitiveValue getTop()
DOM: ImplementsRect.getTop().- Specified by:
getTopin interfaceorg.w3c.dom.css.Rect
-
getRight
public org.w3c.dom.css.CSSPrimitiveValue getRight()
DOM: ImplementsRect.getRight().- Specified by:
getRightin interfaceorg.w3c.dom.css.Rect
-
getBottom
public org.w3c.dom.css.CSSPrimitiveValue getBottom()
DOM: ImplementsRect.getBottom().- Specified by:
getBottomin interfaceorg.w3c.dom.css.Rect
-
getLeft
public org.w3c.dom.css.CSSPrimitiveValue getLeft()
DOM: ImplementsRect.getLeft().- Specified by:
getLeftin interfaceorg.w3c.dom.css.Rect
-
getRed
public org.w3c.dom.css.CSSPrimitiveValue getRed()
DOM: ImplementsRGBColor.getRed().- Specified by:
getRedin interfaceorg.w3c.dom.css.RGBColor
-
getGreen
public org.w3c.dom.css.CSSPrimitiveValue getGreen()
DOM: ImplementsRGBColor.getGreen().- Specified by:
getGreenin interfaceorg.w3c.dom.css.RGBColor
-
getBlue
public org.w3c.dom.css.CSSPrimitiveValue getBlue()
DOM: ImplementsRGBColor.getBlue().- Specified by:
getBluein interfaceorg.w3c.dom.css.RGBColor
-
-