java.lang.Object | +--java.awt.Component | +--LWTextComponent | +--ActiveClient
Implements an integrated text input user interface. This class is an active client of the input method framework, that is, actively uses its APIs to accomplish integration.
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.
ActiveClient(String name)
AttributedCharacterIterator
cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
void
caretPositionChanged(InputMethodEvent event)
AttributedCharacterIterator
getCommittedText(int beginIndex,
int endIndex,
AttributedCharacterIterator.Attribute[] attributes)
InputMethodRequests
getInputMethodRequests()
int
getInsertPositionOffset()
TextHitInfo
getLocationOffset(int x,
int y)
AttributedCharacterIterator
getSelectedText(AttributedCharacterIterator.Attribute[] attributes)
Rectangle
getTextLocation(TextHitInfo offset)
void
inputMethodTextChanged(InputMethodEvent event)
focusGained,
focusLost,
getCaretRectangle,
getCaretRectangle,
getCommittedText,
getCommittedText,
getCommittedTextLength,
getTextLayout,
getTextOrigin,
insertCharacter,
invalidateTextLayout,
keyPressed,
keyReleased,
keyTyped,
paint
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,
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,
paramString,
postEvent,
preferredSize,
prepareImage,
prepareImage,
print,
printAll,
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
public ActiveClient(String name)
name
- the component name to be displayed above the textpublic InputMethodRequests getInputMethodRequests()
public void setFontSize(int size)
public AttributedCharacterIterator getDisplayText()
public TextHitInfo getCaret()
public void inputMethodTextChanged(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(InputMethodEvent event)
public Rectangle getTextLocation(TextHitInfo offset)
public TextHitInfo getLocationOffset(int x, int y)
public int getInsertPositionOffset()
public AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex, AttributedCharacterIterator.Attribute[] attributes)
public AttributedCharacterIterator cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
public AttributedCharacterIterator getSelectedText(AttributedCharacterIterator.Attribute[] attributes)