home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text;
-
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.font.TextHitInfo;
- import java.awt.im.InputMethodRequests;
- import java.io.Serializable;
- import java.text.AttributedCharacterIterator;
- import java.text.AttributedString;
-
- class JTextComponent$InputMethodRequestsHandler implements InputMethodRequests, Serializable {
- // $FF: synthetic field
- private final JTextComponent this$0;
-
- JTextComponent$InputMethodRequestsHandler(JTextComponent var1) {
- this.this$0 = var1;
- }
-
- public AttributedCharacterIterator cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] var1) {
- return (new AttributedString("")).getIterator();
- }
-
- public AttributedCharacterIterator getCommittedText(int var1, int var2, AttributedCharacterIterator.Attribute[] var3) {
- return (new AttributedString("")).getIterator();
- }
-
- public int getCommittedTextLength() {
- return 0;
- }
-
- public int getInsertPositionOffset() {
- return this.this$0.getCaretPosition();
- }
-
- public TextHitInfo getLocationOffset(int var1, int var2) {
- if (JTextComponent.access$200(this.this$0) == null) {
- return null;
- } else {
- Point var3 = this.this$0.getLocationOnScreen();
- var3.x = var1 - var3.x;
- var3.y = var2 - var3.y;
- int var4 = this.this$0.viewToModel(var3);
- 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;
- }
- }
-
- public Rectangle getTextLocation(TextHitInfo var1) {
- Rectangle var2;
- try {
- var2 = this.this$0.modelToView(this.this$0.getCaretPosition());
- if (var2 != null) {
- Point var3 = this.this$0.getLocationOnScreen();
- var2.translate(var3.x, var3.y);
- }
- } catch (BadLocationException var4) {
- var2 = null;
- }
-
- if (var2 == null) {
- var2 = new Rectangle();
- }
-
- return var2;
- }
-
- public AttributedCharacterIterator getSelectedText(AttributedCharacterIterator.Attribute[] var1) {
- String var2 = this.this$0.getSelectedText();
- return var2 != null ? (new AttributedString(var2)).getIterator() : null;
- }
- }
-