You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SlothfulPoint.java 756B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. Copyright (c) 2002 Palo Alto Research Center Incorporated. All Rights Reserved.
  3. */
  4. package figures;
  5. import java.awt.*;
  6. import java.awt.geom.*;
  7. /**
  8. * This class makes mistakes to be caught by invariant checkers.
  9. */
  10. public class SlothfulPoint extends ShapeFigureElement {
  11. private int _x;
  12. private int _y;
  13. public SlothfulPoint(int x, int y) {
  14. }
  15. public void setX(int x) {
  16. _x = x;
  17. }
  18. public void setY(int y) {
  19. _y = y;
  20. }
  21. public void move(int dx, int dy) {
  22. //_x += dx;
  23. //_y += dy;
  24. }
  25. public String toString() {
  26. return "SlothfulPoint";
  27. }
  28. public Shape getShape() {
  29. return new Ellipse2D.Float((float)_x,
  30. (float)_y, 1.0f, 1.0f);
  31. }
  32. }