diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-06-21 00:56:05 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-06-21 00:56:05 +0200 |
commit | 2f08091b65fdff96d3671549e74384ec8306668d (patch) | |
tree | ab4c56e0fa4ada543a99a7eb6f0ffaa14bea8b32 /src/jrummikub/view/impl/SidePanel.java | |
parent | a0573a59282fb431d094d91ba388b7ba0c8fa69d (diff) | |
download | JRummikub-2f08091b65fdff96d3671549e74384ec8306668d.tar JRummikub-2f08091b65fdff96d3671549e74384ec8306668d.zip |
Made showing of hand stone count working
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@520 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view/impl/SidePanel.java')
-rw-r--r-- | src/jrummikub/view/impl/SidePanel.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/jrummikub/view/impl/SidePanel.java b/src/jrummikub/view/impl/SidePanel.java index 88f5d64..facf430 100644 --- a/src/jrummikub/view/impl/SidePanel.java +++ b/src/jrummikub/view/impl/SidePanel.java @@ -52,6 +52,7 @@ class SidePanel extends JPanel implements ISidePanel { private JLabel noLimitsLabel; private JLabel colorLabel; private JProgressBar heapBar; + private GameSettings gameSettings; public SidePanel() { setLayout(new GridBagLayout()); @@ -82,6 +83,7 @@ class SidePanel extends JPanel implements ISidePanel { @Override public void setGameSettings(GameSettings settings) { + gameSettings = settings; initialMeldLabel.setText("" + settings.getInitialMeldThreshold()); setNumberLabel.setText("" + settings.getStoneSetNumber()); highestValueLabel.setText("1 - " + settings.getHighestValue()); @@ -332,7 +334,7 @@ class SidePanel extends JPanel implements ISidePanel { GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; - c.gridheight = 2; + c.gridheight = gameSettings.doSeeHandSize() ? 3 : 2; c.weighty = 1; c.insets = new Insets(4, 4, 4, 4); playerColor = new JLabel(ImageUtil.createColorIcon( @@ -342,6 +344,7 @@ class SidePanel extends JPanel implements ISidePanel { c.gridx = 1; c.gridy = 0; c.gridheight = 1; + c.gridwidth = 2; c.weightx = 1; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(2, 2, 2, 2); @@ -372,6 +375,20 @@ class SidePanel extends JPanel implements ISidePanel { playerStatus = new JLabel(status); add(playerStatus, c); + + if (gameSettings.doSeeHandSize()) { + JLabel handSizeLabel = new JLabel("Handsteine: "); + JLabel handSizeInfo = new JLabel("" + player.getHand().getSize()); + c.gridy = 2; + c.gridwidth = 1; + add(handSizeLabel, c); + + c.gridx = 2; + c.weightx = 0; + c.insets = new Insets(2, 4, 2, 4); + c.anchor = GridBagConstraints.EAST; + add(handSizeInfo, c); + } } } |