public class NativeMouseWheelEvent extends NativeMouseEvent
A NativeMouseWheelEvent
object is passed to every
NativeMouseWheelListener
object which is registered to receive
mouse wheel events using the
GlobalScreen.addNativeMouseWheelListener(NativeMouseWheelListener)
method. The GlobalScreen
object then dispatches a
NativeMouseWheelEvent
to each listener.
Platforms offer customization of the amount of scrolling that should take
place when the mouse wheel is moved. The two most common settings are to
scroll a certain number of "units" (commonly lines of text in a text-based
component) or an entire "block" (similar to page-up/page-down). The
NativeMouseWheelEvent
offers methods for conforming to the
underlying platform settings. These platform settings can be changed at any
time by the user. NativeMouseWheelEvents
reflect the most recent
settings.
GlobalScreen
,
NativeMouseWheelListener
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
WHEEL_BLOCK_SCROLL
Constant representing scrolling by a "block" (like scrolling with
page-up, page-down keys).
|
static int |
WHEEL_UNIT_SCROLL
Constant representing scrolling by "units" (like scrolling with the
arrow keys).
|
BUTTON1, BUTTON2, BUTTON3, BUTTON4, BUTTON5, NATIVE_MOUSE_CLICKED, NATIVE_MOUSE_DRAGGED, NATIVE_MOUSE_FIRST, NATIVE_MOUSE_LAST, NATIVE_MOUSE_MOVED, NATIVE_MOUSE_PRESSED, NATIVE_MOUSE_RELEASED, NATIVE_MOUSE_WHEEL, NOBUTTON
ALT_L_MASK, ALT_MASK, ALT_R_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, BUTTON4_MASK, BUTTON5_MASK, CTRL_L_MASK, CTRL_MASK, CTRL_R_MASK, META_L_MASK, META_MASK, META_R_MASK, SHIFT_L_MASK, SHIFT_MASK, SHIFT_R_MASK
source
Constructor and Description |
---|
NativeMouseWheelEvent(int id,
long when,
int modifiers,
int x,
int y,
int clickCount,
int scrollType,
int scrollAmount,
int wheelRotation)
Instantiates a new
NativeMouseWheelEvent object. |
Modifier and Type | Method and Description |
---|---|
int |
getScrollAmount()
Returns the number of units that should be scrolled per
click of mouse wheel rotation.
|
int |
getScrollType()
Returns the type of scrolling that should take place in response to this
event.
|
int |
getWheelRotation()
Returns the number of "clicks" the mouse wheel was rotated.
|
String |
paramString()
Returns a parameter string identifying the native event.
|
getButton, getClickCount, getPoint, getX, getY
getID, getModifiers, getModifiersText, getWhen, setModifiers
getSource, toString
public static final int WHEEL_UNIT_SCROLL
public static final int WHEEL_BLOCK_SCROLL
public NativeMouseWheelEvent(int id, long when, int modifiers, int x, int y, int clickCount, int scrollType, int scrollAmount, int wheelRotation)
NativeMouseWheelEvent
object.id
- an integer that identifies the native event type.when
- a long integer that gives the time the event occurred.modifiers
- a modifier mask describing the modifier keys and mouse
buttons active for the event.
NativeInputEvent _MASK
modifiers should be used as they are
not compatible with the extended _DOWN_MASK or the old _MASK
InputEvent
modifiers.x
- the x coordinate of the native pointer.y
- the y coordinate of the native pointer.clickCount
- the number of button clicks associated with this event.scrollType
- the type of scrolling which should take place in
response to this event; valid values are WHEEL_UNIT_SCROLL
and WHEEL_BLOCK_SCROLL
.scrollAmount
- for scrollType WHEEL_UNIT_SCROLL
, the
number of units to be scrolled.wheelRotation
- the amount that the mouse wheel was rotated (the
number of "clicks")NativeMouseEvent.NativeMouseEvent(int, long, int, int, int, int)
public int getScrollAmount()
getScrollType
returns
NativeMouseWheelEvent.WHEEL_UNIT_SCROLL
getScrollType
returns
NativeMouseWheelEvent.WHEEL_BLOCK_SCROLL
getScrollType()
public int getScrollType()
Adjustable.getUnitIncrement()
,
Adjustable.getBlockIncrement()
,
Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)
,
Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)
public int getWheelRotation()
public String paramString()
paramString
in class NativeMouseEvent
Copyright © 2006-2015 ${project.vendor}. All Rights Received.