summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl/PlayerPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view/impl/PlayerPanel.java')
-rw-r--r--src/jrummikub/view/impl/PlayerPanel.java34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/jrummikub/view/impl/PlayerPanel.java b/src/jrummikub/view/impl/PlayerPanel.java
index 5b17d38..f18f053 100644
--- a/src/jrummikub/view/impl/PlayerPanel.java
+++ b/src/jrummikub/view/impl/PlayerPanel.java
@@ -411,20 +411,9 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
smallFontSize = MAX_BUTTON_FONT_SIZE;
}
- handRowUpButton.setBounds(0, 0, handButtonWidth, getHeight() / 2);
- handRowUpButton.setFont(handRowUpButton.getFont().deriveFont(
- fontSize * 1.5f));
- handRowDownButton.setBounds(0, getHeight() / 2, handButtonWidth,
- getHeight() / 2);
- handRowDownButton.setFont(handRowDownButton.getFont().deriveFont(
- fontSize * 1.5f));
+ rescaleUpDownButtons(handButtonWidth, fontSize);
- timeBar.setBounds(x, y, width - firstLineHeight - SIDE_PANEL_SEPARATOR,
- firstLineHeight);
- pauseButton.setBounds(x + width - firstLineHeight, y, firstLineHeight,
- firstLineHeight);
- pauseButton.setIcon(ImageUtil
- .createPauseIcon((int) (firstLineHeight * 0.5f)));
+ rescaleTimeBar(x, y, width, firstLineHeight);
endTurnButton.setBounds(x, y + firstLineHeight + SIDE_PANEL_SEPARATOR,
buttonWidth, buttonHeight);
@@ -440,5 +429,24 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
smallFontSize));
}
+
+ private void rescaleTimeBar(int x, int y, int width, int firstLineHeight) {
+ timeBar.setBounds(x, y, width - firstLineHeight - SIDE_PANEL_SEPARATOR,
+ firstLineHeight);
+ pauseButton.setBounds(x + width - firstLineHeight, y, firstLineHeight,
+ firstLineHeight);
+ pauseButton.setIcon(ImageUtil
+ .createPauseIcon((int) (firstLineHeight * 0.5f)));
+ }
+
+ private void rescaleUpDownButtons(int handButtonWidth, float fontSize) {
+ handRowUpButton.setBounds(0, 0, handButtonWidth, getHeight() / 2);
+ handRowUpButton.setFont(handRowUpButton.getFont().deriveFont(
+ fontSize * 1.5f));
+ handRowDownButton.setBounds(0, getHeight() / 2, handButtonWidth,
+ getHeight() / 2);
+ handRowDownButton.setFont(handRowDownButton.getFont().deriveFont(
+ fontSize * 1.5f));
+ }
}
}