org.apache.batik.css.dom
Class CSSOMComputedStyle

java.lang.Object
  |
  +--org.apache.batik.css.dom.CSSOMComputedStyle
All Implemented Interfaces:
CSSStyleDeclaration
Direct Known Subclasses:
CSSOMSVGComputedStyle

public class CSSOMComputedStyle
extends java.lang.Object
implements CSSStyleDeclaration

This class represents the computed style of an element.


Inner Class Summary
protected  class CSSOMComputedStyle.ComputedCSSValue
          To manage a computed CSSValue.
 
Field Summary
protected  CSSEngine cssEngine
          The CSS engine used to compute the values.
protected  CSSStylableElement element
          The associated element.
protected  java.lang.String pseudoElement
          The optional pseudo-element.
protected  java.util.Map values
          The CSS values.
 
Constructor Summary
CSSOMComputedStyle(CSSEngine e, CSSStylableElement elt, java.lang.String pseudoElt)
          Creates a new computed style.
 
Method Summary
protected  CSSValue createCSSValue(int idx)
          Creates a CSSValue to manage the value at the given index.
 java.lang.String getCssText()
          DOM: Implements CSSStyleDeclaration.getCssText().
 int getLength()
          DOM: Implements CSSStyleDeclaration.getLength().
 CSSRule getParentRule()
          DOM: Implements CSSStyleDeclaration.getParentRule().
 CSSValue getPropertyCSSValue(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.getPropertyCSSValue(String).
 java.lang.String getPropertyPriority(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.getPropertyPriority(String).
 java.lang.String getPropertyValue(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.getPropertyValue(String).
 java.lang.String item(int index)
          DOM: Implements CSSStyleDeclaration.item(int).
 java.lang.String removeProperty(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.removeProperty(String).
 void setCssText(java.lang.String cssText)
          DOM: Implements CSSStyleDeclaration.setCssText(String).
 void setProperty(java.lang.String propertyName, java.lang.String value, java.lang.String prio)
          DOM: Implements CSSStyleDeclaration.setProperty(String,String,String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cssEngine

protected CSSEngine cssEngine
The CSS engine used to compute the values.

element

protected CSSStylableElement element
The associated element.

pseudoElement

protected java.lang.String pseudoElement
The optional pseudo-element.

values

protected java.util.Map values
The CSS values.
Constructor Detail

CSSOMComputedStyle

public CSSOMComputedStyle(CSSEngine e,
                          CSSStylableElement elt,
                          java.lang.String pseudoElt)
Creates a new computed style.
Method Detail

getCssText

public java.lang.String getCssText()
DOM: Implements CSSStyleDeclaration.getCssText().
Specified by:
getCssText in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Throws:
DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or a property is readonly.

setCssText

public void setCssText(java.lang.String cssText)
                throws DOMException
DOM: Implements CSSStyleDeclaration.setCssText(String). Throws a NO_MODIFICATION_ALLOWED_ERR DOMException.
Specified by:
setCssText in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Throws:
DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or a property is readonly.

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String propertyName)
DOM: Implements CSSStyleDeclaration.getPropertyValue(String).
Specified by:
getPropertyValue in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
Returns the value of the property if it has been explicitly set for this declaration block. Returns the empty string if the property has not been set.

getPropertyCSSValue

public CSSValue getPropertyCSSValue(java.lang.String propertyName)
DOM: Implements CSSStyleDeclaration.getPropertyCSSValue(String).
Specified by:
getPropertyCSSValue in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
Returns the value of the property if it has been explicitly set for this declaration block. Returns null if the property has not been set.

removeProperty

public java.lang.String removeProperty(java.lang.String propertyName)
                                throws DOMException
DOM: Implements CSSStyleDeclaration.removeProperty(String).
Specified by:
removeProperty in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
Returns the value of the property if it has been explicitly set for this declaration block. Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property.
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.

getPropertyPriority

public java.lang.String getPropertyPriority(java.lang.String propertyName)
DOM: Implements CSSStyleDeclaration.getPropertyPriority(String).
Specified by:
getPropertyPriority in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
A string representing the priority (e.g. "important") if one exists. The empty string if none exists.

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.String value,
                        java.lang.String prio)
                 throws DOMException
DOM: Implements CSSStyleDeclaration.setProperty(String,String,String).
Specified by:
setProperty in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
value - The new value of the property.
priority - The new priority of the property (e.g. "important").
Throws:
DOMException - SYNTAX_ERR: Raised if the specified value has a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.

getLength

public int getLength()
DOM: Implements CSSStyleDeclaration.getLength().
Specified by:
getLength in interface CSSStyleDeclaration

item

public java.lang.String item(int index)
DOM: Implements CSSStyleDeclaration.item(int).
Specified by:
item in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
index - Index of the property name to retrieve.
Returns:
The name of the property at this ordinal position. The empty string if no property exists at this position.

getParentRule

public CSSRule getParentRule()
DOM: Implements CSSStyleDeclaration.getParentRule().
Specified by:
getParentRule in interface CSSStyleDeclaration
Returns:
null.

createCSSValue

protected CSSValue createCSSValue(int idx)
Creates a CSSValue to manage the value at the given index.


Copyright © 2002 Apache Software Foundation. All Rights Reserved.