jdk/src/share/classes/java/awt/event/InputMethodEvent.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 22254 8550495a4d78
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    31 import java.awt.font.TextHitInfo;
    31 import java.awt.font.TextHitInfo;
    32 import java.io.IOException;
    32 import java.io.IOException;
    33 import java.io.ObjectInputStream;
    33 import java.io.ObjectInputStream;
    34 import java.text.AttributedCharacterIterator;
    34 import java.text.AttributedCharacterIterator;
    35 import java.text.CharacterIterator;
    35 import java.text.CharacterIterator;
    36 import javax.tools.annotation.GenerateNativeHeader;
    36 import java.lang.annotation.Native;
    37 
    37 
    38 /**
    38 /**
    39  * Input method events contain information about text that is being
    39  * Input method events contain information about text that is being
    40  * composed using an input method. Whenever the text changes, the
    40  * composed using an input method. Whenever the text changes, the
    41  * input method sends an event. If the text component that's currently
    41  * input method sends an event. If the text component that's currently
    54  * always precedes composed text.
    54  * always precedes composed text.
    55  *
    55  *
    56  * @author JavaSoft Asia/Pacific
    56  * @author JavaSoft Asia/Pacific
    57  * @since 1.2
    57  * @since 1.2
    58  */
    58  */
    59 /* No native methods here, but the constants are needed in the supporting JNI code */
       
    60 @GenerateNativeHeader
       
    61 public class InputMethodEvent extends AWTEvent {
    59 public class InputMethodEvent extends AWTEvent {
    62 
    60 
    63     /**
    61     /**
    64      * Serial Version ID.
    62      * Serial Version ID.
    65      */
    63      */
    66     private static final long serialVersionUID = 4727190874778922661L;
    64     private static final long serialVersionUID = 4727190874778922661L;
    67 
    65 
    68     /**
    66     /**
    69      * Marks the first integer id for the range of input method event ids.
    67      * Marks the first integer id for the range of input method event ids.
    70      */
    68      */
    71     public static final int INPUT_METHOD_FIRST = 1100;
    69     @Native public static final int INPUT_METHOD_FIRST = 1100;
    72 
    70 
    73     /**
    71     /**
    74      * The event type indicating changed input method text. This event is
    72      * The event type indicating changed input method text. This event is
    75      * generated by input methods while processing input.
    73      * generated by input methods while processing input.
    76      */
    74      */
    77     public static final int INPUT_METHOD_TEXT_CHANGED = INPUT_METHOD_FIRST;
    75     @Native public static final int INPUT_METHOD_TEXT_CHANGED = INPUT_METHOD_FIRST;
    78 
    76 
    79     /**
    77     /**
    80      * The event type indicating a changed insertion point in input method text.
    78      * The event type indicating a changed insertion point in input method text.
    81      * This event is
    79      * This event is
    82      * generated by input methods while processing input if only the caret changed.
    80      * generated by input methods while processing input if only the caret changed.
    83      */
    81      */
    84     public static final int CARET_POSITION_CHANGED = INPUT_METHOD_FIRST + 1;
    82     @Native public static final int CARET_POSITION_CHANGED = INPUT_METHOD_FIRST + 1;
    85 
    83 
    86     /**
    84     /**
    87      * Marks the last integer id for the range of input method event ids.
    85      * Marks the last integer id for the range of input method event ids.
    88      */
    86      */
    89     public static final int INPUT_METHOD_LAST = INPUT_METHOD_FIRST + 1;
    87     @Native public static final int INPUT_METHOD_LAST = INPUT_METHOD_FIRST + 1;
    90 
    88 
    91     /**
    89     /**
    92      * The time stamp that indicates when the event was created.
    90      * The time stamp that indicates when the event was created.
    93      *
    91      *
    94      * @serial
    92      * @serial