public void mouseWheelMoved(MouseWheelEvent e){
  boolean accepted=checkModifiers(e);
  if (accepted == true) {
    VisualizationViewer<?,?> vv=(VisualizationViewer<?,?>)e.getSource();
    Point2D mouse=e.getPoint();
    Point2D center=vv.getCenter();
    int amount=e.getWheelRotation();
    if (zoomAtMouse) {
      if (amount > 0) {
        scaler.scale(vv,in,mouse);
      }
 else       if (amount < 0) {
        scaler.scale(vv,out,mouse);
      }
    }
 else {
      if (amount > 0) {
        scaler.scale(vv,in,center);
      }
 else       if (amount < 0) {
        scaler.scale(vv,out,center);
      }
    }
    e.consume();
    vv.repaint();
  }
}

public void mouseWheelMoved ( MouseWheelEvent e ) { boolean accepted = checkModifiers ( e ) ; if ( accepted == true ) { VisualizationViewer < ? , ? > vv = ( VisualizationViewer < ? , ? > ) e . getSource ( ) ; Point2D mouse = e . getPoint ( ) ; Point2D center = vv . getCenter ( ) ; int amount = e . getWheelRotation ( ) ; if ( zoomAtMouse ) { if ( amount > 0 ) { scaler . scale ( vv , in , mouse ) ; } else if ( amount < 0 ) { scaler . scale ( vv , out , mouse ) ; } } else { if ( amount > 0 ) { scaler . scale ( vv , in , center ) ; } else if ( amount < 0 ) { scaler . scale ( vv , out , center ) ; } } e . consume ( ) ; vv . repaint ( ) ; } }
zoom the display in or out , depending on the direction of the mouse wheel motion .
