Esempio n. 1
0
  public void mouseDragged(MouseEvent e) {

    if (pickedShapeGroup.isSelected()) {

      pickedShapeGroup.translateBy(e.getX() - myLastPoint.x, e.getY() - myLastPoint.y);
      myLastPoint = e.getPoint();
      myPanel.repaint();
    } else if (mySelectedShape != null) {
      mySelectedShape.translateBy(e.getX() - myLastPoint.x, e.getY() - myLastPoint.y);
      myLastPoint = e.getPoint();
      myPanel.repaint();
    }
  }