home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / text / JTextComponent$InputMethodRequestsHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.2 KB  |  71 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.Point;
  4. import java.awt.Rectangle;
  5. import java.awt.font.TextHitInfo;
  6. import java.awt.im.InputMethodRequests;
  7. import java.io.Serializable;
  8. import java.text.AttributedCharacterIterator;
  9. import java.text.AttributedString;
  10.  
  11. class JTextComponent$InputMethodRequestsHandler implements InputMethodRequests, Serializable {
  12.    // $FF: synthetic field
  13.    private final JTextComponent this$0;
  14.  
  15.    JTextComponent$InputMethodRequestsHandler(JTextComponent var1) {
  16.       this.this$0 = var1;
  17.    }
  18.  
  19.    public AttributedCharacterIterator cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] var1) {
  20.       return (new AttributedString("")).getIterator();
  21.    }
  22.  
  23.    public AttributedCharacterIterator getCommittedText(int var1, int var2, AttributedCharacterIterator.Attribute[] var3) {
  24.       return (new AttributedString("")).getIterator();
  25.    }
  26.  
  27.    public int getCommittedTextLength() {
  28.       return 0;
  29.    }
  30.  
  31.    public int getInsertPositionOffset() {
  32.       return this.this$0.getCaretPosition();
  33.    }
  34.  
  35.    public TextHitInfo getLocationOffset(int var1, int var2) {
  36.       if (JTextComponent.access$200(this.this$0) == null) {
  37.          return null;
  38.       } else {
  39.          Point var3 = this.this$0.getLocationOnScreen();
  40.          var3.x = var1 - var3.x;
  41.          var3.y = var2 - var3.y;
  42.          int var4 = this.this$0.viewToModel(var3);
  43.          return var4 >= JTextComponent.access$300(this.this$0).getOffset() && var4 <= JTextComponent.access$400(this.this$0).getOffset() ? TextHitInfo.leading(var4 - JTextComponent.access$300(this.this$0).getOffset()) : null;
  44.       }
  45.    }
  46.  
  47.    public Rectangle getTextLocation(TextHitInfo var1) {
  48.       Rectangle var2;
  49.       try {
  50.          var2 = this.this$0.modelToView(this.this$0.getCaretPosition());
  51.          if (var2 != null) {
  52.             Point var3 = this.this$0.getLocationOnScreen();
  53.             var2.translate(var3.x, var3.y);
  54.          }
  55.       } catch (BadLocationException var4) {
  56.          var2 = null;
  57.       }
  58.  
  59.       if (var2 == null) {
  60.          var2 = new Rectangle();
  61.       }
  62.  
  63.       return var2;
  64.    }
  65.  
  66.    public AttributedCharacterIterator getSelectedText(AttributedCharacterIterator.Attribute[] var1) {
  67.       String var2 = this.this$0.getSelectedText();
  68.       return var2 != null ? (new AttributedString(var2)).getIterator() : null;
  69.    }
  70. }
  71.