-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlainButton.java
81 lines (76 loc) · 2.22 KB
/
PlainButton.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import java.awt.Color;
import java.awt.Image;
import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
public class PlainButton extends JButton {
public int ID, factoryID;
public static int tilesize = 66;
/**
* only for factory Buttons
* @param id
* @param fact
*/
public PlainButton (int id, int fact){
setSize(tilesize, tilesize);
ID = id;
factoryID = fact;
setBorder(BorderFactory.createBevelBorder(10));
setBorder(null);
setBorderPainted(false);
setContentAreaFilled(false);
setOpaque(false);
}
/**
* any other type of button
* @param id
*/
//factory floor
public PlainButton (int id) {
setSize(81, 81);
ID = id;
setBorder(BorderFactory.createBevelBorder(10));
setBorder(null);
setBorderPainted(false);
setContentAreaFilled(false);
setOpaque(false);
}
//patternline
public PlainButton (int id, int playerid, int row) {
setSize(30, 57);
ID = id;
//setBorder(BorderFactory.createBevelBorder(0));
/*try {
Image img = ImageIO.read(getClass().getResource("/images/arrow1.png"));
Image img2 = ImageIO.read(getClass().getResource("/images/1.jpg"));
setIcon(new ImageIcon(img));
setDisabledIcon(new ImageIcon(img2));
} catch (Exception ex) {
System.out.println(ex);
}*/
setBorder(BorderFactory.createBevelBorder(10));
setBorder(null);
setBorderPainted(false);
setContentAreaFilled(false);
setOpaque(false);
}
//floorline
public PlainButton () {
setSize(465, 70);
setBorder(BorderFactory.createBevelBorder(10));
setBorder(null);
setBorderPainted(false);
setContentAreaFilled(false);
setOpaque(false);
}
//whole screen
public PlainButton (String str) {
setBorder(BorderFactory.createBevelBorder(10));
setBorder(BorderFactory.createBevelBorder(10));
setBorder(null);
setBorderPainted(false);
setContentAreaFilled(false);
setOpaque(false);
}
}