From e7ee6778b020b555ce5e4a2e96d850b19ba02e35 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Jun 2011 14:51:44 +0200 Subject: Added load and network buttons to settings panel git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@395 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/PlayerPanel.java | 34 ++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src/jrummikub/view/impl/PlayerPanel.java') 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)); + } } } -- cgit v1.2.3