javax.swing.text.rtf
Class RTFReader.DocumentDestination

java.lang.Object
  extended byjavax.swing.text.rtf.RTFReader.AttributeTrackingDestination
      extended byjavax.swing.text.rtf.RTFReader.TextHandlingDestination
          extended byjavax.swing.text.rtf.RTFReader.DocumentDestination
All Implemented Interfaces:
RTFReader.Destination
Enclosing class:
RTFReader

class RTFReader.DocumentDestination
extends RTFReader.TextHandlingDestination
implements RTFReader.Destination

RTFReader.DocumentDestination is a concrete subclass of TextHandlingDestination which appends the text to the StyledDocument given by the target ivar of the containing RTFReader.


Field Summary
(package private)  MutableAttributeSet characterAttributes
          This is the "chr" element of parserState, cached for more efficient use
(package private)  boolean inParagraph
          true if the reader has not just finished a paragraph; false upon startup
(package private)  MutableAttributeSet paragraphAttributes
          This is the "pgf" element of parserState, cached for more efficient use
(package private)  MutableAttributeSet sectionAttributes
          This is the "sec" element of parserState, cached for more efficient use
 
Constructor Summary
(package private) RTFReader.DocumentDestination()
           
 
Method Summary
 void begingroup()
           
protected  void beginParagraph()
           
 void close()
           
(package private)  MutableAttributeSet currentParagraphAttributes()
          Calculates the current paragraph attributes (with keys as given in StyleConstants) from the current parser state.
 AttributeSet currentSectionAttributes()
          Calculates the current section attributes from the current parser state.
(package private)  MutableAttributeSet currentTextAttributes()
          Calculates the current text (character) attributes in a form suitable for SwingText from the current parser state.
 void deliverText(String text, AttributeSet characterAttributes)
           
 void endgroup(Dictionary oldState)
           
protected  void endParagraph()
           
 void endSection()
           
 void finishParagraph(AttributeSet pgfAttributes, AttributeSet chrAttributes)
           
 void handleBinaryBlob(byte[] data)
           
 boolean handleKeyword(String keyword)
           
 boolean handleKeyword(String keyword, int parameter)
           
 void handleText(String text)
           
protected  void resetCharacterAttributes()
          Resets the filter's internal notion of the current character attributes to their default values.
protected  void resetParagraphAttributes()
          Resets the filter's internal notion of the current paragraph's attributes to their default values.
protected  void resetSectionAttributes()
          Resets the filter's internal notion of the current section's attributes to their default values.
protected  MutableAttributeSet rootCharacterAttributes()
          Returns a new MutableAttributeSet containing the default character attributes
protected  MutableAttributeSet rootParagraphAttributes()
          Returns a new MutableAttributeSet containing the default paragraph attributes
protected  MutableAttributeSet rootSectionAttributes()
          Returns a new MutableAttributeSet containing the default section attributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inParagraph

boolean inParagraph
true if the reader has not just finished a paragraph; false upon startup


characterAttributes

MutableAttributeSet characterAttributes
This is the "chr" element of parserState, cached for more efficient use


paragraphAttributes

MutableAttributeSet paragraphAttributes
This is the "pgf" element of parserState, cached for more efficient use


sectionAttributes

MutableAttributeSet sectionAttributes
This is the "sec" element of parserState, cached for more efficient use

Constructor Detail

RTFReader.DocumentDestination

RTFReader.DocumentDestination()
Method Detail

deliverText

public void deliverText(String text,
                        AttributeSet characterAttributes)
Specified by:
deliverText in class RTFReader.TextHandlingDestination

finishParagraph

public void finishParagraph(AttributeSet pgfAttributes,
                            AttributeSet chrAttributes)
Specified by:
finishParagraph in class RTFReader.TextHandlingDestination

endSection

public void endSection()
Specified by:
endSection in class RTFReader.TextHandlingDestination

handleBinaryBlob

public void handleBinaryBlob(byte[] data)

handleText

public void handleText(String text)

handleKeyword

public boolean handleKeyword(String keyword)

handleKeyword

public boolean handleKeyword(String keyword,
                             int parameter)

begingroup

public void begingroup()

endgroup

public void endgroup(Dictionary oldState)

close

public void close()

beginParagraph

protected void beginParagraph()

endParagraph

protected void endParagraph()

rootCharacterAttributes

protected MutableAttributeSet rootCharacterAttributes()
Returns a new MutableAttributeSet containing the default character attributes


rootParagraphAttributes

protected MutableAttributeSet rootParagraphAttributes()
Returns a new MutableAttributeSet containing the default paragraph attributes


rootSectionAttributes

protected MutableAttributeSet rootSectionAttributes()
Returns a new MutableAttributeSet containing the default section attributes


currentTextAttributes

MutableAttributeSet currentTextAttributes()
Calculates the current text (character) attributes in a form suitable for SwingText from the current parser state.


currentParagraphAttributes

MutableAttributeSet currentParagraphAttributes()
Calculates the current paragraph attributes (with keys as given in StyleConstants) from the current parser state.

See Also:
StyleConstants

currentSectionAttributes

public AttributeSet currentSectionAttributes()
Calculates the current section attributes from the current parser state.


resetCharacterAttributes

protected void resetCharacterAttributes()
Resets the filter's internal notion of the current character attributes to their default values. Invoked to handle the \plain keyword.


resetParagraphAttributes

protected void resetParagraphAttributes()
Resets the filter's internal notion of the current paragraph's attributes to their default values. Invoked to handle the \pard keyword.


resetSectionAttributes

protected void resetSectionAttributes()
Resets the filter's internal notion of the current section's attributes to their default values. Invoked to handle the \sectd keyword.