-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shape.java
55 lines (44 loc) · 1.28 KB
/
Shape.java
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import java.awt.Color;
public abstract class Shape {
private double strokeWidth;
private Color strokeColor;
private Color fillColor; //Color fillcolor, Enum = {yellow, blue, black} OR Class
private double transparency;
// create an empty constructer
public Shape() {
strokeWidth = 3;
strokeColor = new Color(0,0,0);
fillColor = new Color(0,0,0);
}
// with params
public Shape(double strokeWidth, Color strokeColor, Color fillColor) {
this.strokeWidth = strokeWidth;
this.strokeColor = strokeColor;
this.fillColor = fillColor;
}
// getters and setters
public void setStrokeWidth(double width) {
strokeWidth = width;
}
public double getStrokeWidth() {
return strokeWidth;
}
public void setStrokeColor(Color color) {
strokeColor = color;
}
public Color getStrokeColor() {
return strokeColor;
}
public void setFillColor(Color fill) {
fillColor = fill;
}
public Color getFillColor() {
return fillColor;
}
public void setTransperancy(double trans) {
transparency = trans;
}
public double getTransperancy() {
return transparency;
}
}