|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class allows a Component to be scrolled with the wheelmouse even if it is not a JScrollPane. To get mousewheel event, the component you want to be scrollable must implement this interface.
MWheelHandler
Method Summary | |
int |
mouseWheelMoved(int nScrolledBy,
int x,
int y,
int nKeyMask)
Invoked by the MWheelHandler when the wheelmouse is scrolled over a component. |
Method Detail |
public int mouseWheelMoved(int nScrolledBy, int x, int y, int nKeyMask)
Scrolling amounts are specified in multiple of WHEEL_DELTA and one WHEEL_DELTA represents a user configurable number of lines to scroll. The number of lines to scroll can be given by MWheelHandler.getWheelScrollLines().
The current models of wheel mouse always scroll by increments of MWheelHandler.WHEEL_DELTA but this is not guaranteed to be true in the future. If a new model of wheelmouse scrolls by a lower amount and we only scroll by nScrolledBy/WHEEL_DELTA the scroll would never happen. For example, if the mouse scrolls by 60 in place of 120, 60/120 = 0 and we would always scroll by 0. For this reason, we must keep the reminder of the division and add it to the next scroll amount. The reminder will already be added to nScrolledBy but it is your responsability to return the reminder.
nScrolledBy
- The amount to scroll.x
- The horizontal position of the mouse in local coordinatesy
- The vertical position of the mouse in local coordinatesnKeyMask
- indicates if the Shift or Alt key is down. Takes values
from InputEvent.SHIFT_MASK and CTRL_MASK.
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.