public class Stroke implements Serializable
1:
2: package scribble2;
3:
4: import java.util.*;
5: import java.io.Serializable;
6: import java.awt.Point;
7: import java.awt.Color;
8:
9: public class Stroke implements Serializable {
10:
11: public Stroke() {}
12:
13: public Stroke(Color color) {
14: this.color = color;
15: }
16:
17: public void setColor(Color color) {
18: this.color = color;
19: }
20:
21: public Color getColor() {
22: return color;
23: }
24:
25: public void addPoint(Point p) {
26: if (p != null) {
27: points.add(p);
28: }
29: }
30:
31: public List getPoints() {
32: return points;
33: }
34:
35: // The list of points on the stroke
36: // elements are instances of java.awt.Point
37: protected List points = new ArrayList();
38:
39: protected Color color = Color.black;
40:
41: }