1 package prefuse.controls; 2 3 import java.awt.Point ; 4 import java.awt.event.MouseWheelEvent ; 5 6 import prefuse.Display; 7 import prefuse.visual.VisualItem; 8 9 17 public class WheelZoomControl extends AbstractZoomControl { 18 19 private Point m_point = new Point (); 20 21 24 public void itemWheelMoved(VisualItem item, MouseWheelEvent e) { 25 if ( m_zoomOverItem ) 26 mouseWheelMoved(e); 27 } 28 29 32 public void mouseWheelMoved(MouseWheelEvent e) { 33 Display display = (Display)e.getComponent(); 34 m_point.x = display.getWidth()/2; 35 m_point.y = display.getHeight()/2; 36 zoom(display, m_point, 37 1 + 0.1f * e.getWheelRotation(), false); 38 } 39 40 } | Popular Tags |