-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSquareStamp
More file actions
47 lines (42 loc) · 918 Bytes
/
SquareStamp
File metadata and controls
47 lines (42 loc) · 918 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
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 Square Stamp.
*
* @author flowersC
* @version 2016-12-13
*
*/
public class SquareStamp extends OriginalStamp {
/**
* The dimension of every square.
*/
private static Dimension d = new Dimension(20, 20);
/**
* This is the constructor for a square stamp.
*
* @param p
* the point
* @param c
* the color
*/
public SquareStamp(Point p, Color c) {
super(p, d, c);
}
/**
* This draws a square 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, 20, 20);
}
}