aboutsummaryrefslogtreecommitdiff
path: root/src/share/classes/com/sun/inputmethods/internal/thaiim
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/classes/com/sun/inputmethods/internal/thaiim')
-rw-r--r--src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethod.java437
-rw-r--r--src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodDescriptor.java99
-rw-r--r--src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodImpl.java235
-rw-r--r--src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiRules.java348
-rw-r--r--src/share/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor1
-rw-r--r--src/share/classes/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties6
6 files changed, 0 insertions, 1126 deletions
diff --git a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethod.java b/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethod.java
deleted file mode 100644
index 40e6cc8ff..000000000
--- a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethod.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- *
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodContext;
-
-import java.awt.AWTEvent;
-import java.awt.Rectangle;
-
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-
-import java.lang.Character.Subset;
-
-import java.util.Locale;
-
-class ThaiInputMethod implements InputMethod {
-
- private ThaiInputMethodImpl impl;
- private Locale locale;
-
- ThaiInputMethod(Locale theLocale, ThaiInputMethodImpl theImplementation) {
- locale = theLocale;
- impl = theImplementation;
- }
-
- /**
- * Sets the input method context, which is used to dispatch input method
- * events to the client component and to request information from
- * the client component.
- * <p>
- * This method is called once immediately after instantiating this input
- * method.
- *
- * @param context the input method context for this input method
- * @exception NullPointerException if <code>context</code> is null
- */
- public void setInputMethodContext(InputMethodContext context) {
-
- impl.setInputMethodContext(context);
- }
-
- /**
- * Attempts to set the input locale. If the input method supports the
- * desired locale, it changes its behavior to support input for the locale
- * and returns true.
- * Otherwise, it returns false and does not change its behavior.
- * <p>
- * This method is called
- * <ul>
- * <li>by {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
- * <li>when switching to this input method through the user interface if the user
- * specified a locale or if the previously selected input method's
- * {@link java.awt.im.spi.InputMethod#getLocale getLocale} method
- * returns a non-null value.
- * </ul>
- *
- * @param locale locale to input
- * @return whether the specified locale is supported
- * @exception NullPointerException if <code>locale</code> is null
- */
- public boolean setLocale(Locale locale) {
-
- if (locale.getLanguage().equals(this.locale.getLanguage())) {
- //System.out.println("returning true for locale " + locale);
- return true;
- }
- else {
- //System.out.println("returning false for locale " + locale);
- return false;
- }
- }
-
- /**
- * Returns the current input locale. Might return null in exceptional cases.
- * <p>
- * This method is called
- * <ul>
- * <li>by {@link java.awt.im.InputContext#getLocale InputContext.getLocale} and
- * <li>when switching from this input method to a different one through the
- * user interface.
- * </ul>
- *
- * @return the current input locale, or null
- */
- public Locale getLocale() {
-
- return locale;
- }
-
- /**
- * Sets the subsets of the Unicode character set that this input method
- * is allowed to input. Null may be passed in to indicate that all
- * characters are allowed.
- * <p>
- * This method is called
- * <ul>
- * <li>immediately after instantiating this input method,
- * <li>when switching to this input method from a different one, and
- * <li>by {@link java.awt.im.InputContext#setCharacterSubsets InputContext.setCharacterSubsets}.
- * </ul>
- *
- * @param subsets the subsets of the Unicode character set from which
- * characters may be input
- */
- public void setCharacterSubsets(Subset[] subsets) {
- }
-
- /**
- * Enables or disables this input method for composition,
- * depending on the value of the parameter <code>enable</code>.
- * <p>
- * An input method that is enabled for composition interprets incoming
- * events for both composition and control purposes, while a
- * disabled input method does not interpret events for composition.
- * Note however that events are passed on to the input method regardless
- * whether it is enabled or not, and that an input method that is disabled
- * for composition may still interpret events for control purposes,
- * including to enable or disable itself for composition.
- * <p>
- * This method is called
- * <ul>
- * <li>by {@link java.awt.im.InputContext#setCompositionEnabled InputContext.setCompositionEnabled},
- * <li>when switching to this input method from a different one using the
- * user interface or
- * {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
- * if the previously selected input method's
- * {@link java.awt.im.spi.InputMethod#isCompositionEnabled isCompositionEnabled}
- * method returns without throwing an exception.
- * </ul>
- *
- * @param enable whether to enable the input method for composition
- * @throws UnsupportedOperationException if this input method does not
- * support the enabling/disabling operation
- * @see #isCompositionEnabled
- */
- public void setCompositionEnabled(boolean enable) {
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * Determines whether this input method is enabled.
- * An input method that is enabled for composition interprets incoming
- * events for both composition and control purposes, while a
- * disabled input method does not interpret events for composition.
- * <p>
- * This method is called
- * <ul>
- * <li>by {@link java.awt.im.InputContext#isCompositionEnabled InputContext.isCompositionEnabled} and
- * <li>when switching from this input method to a different one using the
- * user interface or
- * {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
- * </ul>
- *
- * @return <code>true</code> if this input method is enabled for
- * composition; <code>false</code> otherwise.
- * @throws UnsupportedOperationException if this input method does not
- * support checking whether it is enabled for composition
- * @see #setCompositionEnabled
- */
- public boolean isCompositionEnabled() {
-
- return true;
- }
-
- /**
- * Starts the reconversion operation. The input method obtains the
- * text to be reconverted from the current client component using the
- * {@link java.awt.im.InputMethodRequests#getSelectedText InputMethodRequests.getSelectedText}
- * method. It can use other <code>InputMethodRequests</code>
- * methods to request additional information required for the
- * reconversion operation. The composed and committed text
- * produced by the operation is sent to the client component as a
- * sequence of <code>InputMethodEvent</code>s. If the given text
- * cannot be reconverted, the same text should be sent to the
- * client component as committed text.
- * <p>
- * This method is called by
- * {@link java.awt.im.InputContext#reconvert() InputContext.reconvert}.
- *
- * @throws UnsupportedOperationException if the input method does not
- * support the reconversion operation.
- */
- public void reconvert() {
-
- throw new UnsupportedOperationException("This input method does not reconvert.");
- }
-
- /**
- * Dispatches the event to the input method. If input method support is
- * enabled for the focussed component, incoming events of certain types
- * are dispatched to the current input method for this component before
- * they are dispatched to the component's methods or event listeners.
- * The input method decides whether it needs to handle the event. If it
- * does, it also calls the event's <code>consume</code> method; this
- * causes the event to not get dispatched to the component's event
- * processing methods or event listeners.
- * <p>
- * Events are dispatched if they are instances of InputEvent or its
- * subclasses.
- * This includes instances of the AWT classes KeyEvent and MouseEvent.
- * <p>
- * This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}.
- *
- * @param event the event being dispatched to the input method
- * @exception NullPointerException if <code>event</code> is null
- */
- public void dispatchEvent(AWTEvent event) {
-
- if (event instanceof KeyEvent) {
-
- KeyEvent keyEvent = (KeyEvent) event;
- if (event.getID() == KeyEvent.KEY_TYPED) {
- //System.out.println("handled event " + event);
- impl.handleKeyTyped(keyEvent);
- }
- }
- else {
- //System.out.println("did not handle event " + event);
- }
- }
-
- /**
- * Notifies this input method of changes in the client window
- * location or state. This method is called while this input
- * method is the current input method of its input context and
- * notifications for it are enabled (see {@link
- * InputMethodContext#enableClientWindowNotification
- * InputMethodContext.enableClientWindowNotification}). Calls
- * to this method are temporarily suspended if the input context's
- * {@link java.awt.im.InputContext#removeNotify removeNotify}
- * method is called, and resume when the input method is activated
- * for a new client component. It is called in the following
- * situations:
- * <ul>
- * <li>
- * when the window containing the current client component changes
- * in location, size, visibility, iconification state, or when the
- * window is closed.</li>
- * <li>
- * from <code> enableClientWindowNotification(inputMethod,
- * true)</code> if the current client component exists,</li>
- * <li>
- * when activating the input method for the first time after it
- * called
- * <code>enableClientWindowNotification(inputMethod,
- * true)</code> if during the call no current client component was
- * available,</li>
- * <li>
- * when activating the input method for a new client component
- * after the input context's removeNotify method has been
- * called.</li>
- * </ul>
- * @param bounds client window's {@link
- * java.awt.Component#getBounds bounds} on the screen; or null if
- * the client window is iconified or invisible
- */
- public void notifyClientWindowChange(Rectangle bounds) {
- }
-
- /**
- * Activates the input method for immediate input processing.
- * <p>
- * If an input method provides its own windows, it should make sure
- * at this point that all necessary windows are open and visible.
- * <p>
- * This method is called
- * <ul>
- * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
- * when a client component receives a FOCUS_GAINED event,
- * <li>when switching to this input method from a different one using the
- * user interface or
- * {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
- * </ul>
- * The method is only called when the input method is inactive.
- * A newly instantiated input method is assumed to be inactive.
- */
- public void activate() {
- //System.out.println("activated");
- }
-
- /**
- * Deactivates the input method.
- * The isTemporary argument has the same meaning as in
- * {@link java.awt.event.FocusEvent#isTemporary FocusEvent.isTemporary}.
- * <p>
- * If an input method provides its own windows, only windows that relate
- * to the current composition (such as a lookup choice window) should be
- * closed at this point.
- * It is possible that the input method will be immediately activated again
- * for a different client component, and closing and reopening more
- * persistent windows (such as a control panel) would create unnecessary
- * screen flicker.
- * Before an instance of a different input method class is activated,
- * {@link #hideWindows} is called on the current input method.
- * <p>
- * This method is called
- * <ul>
- * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
- * when a client component receives a FOCUS_LOST event,
- * <li>when switching from this input method to a different one using the
- * user interface or
- * {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
- * <li>before {@link #removeNotify removeNotify} if the current client component is
- * removed.
- * </ul>
- * The method is only called when the input method is active.
- *
- * @param isTemporary whether the focus change is temporary
- */
- public void deactivate(boolean isTemporary) {
- //System.out.println("deactivated");
- }
-
- /**
- * Closes or hides all windows opened by this input method instance or
- * its class.
- * <p>
- * This method is called
- * <ul>
- * <li>before calling {@link #activate activate} on an instance of a different input
- * method class,
- * <li>before calling {@link #dispose dispose} on this input method.
- * </ul>
- * The method is only called when the input method is inactive.
- */
- public void hideWindows() {
- }
-
- /**
- * Notifies the input method that a client component has been
- * removed from its containment hierarchy, or that input method
- * support has been disabled for the component.
- * <p>
- * This method is called by {@link java.awt.im.InputContext#removeNotify InputContext.removeNotify}.
- * <p>
- * The method is only called when the input method is inactive.
- */
- public void removeNotify() {
- }
-
- /**
- * Ends any input composition that may currently be going on in this
- * context. Depending on the platform and possibly user preferences,
- * this may commit or delete uncommitted text. Any changes to the text
- * are communicated to the active component using an input method event.
- *
- * <p>
- * A text editing component may call this in a variety of situations,
- * for example, when the user moves the insertion point within the text
- * (but outside the composed text), or when the component's text is
- * saved to a file or copied to the clipboard.
- * <p>
- * This method is called
- * <ul>
- * <li>by {@link java.awt.im.InputContext#endComposition InputContext.endComposition},
- * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
- * when switching to a different client component
- * <li>when switching from this input method to a different one using the
- * user interface or
- * {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
- * </ul>
- */
- public void endComposition() {
-
- impl.endComposition();
- }
-
- /**
- * Disposes of the input method and releases the resources used by it.
- * In particular, the input method should dispose windows and close files that are no
- * longer needed.
- * <p>
- * This method is called by {@link java.awt.im.InputContext#dispose InputContext.dispose}.
- * <p>
- * The method is only called when the input method is inactive.
- * No method of this interface is called on this instance after dispose.
- */
- public void dispose() {
- }
-
- /**
- * Returns a control object from this input method, or null. A
- * control object provides methods that control the behavior of the
- * input method or obtain information from the input method. The type
- * of the object is an input method specific class. Clients have to
- * compare the result against known input method control object
- * classes and cast to the appropriate class to invoke the methods
- * provided.
- * <p>
- * This method is called by
- * {@link java.awt.im.InputContext#getInputMethodControlObject InputContext.getInputMethodControlObject}.
- *
- * @return a control object from this input method, or null
- */
- public Object getControlObject() {
-
- return null;
- }
-}
diff --git a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodDescriptor.java b/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodDescriptor.java
deleted file mode 100644
index 4d12a728d..000000000
--- a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodDescriptor.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- *
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.Image;
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodDescriptor;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ThaiInputMethodDescriptor implements InputMethodDescriptor {
-
- static final Locale THAI = new Locale("th");
-
- public ThaiInputMethodDescriptor() {
- }
-
- /**
- * @see java.awt.im.spi.InputMethodDescriptor#getAvailableLocales
- */
- public Locale[] getAvailableLocales() {
- return new Locale[] { THAI };
- }
-
- /**
- * @see java.awt.im.spi.InputMethodDescriptor#hasDynamicLocaleList
- */
- public boolean hasDynamicLocaleList() {
- return false;
- }
-
- /**
- * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
- */
- public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
- try {
- ResourceBundle resources = ResourceBundle.getBundle(
- "com.sun.inputmethods.internal.thaiim.resources.DisplayNames", displayLanguage);
- return resources.getString("DisplayName.Thai");
- } catch (MissingResourceException mre) {
- return "Thai Input Method";
- }
- }
-
- /**
- * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodIcon
- */
- public Image getInputMethodIcon(Locale inputLocale) {
- return null;
- }
-
- /**
- * @see java.awt.im.spi.InputMethodDescriptor#createInputMethod
- */
- public InputMethod createInputMethod() throws Exception {
- ThaiInputMethodImpl impl = new ThaiInputMethodImpl();
- return new ThaiInputMethod(THAI, impl);
- }
-
- public String toString() {
- return getClass().getName();
- }
-}
diff --git a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodImpl.java b/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodImpl.java
deleted file mode 100644
index 5cc66d97b..000000000
--- a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodImpl.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- *
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.im.InputMethodRequests;
-import java.awt.im.spi.InputMethodContext;
-
-import java.awt.Toolkit;
-import java.awt.event.KeyEvent;
-import java.awt.event.InputMethodEvent;
-import java.awt.font.TextAttribute;
-import java.awt.font.TextHitInfo;
-
-import java.text.AttributedCharacterIterator;
-import java.text.AttributedString;
-
-class ThaiInputMethodImpl {
-
- private static final char[] keyboardMap = {
- /* 00 */ '\u0000',
- /* 01 */ '\u0001',
- /* 02 */ '\u0002',
- /* 03 */ '\u0003',
- /* 04 */ '\u0004',
- /* 05 */ '\u0005',
- /* 06 */ '\u0006',
- /* 07 */ '\u0007',
- /* 08 */ '\u0008',
- /* 09 */ '\u0009',
- /* 0A */ '\012',
- /* 0B */ '\u000B',
- /* 0C */ '\u000C',
- /* 0D */ '\015',
- /* 0E */ '\u000E',
- /* 0F */ '\u000F',
- /* 10 */ '\u0010',
- /* 11 */ '\u0011',
- /* 12 */ '\u0012',
- /* 13 */ '\u0013',
- /* 14 */ '\u0014',
- /* 15 */ '\u0015',
- /* 16 */ '\u0016',
- /* 17 */ '\u0017',
- /* 18 */ '\u0018',
- /* 19 */ '\u0019',
- /* 1A */ '\u001A',
- /* 1B */ '\u001B',
- /* 1C */ '\u001C',
- /* 1D */ '\u001D',
- /* 1E */ '\u001E',
- /* 1F */ '\u001F',
- /* 20 */ '\u0020',
- /* 21 */ '\u0e45', // '!'
- /* 22 */ '\u002e', // '"'
- /* 23 */ '\u0e52', // '#'
- /* 24 */ '\u0e53', // '$'
- /* 25 */ '\u0e54', // '%'
- /* 26 */ '\u0e4e', // '&'
- /* 27 */ '\u0e07', // '''
- /* 28 */ '\u0e56', // '('
- /* 29 */ '\u0e57', // ')'
- /* 2A */ '\u0e55', // '*'
- /* 2B */ '\u0e59', // '+'
- /* 2C */ '\u0e21', // ','
- /* 2D */ '\u0e02', // '-'
- /* 2E */ '\u0e43', // '.'
- /* 2F */ '\u0e1d', // '/'
- /* 30 */ '\u0e08', // '0'
- /* 31 */ '\u0e3f', // '1'
- /* 32 */ '\u002f', // '2'
- /* 33 */ '\u002d', // '3'
- /* 34 */ '\u0e20', // '4'
- /* 35 */ '\u0e16', // '5'
- /* 36 */ '\u0e38', // '6'
- /* 37 */ '\u0e36', // '7'
- /* 38 */ '\u0e04', // '8'
- /* 39 */ '\u0e15', // '9'
- /* 3A */ '\u0e0b', // ':'
- /* 3B */ '\u0e27', // ';'
- /* 3C */ '\u0e12', // '<'
- /* 3D */ '\u0e0a', // '='
- /* 3E */ '\u0e2c', // '>'
- /* 3F */ '\u0e26', // '?'
- /* 40 */ '\u0e51', // '@'
- /* 41 */ '\u0e24', // 'A'
- /* 42 */ '\u0e3a', // 'B'
- /* 43 */ '\u0e09', // 'C'
- /* 44 */ '\u0e0f', // 'D'
- /* 45 */ '\u0e0e', // 'E'
- /* 46 */ '\u0e42', // 'F'
- /* 47 */ '\u0e0c', // 'G'
- /* 48 */ '\u0e47', // 'H'
- /* 49 */ '\u0e13', // 'I'
- /* 4A */ '\u0e4b', // 'J'
- /* 4B */ '\u0e29', // 'K'
- /* 4C */ '\u0e28', // 'L'
- /* 4D */ '\u003f', // 'M'
- /* 4E */ '\u0e4c', // 'N'
- /* 4F */ '\u0e2f', // 'O'
- /* 50 */ '\u0e0d', // 'P'
- /* 51 */ '\u0e50', // 'Q'
- /* 52 */ '\u0e11', // 'R'
- /* 53 */ '\u0e06', // 'S'
- /* 54 */ '\u0e18', // 'T'
- /* 55 */ '\u0e4a', // 'U'
- /* 56 */ '\u0e2e', // 'V'
- /* 57 */ '\u0022', // 'W'
- /* 58 */ '\u0029', // 'X'
- /* 59 */ '\u0e4d', // 'Y'
- /* 5A */ '\u0028', // 'Z'
- /* 5B */ '\u0e1a', // '['
- /* 5C */ '\u0e05', // '\'
- /* 5D */ '\u0e25', // ']'
- /* 5E */ '\u0e39', // '^'
- /* 5F */ '\u0e58', // '_'
- /* 60 */ '\u0e4f', // '`'
- /* 61 */ '\u0e1f', // 'a'
- /* 62 */ '\u0e34', // 'b'
- /* 63 */ '\u0e41', // 'c'
- /* 64 */ '\u0e01', // 'd'
- /* 65 */ '\u0e33', // 'e'
- /* 66 */ '\u0e14', // 'f'
- /* 67 */ '\u0e40', // 'g'
- /* 68 */ '\u0e49', // 'h'
- /* 69 */ '\u0e23', // 'i'
- /* 6A */ '\u0e48', // 'j'
- /* 6B */ '\u0e32', // 'k'
- /* 6C */ '\u0e2a', // 'l'
- /* 6D */ '\u0e17', // 'm'
- /* 6E */ '\u0e37', // 'n'
- /* 6F */ '\u0e19', // 'o'
- /* 70 */ '\u0e22', // 'p'
- /* 71 */ '\u0e46', // 'q'
- /* 72 */ '\u0e1e', // 'r'
- /* 73 */ '\u0e2b', // 's'
- /* 74 */ '\u0e30', // 't'
- /* 75 */ '\u0e35', // 'u'
- /* 76 */ '\u0e2d', // 'v'
- /* 77 */ '\u0e44', // 'w'
- /* 78 */ '\u0e1b', // 'x'
- /* 79 */ '\u0e31', // 'y'
- /* 7A */ '\u0e1c', // 'z'
- /* 7B */ '\u0e10', // '{'
- /* 7C */ '\u0e03', // '|'
- /* 7D */ '\u002c', // '}'
- /* 7E */ '\u0e5b', // '~'
- /* 7F */ '\u007F' //
- };
-
- // cached TextHitInfo. Only one type of TextHitInfo is required.
- private static final TextHitInfo ZERO_TRAILING_HIT_INFO = TextHitInfo.trailing(0);
-
- private ThaiRules rules;
-
- /**
- * Returns the equivalent character for thai locale.
- * @param originalChar The original character.
- */
- private char getMappedChar( char originalChar )
- {
- if (originalChar <= keyboardMap.length) {
- return keyboardMap[originalChar];
- }
-
- return originalChar;
- }//getMappedChar()
-
- private InputMethodContext context;
-
- void setInputMethodContext(InputMethodContext context) {
- this.context = context;
- rules = new ThaiRules((InputMethodRequests)context);
- }
-
- void handleKeyTyped(KeyEvent kevent) {
- char keyChar = kevent.getKeyChar();
- char currentChar = getMappedChar(keyChar);
- if (!Character.UnicodeBlock.THAI.equals(Character.UnicodeBlock.of(currentChar))) {
- // don't care
- return;
- } else if (rules.isInputValid(currentChar)) {
- Character tmp = new Character(currentChar);
- String tmp2 = tmp.toString();
- context.dispatchInputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
- (new AttributedString(tmp2)).getIterator(),
- 1,
- ZERO_TRAILING_HIT_INFO,
- ZERO_TRAILING_HIT_INFO);
- } else {
- // input sequence is not allowed
- Toolkit.getDefaultToolkit().beep();
- }
-
- kevent.consume();// prevent client from getting this event.
- return;
- }//dispatchEvent()
-
- void endComposition() {
- }//endComposition()
-}
diff --git a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiRules.java b/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiRules.java
deleted file mode 100644
index 02e4b6ed4..000000000
--- a/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiRules.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.im.InputMethodRequests;
-
-public class ThaiRules {
-
- public static final char BASE = 0x0e00;
-
- public static final byte NON = 0;
- public static final byte CONS = 1;
- public static final byte LV = 2;
- public static final byte FV1 = 3;
- public static final byte FV2 = 4;
- public static final byte FV3 = 5;
- public static final byte FV4 = 6;
- /* Note that FV4 is added. It is not in WTT.
- * We need it for SARA AM since it has a
- * weired characteristic to share the same
- * cell with whatever consonant preceeds it.
- */
- public static final byte BV1 = 7;
- public static final byte BV2 = 8;
- public static final byte BD = 9;
- public static final byte TONE = 10;
- public static final byte AD1 = 11;
- public static final byte AD2 = 12;
- public static final byte AD3 = 13;
- public static final byte AV1 = 14;
- public static final byte AV2 = 15;
- public static final byte AV3 = 16;
-
- /**
- * Constants for validity checking and auto correction
- */
- public static final byte STRICT = 0;
- public static final byte LOOSE = 1;
- public static final byte NOREPLACE = 2;
-
- public static final byte[] CHARTYPE = {
- /* 0e00 UNUSED */ NON,
- /* THAI CHARACTER KO KAI */ CONS,
- /* THAI CHARACTER KHO KHAI */ CONS,
- /* THAI CHARACTER KHO KHUAT */ CONS,
- /* THAI CHARACTER KHO KHWAI */ CONS,
- /* THAI CHARACTER KHO KHON */ CONS,
- /* THAI CHARACTER KHO RAKHANG */ CONS,
- /* THAI CHARACTER NGO NGU */ CONS,
- /* THAI CHARACTER CHO CHAN */ CONS,
- /* THAI CHARACTER CHO CHING */ CONS,
- /* THAI CHARACTER CHO CHANG */ CONS,
- /* THAI CHARACTER SO SO */ CONS,
- /* THAI CHARACTER CHO CHOE */ CONS,
- /* THAI CHARACTER YO YING */ CONS,
- /* THAI CHARACTER DO CHADA */ CONS,
- /* THAI CHARACTER TO PATAK */ CONS,
- /* THAI CHARACTER THO THAN */ CONS,
- /* THAI CHARACTER THO NANGMONTHO */ CONS,
- /* THAI CHARACTER THO PHUTHAO */ CONS,
- /* THAI CHARACTER NO NEN */ CONS,
- /* THAI CHARACTER DO DEK */ CONS,
- /* THAI CHARACTER TO TAO */ CONS,
- /* THAI CHARACTER THO THUNG */ CONS,
- /* THAI CHARACTER THO THAHAN */ CONS,
- /* THAI CHARACTER THO THONG */ CONS,
- /* THAI CHARACTER NO NU */ CONS,
- /* THAI CHARACTER BO BAIMAI */ CONS,
- /* THAI CHARACTER PO PLA */ CONS,
- /* THAI CHARACTER PHO PHUNG */ CONS,
- /* THAI CHARACTER FO FA */ CONS,
- /* THAI CHARACTER PHO PHAN */ CONS,
- /* THAI CHARACTER FO FAN */ CONS,
- /* THAI CHARACTER PHO SAMPHAO */ CONS,
- /* THAI CHARACTER MO MA */ CONS,
- /* THAI CHARACTER YO YAK */ CONS,
- /* THAI CHARACTER RO RUA */ CONS,
- /* THAI CHARACTER RU */ FV3,
- /* THAI CHARACTER LO LING */ CONS,
- /* THAI CHARACTER LU */ FV3,
- /* THAI CHARACTER WO WAEN */ CONS,
- /* THAI CHARACTER SO SALA */ CONS,
- /* THAI CHARACTER SO RUSI */ CONS,
- /* THAI CHARACTER SO SUA */ CONS,
- /* THAI CHARACTER HO HIP */ CONS,
- /* THAI CHARACTER LO CHULA */ CONS,
- /* THAI CHARACTER O ANG */ CONS,
- /* THAI CHARACTER HO NOKHUK */ CONS,
- /* THAI CHARACTER PAIYANNOI */ NON,
- /* THAI CHARACTER SARA A */ FV1,
- /* THAI CHARACTER MAI HAN-AKAT */ AV2,
- /* THAI CHARACTER SARA AA */ FV1,
- /* THAI CHARACTER SARA AM */ FV4,
- /* THAI CHARACTER SARA I */ AV1,
- /* THAI CHARACTER SARA II */ AV3,
- /* THAI CHARACTER SARA UE */ AV2,
- /* THAI CHARACTER SARA UEE */ AV3,
- /* THAI CHARACTER SARA U */ BV1,
- /* THAI CHARACTER SARA UU */ BV2,
- /* THAI CHARACTER PHINTHU */ BD,
- /* 0e3b UNUSED */ NON,
- /* 0e3c UNUSED */ NON,
- /* 0e3d UNUSED */ NON,
- /* 0e3e UNUSED */ NON,
- /* THAI CURRENCY SYMBOL BAHT */ NON,
- /* THAI CHARACTER SARA E */ LV,
- /* THAI CHARACTER SARA AE */ LV,
- /* THAI CHARACTER SARA O */ LV,
- /* THAI CHARACTER SARA AI MAIMUAN */ LV,
- /* THAI CHARACTER SARA AI MAIMALAI */ LV,
- /* THAI CHARACTER LAKKHANGYAO */ FV2,
- /* THAI CHARACTER MAIYAMOK */ NON,
- /* THAI CHARACTER MAITAIKHU */ AD2,
- /* THAI CHARACTER MAI EK */ TONE,
- /* THAI CHARACTER MAI THO */ TONE,
- /* THAI CHARACTER MAI TRI */ TONE,
- /* THAI CHARACTER MAI CHATTAWA */ TONE,
- /* THAI CHARACTER THANTHAKHAT */ AD1,
- /* THAI CHARACTER NIKHAHIT */ AD3,
- /* THAI CHARACTER YAMAKKAN */ AD3,
- /* THAI CHARACTER FONGMAN */ NON,
- /* THAI DIGIT ZERO */ NON,
- /* THAI DIGIT ONE */ NON,
- /* THAI DIGIT TWO */ NON,
- /* THAI DIGIT THREE */ NON,
- /* THAI DIGIT FOUR */ NON,
- /* THAI DIGIT FIVE */ NON,
- /* THAI DIGIT SIX */ NON,
- /* THAI DIGIT SEVEN */ NON,
- /* THAI DIGIT EIGHT */ NON,
- /* THAI DIGIT NINE */ NON,
- /* THAI CHARACTER ANGKHANKHU */ NON,
- /* THAI CHARACTER KHOMUT */ NON
- };
-
- private InputMethodRequests requests;
-
- ThaiRules(InputMethodRequests requests) {
- this.requests = requests;
- }
-
- public static byte getCharType(char c) {
- byte cType;
- int ci = ((int) c) - (int) BASE;
- if (ci < 0 || ci >= CHARTYPE.length)
- cType = NON;
- else
- cType = CHARTYPE[ci];
- return cType;
- }
-
- private static boolean isValid(char c1, char c2, int[] validityArray) {
- return ((validityArray[getCharType(c1)]
- & (1 << getCharType(c2))) != 0);
- }
-
- /**
- * VALIDITY is a bit matrix defining whether one
- * character is allowed to be typed in after the
- * previous one (array index). Determining the
- * validity is done by bit-anding the 2nd char
- * type's mask (obtained by 1 << chartype) with
- * the array element indexed by the first char
- * type. If the result is non-zero, the 2nd
- * character is allowed to follow the first.
- */
-
- /* Please note that the bits in the comment below
- * are displayed least significant bit first.
- * The actual value reflexs this representation
- * when the bits are swapped.
- */
-
- private static final int[] INPUTVALIDITY = {
- /* NON 1110 010 0 0000 0000 0 */ 0x00027,
- /* CONS 1111 111 1 1111 1111 1 */ 0x1ffff,
- /* LV 0100 000 0 0000 0000 0 */ 0x00002,
- /* FV1 1110 010 0 0000 0000 0 */ 0x00027,
- /* FV2 1110 010 0 0000 0000 0 */ 0x00027,
- /* FV3 1110 110 0 0000 0000 0 */ 0x00037,
- /* FV4 1110 010 0 0000 0000 0 */ 0x00027,
- /* BV1 1110 010 0 0011 0000 0 */ 0x00c27,
- /* BV2 1110 010 0 0010 0000 0 */ 0x00427,
- /* BD 1110 010 0 0000 0000 0 */ 0x00027,
- /* TONE 1111 011 0 0000 0000 0 */ 0x0006f,
- /* AD1 1110 010 0 0000 0000 0 */ 0x00027,
- /* AD2 1110 010 0 0000 0000 0 */ 0x00027,
- /* AD3 1110 010 0 0000 0000 0 */ 0x00027,
- /* AV1 1110 010 0 0011 0000 0 */ 0x00c27,
- /* AV2 1110 010 0 0010 0000 0 */ 0x00427,
- /* AV3 1110 010 0 0010 0100 0 */ 0x02427
- };
-
- private static final int[] COMPOSABLE = {
- /* NON 0000 000 0 0000 0000 0 */ 0x00000,
- /* CONS 0000 001 1 1111 1111 1 */ 0x1ffc0,
- /* LV 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV1 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV2 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV3 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV4 0000 000 0 0000 0000 0 */ 0x00000,
- /* BV1 0000 000 0 0011 0000 0 */ 0x00c00,
- /* BV2 0000 000 0 0010 0000 0 */ 0x00400,
- /* BD 0000 000 0 0000 0000 0 */ 0x00000,
- /* TONE 0000 001 0 0000 0000 0 */ 0x00040,
- /* AD1 0000 000 0 0000 0000 0 */ 0x00000,
- /* AD2 0000 000 0 0000 0000 0 */ 0x00000,
- /* AD3 0000 000 0 0000 0000 0 */ 0x00000,
- /* AV1 0000 000 0 0011 0000 0 */ 0x00c00,
- /* AV2 0000 000 0 0010 0000 0 */ 0x00400,
- /* AV3 0000 000 0 0010 0100 0 */ 0x02400
- };
-
- private static final int[] REPLACABLE = {
- /* NON 0000 000 0 0000 0000 0 */ 0x00000,
- /* CONS 0000 000 0 0000 0000 0 */ 0x00000,
- /* LV 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV1 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV2 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV3 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV4 0000 001 1 1001 1111 1 */ 0x1f9c0,
- /* BV1 0000 001 1 1100 1111 1 */ 0x1f3c0,
- /* BV2 0000 001 1 1101 1111 1 */ 0x1fbc0,
- /* BD 0000 001 1 1111 1111 1 */ 0x1ffc0,
- /* TONE 0000 000 0 0111 1100 0 */ 0x03e00,
- /* AD1 0000 001 0 1111 1101 1 */ 0x1bf40,
- /* AD2 0000 001 1 1111 1111 1 */ 0x1ffc0,
- /* AD3 0000 001 1 1111 1111 0 */ 0x0ffc0,
- /* AV1 0000 001 1 1100 1111 1 */ 0x1f3c0,
- /* AV2 0000 001 1 1101 1111 1 */ 0x1fbc0,
- /* AV3 0000 001 1 1101 1011 1 */ 0x1dbc0
- };
-
- private static final int[] SWAPPABLE = {
- /* NON 0000 000 0 0000 0000 0 */ 0x00000,
- /* CONS 0000 000 0 0000 0000 0 */ 0x00000,
- /* LV 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV1 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV2 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV3 0000 000 0 0000 0000 0 */ 0x00000,
- /* FV4 0000 000 0 0010 0000 0 */ 0x00400,
- /* BV1 0000 000 0 0000 0000 0 */ 0x00000,
- /* BV2 0000 000 0 0000 0000 0 */ 0x00000,
- /* BD 0000 000 0 0000 0000 0 */ 0x00000,
- /* TONE 0000 000 1 1000 0011 1 */ 0x1c180,
- /* AD1 0000 000 1 0000 0010 0 */ 0x04080,
- /* AD2 0000 000 0 0000 0000 0 */ 0x00000,
- /* AD3 0000 000 0 0000 0000 1 */ 0x10000,
- /* AV1 0000 000 0 0000 0000 0 */ 0x00000,
- /* AV2 0000 000 0 0000 0000 0 */ 0x00000,
- /* AV3 0000 000 0 0000 0000 0 */ 0x00000
- };
-
- public static boolean isInputValid(char c1, char c2) {
- return isValid(c1, c2, INPUTVALIDITY);
- }
-
- public static boolean isComposable(char c1, char c2) {
- return isValid(c1, c2, COMPOSABLE);
- }
-
- public static boolean isSwappable(char c1, char c2) {
- return isValid(c1, c2, SWAPPABLE);
- }
-
- public static boolean isReplacable(char c1, char c2) {
- return isValid(c1, c2, REPLACABLE);
- }
-
- public static boolean isForward(char c) {
- return (getCharType(c) < FV4);
- }
-
- public static boolean isDead(char c) {
- return (getCharType(c) > FV3);
- }
-
- public boolean isInputValid(char current) {
- int offset = requests.getInsertPositionOffset();
- if (offset == 0) {
- byte charType = getCharType(current);
- return ((charType < FV1) || (charType == FV3));
- }
- else {
- char prev = requests.getCommittedText(offset-1, offset, null).first();
-
- if(isForward(current)) {
- if (isInputValid(prev, current)) {
- if (getCharType(prev) == TONE &&
- getCharType(current) == FV1) {
- if (offset == 1) {
- return true;
- } else {
- char pprev =
- requests.getCommittedText(offset-2, offset-1, null).first();
- return isInputValid(pprev, current);
- }
- } else {
- return true;
- }
- } else if (prev == '\u0e32' && // SARA AA
- current == '\u0e30') { // SARA A
- return true;
- } else if (prev == '\u0e4d' && // NIKAHIT
- current == '\u0e32') { // SARA AA
- // Special compose to SARA AM
- return true;
- } else {
- return false;
- }
- } else {
- if(isInputValid(prev, current)) {
- if (getCharType(prev) == TONE &&
- getCharType(current) == FV4) {
- return (offset != 1);
- } else {
- return true;
- }
- } else {
- return false;
- }
- }
- }
- }
-}
diff --git a/src/share/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor b/src/share/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor
deleted file mode 100644
index 9f60bbe99..000000000
--- a/src/share/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.inputmethods.internal.thaiim.ThaiInputMethodDescriptor
diff --git a/src/share/classes/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties b/src/share/classes/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties
deleted file mode 100644
index e4528a49a..000000000
--- a/src/share/classes/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# Default Input method display names for Thai input methods
-#
-
-DisplayName.Thai = Thai Input Method
-