コード例 #1
0
  @Override
  public void mouseWheelMoved(MouseWheelEvent e) {
    lastInc = (e.getWheelRotation() / 10.0f);
    factor = factor + lastInc;

    View view = targets.get(0).getView();
    mouse3d = view.projectMouse(lastMouseX, lastMouseY);

    zoom(1 + lastInc);
  }
コード例 #2
0
  /** ************* */
  @Override
  public void mouseDragged(MouseEvent e) {
    int yflip = -e.getY() + targets.get(0).getCanvas().getRendererHeight();
    Coord2d mouse = new Coord2d(e.getX(), yflip);
    View view = targets.get(0).getView();
    Coord3d thisMouse3d = view.projectMouse(e.getX(), yflip);

    // 1/2 pan for cleaner rendering
    if (!done) {
      pan(prevMouse3d, thisMouse3d);
      done = true;
    } else done = false;
    prevMouse = mouse;
    prevMouse3d = thisMouse3d;
  }