Home » openjdk-7 » javax » swing » text » rtf » [javadoc | source]
class: RTFGenerator [javadoc | source]
Generates an RTF output stream (java.io.OutputStream) from rich text (handed off through a series of LTTextAcceptor calls). Can be used to generate RTF from any object which knows how to write to a text acceptor (e.g., LTAttributedText and LTRTFFilter).

Note that this is a lossy conversion since RTF's model of text does not exactly correspond with LightText's.

Nested Class Summary:
static class  RTFGenerator.CharacterKeywordPair   
Field Summary
 Dictionary<Object, Integer> colorTable     
 int colorCount     
 Dictionary<String, Integer> fontTable     
 int fontCount     
 Dictionary<AttributeSet, Integer> styleTable     
 int styleCount     
 OutputStream outputStream     
 boolean afterKeyword     
 MutableAttributeSet outputAttributes     
 int unicodeCount     
 int[] outputConversion     
public static final  Color defaultRTFColor    The default color, used for text without an explicit color attribute. 
public static final  float defaultFontSize     
public static final  String defaultFontFamily     
protected static  CharacterKeywordPair[] textKeywords     
static final  char[] hexdigits     
 public RTFGenerator(OutputStream to) 
Method from javax.swing.text.rtf.RTFGenerator Summary:
approximationForUnicode,   checkControlWord,   checkControlWords,   checkNumericControlWord,   convertCharacter,   examineElement,   outputConversionForName,   outputConversionFromTranslationTable,   resetCharacterAttributes,   resetParagraphAttributes,   resetSectionAttributes,   updateCharacterAttributes,   updateParagraphAttributes,   updateSectionAttributes,   writeBegingroup,   writeCharacter,   writeControlWord,   writeControlWord,   writeDocument,   writeDocumentProperties,   writeEndgroup,   writeLineBreak,   writeParagraphElement,   writeRTFHeader,   writeRTFTrailer,   writeRawString,   writeText,   writeText,   writeTextElement
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.rtf.RTFGenerator Detail:
 String approximationForUnicode(char ch) 
 protected  void checkControlWord(MutableAttributeSet currentAttributes,
    AttributeSet newAttributes,
    RTFAttribute word) throws IOException 
 protected  void checkControlWords(MutableAttributeSet currentAttributes,
    AttributeSet newAttributes,
    RTFAttribute[] words,
    int domain) throws IOException 
 protected  void checkNumericControlWord(MutableAttributeSet currentAttributes,
    AttributeSet newAttributes,
    Object attrName,
    String controlWord,
    float dflt,
    float scale) throws IOException 
 protected static int convertCharacter(int[] conversion,
    char ch) 
    Takes a char and a conversion table (an int[] in the current implementation, but conversion tables should be treated as an opaque type) and returns the corresponding byte value (as an int, since bytes are signed).
 public  void examineElement(Element el) 
 static int[] outputConversionForName(String name) throws IOException 
 static int[] outputConversionFromTranslationTable(char[] table) 
    Takes a translation table (a 256-element array of characters) and creates an output conversion table for use by convertCharacter().
 protected  void resetCharacterAttributes(MutableAttributeSet currentAttributes) throws IOException 
 protected  void resetParagraphAttributes(MutableAttributeSet currentAttributes) throws IOException 
 protected  void resetSectionAttributes(MutableAttributeSet currentAttributes) throws IOException 
  void updateCharacterAttributes(MutableAttributeSet current,
    AttributeSet newAttributes,
    boolean updateStyleChanges) throws IOException 
  void updateParagraphAttributes(MutableAttributeSet current,
    AttributeSet newAttributes,
    boolean emitStyleChanges) throws IOException 
  void updateSectionAttributes(MutableAttributeSet current,
    AttributeSet newAttributes,
    boolean emitStyleChanges) throws IOException 
 public  void writeBegingroup() throws IOException 
 public  void writeCharacter(char ch) throws IOException 
 public  void writeControlWord(String keyword) throws IOException 
 public  void writeControlWord(String keyword,
    int arg) throws IOException 
 public static  void writeDocument(Document d,
    OutputStream to) throws IOException 
  void writeDocumentProperties(Document doc) throws IOException 
 public  void writeEndgroup() throws IOException 
 public  void writeLineBreak() throws IOException 
 public  void writeParagraphElement(Element el) throws IOException 
 public  void writeRTFHeader() throws IOException 
 public  void writeRTFTrailer() throws IOException 
 public  void writeRawString(String str) throws IOException 
 public  void writeText(Segment s) throws IOException 
 public  void writeText(String s) throws IOException 
 public  void writeTextElement(Element el) throws IOException