Package org.jfree.layouting.input.swing
Class SwingDocumentImport
- java.lang.Object
-
- org.jfree.layouting.input.swing.SwingDocumentImport
-
public class SwingDocumentImport extends java.lang.ObjectRight now, we do not convert Swing-styles into CSS styles. Hey, we should, but we don't. todo parse styles
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringELEMENT_STYLE_ATTRIBUTEstatic java.lang.StringNAMESPACEstatic java.lang.StringSTYLESHEETstatic java.lang.StringSTYLESHEET_PCDATAstatic java.lang.StringSTYLESHEET_TYPE
-
Constructor Summary
Constructors Constructor Description SwingDocumentImport()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConverterAttributeSetconvertAttributes(javax.swing.text.AttributeSet attr, javax.swing.text.Element context)protected java.lang.StringgetElementText(javax.swing.text.Element element)Returns the text content of an element.InputFeedgetFeed()java.lang.StringgetNormalizedStyleName(java.lang.String name)protected voidhandleElement(javax.swing.text.Element element)static voidmain(java.lang.String[] args)voidparseDocument(javax.swing.text.DefaultStyledDocument doc, InputFeed feed)protected voidprocessDocumentProperties(javax.swing.text.DefaultStyledDocument document)Processes the document properties.protected voidprocessStyleElements(javax.swing.text.DefaultStyledDocument document)Processes the style definitions of a styled document.voidsetFeed(InputFeed feed)
-
-
-
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
-
-
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.BadLocationExceptionInputFeedException
-
getElementText
protected java.lang.String getElementText(javax.swing.text.Element element) throws javax.swing.text.BadLocationExceptionReturns 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 InputFeedExceptionProcesses 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 InputFeedExceptionProcesses 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.BadLocationExceptionInputFeedException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, javax.swing.text.BadLocationException, InputFeedException- Throws:
java.io.IOExceptionjavax.swing.text.BadLocationExceptionInputFeedException
-
-