|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.css.AbstractViewCSS
This class provides an abstract implementation of the
ViewCSS
interface.
Field Summary | |
protected DocumentView |
document
The document of which this object is a view. |
protected MediaList |
media
The media to use for cascading. |
protected java.util.List |
relativeValueResolvers
The relative value resolvers. |
protected SoftDoublyIndexedTable |
styles
The cached computed styles. |
protected CSSStyleSheet |
userAgentStyleSheet
The user-agent style sheet. |
protected CSSStyleSheet |
userStyleSheet
The user style sheet. |
Constructor Summary | |
protected |
AbstractViewCSS(DocumentView doc)
creates a new ViewCSS object. |
Method Summary | |
protected void |
addAuthorStyleSheetProperties(Element e,
java.lang.String pe,
CSSOMReadOnlyStyleDeclaration rd)
Adds the author style sheets properties matching the given element and pseudo-element to the given style declaration. |
protected void |
addInlineStyleProperties(Element e,
java.lang.String pe,
java.net.URL buri,
CSSOMReadOnlyStyleDeclaration rd)
Adds the inline style properties to the given style declaration. |
protected void |
addMatchingRules(CSSRuleList l,
Element e,
java.lang.String pe,
java.net.URL buri,
CSSOMRuleList rl)
Adds the style rules that match the given element and pseudo-element to the given rule list. |
protected void |
addNonCSSPresentationalHints(Element e,
java.lang.String pe,
java.net.URL buri,
CSSOMReadOnlyStyleDeclaration rd)
Adds the non-CSS presentational hints to the given style declaration. |
protected void |
addOverrideStyleProperties(Element e,
java.lang.String pe,
java.net.URL buri,
CSSOMReadOnlyStyleDeclaration rd)
Adds the override style properties to the given style declaration. |
void |
addRelativeValueResolver(RelativeValueResolver rvr)
Adds a resolver to the resolver list. |
protected void |
addUserAgentProperties(Element e,
java.lang.String pe,
CSSOMReadOnlyStyleDeclaration rd)
Adds the user-agent style sheets properties matching the given element and pseudo-element to the given style declaration. |
protected void |
addUserProperties(Element e,
java.lang.String pe,
CSSOMReadOnlyStyleDeclaration rd)
Adds the user style sheets properties matching the given element and pseudo-element to the given style declaration. |
protected void |
computeRelativeValues(Element e,
java.lang.String pe,
CSSOMReadOnlyStyleDeclaration rd)
Computes the relative values in the given style declaration for the given element and pseudo-element. |
CSSOMReadOnlyStyleDeclaration |
computeStyle(Element elt,
java.lang.String pseudoElt)
Computes the cascaded style for the given element and pseudo element. |
void |
dispose()
Clears the caches. |
CSSOMReadOnlyStyleDeclaration |
getCascadedStyle(Element elt,
java.lang.String pseudoElt)
Computes the cascaded style for the given element and pseudo element. |
CSSStyleDeclaration |
getComputedStyle(Element elt,
java.lang.String pseudoElt)
DOM: Implements ViewCSS.getComputedStyle(Element,String) . |
CSSOMReadOnlyStyleDeclaration |
getComputedStyleInternal(Element elt,
java.lang.String pseudoElt)
Internal version of getComputedStyle(). |
DocumentView |
getDocument()
DOM: Implements AbstractView.getDocument() . |
protected boolean |
mediaMatch(MediaList ml)
Whether the given media list matches the media list of this ViewCSS object. |
protected void |
resolveURI(CSSOMReadOnlyValue value,
java.net.URL buri)
If 'value' is an CSS_URI, resolves the value, relative to the given URI. |
protected void |
setAuthorProperty(java.lang.String name,
CSSStyleDeclaration decl,
java.net.URL buri,
CSSOMReadOnlyStyleDeclaration dest)
Sets a author value to a computed style declaration. |
void |
setComputedStyle(Element elt,
java.lang.String pseudoElt,
CSSOMReadOnlyStyleDeclaration sd)
Sets the computed style in the cache in a way it is not collectable. |
void |
setMedia(java.lang.String mediaText)
Sets the media to use to compute the styles. |
protected void |
setUserAgentProperty(java.lang.String name,
CSSStyleDeclaration decl,
CSSOMReadOnlyStyleDeclaration dest)
Sets a user-agent value to a computed style declaration. |
void |
setUserAgentStyleSheet(CSSStyleSheet ss)
Sets the user-agent style sheet to use for cascading. |
protected void |
setUserProperty(java.lang.String name,
CSSStyleDeclaration decl,
CSSOMReadOnlyStyleDeclaration dest)
Sets a user value to a computed style declaration. |
void |
setUserStyleSheet(CSSStyleSheet ss)
Sets the user style sheet to use for cascading. |
protected CSSOMRuleList |
sortRules(CSSOMRuleList l,
Element e,
java.lang.String pe)
Sorts the rules in the given rule list by specificity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DocumentView document
protected SoftDoublyIndexedTable styles
protected MediaList media
protected CSSStyleSheet userAgentStyleSheet
protected CSSStyleSheet userStyleSheet
protected java.util.List relativeValueResolvers
Constructor Detail |
protected AbstractViewCSS(DocumentView doc)
doc
- The document view associated with this abstract view.Method Detail |
public DocumentView getDocument()
AbstractView.getDocument()
.getDocument
in interface AbstractView
public CSSStyleDeclaration getComputedStyle(Element elt, java.lang.String pseudoElt)
ViewCSS.getComputedStyle(Element,String)
.getComputedStyle
in interface ViewCSS
org.w3c.dom.css.ViewCSS
elt
- The element whose style is to be computed. This parameter
cannot be null.pseudoElt
- The pseudo-element or null
if none.CSSStyleDeclaration
is
read-only and contains only absolute values.public CSSOMReadOnlyStyleDeclaration getComputedStyleInternal(Element elt, java.lang.String pseudoElt)
public void setComputedStyle(Element elt, java.lang.String pseudoElt, CSSOMReadOnlyStyleDeclaration sd)
public void dispose()
public void setMedia(java.lang.String mediaText)
mediaText
- The text representation of the media.public void setUserAgentStyleSheet(CSSStyleSheet ss)
public void setUserStyleSheet(CSSStyleSheet ss)
public void addRelativeValueResolver(RelativeValueResolver rvr)
public CSSOMReadOnlyStyleDeclaration computeStyle(Element elt, java.lang.String pseudoElt)
public CSSOMReadOnlyStyleDeclaration getCascadedStyle(Element elt, java.lang.String pseudoElt)
protected void computeRelativeValues(Element e, java.lang.String pe, CSSOMReadOnlyStyleDeclaration rd)
e
- The element to match.pe
- The pseudo-element to match.rd
- The result style declaration.protected void addUserAgentProperties(Element e, java.lang.String pe, CSSOMReadOnlyStyleDeclaration rd)
e
- The element to match.pe
- The pseudo-element to match.rd
- The result style declaration.protected void setUserAgentProperty(java.lang.String name, CSSStyleDeclaration decl, CSSOMReadOnlyStyleDeclaration dest)
name
- The property name.decl
- The style declaration.dest
- The result style declaration.protected void addUserProperties(Element e, java.lang.String pe, CSSOMReadOnlyStyleDeclaration rd)
e
- The element to match.pe
- The pseudo-element to match.rd
- The result style declaration.protected void setUserProperty(java.lang.String name, CSSStyleDeclaration decl, CSSOMReadOnlyStyleDeclaration dest)
name
- The property name.decl
- The style declaration.dest
- The result style declaration.protected void addNonCSSPresentationalHints(Element e, java.lang.String pe, java.net.URL buri, CSSOMReadOnlyStyleDeclaration rd)
e
- The element to match.pe
- The pseudo-element to match.rd
- The result style declaration.protected void addAuthorStyleSheetProperties(Element e, java.lang.String pe, CSSOMReadOnlyStyleDeclaration rd)
e
- The element to match.pe
- The pseudo-element to match.rd
- The result style declaration.protected void addInlineStyleProperties(Element e, java.lang.String pe, java.net.URL buri, CSSOMReadOnlyStyleDeclaration rd)
e
- The element to match.pe
- The pseudo-element to match.buri
- The base uri, if any.rd
- The result style declaration.protected void addOverrideStyleProperties(Element e, java.lang.String pe, java.net.URL buri, CSSOMReadOnlyStyleDeclaration rd)
e
- The element to match.pe
- The pseudo-element to match.buri
- The base uri, if any.rd
- The result style declaration.protected void setAuthorProperty(java.lang.String name, CSSStyleDeclaration decl, java.net.URL buri, CSSOMReadOnlyStyleDeclaration dest)
name
- The property name.decl
- The style declaration.buri
- The base uri, if any.dest
- The result style declaration.protected void resolveURI(CSSOMReadOnlyValue value, java.net.URL buri)
protected void addMatchingRules(CSSRuleList l, Element e, java.lang.String pe, java.net.URL buri, CSSOMRuleList rl)
l
- The input rule list.e
- The element to match.pe
- The pseudo-element to match.buri
- The base uri, if any.rl
- The result rule list.protected CSSOMRuleList sortRules(CSSOMRuleList l, Element e, java.lang.String pe)
l
- The rule list. The list is cleared by the methods.e
- The element to match.pe
- The pseudo-element to match.protected boolean mediaMatch(MediaList ml)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |