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 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package figures;
  13. import java.awt.*;
  14. import java.awt.geom.*;
  15. /**
  16. * This class makes mistakes to be caught by invariant checkers.
  17. */
  18. public class SlothfulPoint extends ShapeFigureElement {
  19. private int _x;
  20. private int _y;
  21. public SlothfulPoint(int x, int y) {
  22. }
  23. public int getX() { return _x; }
  24. public int getY() { return _y; }
  25. public void setX(int x) { }
  26. public void setY(int y) { }
  27. public void move(int dx, int dy) {
  28. System.out.println("Slothful moving");
  29. }
  30. public String toString() {
  31. return "SlothfulPoint";
  32. }
  33. public Shape getShape() {
  34. return new Ellipse2D.Float((float)_x,
  35. (float)_y, 1.0f, 1.0f);
  36. }
  37. }