Finished side panel info

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@501 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Jannis Harder 2011-06-20 03:19:02 +02:00
parent 4df5c0e665
commit 8a3e4c3e26
6 changed files with 118 additions and 32 deletions

View file

@ -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 {