-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScreenObject.java
54 lines (45 loc) · 961 Bytes
/
ScreenObject.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
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
public abstract class ScreenObject {
protected Point location;
protected Rectangle size;
/**
* Create the screen object and its size and location.
* @param location location of the screen object
* @param size size of the screen object
*/
public ScreenObject(Point location, Rectangle size){
this.location = location;
this.size = size;
}
/**
* @return the location
*/
public Point getLocation() {
return location;
}
/**
* @param location the location to set
*/
public void setLocation(Point location) {
this.location = location;
}
/**
* @return the size
*/
public Rectangle getSize() {
return size;
}
/**
* @param size the size to set
*/
public void setSize(Rectangle size) {
this.size = size;
}
/**
*
* @param g make all subclasses of screenobject have a draw method
*/
abstract public void draw(Graphics g);
}