< prev index next >
src/java.desktop/share/classes/java/awt/Event.java
Print this page
@@ -26,37 +26,37 @@
import java.awt.event.*;
import java.io.*;
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
- * <code>Event</code> is a platform-independent class that
+ * {@code Event} is a platform-independent class that
* encapsulates events from the platform's Graphical User
* Interface in the Java 1.0 event model. In Java 1.1
- * and later versions, the <code>Event</code> class is maintained
+ * and later versions, the {@code Event} class is maintained
* only for backwards compatibility. The information in this
* class description is provided to assist programmers in
* converting Java 1.0 programs to the new event model.
* <p>
* In the Java 1.0 event model, an event contains an
* {@link Event#id} field
* that indicates what type of event it is and which other
- * <code>Event</code> variables are relevant for the event.
+ * {@code Event} variables are relevant for the event.
* <p>
* For keyboard events, {@link Event#key}
* contains a value indicating which key was activated, and
* {@link Event#modifiers} contains the
* modifiers for that event. For the KEY_PRESS and KEY_RELEASE
- * event ids, the value of <code>key</code> is the unicode
+ * event ids, the value of {@code key} is the unicode
* character code for the key. For KEY_ACTION and
- * KEY_ACTION_RELEASE, the value of <code>key</code> is
+ * KEY_ACTION_RELEASE, the value of {@code key} is
* one of the defined action-key identifiers in the
- * <code>Event</code> class (<code>PGUP</code>,
- * <code>PGDN</code>, <code>F1</code>, <code>F2</code>, etc).
+ * {@code Event} class ({@code PGUP},
+ * {@code PGDN}, {@code F1}, {@code F2}, etc).
*
* @author Sami Shaio
* @since 1.0
*/
public class Event implements java.io.Serializable {
@@ -291,21 +291,21 @@
*/
public static final int KEY_RELEASE = 2 + KEY_EVENT;
/**
* The user has pressed a non-ASCII <em>action</em> key.
- * The <code>key</code> field contains a value that indicates
+ * The {@code key} field contains a value that indicates
* that the event occurred on one of the action keys, which
* comprise the 12 function keys, the arrow (cursor) keys,
* Page Up, Page Down, Home, End, Print Screen, Scroll Lock,
* Caps Lock, Num Lock, Pause, and Insert.
*/
public static final int KEY_ACTION = 3 + KEY_EVENT;
/**
* The user has released a non-ASCII <em>action</em> key.
- * The <code>key</code> field contains a value that indicates
+ * The {@code key} field contains a value that indicates
* that the event occurred on one of the action keys, which
* comprise the 12 function keys, the arrow (cursor) keys,
* Page Up, Page Down, Home, End, Print Screen, Scroll Lock,
* Caps Lock, Num Lock, Pause, and Insert.
*/
@@ -313,23 +313,23 @@
/* Base for all mouse events. */
private static final int MOUSE_EVENT = 500;
/**
- * The user has pressed the mouse button. The <code>ALT_MASK</code>
+ * The user has pressed the mouse button. The {@code ALT_MASK}
* flag indicates that the middle button has been pressed.
- * The <code>META_MASK</code>flag indicates that the
+ * The {@code META_MASK} flag indicates that the
* right button has been pressed.
* @see java.awt.Event#ALT_MASK
* @see java.awt.Event#META_MASK
*/
public static final int MOUSE_DOWN = 1 + MOUSE_EVENT;
/**
- * The user has released the mouse button. The <code>ALT_MASK</code>
+ * The user has released the mouse button. The {@code ALT_MASK}
* flag indicates that the middle button has been released.
- * The <code>META_MASK</code>flag indicates that the
+ * The {@code META_MASK} flag indicates that the
* right button has been released.
* @see java.awt.Event#ALT_MASK
* @see java.awt.Event#META_MASK
*/
public static final int MOUSE_UP = 2 + MOUSE_EVENT;
@@ -349,12 +349,12 @@
*/
public static final int MOUSE_EXIT = 5 + MOUSE_EVENT;
/**
* The user has moved the mouse with a button pressed. The
- * <code>ALT_MASK</code> flag indicates that the middle
- * button is being pressed. The <code>META_MASK</code> flag indicates
+ * {@code ALT_MASK} flag indicates that the middle
+ * button is being pressed. The {@code META_MASK} flag indicates
* that the right button is being pressed.
* @see java.awt.Event#ALT_MASK
* @see java.awt.Event#META_MASK
*/
public static final int MOUSE_DRAG = 6 + MOUSE_EVENT;
@@ -464,11 +464,11 @@
*/
public long when;
/**
* Indicates which type of event the event is, and which
- * other <code>Event</code> variables are relevant for the event.
+ * other {@code Event} variables are relevant for the event.
* This has been replaced by AWTEvent.getID()
*
* @serial
* @see java.awt.AWTEvent#getID()
*/
@@ -516,24 +516,24 @@
* @see java.awt.event.InputEvent#getModifiers()
*/
public int modifiers;
/**
- * For <code>MOUSE_DOWN</code> events, this field indicates the
+ * For {@code MOUSE_DOWN} events, this field indicates the
* number of consecutive clicks. For other events, its value is
- * <code>0</code>.
+ * {@code 0}.
* This field has been replaced by MouseEvent.getClickCount().
*
* @serial
* @see java.awt.event.MouseEvent#getClickCount()
*/
public int clickCount;
/**
* An arbitrary argument of the event. The value of this field
* depends on the type of event.
- * <code>arg</code> has been replaced by event specific property.
+ * {@code arg} has been replaced by event specific property.
*
* @serial
*/
public Object arg;
@@ -606,15 +606,15 @@
accessed from C.
*/
private static native void initIDs();
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
- * Creates an instance of <code>Event</code> with the specified target
+ * Creates an instance of {@code Event} with the specified target
* component, time stamp, event type, <i>x</i> and <i>y</i>
* coordinates, keyboard key, state of the modifier keys, and
* argument.
* @param target the target component.
* @param when the time stamp.
@@ -657,18 +657,18 @@
default:
}
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
- * Creates an instance of <code>Event</code>, with the specified target
+ * Creates an instance of {@code Event}, with the specified target
* component, time stamp, event type, <i>x</i> and <i>y</i>
* coordinates, keyboard key, state of the modifier keys, and an
- * argument set to <code>null</code>.
+ * argument set to {@code null}.
* @param target the target component.
* @param when the time stamp.
* @param id the event type.
* @param x the <i>x</i> coordinate.
* @param y the <i>y</i> coordinate.
@@ -678,28 +678,28 @@
public Event(Object target, long when, int id, int x, int y, int key, int modifiers) {
this(target, when, id, x, y, key, modifiers, null);
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
- * Creates an instance of <code>Event</code> with the specified
+ * Creates an instance of {@code Event} with the specified
* target component, event type, and argument.
* @param target the target component.
* @param id the event type.
* @param arg the specified argument.
*/
public Event(Object target, int id, Object arg) {
this(target, 0, id, 0, 0, 0, 0, arg);
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
* Translates this event so that its <i>x</i> and <i>y</i>
* coordinates are increased by <i>dx</i> and <i>dy</i>,
* respectively.
* <p>
@@ -714,62 +714,62 @@
this.x += dx;
this.y += dy;
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
* Checks if the Shift key is down.
- * @return <code>true</code> if the key is down;
- * <code>false</code> otherwise.
+ * @return {@code true} if the key is down;
+ * {@code false} otherwise.
* @see java.awt.Event#modifiers
* @see java.awt.Event#controlDown
* @see java.awt.Event#metaDown
*/
public boolean shiftDown() {
return (modifiers & SHIFT_MASK) != 0;
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
* Checks if the Control key is down.
- * @return <code>true</code> if the key is down;
- * <code>false</code> otherwise.
+ * @return {@code true} if the key is down;
+ * {@code false} otherwise.
* @see java.awt.Event#modifiers
* @see java.awt.Event#shiftDown
* @see java.awt.Event#metaDown
*/
public boolean controlDown() {
return (modifiers & CTRL_MASK) != 0;
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
* Checks if the Meta key is down.
*
- * @return <code>true</code> if the key is down;
- * <code>false</code> otherwise.
+ * @return {@code true} if the key is down;
+ * {@code false} otherwise.
* @see java.awt.Event#modifiers
* @see java.awt.Event#shiftDown
* @see java.awt.Event#controlDown
*/
public boolean metaDown() {
return (modifiers & META_MASK) != 0;
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
*/
void consume() {
switch(id) {
case KEY_PRESS:
case KEY_RELEASE:
@@ -781,22 +781,22 @@
// event type cannot be consumed
}
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
*/
boolean isConsumed() {
return consumed;
}
/*
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
* Returns the integer key-code associated with the key in this event,
* as described in java.awt.Event.
*/
static int getOldEventKey(KeyEvent e) {
@@ -808,13 +808,13 @@
}
return (int)e.getKeyChar();
}
/*
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
* Returns a new KeyEvent char which corresponds to the int key
* of this old event.
*/
char getKeyEventChar() {
@@ -825,19 +825,19 @@
}
return (char)key;
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
- * Returns a string representing the state of this <code>Event</code>.
+ * Returns a string representing the state of this {@code Event}.
* This method is intended to be used only for debugging purposes, and the
* content and format of the returned string may vary between
* implementations. The returned string may be empty but may not be
- * <code>null</code>.
+ * {@code null}.
*
* @return the parameter string of this event
*/
protected String paramString() {
String str = "id=" + id + ",x=" + x + ",y=" + y;
@@ -861,13 +861,13 @@
}
return str;
}
/**
- * <b>NOTE:</b> The <code>Event</code> class is obsolete and is
+ * <b>NOTE:</b> The {@code Event} class is obsolete and is
* available only for backwards compatibility. It has been replaced
- * by the <code>AWTEvent</code> class and its subclasses.
+ * by the {@code AWTEvent} class and its subclasses.
* <p>
* Returns a representation of this event's values as a string.
* @return a string that represents the event and the values
* of its member fields.
* @see java.awt.Event#paramString
< prev index next >