Kommentare
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@467 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
297d5de03e
commit
6ffc2c38a2
3 changed files with 45 additions and 17 deletions
|
@ -5,5 +5,10 @@ package jrummikub.view;
|
||||||
*/
|
*/
|
||||||
public interface IStoneCollectionPanel extends IStonePanel {
|
public interface IStoneCollectionPanel extends IStonePanel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide stone collection
|
||||||
|
*
|
||||||
|
* @param enable
|
||||||
|
*/
|
||||||
void setHidden(boolean enable);
|
void setHidden(boolean enable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,10 +254,24 @@ public interface IView {
|
||||||
WIN_PANEL
|
WIN_PANEL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is set if a player tried to lay out less than initial meld threshold
|
||||||
|
*
|
||||||
|
* @param points
|
||||||
|
* initial meld threshold
|
||||||
|
*/
|
||||||
void setInitialMeldError(int points);
|
void setInitialMeldError(int points);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show stone collection
|
||||||
|
*
|
||||||
|
* @param enable
|
||||||
|
*/
|
||||||
void setStoneCollectionHidden(boolean enable);
|
void setStoneCollectionHidden(boolean enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is set if the player tried to modify the table without laying out first
|
||||||
|
*/
|
||||||
void setInitialMeldFirstError();
|
void setInitialMeldFirstError();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,15 +334,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
choices);
|
choices);
|
||||||
}
|
}
|
||||||
|
|
||||||
initialMeldThresholdSpinner.setValue(gameSettings
|
setInitialSettingsValue(gameSettings);
|
||||||
.getInitialMeldThreshold());
|
|
||||||
stoneSetNumberSpinner.setValue(gameSettings.getStoneSetNumber());
|
|
||||||
highestValueSpinner.setValue(gameSettings.getHighestValue());
|
|
||||||
numberOfStonesDealtSpinner.setValue(gameSettings
|
|
||||||
.getNumberOfStonesDealt());
|
|
||||||
jokerNumberSpinner.setValue(gameSettings.getJokerNumber());
|
|
||||||
timeSpinner.setValue(gameSettings.getTotalTime());
|
|
||||||
noLimitsBox.setSelected(gameSettings.isNoLimits());
|
|
||||||
|
|
||||||
initialMeldThresholdLabel.setText(gameSettings
|
initialMeldThresholdLabel.setText(gameSettings
|
||||||
.getInitialMeldThreshold() + " Punkte");
|
.getInitialMeldThreshold() + " Punkte");
|
||||||
|
@ -373,6 +365,18 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
playerSettingsViewport.revalidate();
|
playerSettingsViewport.revalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setInitialSettingsValue(GameSettings gameSettings) {
|
||||||
|
initialMeldThresholdSpinner.setValue(gameSettings
|
||||||
|
.getInitialMeldThreshold());
|
||||||
|
stoneSetNumberSpinner.setValue(gameSettings.getStoneSetNumber());
|
||||||
|
highestValueSpinner.setValue(gameSettings.getHighestValue());
|
||||||
|
numberOfStonesDealtSpinner.setValue(gameSettings
|
||||||
|
.getNumberOfStonesDealt());
|
||||||
|
jokerNumberSpinner.setValue(gameSettings.getJokerNumber());
|
||||||
|
timeSpinner.setValue(gameSettings.getTotalTime());
|
||||||
|
noLimitsBox.setSelected(gameSettings.isNoLimits());
|
||||||
|
}
|
||||||
|
|
||||||
private void updatePlayerSettingsPanel(int i, PlayerSettings settings,
|
private void updatePlayerSettingsPanel(int i, PlayerSettings settings,
|
||||||
List<Type> choices) {
|
List<Type> choices) {
|
||||||
if (i < playerSettingsPanels.size()) {
|
if (i < playerSettingsPanels.size()) {
|
||||||
|
@ -445,6 +449,18 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
variantLabel = new JLabel("Variante:");
|
variantLabel = new JLabel("Variante:");
|
||||||
makeVariantPanel();
|
makeVariantPanel();
|
||||||
|
|
||||||
|
row = makeAllOptionLabels(row);
|
||||||
|
|
||||||
|
GridBagConstraints c = new GridBagConstraints();
|
||||||
|
c.gridx = 1;
|
||||||
|
c.gridy = row;
|
||||||
|
c.fill = GridBagConstraints.BOTH;
|
||||||
|
c.weightx = 1;
|
||||||
|
c.weighty = 1;
|
||||||
|
optionsPanel.add(makeFiller(), c);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int makeAllOptionLabels(int row) {
|
||||||
makeOptionLabel(row++, "Auslegeschranke:");
|
makeOptionLabel(row++, "Auslegeschranke:");
|
||||||
initialMeldThresholdLabel = new JLabel();
|
initialMeldThresholdLabel = new JLabel();
|
||||||
initialMeldThresholdSpinner = createOptionSpinner(1, 999, 1,
|
initialMeldThresholdSpinner = createOptionSpinner(1, 999, 1,
|
||||||
|
@ -481,14 +497,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
makeOptionLabel(row, "Steinfarben:");
|
makeOptionLabel(row, "Steinfarben:");
|
||||||
createColorSelectionPanel();
|
createColorSelectionPanel();
|
||||||
colorLabelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
|
colorLabelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
|
||||||
|
return row;
|
||||||
GridBagConstraints c = new GridBagConstraints();
|
|
||||||
c.gridx = 1;
|
|
||||||
c.gridy = row;
|
|
||||||
c.fill = GridBagConstraints.BOTH;
|
|
||||||
c.weightx = 1;
|
|
||||||
c.weighty = 1;
|
|
||||||
optionsPanel.add(makeFiller(), c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeOptionPanelComponentsAndLabels() {
|
private void removeOptionPanelComponentsAndLabels() {
|
||||||
|
|
Reference in a new issue