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.

Figure.java 778B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package grafikchat.model;
  2. import java.awt.Point;
  3. import java.io.Serializable;
  4. import java.util.ArrayList;
  5. import java.util.List;
  6. /**
  7. * Figure drawn by user with mouse
  8. *
  9. * @author marian
  10. */
  11. public class Figure implements Serializable
  12. {
  13. private static final long serialVersionUID = 8582433437601788991L;
  14. private final ArrayList<Point> points;
  15. /**
  16. * Constructor, initialize figure
  17. */
  18. public Figure()
  19. {
  20. points = new ArrayList<>();
  21. }
  22. /**
  23. * Add point to figure
  24. * @param p new point
  25. */
  26. public void addPoint(Point p)
  27. {
  28. points.add(p);
  29. }
  30. /**
  31. * Get all points of figure
  32. * @return all points
  33. */
  34. public List<Point> getPoints()
  35. {
  36. return points;
  37. }
  38. }