Package org.xhtmlrenderer.context
Class StyleReference
- java.lang.Object
-
- org.xhtmlrenderer.context.StyleReference
-
public class StyleReference extends java.lang.Object
- Author:
- Torbj�rn Gannholm
-
-
Constructor Summary
Constructors Constructor Description StyleReference(UserAgentCallback userAgent)
Default constructor for initializing members.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flushAllStyleSheets()
void
flushStyleSheets()
Flushes any stylesheet associated with this stylereference (based on the user agent callback) that are in cache.java.util.Map
getCascadedPropertiesMap(org.w3c.dom.Element e)
Returns a Map keyed by CSS property names (e.g.CascadedStyle
getCascadedStyle(org.w3c.dom.Element e, boolean restyle)
Gets the CascadedStyle for an element.java.util.List
getFontFaceRules()
PageInfo
getPageStyle(java.lang.String pageName, java.lang.String pseudoPage)
CascadedStyle
getPseudoElementStyle(org.w3c.dom.Node node, java.lang.String pseudoElement)
Gets the pseudoElementStyle attribute of the StyleReference objectboolean
isHoverStyled(org.w3c.dom.Element e)
Description of the Methodvoid
removeStyle(org.w3c.dom.Element e)
void
setDocumentContext(SharedContext context, NamespaceHandler nsh, org.w3c.dom.Document doc, UserInterface ui)
Sets the documentContext attribute of the StyleReference objectvoid
setSupportCMYKColors(boolean b)
void
setUserAgentCallback(UserAgentCallback userAgentCallback)
-
-
-
Constructor Detail
-
StyleReference
public StyleReference(UserAgentCallback userAgent)
Default constructor for initializing members.- Parameters:
userAgent
- PARAM
-
-
Method Detail
-
setDocumentContext
public void setDocumentContext(SharedContext context, NamespaceHandler nsh, org.w3c.dom.Document doc, UserInterface ui)
Sets the documentContext attribute of the StyleReference object- Parameters:
context
- The new documentContext valuensh
- The new documentContext valuedoc
- The new documentContext valueui
-
-
isHoverStyled
public boolean isHoverStyled(org.w3c.dom.Element e)
Description of the Method- Parameters:
e
- PARAM- Returns:
- Returns
-
getCascadedPropertiesMap
public java.util.Map getCascadedPropertiesMap(org.w3c.dom.Element e)
Returns a Map keyed by CSS property names (e.g. 'border-width'), and the assigned value as a SAC CSSValue instance. The properties should have been matched to the element when the Context was established for this StyleReference on the Document to which the Element belongs. Seeorg.xhtmlrenderer.swing.BasicPanel#setDocument(Document, java.net.URL)
for an example of how to establish a StyleReference and associate to a Document.- Parameters:
e
- The DOM Element for which to find properties- Returns:
- Map of CSS property names to CSSValue instance assigned to it.
-
getPseudoElementStyle
public CascadedStyle getPseudoElementStyle(org.w3c.dom.Node node, java.lang.String pseudoElement)
Gets the pseudoElementStyle attribute of the StyleReference object- Parameters:
node
- PARAMpseudoElement
- PARAM- Returns:
- The pseudoElementStyle value
-
getCascadedStyle
public CascadedStyle getCascadedStyle(org.w3c.dom.Element e, boolean restyle)
Gets the CascadedStyle for an element. This must then be converted in the current context to a CalculatedStyle (use getDerivedStyle)- Parameters:
e
- The elementrestyle
-- Returns:
- The style value
-
getPageStyle
public PageInfo getPageStyle(java.lang.String pageName, java.lang.String pseudoPage)
-
flushStyleSheets
public void flushStyleSheets()
Flushes any stylesheet associated with this stylereference (based on the user agent callback) that are in cache.
-
flushAllStyleSheets
public void flushAllStyleSheets()
-
removeStyle
public void removeStyle(org.w3c.dom.Element e)
-
getFontFaceRules
public java.util.List getFontFaceRules()
-
setUserAgentCallback
public void setUserAgentCallback(UserAgentCallback userAgentCallback)
-
setSupportCMYKColors
public void setSupportCMYKColors(boolean b)
-
-