1 /* |
1 /* |
2 * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 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 |
25 |
25 |
26 package java.awt.event; |
26 package java.awt.event; |
27 |
27 |
28 import java.awt.Component; |
28 import java.awt.Component; |
29 |
29 |
30 import javax.tools.annotation.GenerateNativeHeader; |
30 import java.lang.annotation.Native; |
31 |
31 |
32 /** |
32 /** |
33 * An event which indicates that the mouse wheel was rotated in a component. |
33 * An event which indicates that the mouse wheel was rotated in a component. |
34 * <P> |
34 * <P> |
35 * A wheel mouse is a mouse which has a wheel in place of the middle button. |
35 * A wheel mouse is a mouse which has a wheel in place of the middle button. |
97 * @see javax.swing.JScrollPane |
97 * @see javax.swing.JScrollPane |
98 * @see javax.swing.JScrollPane#setWheelScrollingEnabled(boolean) |
98 * @see javax.swing.JScrollPane#setWheelScrollingEnabled(boolean) |
99 * @since 1.4 |
99 * @since 1.4 |
100 */ |
100 */ |
101 |
101 |
102 /* No native methods here, but the constants are needed in the supporting JNI code */ |
|
103 @GenerateNativeHeader |
|
104 public class MouseWheelEvent extends MouseEvent { |
102 public class MouseWheelEvent extends MouseEvent { |
105 |
103 |
106 /** |
104 /** |
107 * Constant representing scrolling by "units" (like scrolling with the |
105 * Constant representing scrolling by "units" (like scrolling with the |
108 * arrow keys) |
106 * arrow keys) |
109 * |
107 * |
110 * @see #getScrollType |
108 * @see #getScrollType |
111 */ |
109 */ |
112 public static final int WHEEL_UNIT_SCROLL = 0; |
110 @Native public static final int WHEEL_UNIT_SCROLL = 0; |
113 |
111 |
114 /** |
112 /** |
115 * Constant representing scrolling by a "block" (like scrolling |
113 * Constant representing scrolling by a "block" (like scrolling |
116 * with page-up, page-down keys) |
114 * with page-up, page-down keys) |
117 * |
115 * |
118 * @see #getScrollType |
116 * @see #getScrollType |
119 */ |
117 */ |
120 public static final int WHEEL_BLOCK_SCROLL = 1; |
118 @Native public static final int WHEEL_BLOCK_SCROLL = 1; |
121 |
119 |
122 /** |
120 /** |
123 * Indicates what sort of scrolling should take place in response to this |
121 * Indicates what sort of scrolling should take place in response to this |
124 * event, based on platform settings. Legal values are: |
122 * event, based on platform settings. Legal values are: |
125 * <ul> |
123 * <ul> |