Class TransliteratingTextComponent

java.lang.Object
java.awt.Component
java.awt.Canvas
com.ibm.icu.dev.demo.impl.DumbTextComponent
com.ibm.icu.dev.demo.translit.TransliteratingTextComponent
All Implemented Interfaces:
FocusListener, KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class TransliteratingTextComponent extends DumbTextComponent
A subclass of DumbTextComponent that passes key events through a Transliterator.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For serialization
      See Also:
    • DEBUG

      private static boolean DEBUG
    • translit

      private Transliterator translit
  • Constructor Details

    • TransliteratingTextComponent

      public TransliteratingTextComponent()
      Constructor.
  • Method Details

    • handleKeyTyped

      protected void handleKeyTyped(KeyEvent e)
      DumbTextComponent API. Framework method that is called when a KeyEvent is received. This implementation runs the new character through the current Transliterator, if one is set, and inserts the transliterated text into the buffer.
      Overrides:
      handleKeyTyped in class DumbTextComponent
    • flush

      public void flush()
    • transliterate

      protected void transliterate(char ch, boolean flush)
    • setTransliterator

      public void setTransliterator(Transliterator t)
      Set the Transliterator and direction to use to process incoming KeyEvents.
      Parameters:
      t - the Transliterator to use
    • getTransliterator

      public Transliterator getTransliterator()
    • escape

      public static final String escape(String s)
      Escape non-ASCII characters as Unicode. JUST FOR DEBUGGING OUTPUT.