src/share/classes/java/awt/Event.java

Print this page
rev 10048 : 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
Reviewed-by:


  40  * class description is provided to assist programmers in
  41  * converting Java 1.0 programs to the new event model.
  42  * <p>
  43  * In the Java&nbsp;1.0 event model, an event contains an
  44  * {@link Event#id} field
  45  * that indicates what type of event it is and which other
  46  * <code>Event</code> variables are relevant for the event.
  47  * <p>
  48  * For keyboard events, {@link Event#key}
  49  * contains a value indicating which key was activated, and
  50  * {@link Event#modifiers} contains the
  51  * modifiers for that event.  For the KEY_PRESS and KEY_RELEASE
  52  * event ids, the value of <code>key</code> is the unicode
  53  * character code for the key. For KEY_ACTION and
  54  * KEY_ACTION_RELEASE, the value of <code>key</code> is
  55  * one of the defined action-key identifiers in the
  56  * <code>Event</code> class (<code>PGUP</code>,
  57  * <code>PGDN</code>, <code>F1</code>, <code>F2</code>, etc).
  58  *
  59  * @author     Sami Shaio
  60  * @since      JDK1.0
  61  */
  62 public class Event implements java.io.Serializable {
  63     private transient long data;
  64 
  65     /* Modifier constants */
  66 
  67     /**
  68      * This flag indicates that the Shift key was down when the event
  69      * occurred.
  70      */
  71     public static final int SHIFT_MASK          = 1 << 0;
  72 
  73     /**
  74      * This flag indicates that the Control key was down when the event
  75      * occurred.
  76      */
  77     public static final int CTRL_MASK           = 1 << 1;
  78 
  79     /**
  80      * This flag indicates that the Meta key was down when the event


 854             str += ",meta";
 855         }
 856         if (target != null) {
 857             str += ",target=" + target;
 858         }
 859         if (arg != null) {
 860             str += ",arg=" + arg;
 861         }
 862         return str;
 863     }
 864 
 865     /**
 866      * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
 867      * available only for backwards compatibility.  It has been replaced
 868      * by the <code>AWTEvent</code> class and its subclasses.
 869      * <p>
 870      * Returns a representation of this event's values as a string.
 871      * @return    a string that represents the event and the values
 872      *                 of its member fields.
 873      * @see       java.awt.Event#paramString
 874      * @since     JDK1.1
 875      */
 876     public String toString() {
 877         return getClass().getName() + "[" + paramString() + "]";
 878     }
 879 }


  40  * class description is provided to assist programmers in
  41  * converting Java&nbsp;1.0 programs to the new event model.
  42  * <p>
  43  * In the Java&nbsp;1.0 event model, an event contains an
  44  * {@link Event#id} field
  45  * that indicates what type of event it is and which other
  46  * <code>Event</code> variables are relevant for the event.
  47  * <p>
  48  * For keyboard events, {@link Event#key}
  49  * contains a value indicating which key was activated, and
  50  * {@link Event#modifiers} contains the
  51  * modifiers for that event.  For the KEY_PRESS and KEY_RELEASE
  52  * event ids, the value of <code>key</code> is the unicode
  53  * character code for the key. For KEY_ACTION and
  54  * KEY_ACTION_RELEASE, the value of <code>key</code> is
  55  * one of the defined action-key identifiers in the
  56  * <code>Event</code> class (<code>PGUP</code>,
  57  * <code>PGDN</code>, <code>F1</code>, <code>F2</code>, etc).
  58  *
  59  * @author     Sami Shaio
  60  * @since      1.0
  61  */
  62 public class Event implements java.io.Serializable {
  63     private transient long data;
  64 
  65     /* Modifier constants */
  66 
  67     /**
  68      * This flag indicates that the Shift key was down when the event
  69      * occurred.
  70      */
  71     public static final int SHIFT_MASK          = 1 << 0;
  72 
  73     /**
  74      * This flag indicates that the Control key was down when the event
  75      * occurred.
  76      */
  77     public static final int CTRL_MASK           = 1 << 1;
  78 
  79     /**
  80      * This flag indicates that the Meta key was down when the event


 854             str += ",meta";
 855         }
 856         if (target != null) {
 857             str += ",target=" + target;
 858         }
 859         if (arg != null) {
 860             str += ",arg=" + arg;
 861         }
 862         return str;
 863     }
 864 
 865     /**
 866      * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
 867      * available only for backwards compatibility.  It has been replaced
 868      * by the <code>AWTEvent</code> class and its subclasses.
 869      * <p>
 870      * Returns a representation of this event's values as a string.
 871      * @return    a string that represents the event and the values
 872      *                 of its member fields.
 873      * @see       java.awt.Event#paramString
 874      * @since     1.1
 875      */
 876     public String toString() {
 877         return getClass().getName() + "[" + paramString() + "]";
 878     }
 879 }