summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r--src/jrummikub/view/impl/WinPanel.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/jrummikub/view/impl/WinPanel.java b/src/jrummikub/view/impl/WinPanel.java
index d274b19..4d9aacc 100644
--- a/src/jrummikub/view/impl/WinPanel.java
+++ b/src/jrummikub/view/impl/WinPanel.java
@@ -136,18 +136,7 @@ class WinPanel extends JPanel {
fontSize = MAX_BUTTON_FONT_SIZE;
if (type == BottomPanelType.WIN_PANEL) {
- waitingLabel.setVisible(false);
- newRoundButton.setBounds(x, buttonY, buttonWidth, buttonHeight);
- newRoundButton.setFont(newRoundButton.getFont().deriveFont(fontSize));
- newRoundButton.setVisible(true);
-
- newGameButton.setBounds(x + buttonWidth + PANEL_SEPARATOR, buttonY,
- buttonWidth, buttonHeight);
- newGameButton.setFont(newGameButton.getFont().deriveFont(fontSize));
-
- endProgramButton.setBounds(x + 2 * (buttonWidth + PANEL_SEPARATOR),
- buttonY, buttonWidth, buttonHeight);
- endProgramButton.setFont(endProgramButton.getFont().deriveFont(fontSize));
+ rescaleWinPanel(x, buttonWidth, buttonHeight, buttonY, fontSize);
} else if (type == BottomPanelType.NETWORK_WIN_PANEL) {
waitingLabel.setBounds(x, y, width, labelHeight);
waitingLabel.setVisible(true);
@@ -163,6 +152,22 @@ class WinPanel extends JPanel {
}
}
+ private void rescaleWinPanel(int x, int buttonWidth, int buttonHeight,
+ int buttonY, float fontSize) {
+ waitingLabel.setVisible(false);
+ newRoundButton.setBounds(x, buttonY, buttonWidth, buttonHeight);
+ newRoundButton.setFont(newRoundButton.getFont().deriveFont(fontSize));
+ newRoundButton.setVisible(true);
+
+ newGameButton.setBounds(x + buttonWidth + PANEL_SEPARATOR, buttonY,
+ buttonWidth, buttonHeight);
+ newGameButton.setFont(newGameButton.getFont().deriveFont(fontSize));
+
+ endProgramButton.setBounds(x + 2 * (buttonWidth + PANEL_SEPARATOR),
+ buttonY, buttonWidth, buttonHeight);
+ endProgramButton.setFont(endProgramButton.getFont().deriveFont(fontSize));
+ }
+
void setType(BottomPanelType type) {
this.type = type;
rescale();