/** * This method should be called, if the specified MouseEvent should affect * zooming based on vertical mouse dragging. * * @param e */ public void zoom(final MouseEvent e) { final int y = e.getY(); final int dy = y - yLast; zoom(dy); xLast = e.getX(); yLast = y; } }
/** * This method should be called, if the specified MouseEvent should affect * zooming based on wheel movement. * * @param e */ public void wheel_zoom(final MouseEvent e) { final MouseWheelEvent we = (MouseWheelEvent) e; int units = 0; if (we.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) units = we.getUnitsToScroll(); zoom(units); }
viewTransformer.zoom(e); e.consume();