DrawCanvas.java (mousePressed -- handling “Edit” mode)
public void mousePressed(MouseEvent e) {
else if (currentTool.equals("Edit")) {
if (hitSelected(selection, e.getX(), e.getY())) {
savedMouseX = e.getX(); savedMouseY = e.getY();
for (Enumeration vEnum = selection.elements();
vEnum.hasMoreElements();) {
((PDPoint)vEnum.nextElement()).unmark();
selectionRect.setP1(e.getX(), e.getY());