-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSideInfoPanel.java
65 lines (54 loc) · 1.71 KB
/
SideInfoPanel.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
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
public class SideInfoPanel extends JPanel {
private ArrayList<ShipButton> arrayButton;
Fleet ownFleet;
public SideInfoPanel(ButtonPanelListener bpl){
super();
arrayButton = new ArrayList<ShipButton>();
this.setSize(120, 240);
this.setLayout(null);
this.setBackground(Color.white);
ShipButton huge = new ShipButton("huge");
ShipButton big1 = new ShipButton("big1");
ShipButton big2 = new ShipButton("big2");
ShipButton middle1 = new ShipButton("middle1");
ShipButton middle2 = new ShipButton("middle2");
ShipButton middle3 = new ShipButton("middle3");
ShipButton little1 = new ShipButton("little1");
ShipButton little2 = new ShipButton("little2");
ShipButton little3 = new ShipButton("little3");
ShipButton little4 = new ShipButton("little4");
huge.setBounds(5, 5, 20, 80);
big1.setBounds(5, 95, 20, 60);
big2.setBounds(35, 95, 20, 60);
middle1.setBounds(5, 165, 20, 40);
middle2.setBounds(35, 165, 20, 40);
middle3.setBounds(65, 165, 20, 40);
little1.setBounds(5, 215, 20, 20);
little2.setBounds(35, 215, 20, 20);
little3.setBounds(65, 215, 20, 20);
little4.setBounds(95, 215, 20, 20);
arrayButton.add(huge);
arrayButton.add(big1);
arrayButton.add(big2);
arrayButton.add(middle1);
arrayButton.add(middle2);
arrayButton.add(middle3);
arrayButton.add(little1);
arrayButton.add(little2);
arrayButton.add(little3);
arrayButton.add(little4);
for(ShipButton b: arrayButton){
b.setBackground(Color.gray);
b.setEnabled(false);
this.add(b);
b.addActionListener(bpl);
}
}
public ArrayList<ShipButton> getArrayButton(){
return arrayButton;
}
}