1 |
/* KeyAdapter.java -- Convenience class for writing key listeners. |
/* KeyAdapter.java -- convenience class for writing key listeners |
2 |
Copyright (C) 1999 Free Software Foundation, Inc. |
Copyright (C) 1999, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
39 |
package java.awt.event; |
package java.awt.event; |
40 |
|
|
41 |
/** |
/** |
42 |
* This is a convenience class for writing key listeners. It implements |
* This class implements <code>KeyListener</code> and implements all methods |
43 |
* The <code>KeyListener</code> interface with empty method bodies. This |
* with empty bodies. This allows a listener interested in implementing only |
44 |
* allows a subclass to override just those methods of interest. |
* a subset of the <code>KeyListener</code> interface to extend this class |
45 |
* |
* and override only the desired methods. |
46 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* |
47 |
*/ |
* @author Aaron M. Renn <arenn@urbanophile.com> |
48 |
public abstract class KeyAdapter implements KeyListener |
* @see KeyEvent |
49 |
{ |
* @see KeyListener |
50 |
|
* @since 1.1 |
51 |
/* |
* @status updated to 1.4 |
|
* Constructors |
|
52 |
*/ |
*/ |
53 |
|
public abstract class KeyAdapter implements KeyListener |
|
/** |
|
|
* Do nothing default constructor for subclasses. |
|
|
*/ |
|
|
public |
|
|
KeyAdapter() |
|
|
{ |
|
|
} |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Instance Methods |
|
|
*/ |
|
|
|
|
|
/** |
|
|
* Implements this method in the interface with an empty body. |
|
|
* |
|
|
* @param event ignored. |
|
|
*/ |
|
|
public void |
|
|
keyPressed(KeyEvent event) |
|
|
{ |
|
|
} |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* Implements this method in the interface with an empty body. |
|
|
* |
|
|
* @param event ignored. |
|
|
*/ |
|
|
public void |
|
|
keyReleased(KeyEvent event) |
|
|
{ |
|
|
} |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* Implements this method in the interface with an empty body. |
|
|
* |
|
|
* @param event ignored. |
|
|
*/ |
|
|
public void |
|
|
keyTyped(KeyEvent event) |
|
54 |
{ |
{ |
55 |
} |
/** |
56 |
|
* Do nothing default constructor for subclasses. |
57 |
|
*/ |
58 |
|
public KeyAdapter() |
59 |
|
{ |
60 |
|
} |
61 |
|
|
62 |
|
/** |
63 |
|
* Implements this method in the interface with an empty body. |
64 |
|
* |
65 |
|
* @param event the event, ignored in this implementation |
66 |
|
*/ |
67 |
|
public void keyTyped(KeyEvent event) |
68 |
|
{ |
69 |
|
} |
70 |
|
|
71 |
|
/** |
72 |
|
* Implements this method in the interface with an empty body. |
73 |
|
* |
74 |
|
* @param event the event, ignored in this implementation |
75 |
|
*/ |
76 |
|
public void keyPressed(KeyEvent event) |
77 |
|
{ |
78 |
|
} |
79 |
|
|
80 |
|
/** |
81 |
|
* Implements this method in the interface with an empty body. |
82 |
|
* |
83 |
|
* @param event the event, ignored in this implementation |
84 |
|
*/ |
85 |
|
public void keyReleased(KeyEvent event) |
86 |
|
{ |
87 |
|
} |
88 |
} // class KeyAdapter |
} // class KeyAdapter |
|
|
|