fi.hut.tml.xsmiles.gui.ftv
Class FBLightTextComponent

java.lang.Object
  extended byjava.awt.Component
      extended byfi.hut.tml.xsmiles.gui.ftv.FBLightTextComponent
All Implemented Interfaces:
java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, java.io.Serializable

public class FBLightTextComponent
extends java.awt.Component
implements java.awt.event.KeyListener, java.awt.event.FocusListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.Insets borderInsets
           
protected  int caretPos
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FBLightTextComponent(java.lang.String name, boolean enableInputMethodss)
          Constructs a LWTextComponent.
 
Method Summary
 void deleteBackwardCharacter()
           
 void deleteForwardCharacter()
           
 void focusGained(java.awt.event.FocusEvent event)
          Turns on drawing of the component's thicker frame and the caret.
 void focusLost(java.awt.event.FocusEvent event)
          Turns off drawing of the component's thicker frame and the caret.
 int getCaretPos()
           
 java.awt.Rectangle getCaretRectangle()
           
 java.awt.Dimension getPreferredSize()
           
 java.lang.String getText()
           
 java.awt.Point getTextOrigin()
          Returns the origin of the text.
 void insertCharacter(char c)
          Inserts the given character at the end of the text.
 boolean isFocusTraversable()
           
 void keyPressed(java.awt.event.KeyEvent event)
           
 void keyReleased(java.awt.event.KeyEvent event)
          Ignores key released events.
 void keyTyped(java.awt.event.KeyEvent event)
          Handles the key typed event.
 void moveCaretLeft()
           
 void moveCaretRight()
           
 void moveCaretTo(int pos)
           
 void paint(java.awt.Graphics g)
           
 void setCharsWidth(int newWidth)
           
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFontSet, isForegroundSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

borderInsets

protected java.awt.Insets borderInsets

caretPos

protected int caretPos
Constructor Detail

FBLightTextComponent

public FBLightTextComponent(java.lang.String name,
                            boolean enableInputMethodss)
Constructs a LWTextComponent.

Parameters:
name - the component name to be displayed above the text
Method Detail

setCharsWidth

public void setCharsWidth(int newWidth)

isFocusTraversable

public boolean isFocusTraversable()

paint

public void paint(java.awt.Graphics g)

getPreferredSize

public java.awt.Dimension getPreferredSize()

getCaretPos

public int getCaretPos()

getCaretRectangle

public java.awt.Rectangle getCaretRectangle()

getText

public java.lang.String getText()

getTextOrigin

public java.awt.Point getTextOrigin()
Returns the origin of the text. This is the leftmost point on the baseline of the text.

Returns:
the origin of the text

insertCharacter

public void insertCharacter(char c)
Inserts the given character at the end of the text.

Parameters:
c - the character to be inserted

deleteBackwardCharacter

public void deleteBackwardCharacter()

deleteForwardCharacter

public void deleteForwardCharacter()

moveCaretLeft

public void moveCaretLeft()

moveCaretRight

public void moveCaretRight()

moveCaretTo

public void moveCaretTo(int pos)

keyTyped

public void keyTyped(java.awt.event.KeyEvent event)
Handles the key typed event. If the character is backspace, the last character is removed from the text that the user has entered. Otherwise, the character is appended to the text. Then, the text is redrawn.

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent event)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent event)
Ignores key released events.

Specified by:
keyReleased in interface java.awt.event.KeyListener

focusGained

public void focusGained(java.awt.event.FocusEvent event)
Turns on drawing of the component's thicker frame and the caret.

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent event)
Turns off drawing of the component's thicker frame and the caret.

Specified by:
focusLost in interface java.awt.event.FocusListener


X-Smiles 1.2