boolean (Point location) { if (myLastMouseLocation == null) { myLastMouseLocation = location; return false; } Point prev = myLastMouseLocation; myLastMouseLocation = location; return !prev.equals(location); }