-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPolyline.java
More file actions
38 lines (33 loc) · 843 Bytes
/
Polyline.java
File metadata and controls
38 lines (33 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package a2;
import java.awt.Color;
import java.awt.geom.Point2D;
import java.io.Serializable;
import java.util.ArrayList;
@SuppressWarnings("serial")
public class Polyline implements Serializable {
// line model
ArrayList<Point2D> points;
Color color;
float strokeThickness;
public ArrayList<Point2D> getPoints() {
return points;
}
public Color getColour() {
return color;
}
public void setColour(Color colour) {
this.color = colour;
}
public float getStrokeThickness() {
return strokeThickness;
}
public void setStrokeThickness(float strokeThickness) {
this.strokeThickness = strokeThickness;
}
// add a point to end of shape
public void addPoint(double x, double y) {
if (points == null)
points = new ArrayList<Point2D>();
points.add(new Point2D.Double(x,y));
}
}