public void mouseMove(MouseEvent e, int x, int y) { if (e.getSource() == getActiveView()) { if (fPolygon != null) { if (fPolygon.pointCount() > 1) { fPolygon.setPointAt(new Point(x, y), fPolygon.pointCount() - 1); getActiveView().checkDamage(); } } } }
public void deactivate() { if (fPolygon != null) { fPolygon.smoothPoints(); if (fPolygon.pointCount() < 3 || fPolygon.size().width < 4 || fPolygon.size().height < 4) { getActiveView().drawing().remove(fPolygon); // nothing to undo setUndoActivity(null); } } fPolygon = null; super.deactivate(); }