|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.layouting.normalizer.content.ContentNormalizer
public class ContentNormalizer
This class is responsible for normalizing content from the 'content' style property and for hiding content that has 'display:none' set. The ContentNormalizer also resolves all styles for elements.
Pagebreaks are determined in the model-builder or the layouter. A pagebreak is only activated if it affects a line-box; the normalizer has no information about lineboxes and therefore cannot perform any pagebreak computation at all. Todo: Content that has been ignored because there was no 'content:contents' definition for it, should have this content moved into the '::alternate' pseudo-element. This one can be used to build footnotes and other fancy stuff. More todo: Quote-Level cannot be resolved, until the content has been processed by the renderer. The Quote-Tokens need to be passed down to the renderer unchanged; they need the defined quotes for the current element when being printed. The language is currently unresolved. It needs to be takes from the parent context or the xml:lang attribute. Resolving the language using stylesheets does not work, as there is a language-matching rule which depends on that value. Todo: DisplayNone does not remove the element from the document tree. Quote: The element is not rendered. The rendering is the same as if the element had been removed from the document tree, except for possible effects on counters (see [generated] or [paged]). [generated]: An element that is not displayed ('display' set to 'none') cannot increment or reset a counter. Note that :before and :after pseudo elements of this element are also not rendered, see [generated].)
Nested Class Summary | |
---|---|
protected static class |
ContentNormalizer.ContentNormalizerState
|
Constructor Summary | |
---|---|
|
ContentNormalizer(LayoutProcess layoutProcess)
|
protected |
ContentNormalizer(LayoutProcess layoutProcess,
boolean init)
|
Method Summary | |
---|---|
void |
addText(java.lang.String text)
Adds text content to the current element. |
protected ContentNormalizer.ContentNormalizerState |
createSaveState()
|
void |
endDocument()
Ends the document. |
void |
endElement()
Ends the current element. |
protected void |
fillState(ContentNormalizer.ContentNormalizerState state)
|
protected void |
generateAfterPseudoElements(LayoutElement element)
|
protected boolean |
generateBeforePseudoElements(LayoutElement element)
|
protected void |
generateContentAfter(LayoutElement element)
|
protected boolean |
generateContentBefore(LayoutElement element)
|
protected void |
generateStrings(LayoutElement element)
|
Renderer |
getRenderer()
Returns the renderer. |
StyleResolver |
getStyleResolver()
|
void |
handlePageBreak(CSSValue pageName,
PseudoPage[] pseudoPages)
|
protected void |
restore(ContentNormalizer.ContentNormalizerState state)
|
State |
saveState()
|
void |
startDocument()
Start document is the first call to the normalizer. |
void |
startElement(java.lang.String namespace,
java.lang.String tag,
AttributeMap attributes)
Starts a new element. |
protected void |
startElementInternal(java.lang.String namespace,
java.lang.String tag,
java.lang.String pseudo,
AttributeMap attributes)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentNormalizer(LayoutProcess layoutProcess)
protected ContentNormalizer(LayoutProcess layoutProcess, boolean init)
Method Detail |
---|
public void startDocument() throws java.io.IOException, NormalizationException
Normalizer
startDocument
in interface Normalizer
java.io.IOException
NormalizationException
public void startElement(java.lang.String namespace, java.lang.String tag, AttributeMap attributes) throws NormalizationException, java.io.IOException
startElement
in interface Normalizer
namespace
- tag
- attributes
-
NormalizationException
java.io.IOException
protected void startElementInternal(java.lang.String namespace, java.lang.String tag, java.lang.String pseudo, AttributeMap attributes) throws NormalizationException, java.io.IOException
NormalizationException
java.io.IOException
protected boolean generateBeforePseudoElements(LayoutElement element) throws java.io.IOException, NormalizationException
java.io.IOException
NormalizationException
protected boolean generateContentBefore(LayoutElement element) throws java.io.IOException, NormalizationException
java.io.IOException
NormalizationException
protected void generateContentAfter(LayoutElement element) throws java.io.IOException, NormalizationException
java.io.IOException
NormalizationException
protected void generateStrings(LayoutElement element) throws java.io.IOException, NormalizationException
java.io.IOException
NormalizationException
protected void generateAfterPseudoElements(LayoutElement element) throws java.io.IOException, NormalizationException
java.io.IOException
NormalizationException
public void addText(java.lang.String text) throws NormalizationException, java.io.IOException
addText
in interface Normalizer
text
-
NormalizationException
java.io.IOException
public void endElement() throws NormalizationException, java.io.IOException
endElement
in interface Normalizer
NormalizationException
java.io.IOException
public void endDocument() throws java.io.IOException, NormalizationException
Normalizer
endDocument
in interface Normalizer
java.io.IOException
NormalizationException
public void handlePageBreak(CSSValue pageName, PseudoPage[] pseudoPages)
handlePageBreak
in interface Normalizer
protected ContentNormalizer.ContentNormalizerState createSaveState()
protected void fillState(ContentNormalizer.ContentNormalizerState state) throws StateException
StateException
public State saveState() throws StateException
saveState
in interface StatefullComponent
StateException
protected void restore(ContentNormalizer.ContentNormalizerState state) throws StateException
StateException
public Renderer getRenderer()
getRenderer
in interface Normalizer
public StyleResolver getStyleResolver()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |