Made showing of hand stone count working
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@520 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
a0573a5928
commit
2f08091b65
4 changed files with 35 additions and 7 deletions
|
@ -168,6 +168,15 @@ public abstract class AbstractSettingsControl {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
connections.add(view.getSettingsPanel().getChangeSeeHandSizeEvent()
|
||||||
|
.add(new IListener1<Boolean>() {
|
||||||
|
@Override
|
||||||
|
public void handle(Boolean value) {
|
||||||
|
settings.setSeeHandSize(value);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -245,7 +245,7 @@ public interface ISettingsPanel {
|
||||||
*/
|
*/
|
||||||
public void setPlayerColors(Set<Color> colors);
|
public void setPlayerColors(Set<Color> colors);
|
||||||
|
|
||||||
public IEvent1<Boolean> getChangeSeeHandSize();
|
public IEvent1<Boolean> getChangeSeeHandSizeEvent();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies the different kinds of settings errors that can be displayed
|
* Specifies the different kinds of settings errors that can be displayed
|
||||||
|
|
|
@ -216,7 +216,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEvent1<Boolean> getChangeSeeHandSize() {
|
public IEvent1<Boolean> getChangeSeeHandSizeEvent() {
|
||||||
return changeSeeHandSizeEvent;
|
return changeSeeHandSizeEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
.setText(Integer.toString(gameSettings.getJokerNumber()));
|
.setText(Integer.toString(gameSettings.getJokerNumber()));
|
||||||
timeLabel.setText(gameSettings.getTotalTime() + " Sekunden");
|
timeLabel.setText(gameSettings.getTotalTime() + " Sekunden");
|
||||||
noLimitsLabel.setText(gameSettings.isNoLimits() ? "An" : "Aus");
|
noLimitsLabel.setText(gameSettings.isNoLimits() ? "An" : "Aus");
|
||||||
//seeHandSizeLabel.setText(gameSettings.doSeeHandSize() ? "An" : "Aus");
|
seeHandSizeLabel.setText(gameSettings.doSeeHandSize() ? "An" : "Aus");
|
||||||
|
|
||||||
colorLabelPanel.removeAll();
|
colorLabelPanel.removeAll();
|
||||||
|
|
||||||
|
@ -503,9 +503,10 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
makeOptionLabel(row++, "No Limits:");
|
makeOptionLabel(row++, "No Limits:");
|
||||||
noLimitsLabel = new JLabel();
|
noLimitsLabel = new JLabel();
|
||||||
noLimitsBox = createOptionCheckbox(changeNoLimitsEvent);
|
noLimitsBox = createOptionCheckbox(changeNoLimitsEvent);
|
||||||
seeHandSizeBox = createOptionCheckbox(changeSeeHandSizeEvent);
|
|
||||||
|
|
||||||
makeOptionLabel(row++, "Steinanzahl anzeigen");
|
makeOptionLabel(row++, "Steinanzahl anzeigen:");
|
||||||
|
seeHandSizeLabel = new JLabel();
|
||||||
|
seeHandSizeBox = createOptionCheckbox(changeSeeHandSizeEvent);
|
||||||
|
|
||||||
makeOptionLabel(row, "Steinfarben:");
|
makeOptionLabel(row, "Steinfarben:");
|
||||||
createColorSelectionPanel();
|
createColorSelectionPanel();
|
||||||
|
@ -532,6 +533,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
optionsPanel.remove(noLimitsBox);
|
optionsPanel.remove(noLimitsBox);
|
||||||
optionsPanel.remove(noLimitsLabel);
|
optionsPanel.remove(noLimitsLabel);
|
||||||
optionsPanel.remove(seeHandSizeBox);
|
optionsPanel.remove(seeHandSizeBox);
|
||||||
|
optionsPanel.remove(seeHandSizeLabel);
|
||||||
|
|
||||||
optionsPanel.remove(colorSelectionPanel);
|
optionsPanel.remove(colorSelectionPanel);
|
||||||
optionsPanel.remove(colorLabelPanel);
|
optionsPanel.remove(colorLabelPanel);
|
||||||
|
@ -565,7 +567,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
addOptionPanelComponent(jokerNumberLabel, false, row++);
|
addOptionPanelComponent(jokerNumberLabel, false, row++);
|
||||||
addOptionPanelComponent(timeLabel, false, row++);
|
addOptionPanelComponent(timeLabel, false, row++);
|
||||||
addOptionPanelComponent(noLimitsLabel, false, row++);
|
addOptionPanelComponent(noLimitsLabel, false, row++);
|
||||||
addOptionPanelComponent(seeHandSizeBox, false, row++);
|
addOptionPanelComponent(seeHandSizeLabel, false, row++);
|
||||||
addOptionPanelComponent(colorLabelPanel, false, row++);
|
addOptionPanelComponent(colorLabelPanel, false, row++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ class SidePanel extends JPanel implements ISidePanel {
|
||||||
private JLabel noLimitsLabel;
|
private JLabel noLimitsLabel;
|
||||||
private JLabel colorLabel;
|
private JLabel colorLabel;
|
||||||
private JProgressBar heapBar;
|
private JProgressBar heapBar;
|
||||||
|
private GameSettings gameSettings;
|
||||||
|
|
||||||
public SidePanel() {
|
public SidePanel() {
|
||||||
setLayout(new GridBagLayout());
|
setLayout(new GridBagLayout());
|
||||||
|
@ -82,6 +83,7 @@ class SidePanel extends JPanel implements ISidePanel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGameSettings(GameSettings settings) {
|
public void setGameSettings(GameSettings settings) {
|
||||||
|
gameSettings = settings;
|
||||||
initialMeldLabel.setText("" + settings.getInitialMeldThreshold());
|
initialMeldLabel.setText("" + settings.getInitialMeldThreshold());
|
||||||
setNumberLabel.setText("" + settings.getStoneSetNumber());
|
setNumberLabel.setText("" + settings.getStoneSetNumber());
|
||||||
highestValueLabel.setText("1 - " + settings.getHighestValue());
|
highestValueLabel.setText("1 - " + settings.getHighestValue());
|
||||||
|
@ -332,7 +334,7 @@ class SidePanel extends JPanel implements ISidePanel {
|
||||||
GridBagConstraints c = new GridBagConstraints();
|
GridBagConstraints c = new GridBagConstraints();
|
||||||
c.gridx = 0;
|
c.gridx = 0;
|
||||||
c.gridy = 0;
|
c.gridy = 0;
|
||||||
c.gridheight = 2;
|
c.gridheight = gameSettings.doSeeHandSize() ? 3 : 2;
|
||||||
c.weighty = 1;
|
c.weighty = 1;
|
||||||
c.insets = new Insets(4, 4, 4, 4);
|
c.insets = new Insets(4, 4, 4, 4);
|
||||||
playerColor = new JLabel(ImageUtil.createColorIcon(
|
playerColor = new JLabel(ImageUtil.createColorIcon(
|
||||||
|
@ -342,6 +344,7 @@ class SidePanel extends JPanel implements ISidePanel {
|
||||||
c.gridx = 1;
|
c.gridx = 1;
|
||||||
c.gridy = 0;
|
c.gridy = 0;
|
||||||
c.gridheight = 1;
|
c.gridheight = 1;
|
||||||
|
c.gridwidth = 2;
|
||||||
c.weightx = 1;
|
c.weightx = 1;
|
||||||
c.fill = GridBagConstraints.HORIZONTAL;
|
c.fill = GridBagConstraints.HORIZONTAL;
|
||||||
c.insets = new Insets(2, 2, 2, 2);
|
c.insets = new Insets(2, 2, 2, 2);
|
||||||
|
@ -372,6 +375,20 @@ class SidePanel extends JPanel implements ISidePanel {
|
||||||
|
|
||||||
playerStatus = new JLabel(status);
|
playerStatus = new JLabel(status);
|
||||||
add(playerStatus, c);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue