-
Notifications
You must be signed in to change notification settings - Fork 1
/
Form.java
72 lines (62 loc) 路 1.11 KB
/
Form.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package application;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
public class Form {
Rectangle a;
Rectangle b;
Rectangle c;
Rectangle d;
Color color;
private String name;
public int form = 1;
public Form(Rectangle a, Rectangle b, Rectangle c, Rectangle d) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
}
public Form(Rectangle a, Rectangle b, Rectangle c, Rectangle d, String name) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
this.name = name;
switch (name) {
case "j":
color = Color.SLATEGRAY;
break;
case "l":
color = Color.DARKGOLDENROD;
break;
case "o":
color = Color.INDIANRED;
break;
case "s":
color = Color.FORESTGREEN;
break;
case "t":
color = Color.CADETBLUE;
break;
case "z":
color = Color.HOTPINK;
break;
case "i":
color = Color.SANDYBROWN;
break;
}
this.a.setFill(color);
this.b.setFill(color);
this.c.setFill(color);
this.d.setFill(color);
}
public String getName() {
return name;
}
public void changeForm() {
if (form != 4) {
form++;
} else {
form = 1;
}
}
}