org.jfree.layouting.layouter.style.resolver

Class DefaultStyleResolver

Implemented Interfaces:
StatefullComponent, StyleResolver

public class DefaultStyleResolver
extends AbstractStyleResolver

A cascading style resolver. This resolver follows the cascading rules as outlined by the Cascading Stylesheet Standard.
Author:
Thomas Morgner

Nested Class Summary

Nested classes/interfaces inherited from class org.jfree.layouting.layouter.style.resolver.AbstractStyleResolver

AbstractStyleResolver.AbstractStyleResolverState

Constructor Summary

DefaultStyleResolver()

Method Summary

StyleResolver
deriveInstance()
void
initialize(LayoutProcess layoutProcess)
boolean
isPseudoElementStyleResolvable(LayoutElement element, String pseudo)
Performs tests, whether there is a pseudo-element definition for the given element.
protected void
resolveOutOfContext(LayoutElement element)
LayoutStyle
resolvePageStyle(CSSValue pageName, PseudoPage[] pseudoPages, PageAreaType pageArea)
void
resolveStyle(LayoutElement element)
Resolves the style.
State
saveState()

Methods inherited from class org.jfree.layouting.layouter.style.resolver.AbstractStyleResolver

containsAttrFunction, copyStyleInformation, createAnonymousContext, fillState, getDocumentContext, getInitialStyle, getKeys, getLayoutProcess, getNamespaces, initialize, loadInitialStyle, resolveOutOfContext, resolveValue

Constructor Details

DefaultStyleResolver

public DefaultStyleResolver()

Method Details

deriveInstance

public StyleResolver deriveInstance()
Specified by:
deriveInstance in interface StyleResolver

initialize

public void initialize(LayoutProcess layoutProcess)
Specified by:
initialize in interface StyleResolver
Overrides:
initialize in interface AbstractStyleResolver

isPseudoElementStyleResolvable

public boolean isPseudoElementStyleResolvable(LayoutElement element,
                                              String pseudo)
Performs tests, whether there is a pseudo-element definition for the given element. The element itself can be a pseudo-element as well.
Specified by:
isPseudoElementStyleResolvable in interface StyleResolver
Parameters:
element -
pseudo -
Returns:

resolveOutOfContext

protected void resolveOutOfContext(LayoutElement element)
Overrides:
resolveOutOfContext in interface AbstractStyleResolver

resolvePageStyle

public LayoutStyle resolvePageStyle(CSSValue pageName,
                                    PseudoPage[] pseudoPages,
                                    PageAreaType pageArea)
Specified by:
resolvePageStyle in interface StyleResolver

resolveStyle

public void resolveStyle(LayoutElement element)
Resolves the style. This is guaranteed to be called in the order of the document elements traversing the document tree using the 'deepest-node-first' strategy. (8% just for the first class calls (not counting the calls comming from resolveAnonymous (which is another 6%))
Specified by:
resolveStyle in interface StyleResolver
Parameters:
element - the elemen that should be resolved.

saveState

public State saveState()
            throws StateException
Specified by:
saveState in interface StatefullComponent