Back to index

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