summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-06-20 03:19:02 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-06-20 03:19:02 +0200
commit8a3e4c3e26cba022dfaf06f8c7cd31b33b0889e9 (patch)
tree3b32ee8a52f84138a05a2d3eef74cec1a3c15a2d /src/jrummikub/view
parent4df5c0e665991dd19a2f25ee513c3ff85a672c55 (diff)
downloadJRummikub-8a3e4c3e26cba022dfaf06f8c7cd31b33b0889e9.tar
JRummikub-8a3e4c3e26cba022dfaf06f8c7cd31b33b0889e9.zip
Finished side panel info
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@501 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r--src/jrummikub/view/impl/SidePanel.java32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/jrummikub/view/impl/SidePanel.java b/src/jrummikub/view/impl/SidePanel.java
index a4e0e43..88f5d64 100644
--- a/src/jrummikub/view/impl/SidePanel.java
+++ b/src/jrummikub/view/impl/SidePanel.java
@@ -63,7 +63,7 @@ class SidePanel extends JPanel implements ISidePanel {
c.gridx = 0;
c.gridy = 0;
c.weightx = 1;
- c.fill = GridBagConstraints.BOTH;
+ c.fill = GridBagConstraints.HORIZONTAL;
infoPanel.setBorder(new MatteBorder(0, 0, 1, 0, Color.GRAY));
add(infoPanel, c);
@@ -159,7 +159,9 @@ class SidePanel extends JPanel implements ISidePanel {
c.weightx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.WEST;
- panel.add(new JLabel(name + ": "), c);
+ JLabel nameLabel = new JLabel(name + ": ");
+ nameLabel.setPreferredSize(new Dimension(0,nameLabel.getPreferredSize().height));
+ panel.add(nameLabel, c);
JLabel label = new JLabel("");
label.setHorizontalAlignment(SwingConstants.RIGHT);
c.weightx = 0;
@@ -321,7 +323,6 @@ class SidePanel extends JPanel implements ISidePanel {
JLabel playerName;
JLabel playerStatus;
JLabel playerColor;
-
public PlayerListItem(IPlayer player) {
setLayout(new GridBagLayout());
@@ -343,18 +344,35 @@ class SidePanel extends JPanel implements ISidePanel {
c.gridheight = 1;
c.weightx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
- c.insets = new Insets(2,2,2,2);
+ c.insets = new Insets(2, 2, 2, 2);
playerName = new JLabel(settings.getName());
playerName.putClientProperty("html.disable", Boolean.TRUE);
add(playerName, c);
-
+
c.gridx = 1;
c.gridy = 1;
- playerStatus = new JLabel(player.getLaidOut() ? "rausgekommen" : "nicht rausgekommen");
+
+ String status = "Stein gezogen";
+
+ if (player.wasLastTurnInvalid()) {
+ status = "ungültiger Zug";
+ if (!player.getLaidOut()) {
+ status = "ungültig, nicht rausgekommen";
+ }
+ } else {
+ if (!player.getLaidOut()) {
+ status = "nicht rausgekommen";
+ } else if (player.getLastTurnStoneCount() == 1) {
+ status = "1 Stein abgelegt";
+ } else if (player.getLastTurnStoneCount() > 1) {
+ status = player.getLastTurnStoneCount() + " Steine abgelegt";
+ }
+ }
+
+ playerStatus = new JLabel(status);
add(playerStatus, c);
}
-
}
class PlayerListPanel extends JPanel {