Back to index

wims  3.65+svn20090927
Wheel.java
Go to the documentation of this file.
00001 /*
00002  * Created on 14.01.2006
00003  *
00004  */
00005 package rene.lister;
00006 
00007 import java.awt.event.MouseWheelEvent;
00008 import java.awt.event.MouseWheelListener;
00009 
00010 class Wheel
00011 implements MouseWheelListener
00012 {      WheelListener V;
00013 
00014        public Wheel (WheelListener v)
00015        {      V=v;
00016        }
00017        
00018        public void mouseWheelMoved (MouseWheelEvent e)
00019        {      if (e.getScrollType()==MouseWheelEvent.WHEEL_BLOCK_SCROLL)
00020               {      if (e.getWheelRotation()>0)
00021                             V.pageUp();
00022                      else
00023                             V.pageDown();
00024               }
00025               else
00026               {      int n=e.getScrollAmount();
00027                      if (e.getWheelRotation()>0) V.up(n);
00028                      else V.down(n);
00029               }
00030        }
00031 }