From 9861417ac10271103d74abeb591518ec2a50b43a Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Wed, 22 Jun 2011 00:12:07 +0200 Subject: ALLES was muss und da ist ist kommentiert git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@561 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/WinPanel.java | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'src/jrummikub/view/impl') 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(); -- cgit v1.2.3