/** This method cannot be called directly. */ public void mousePressed(MouseEvent e) { synchronized (mouseLock) { mouseX = StdDraw.userX(e.getX()); mouseY = StdDraw.userY(e.getY()); mousePressed = true; // System.out.println(mouseX+" ,"+mouseY); } }
/** This method cannot be called directly. */ public void mouseMoved(MouseEvent e) { synchronized (mouseLock) { mouseX = StdDraw.userX(e.getX()); mouseY = StdDraw.userY(e.getY()); } }