-
Notifications
You must be signed in to change notification settings - Fork 0
/
BeadGraphic.java
59 lines (49 loc) · 1.01 KB
/
BeadGraphic.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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
/**
*makes a bead with a stored ellipse
* @author blybr
*/
public class BeadGraphic {
private int xCoord;
private int yCoord;
private Color colour=Color.BLACK;
private Ellipse2D.Double bead;
/**
* Constructor makes beads
* can be modified to put player
* specific color on peg
* @param x
* @param y
*/
public BeadGraphic(int x, int y)
{
xCoord = x;
yCoord = y;
bead = new Ellipse2D.Double(x, y, 15, 15);
}
/**
* draws bead of appropriate color
* @param g2
*/
public void draw(Graphics2D g2)
{
g2.setColor(colour);// draws bead of appropriate colour
g2.draw(bead);
g2.fill(bead);
}
/**
* currently not used but functionally works
* @return
*/
public Ellipse2D.Double getBead()
{
return bead;
}
}