108 private boolean compositionEnableSupported = true;
109 // The savedCompositionState indicates the composition mode when
110 // endComposition or setCompositionEnabled is called. It doesn't always
111 // reflect the actual composition state because it doesn't get updated
112 // when the user changes the composition state through direct interaction
113 // with the input method. It is used to save the composition mode when
114 // focus is traversed across different client components sharing the
115 // same java input context. Also if set/isCompositionEnabled are not
116 // supported, it remains false.
117 private boolean savedCompositionState = false;
118
119 // variables to keep track of preedit context.
120 // these variables need to be accessed within AWT_LOCK/UNLOCK
121 private String committedText = null;
122 private StringBuffer composedText = null;
123 private IntBuffer rawFeedbacks;
124
125 // private data (X11InputMethodData structure defined in
126 // awt_InputMethod.c) for native methods
127 // this structure needs to be accessed within AWT_LOCK/UNLOCK
128 transient private long pData = 0; // accessed by native
129
130 // Initialize highlight mapping table
131 static {
132 @SuppressWarnings({"unchecked", "rawtypes"})
133 Map<TextAttribute, ?> styles[] = new Map[4];
134 HashMap<TextAttribute, Object> map;
135
136 // UNSELECTED_RAW_TEXT_HIGHLIGHT
137 map = new HashMap<>(1);
138 map.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
139 styles[0] = Collections.unmodifiableMap(map);
140
141 // SELECTED_RAW_TEXT_HIGHLIGHT
142 map = new HashMap<>(1);
143 map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON);
144 styles[1] = Collections.unmodifiableMap(map);
145
146 // UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
147 map = new HashMap<>(1);
148 map.put(TextAttribute.INPUT_METHOD_UNDERLINE,
|
108 private boolean compositionEnableSupported = true;
109 // The savedCompositionState indicates the composition mode when
110 // endComposition or setCompositionEnabled is called. It doesn't always
111 // reflect the actual composition state because it doesn't get updated
112 // when the user changes the composition state through direct interaction
113 // with the input method. It is used to save the composition mode when
114 // focus is traversed across different client components sharing the
115 // same java input context. Also if set/isCompositionEnabled are not
116 // supported, it remains false.
117 private boolean savedCompositionState = false;
118
119 // variables to keep track of preedit context.
120 // these variables need to be accessed within AWT_LOCK/UNLOCK
121 private String committedText = null;
122 private StringBuffer composedText = null;
123 private IntBuffer rawFeedbacks;
124
125 // private data (X11InputMethodData structure defined in
126 // awt_InputMethod.c) for native methods
127 // this structure needs to be accessed within AWT_LOCK/UNLOCK
128 private transient long pData = 0; // accessed by native
129
130 // Initialize highlight mapping table
131 static {
132 @SuppressWarnings({"unchecked", "rawtypes"})
133 Map<TextAttribute, ?> styles[] = new Map[4];
134 HashMap<TextAttribute, Object> map;
135
136 // UNSELECTED_RAW_TEXT_HIGHLIGHT
137 map = new HashMap<>(1);
138 map.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
139 styles[0] = Collections.unmodifiableMap(map);
140
141 // SELECTED_RAW_TEXT_HIGHLIGHT
142 map = new HashMap<>(1);
143 map.put(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON);
144 styles[1] = Collections.unmodifiableMap(map);
145
146 // UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
147 map = new HashMap<>(1);
148 map.put(TextAttribute.INPUT_METHOD_UNDERLINE,
|