|
23 | 23 | import javax.swing.JFrame;
|
24 | 24 | import javax.swing.JLabel;
|
25 | 25 | import javax.swing.JOptionPane;
|
26 |
| -import javax.swing.JPanel; |
27 | 26 | import javax.swing.SwingUtilities;
|
28 | 27 | import org.triplea.java.collections.CollectionUtils;
|
29 | 28 | import org.triplea.java.collections.IntegerMap;
|
@@ -92,34 +91,30 @@ public void display(final GamePlayer gamePlayer) {
|
92 | 91 | () -> {
|
93 | 92 | removeAll();
|
94 | 93 | actionLabel.setText(gamePlayer.getName() + " production");
|
95 |
| - add(actionLabel); |
96 | 94 | add(SwingComponents.leftBox(actionLabel));
|
97 | 95 |
|
98 | 96 | buyButton.setText(BUY);
|
99 |
| - final JPanel buttonsPanel = new JPanel(); |
100 |
| - buttonsPanel.add(buyButton); |
101 |
| - buttonsPanel.add(createDoneButton()); |
102 |
| - add(buttonsPanel); |
| 97 | + add(createButtonsPanel(buyButton, createDoneButton())); |
103 | 98 |
|
104 | 99 | add(Box.createVerticalStrut(9));
|
105 | 100 |
|
106 | 101 | purchasedLabel.setText("");
|
107 |
| - add(purchasedLabel); |
| 102 | + add(SwingComponents.leftBox(purchasedLabel)); |
108 | 103 |
|
109 | 104 | add(Box.createVerticalStrut(4));
|
110 | 105 |
|
111 | 106 | purchasedUnits.setUnitsFromProductionRuleMap(new IntegerMap<>(), gamePlayer);
|
112 |
| - add(purchasedUnits); |
| 107 | + add(SwingComponents.leftBox(purchasedUnits)); |
113 | 108 |
|
114 | 109 | getData().acquireReadLock();
|
115 | 110 | try {
|
116 | 111 | purchasedPreviousRoundsUnits.setUnitsFromCategories(
|
117 | 112 | UnitSeparator.categorize(gamePlayer.getUnits()));
|
118 | 113 | add(Box.createVerticalStrut(4));
|
119 | 114 | if (!gamePlayer.getUnitCollection().isEmpty()) {
|
120 |
| - add(purchasedPreviousRoundsLabel); |
| 115 | + add(SwingComponents.leftBox(purchasedPreviousRoundsLabel)); |
121 | 116 | }
|
122 |
| - add(purchasedPreviousRoundsUnits); |
| 117 | + add(SwingComponents.leftBox(purchasedPreviousRoundsUnits)); |
123 | 118 | } finally {
|
124 | 119 | getData().releaseReadLock();
|
125 | 120 | }
|
|
0 commit comments