home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / text / rtf / RTFReader$FonttblDestination.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  2.9 KB  |  70 lines

  1. package com.sun.java.swing.text.rtf;
  2.  
  3. import java.util.Dictionary;
  4. import java.util.Enumeration;
  5.  
  6. class RTFReader$FonttblDestination implements RTFReader.Destination {
  7.    // $FF: synthetic field
  8.    private final RTFReader this$0;
  9.    int nextFontNumber;
  10.    String nextFontFamily;
  11.  
  12.    public void handleBinaryBlob(byte[] var1) {
  13.    }
  14.  
  15.    public void handleText(String var1) {
  16.       int var2 = var1.indexOf(59);
  17.       String var3;
  18.       if (var2 > 0) {
  19.          var3 = var1.substring(0, var2);
  20.       } else {
  21.          var3 = var1;
  22.       }
  23.  
  24.       this.this$0.fontTable.put(new Integer(this.nextFontNumber), var3);
  25.       this.nextFontNumber = -1;
  26.       this.nextFontFamily = null;
  27.    }
  28.  
  29.    public boolean handleKeyword(String var1) {
  30.       if (var1.charAt(0) == 'f') {
  31.          this.nextFontFamily = var1.substring(1);
  32.          return true;
  33.       } else {
  34.          return false;
  35.       }
  36.    }
  37.  
  38.    public boolean handleKeyword(String var1, int var2) {
  39.       if (var1.equals("f")) {
  40.          this.nextFontNumber = var2;
  41.          return true;
  42.       } else {
  43.          return false;
  44.       }
  45.    }
  46.  
  47.    public void begingroup() {
  48.    }
  49.  
  50.    public void endgroup(Dictionary var1) {
  51.    }
  52.  
  53.    public void close() {
  54.       Enumeration var1 = this.this$0.fontTable.keys();
  55.       this.this$0.warnings.println("Done reading font table.");
  56.  
  57.       while(var1.hasMoreElements()) {
  58.          Integer var2 = (Integer)var1.nextElement();
  59.          this.this$0.warnings.println("Number " + var2 + ": " + this.this$0.fontTable.get(var2));
  60.       }
  61.  
  62.       this.this$0.warnings.println();
  63.    }
  64.  
  65.    RTFReader$FonttblDestination(RTFReader var1) {
  66.       this.this$0 = var1;
  67.       this.this$0 = var1;
  68.    }
  69. }
  70.