org.jfree.layouting.input.swing
Class SwingDocumentImport

java.lang.Object
  extended by org.jfree.layouting.input.swing.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 java.lang.String ELEMENT_STYLE_ATTRIBUTE
           
static java.lang.String NAMESPACE
           
static java.lang.String STYLESHEET
           
static java.lang.String STYLESHEET_PCDATA
           
static java.lang.String STYLESHEET_TYPE
           
 
Constructor Summary
SwingDocumentImport()
           
 
Method Summary
 ConverterAttributeSet convertAttributes(javax.swing.text.AttributeSet attr, javax.swing.text.Element context)
           
protected  java.lang.String getElementText(javax.swing.text.Element element)
          Returns the text content of an element.
 InputFeed getFeed()
           
 java.lang.String getNormalizedStyleName(java.lang.String name)
           
protected  void handleElement(javax.swing.text.Element element)
           
static void main(java.lang.String[] args)
           
 void parseDocument(javax.swing.text.DefaultStyledDocument doc, InputFeed feed)
           
protected  void processDocumentProperties(javax.swing.text.DefaultStyledDocument document)
          Processes the document properties.
protected  void processStyleElements(javax.swing.text.DefaultStyledDocument document)
          Processes the style definitions of a styled document.
 void setFeed(InputFeed feed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final java.lang.String NAMESPACE
See Also:
Constant Field Values

STYLESHEET_TYPE

public static final java.lang.String STYLESHEET_TYPE
See Also:
Constant Field Values

STYLESHEET_PCDATA

public static final java.lang.String STYLESHEET_PCDATA
See Also:
Constant Field Values

STYLESHEET

public static final java.lang.String STYLESHEET
See Also:
Constant Field Values

ELEMENT_STYLE_ATTRIBUTE

public static final java.lang.String ELEMENT_STYLE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

SwingDocumentImport

public SwingDocumentImport()
Method Detail

getFeed

public InputFeed getFeed()

setFeed

public void setFeed(InputFeed feed)

getNormalizedStyleName

public java.lang.String getNormalizedStyleName(java.lang.String name)

convertAttributes

public ConverterAttributeSet convertAttributes(javax.swing.text.AttributeSet attr,
                                               javax.swing.text.Element context)
                                        throws InputFeedException
Throws:
InputFeedException

handleElement

protected void handleElement(javax.swing.text.Element element)
                      throws javax.swing.text.BadLocationException,
                             InputFeedException
Throws:
javax.swing.text.BadLocationException
InputFeedException

getElementText

protected java.lang.String getElementText(javax.swing.text.Element element)
                                   throws javax.swing.text.BadLocationException
Returns the text content of an element.

Parameters:
element - The element containing text.
Returns:
The text.
Throws:
javax.swing.text.BadLocationException - If the text position is invalid.

processStyleElements

protected void processStyleElements(javax.swing.text.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.

processDocumentProperties

protected void processDocumentProperties(javax.swing.text.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.

parseDocument

public void parseDocument(javax.swing.text.DefaultStyledDocument doc,
                          InputFeed feed)
                   throws javax.swing.text.BadLocationException,
                          InputFeedException
Throws:
javax.swing.text.BadLocationException
InputFeedException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        javax.swing.text.BadLocationException,
                        InputFeedException
Throws:
java.io.IOException
javax.swing.text.BadLocationException
InputFeedException