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 Form| Modifier 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_HORIZONTAL_DIRECTION
Constant representing scrolling in the horizontal direction.
|
static int |
WHEEL_UNIT_SCROLL
Constant representing scrolling by "units" (like scrolling with the
arrow keys).
|
static int |
WHEEL_VERTICAL_DIRECTION
Constant representing scrolling in the vertical direction.
|
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, NOBUTTONALT_L_MASK, ALT_MASK, ALT_R_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, BUTTON4_MASK, BUTTON5_MASK, CAPS_LOCK_MASK, CTRL_L_MASK, CTRL_MASK, CTRL_R_MASK, META_L_MASK, META_MASK, META_R_MASK, NUM_LOCK_MASK, SCROLL_LOCK_MASK, SHIFT_L_MASK, SHIFT_MASK, SHIFT_R_MASKsource| Constructor and Description |
|---|
NativeMouseWheelEvent(int id,
int modifiers,
int x,
int y,
int clickCount,
int scrollType,
int scrollAmount,
int wheelRotation)
Instantiates a new
NativeMouseWheelEvent object with a vertical direction. |
NativeMouseWheelEvent(int id,
int modifiers,
int x,
int y,
int clickCount,
int scrollType,
int scrollAmount,
int wheelRotation,
int wheelDirection)
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 |
getWheelDirection()
Returns the direction 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, getYgetID, getModifiers, getModifiersText, getWhen, setModifiersgetSource, toStringpublic static final int WHEEL_UNIT_SCROLL
public static final int WHEEL_BLOCK_SCROLL
public static final int WHEEL_VERTICAL_DIRECTION
public static final int WHEEL_HORIZONTAL_DIRECTION
public NativeMouseWheelEvent(int id,
int modifiers,
int x,
int y,
int clickCount,
int scrollType,
int scrollAmount,
int wheelRotation)
NativeMouseWheelEvent object with a vertical direction.id - an integer that identifies the native event type.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")NativeMouseWheelEvent(int, int, int, int, int, int, int, int, int),
NativeMouseEvent.NativeMouseEvent(int, int, int, int, int)public NativeMouseWheelEvent(int id,
int modifiers,
int x,
int y,
int clickCount,
int scrollType,
int scrollAmount,
int wheelRotation,
int wheelDirection)
NativeMouseWheelEvent object.id - an integer that identifies the native event type.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")wheelDirection - the direction of scrolling which should take place in
response to this event; valid values are WHEEL_VERTICAL_DIRECTION
and WHEEL_HORIZONTAL_DIRECTION.NativeMouseEvent.NativeMouseEvent(int, int, int, int, int)public int getScrollAmount()
getScrollType returns
NativeMouseWheelEvent.WHEEL_UNIT_SCROLLgetScrollType returns
NativeMouseWheelEvent.WHEEL_BLOCK_SCROLLgetScrollType()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 int getWheelDirection()
public String paramString()
paramString in class NativeMouseEventCopyright © 2006-2017 ${project.vendor}. All Rights Received.