-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangleStamp
More file actions
48 lines (42 loc) · 965 Bytes
/
RectangleStamp
File metadata and controls
48 lines (42 loc) · 965 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
39
40
41
42
43
44
45
46
47
48
package uwstout.cs144.projects.project3.toddlerGame;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
/**
* This class creates a Rectangle Stamp.
*
* @author flowersC
* @version 2016-12-13
*
*/
public class RectangleStamp extends OriginalStamp {
/**
* This is the set dimension for every rectangle stamp.
*/
private static Dimension d = new Dimension(30, 60);
/**
* This is the constructor for a rectangle stamp.
*
* @param p
* the point
* @param c
* the color
*/
public RectangleStamp(Point p, Color c) {
super(p, d, c);
}
/**
* This method draws the rectangle to the panel.
*
* @param g
* the graphics
*/
public void draw(Graphics g) {
System.out.println("worked" + getColor() + getPosition() + getSize());
g.setColor(getColor());
int x = (int) point.getX();
int y = (int) point.getY();
g.fillRect(x, y, 30, 60);
}
}