org.jfree.layouting.input.swing

Class SwingDocumentImport


public class SwingDocumentImport
extends java.lang.Object

Right now, we do not convert Swing-styles into CSS styles. Hey, we should, but we don't.

todo parse styles

Field Summary

static String
ELEMENT_STYLE_ATTRIBUTE
static String
NAMESPACE
static String
STYLESHEET
static String
STYLESHEET_PCDATA
static String
STYLESHEET_TYPE

Constructor Summary

SwingDocumentImport()

Method Summary

ConverterAttributeSet
convertAttributes(AttributeSet attr, Element context)
protected String
getElementText(Element element)
Returns the text content of an element.
InputFeed
getFeed()
String
getNormalizedStyleName(String name)
protected void
handleElement(Element element)
static void
main(String[] args)
void
parseDocument(DefaultStyledDocument doc, InputFeed feed)
protected void
processDocumentProperties(DefaultStyledDocument document)
Processes the document properties.
protected void
processStyleElements(DefaultStyledDocument document)
Processes the style definitions of a styled document.
void
setFeed(InputFeed feed)

Field Details

ELEMENT_STYLE_ATTRIBUTE

public static final String ELEMENT_STYLE_ATTRIBUTE

NAMESPACE

public static final String NAMESPACE

STYLESHEET

public static final String STYLESHEET

STYLESHEET_PCDATA

public static final String STYLESHEET_PCDATA

STYLESHEET_TYPE

public static final String STYLESHEET_TYPE

Constructor Details

SwingDocumentImport

public SwingDocumentImport()

Method Details

convertAttributes

public ConverterAttributeSet convertAttributes(AttributeSet attr,
                                               Element context)
            throws InputFeedException

getElementText

protected String getElementText(Element element)
            throws BadLocationException
Returns the text content of an element.
Parameters:
element - The element containing text.
Returns:
The text.

getFeed

public InputFeed getFeed()

getNormalizedStyleName

public String getNormalizedStyleName(String name)

handleElement

protected void handleElement(Element element)
            throws BadLocationException,
                   InputFeedException

main

public static void main(String[] args)
            throws IOException,
                   BadLocationException,
                   InputFeedException

parseDocument

public void parseDocument(DefaultStyledDocument doc,
                          InputFeed feed)
            throws BadLocationException,
                   InputFeedException

processDocumentProperties

protected void processDocumentProperties(DefaultStyledDocument document)
            throws InputFeedException
Processes the document properties. These properties defined once for the whole document.
Parameters:
document - The document source.
Throws:
InputFeedException - If a problem occured with the feed.

processStyleElements

protected void processStyleElements(DefaultStyledDocument document)
            throws InputFeedException
Processes the style definitions of a styled document. Style definitions are declared once in the document and are reused by styled elements.
Parameters:
document - The source document.
Throws:
InputFeedException - If a problem occured with the feed.

setFeed

public void setFeed(InputFeed feed)