|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.MouseWheelController
public class MouseWheelController extends Object
This class allows you to control the units scrolled for each mouse wheel rotation relative to the unit increment value of the scroll bar. Specifying a scroll amount of 1, is equivalent to clicking the unit scroll button of the scroll bar once.
| Field Summary | |
|---|---|
private MouseWheelListener[] |
realListeners
|
private int |
scrollAmount
|
private JScrollPane |
scrollPane
|
| Constructor Summary | |
MouseWheelController(JScrollPane scrollPane)
Convenience constructor to create the class with a scroll amount of 1. |
|
MouseWheelController(JScrollPane scrollPane, int scrollAmount)
Create the class with the specified scroll amount. |
|
| Method Summary | |
|---|---|
private MouseWheelEvent
|
createScrollAmountEvent(MouseWheelEvent e)
|
int
|
getScrollAmount()
Get the scroll amount |
void
|
install()
Install this class as the default listener for MouseWheel events. |
void
|
mouseWheelMoved(MouseWheelEvent e)
Redispatch a MouseWheelEvent to the real MouseWheelListeners |
void
|
setScrollAmount(int scrollAmount)
Set the scroll amount. |
void
|
uninstall()
Remove the class as the default listener and reinstall the original listeners. |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private MouseWheelListener[] realListeners
private int scrollAmount
private JScrollPane scrollPane
| Constructor Detail |
|---|
public MouseWheelController(JScrollPane scrollPane)
scrollPane - the scroll pane being used by the mouse wheel
public MouseWheelController(JScrollPane scrollPane, int scrollAmount)
scrollAmount - the scroll amount to by used for this scroll panescrollPane - the scroll pane being used by the mouse wheel
| Method Detail |
|---|
private MouseWheelEvent createScrollAmountEvent(MouseWheelEvent e)
public int getScrollAmount()
public void install()
public void mouseWheelMoved(MouseWheelEvent e)
public void setScrollAmount(int scrollAmount)
scrollAmount - an integer value. A value of zero will use the
default scroll amount for your OS.
public void uninstall()
Groovy Documentation