Print this page
Split |
Close |
Expand all |
Collapse all |
--- old/src/share/classes/java/awt/event/MouseAdapter.java
+++ new/src/share/classes/java/awt/event/MouseAdapter.java
1 1 /*
2 2 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation. Oracle designates this
8 8 * particular file as subject to the "Classpath" exception as provided
9 9 * by Oracle in the LICENSE file that accompanied this code.
10 10 *
11 11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 14 * version 2 for more details (a copy is included in the LICENSE file that
15 15 * accompanied this code).
16 16 *
17 17 * You should have received a copy of the GNU General Public License version
18 18 * 2 along with this work; if not, write to the Free Software Foundation,
19 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 20 *
21 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 22 * or visit www.oracle.com if you need additional information or have any
23 23 * questions.
24 24 */
25 25
26 26 package java.awt.event;
27 27
28 28 /**
29 29 * An abstract adapter class for receiving mouse events.
30 30 * The methods in this class are empty. This class exists as
31 31 * convenience for creating listener objects.
32 32 * <P>
33 33 * Mouse events let you track when a mouse is pressed, released, clicked,
34 34 * moved, dragged, when it enters a component, when it exits and
35 35 * when a mouse wheel is moved.
36 36 * <P>
37 37 * Extend this class to create a {@code MouseEvent}
38 38 * (including drag and motion events) or/and {@code MouseWheelEvent}
39 39 * listener and override the methods for the events of interest. (If you implement the
40 40 * {@code MouseListener},
41 41 * {@code MouseMotionListener}
42 42 * interface, you have to define all of
43 43 * the methods in it. This abstract class defines null methods for them
44 44 * all, so you can only have to define methods for events you care about.)
45 45 * <P>
46 46 * Create a listener object using the extended class and then register it with
47 47 * a component using the component's {@code addMouseListener}
48 48 * {@code addMouseMotionListener}, {@code addMouseWheelListener}
49 49 * methods.
50 50 * The relevant method in the listener object is invoked and the {@code MouseEvent}
51 51 * or {@code MouseWheelEvent} is passed to it in following cases:
52 52 * <ul>
53 53 * <li>when a mouse button is pressed, released, or clicked (pressed and released)
54 54 * <li>when the mouse cursor enters or exits the component
55 55 * <li>when the mouse wheel rotated, or mouse moved or dragged
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
56 56 * </ul>
57 57 *
58 58 * @author Carl Quinn
59 59 * @author Andrei Dmitriev
60 60 *
61 61 * @see MouseEvent
62 62 * @see MouseWheelEvent
63 63 * @see MouseListener
64 64 * @see MouseMotionListener
65 65 * @see MouseWheelListener
66 - * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
66 + * @see <a href="https://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
67 67 *
68 68 * @since 1.1
69 69 */
70 70 public abstract class MouseAdapter implements MouseListener, MouseWheelListener, MouseMotionListener {
71 71 /**
72 72 * {@inheritDoc}
73 73 */
74 74 public void mouseClicked(MouseEvent e) {}
75 75
76 76 /**
77 77 * {@inheritDoc}
78 78 */
79 79 public void mousePressed(MouseEvent e) {}
80 80
81 81 /**
82 82 * {@inheritDoc}
83 83 */
84 84 public void mouseReleased(MouseEvent e) {}
85 85
86 86 /**
87 87 * {@inheritDoc}
88 88 */
89 89 public void mouseEntered(MouseEvent e) {}
90 90
91 91 /**
92 92 * {@inheritDoc}
93 93 */
94 94 public void mouseExited(MouseEvent e) {}
95 95
96 96 /**
97 97 * {@inheritDoc}
98 98 * @since 1.6
99 99 */
100 100 public void mouseWheelMoved(MouseWheelEvent e){}
101 101
102 102 /**
103 103 * {@inheritDoc}
104 104 * @since 1.6
105 105 */
106 106 public void mouseDragged(MouseEvent e){}
107 107
108 108 /**
109 109 * {@inheritDoc}
110 110 * @since 1.6
111 111 */
112 112 public void mouseMoved(MouseEvent e){}
113 113 }
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX