org.jfree.layouting.input.swing

Class SwingDocumentImport

public class SwingDocumentImport extends 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 StringELEMENT_STYLE_ATTRIBUTE
static StringNAMESPACE
static StringSTYLESHEET
static StringSTYLESHEET_PCDATA
static StringSTYLESHEET_TYPE
Constructor Summary
SwingDocumentImport()
Method Summary
ConverterAttributeSetconvertAttributes(AttributeSet attr, Element context)
protected StringgetElementText(Element element)
Returns the text content of an element.
InputFeedgetFeed()
StringgetNormalizedStyleName(String name)
protected voidhandleElement(Element element)
static voidmain(String[] args)
voidparseDocument(DefaultStyledDocument doc, InputFeed feed)
protected voidprocessDocumentProperties(DefaultStyledDocument document)
Processes the document properties.
protected voidprocessStyleElements(DefaultStyledDocument document)
Processes the style definitions of a styled document.
voidsetFeed(InputFeed feed)

Field Detail

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 Detail

SwingDocumentImport

public SwingDocumentImport()

Method Detail

convertAttributes

public ConverterAttributeSet convertAttributes(AttributeSet attr, Element context)

getElementText

protected String getElementText(Element element)
Returns the text content of an element.

Parameters: element The element containing text.

Returns: The text.

Throws: BadLocationException If the text position is invalid.

getFeed

public InputFeed getFeed()

getNormalizedStyleName

public String getNormalizedStyleName(String name)

handleElement

protected void handleElement(Element element)

main

public static void main(String[] args)

parseDocument

public void parseDocument(DefaultStyledDocument doc, InputFeed feed)

processDocumentProperties

protected void processDocumentProperties(DefaultStyledDocument document)
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)
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)