KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > event > MouseWheelEvent


1 /*
2    SwingWT
3    Copyright(c)2004, Daniel Naab
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: dannaab@users.sourceforge.net
9
10    $Log: MouseWheelEvent.java,v $
11    Revision 1.1 2004/04/30 23:29:17 dannaab
12    new mouse event/listener interfaces
13
14  */

15
16 package swingwt.awt.event;
17
18 import swingwt.awt.Component;
19
20 /**
21  * MouseWheelEvent
22  *
23  * @author Naab
24  * @version %I%, %G%
25  */

26 public class MouseWheelEvent extends MouseEvent
27 {
28     public static final int WHEEL_UNIT_SCROLL = 0;
29     public static final int WHEEL_BLOCK_SCROLL = 1;
30
31     int scrollType, scrollAmount, wheelRotation;
32
33     public MouseWheelEvent( Component source, int id, long when, int modifiers,
34                             int x, int y, int clickCount, boolean popupTrigger,
35                             int scrollType, int scrollAmount, int wheelRotation )
36     {
37         super(source, id, when, modifiers, x, y, clickCount, popupTrigger);
38         this.scrollType = scrollType;
39         this.scrollAmount = scrollAmount;
40         this.wheelRotation = wheelRotation;
41     }
42     public int getScrollType() { return scrollType; }
43     public int getScrollAmount() { return scrollAmount; }
44     public int getWheelRotation() { return wheelRotation; }
45     public int getUnitsToScroll() { return scrollAmount * wheelRotation; }
46 }
47
Popular Tags