javax.swing.text.rtf
Class RTFReader.StylesheetDestination.StyleDefiningDestination

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

class RTFReader.StylesheetDestination.StyleDefiningDestination
extends RTFReader.AttributeTrackingDestination
implements RTFReader.Destination

This subclass handles an individual style


Field Summary
(package private)  boolean additive
           
(package private)  int basedOn
           
(package private)  MutableAttributeSet characterAttributes
          This is the "chr" element of parserState, cached for more efficient use
(package private)  boolean characterStyle
           
(package private)  boolean hidden
           
(package private)  int nextStyle
           
 int number
           
(package private)  MutableAttributeSet paragraphAttributes
          This is the "pgf" element of parserState, cached for more efficient use
(package private)  Style realizedStyle
           
(package private)  MutableAttributeSet sectionAttributes
          This is the "sec" element of parserState, cached for more efficient use
(package private)  boolean sectionStyle
           
 String styleName
           
(package private)  int STYLENUMBER_NONE
           
 
Constructor Summary
RTFReader.StylesheetDestination.StyleDefiningDestination()
           
 
Method Summary
 void begingroup()
           
 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 endgroup(Dictionary oldState)
           
 void handleBinaryBlob(byte[] data)
           
 boolean handleKeyword(String keyword)
           
 boolean handleKeyword(String keyword, int parameter)
           
 void handleText(String text)
           
 Style realize()
           
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

STYLENUMBER_NONE

final int STYLENUMBER_NONE
See Also:
Constant Field Values

additive

boolean additive

characterStyle

boolean characterStyle

sectionStyle

boolean sectionStyle

styleName

public String styleName

number

public int number

basedOn

int basedOn

nextStyle

int nextStyle

hidden

boolean hidden

realizedStyle

Style realizedStyle

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.StylesheetDestination.StyleDefiningDestination

public RTFReader.StylesheetDestination.StyleDefiningDestination()
Method Detail

handleText

public void handleText(String text)
Specified by:
handleText in interface RTFReader.Destination
Specified by:
handleText in class RTFReader.AttributeTrackingDestination

close

public void close()
Specified by:
close in interface RTFReader.Destination
Overrides:
close in class RTFReader.AttributeTrackingDestination

handleKeyword

public boolean handleKeyword(String keyword)
Specified by:
handleKeyword in interface RTFReader.Destination
Overrides:
handleKeyword in class RTFReader.AttributeTrackingDestination

handleKeyword

public boolean handleKeyword(String keyword,
                             int parameter)
Specified by:
handleKeyword in interface RTFReader.Destination
Overrides:
handleKeyword in class RTFReader.AttributeTrackingDestination

realize

public Style realize()

handleBinaryBlob

public void handleBinaryBlob(byte[] data)

begingroup

public void begingroup()

endgroup

public void endgroup(Dictionary oldState)

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.