Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--LWTextComponent | +--ActiveClient
This class directly implements the two client interfaces of the input method framework, InputMethodListener and InputMethodRequests. This is not required. Especially in cases where the public interface matters (such as in a class library), it may be more appropriate to hide the implementations of these two interfaces in separate classes.
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
ActiveClient(java.lang.String name)
Constructs an ActiveClient. |
Method Summary | |
java.text.AttributedCharacterIterator | cancelLatestCommittedText(java.text.AttributedCharacterIterator.Attribute[] attributes)
Returns null to indicate that the "Undo Commit" feature is not supported by this simple text component. |
void | caretPositionChanged(java.awt.event.InputMethodEvent event)
Handles changes to the caret within composed text. |
java.awt.font.TextHitInfo | getCaret()
Returns a text hit info indicating the current caret (insertion point). |
java.text.AttributedCharacterIterator | getCommittedText(int beginIndex,
int endIndex,
java.text.AttributedCharacterIterator.Attribute[] attributes)
Gets an iterator providing access to the entire text and attributes contained in the text editing component except for uncommitted text. |
java.text.AttributedCharacterIterator | getDisplayText()
Returns the text that the user has entered. |
java.awt.im.InputMethodRequests | getInputMethodRequests()
Implements getInputMethodRequests for ActiveClient by returning "this". |
int | getInsertPositionOffset()
Gets the offset of the insert position in the committed text contained in the text editing component. |
java.awt.font.TextHitInfo | getLocationOffset(int x,
int y)
Gets the offset within the composed text for the specified absolute x and y coordinates on the screen. |
java.text.AttributedCharacterIterator | getSelectedText(java.text.AttributedCharacterIterator.Attribute[] attributes)
Gets the currently selected text from the text editing component. |
java.awt.Rectangle | getTextLocation(java.awt.font.TextHitInfo offset)
Gets the location of a specified offset in the current composed text, or of the selection in committed text. |
void | inputMethodTextChanged(java.awt.event.InputMethodEvent event)
Handles changes to the text entered through an input method. |
Methods inherited from class LWTextComponent | |
focusGained, focusLost, getCaret, getCaretRectangle, getCaretRectangle, getCommittedTextLength, getCommittedText, getCommittedText, getDisplayText, getTextLayout, getTextOrigin, insertCharacter, invalidateTextLayout, keyPressed, keyReleased, keyTyped, paint |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public ActiveClient(java.lang.String name)
name
- the component name to be displayed above the textMethod Detail |
public java.awt.im.InputMethodRequests getInputMethodRequests()
public java.text.AttributedCharacterIterator getDisplayText()
public java.awt.font.TextHitInfo getCaret()
public void inputMethodTextChanged(java.awt.event.InputMethodEvent event)
In this simple component, we only keep input method highlight attributes. Smarter components may want to keep language, reading, input method segment, and other attributes as well.
public void caretPositionChanged(java.awt.event.InputMethodEvent event)
public java.awt.Rectangle getTextLocation(java.awt.font.TextHitInfo offset)
public java.awt.font.TextHitInfo getLocationOffset(int x, int y)
public int getInsertPositionOffset()
public java.text.AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex, java.text.AttributedCharacterIterator.Attribute[] attributes)
public java.text.AttributedCharacterIterator cancelLatestCommittedText(java.text.AttributedCharacterIterator.Attribute[] attributes)
public java.text.AttributedCharacterIterator getSelectedText(java.text.AttributedCharacterIterator.Attribute[] attributes)
Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |