< prev index next >

src/java.desktop/share/classes/java/awt/im/InputMethodHighlight.java

Print this page




  24  */
  25 
  26 package java.awt.im;
  27 
  28 import java.awt.font.TextAttribute;
  29 import java.util.Map;
  30 
  31 /**
  32 * An InputMethodHighlight is used to describe the highlight
  33 * attributes of text being composed.
  34 * The description can be at two levels:
  35 * at the abstract level it specifies the conversion state and whether the
  36 * text is selected; at the concrete level it specifies style attributes used
  37 * to render the highlight.
  38 * An InputMethodHighlight must provide the description at the
  39 * abstract level; it may or may not provide the description at the concrete
  40 * level.
  41 * If no concrete style is provided, a renderer should use
  42 * {@link java.awt.Toolkit#mapInputMethodHighlight} to map to a concrete style.
  43 * <p>
  44 * The abstract description consists of three fields: <code>selected</code>,
  45 * <code>state</code>, and <code>variation</code>.
  46 * <code>selected</code> indicates whether the text range is the one that the
  47 * input method is currently working on, for example, the segment for which
  48 * conversion candidates are currently shown in a menu.
  49 * <code>state</code> represents the conversion state. State values are defined
  50 * by the input method framework and should be distinguished in all
  51 * mappings from abstract to concrete styles. Currently defined state values
  52 * are raw (unconverted) and converted.
  53 * These state values are recommended for use before and after the
  54 * main conversion step of text composition, say, before and after kana-&gt;kanji
  55 * or pinyin-&gt;hanzi conversion.
  56 * The <code>variation</code> field allows input methods to express additional
  57 * information about the conversion results.
  58 * <p>
  59 *
  60 * InputMethodHighlight instances are typically used as attribute values
  61 * returned from AttributedCharacterIterator for the INPUT_METHOD_HIGHLIGHT
  62 * attribute. They may be wrapped into {@link java.text.Annotation Annotation}
  63 * instances to indicate separate text segments.
  64 *
  65 * @see java.text.AttributedCharacterIterator
  66 * @since 1.2
  67 */
  68 
  69 public class InputMethodHighlight {
  70 
  71     /**
  72      * Constant for the raw text state.
  73      */
  74     public static final int RAW_TEXT = 0;
  75 
  76     /**




  24  */
  25 
  26 package java.awt.im;
  27 
  28 import java.awt.font.TextAttribute;
  29 import java.util.Map;
  30 
  31 /**
  32 * An InputMethodHighlight is used to describe the highlight
  33 * attributes of text being composed.
  34 * The description can be at two levels:
  35 * at the abstract level it specifies the conversion state and whether the
  36 * text is selected; at the concrete level it specifies style attributes used
  37 * to render the highlight.
  38 * An InputMethodHighlight must provide the description at the
  39 * abstract level; it may or may not provide the description at the concrete
  40 * level.
  41 * If no concrete style is provided, a renderer should use
  42 * {@link java.awt.Toolkit#mapInputMethodHighlight} to map to a concrete style.
  43 * <p>
  44 * The abstract description consists of three fields: {@code selected},
  45 * {@code state}, and {@code variation}.
  46 * {@code selected} indicates whether the text range is the one that the
  47 * input method is currently working on, for example, the segment for which
  48 * conversion candidates are currently shown in a menu.
  49 * {@code state} represents the conversion state. State values are defined
  50 * by the input method framework and should be distinguished in all
  51 * mappings from abstract to concrete styles. Currently defined state values
  52 * are raw (unconverted) and converted.
  53 * These state values are recommended for use before and after the
  54 * main conversion step of text composition, say, before and after kana-&gt;kanji
  55 * or pinyin-&gt;hanzi conversion.
  56 * The {@code variation} field allows input methods to express additional
  57 * information about the conversion results.
  58 * <p>
  59 *
  60 * InputMethodHighlight instances are typically used as attribute values
  61 * returned from AttributedCharacterIterator for the INPUT_METHOD_HIGHLIGHT
  62 * attribute. They may be wrapped into {@link java.text.Annotation Annotation}
  63 * instances to indicate separate text segments.
  64 *
  65 * @see java.text.AttributedCharacterIterator
  66 * @since 1.2
  67 */
  68 
  69 public class InputMethodHighlight {
  70 
  71     /**
  72      * Constant for the raw text state.
  73      */
  74     public static final int RAW_TEXT = 0;
  75 
  76     /**


< prev index next >