-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShapeClass.java
More file actions
112 lines (79 loc) · 1.47 KB
/
ShapeClass.java
File metadata and controls
112 lines (79 loc) · 1.47 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
By: Dylan Snelgrove
Date: January, 2018
Shape class
- an abstract class that is the parent class of all shapes: card, deck.
*/
import java.awt.*;
public abstract class ShapeClass
{
//encapsulated data
private int iCenterX;
private int iCenterY;
private int iWidth;
private int iHeight;
private Color cColor;
//constructors (--none--)
//communicator methods
//sets
public void setCenterX (int ipCenterX)
{
iCenterX = ipCenterX;
}
public void setCenterY (int ipCenterY)
{
iCenterY = ipCenterY;
}
public void setCenter (int ipCenterX, int ipCenterY)
{
iCenterX = ipCenterX;
iCenterY = ipCenterY;
}
public void setDimensions (int ipWidth, int ipHeight)
{
iWidth = ipWidth;
iHeight = ipHeight;
}
public void setWidth (int ipWidth)
{
iWidth = ipWidth;
}
public void setHeight (int ipHeight)
{
iHeight = ipHeight;
}
public void setColor (Color cpColor)
{
cColor = cpColor;
}
//gets
int getCenterX ()
{
return iCenterX;
}
int getCenterY ()
{
return iCenterY;
}
int getWidth ()
{
return iWidth;
}
int getHeight ()
{
return iHeight;
}
Color getColor ()
{
return cColor;
}
//any action methods
public void delay (int time_ms)
{
long lFinalTime = System.currentTimeMillis () + time_ms;
do
{
}
while (lFinalTime >= System.currentTimeMillis ());
}
}