From dcf87994cb4cb5083e12e2acb55ec6cf42e4d7e9 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sun, 19 Jun 2011 18:53:02 +0200 Subject: Show side panel only ingame git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@487 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/SidePanel.java | 2 +- src/jrummikub/view/impl/View.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/jrummikub/view/impl') diff --git a/src/jrummikub/view/impl/SidePanel.java b/src/jrummikub/view/impl/SidePanel.java index fd0d376..9e83c91 100644 --- a/src/jrummikub/view/impl/SidePanel.java +++ b/src/jrummikub/view/impl/SidePanel.java @@ -87,7 +87,7 @@ class SidePanel extends JPanel implements ISidePanel { JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); initialMeldLabel = createRuleLine(panel, "Auslegeschranke", 0); - setNumberLabel = createRuleLine(panel, "Steinsätze", 1); + setNumberLabel = createRuleLine(panel, "Steins\u00e4tze", 1); highestValueLabel = createRuleLine(panel,"Steinwert", 2); handStonesLabel = createRuleLine(panel, "Startsteine", 3); jokerLabel = createRuleLine(panel, "Joker", 4); diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java index 5755c73..caac01f 100644 --- a/src/jrummikub/view/impl/View.java +++ b/src/jrummikub/view/impl/View.java @@ -349,6 +349,7 @@ public class View extends JFrame implements IView { mainLayer.add(winPanel); sidePanel = new SidePanel(); + sidePanel.setVisible(false); mainLayer.add(sidePanel); sidePanel.setBorder(new MatteBorder(0, 0, TABLE_BORDER_WIDTH, 0, Color.BLACK)); @@ -379,11 +380,13 @@ public class View extends JFrame implements IView { playerPanel.setBounds(0, tableHeight, width, playerPanelHeight); playerPanel.rescale(); - int sideWidth = playerPanel.getLeftPanelWidth() + 1; + int sideWidth = sidePanel.isVisible() ? playerPanel.getLeftPanelWidth() + 1 : 0; table.setBounds(sideWidth, 0, width - sideWidth, tableHeight); table.validate(); - sidePanel.setBounds(0, 0, sideWidth, tableHeight); + if (sidePanel.isVisible()) { + sidePanel.setBounds(0, 0, sideWidth, tableHeight); + } startTurnPanel.setBounds(0, tableHeight, width, playerPanelHeight); pausePanel.setBounds(0, tableHeight, width, playerPanelHeight); winPanel.setBounds(0, tableHeight, width, playerPanelHeight); @@ -446,6 +449,12 @@ public class View extends JFrame implements IView { public void showScorePanel(boolean show) { scorePanel.setVisible(show); } + + @Override + public void showSidePanel(boolean show) { + sidePanel.setVisible(show); + rescale(); + } @Override public void setCurrentPlayerName(String playerName) { -- cgit v1.2.3