summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-18 17:41:43 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-18 17:41:43 +0200
commit6ffc2c38a2bf5b3a3e52eabb99977dfeabadbd81 (patch)
tree3eac73da7473a8104d3e0181fe4e79bce514e887 /src/jrummikub/view/impl
parent297d5de03ef6e9f0c55d461021699dd2d34051f7 (diff)
downloadJRummikub-6ffc2c38a2bf5b3a3e52eabb99977dfeabadbd81.tar
JRummikub-6ffc2c38a2bf5b3a3e52eabb99977dfeabadbd81.zip
Kommentare
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@467 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java43
1 files changed, 26 insertions, 17 deletions
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java
index b3e1604..9262ee8 100644
--- a/src/jrummikub/view/impl/SettingsPanel.java
+++ b/src/jrummikub/view/impl/SettingsPanel.java
@@ -334,15 +334,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
choices);
}
- 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());
+ setInitialSettingsValue(gameSettings);
initialMeldThresholdLabel.setText(gameSettings
.getInitialMeldThreshold() + " Punkte");
@@ -373,6 +365,18 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
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,
List<Type> choices) {
if (i < playerSettingsPanels.size()) {
@@ -445,6 +449,18 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
variantLabel = new JLabel("Variante:");
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:");
initialMeldThresholdLabel = new JLabel();
initialMeldThresholdSpinner = createOptionSpinner(1, 999, 1,
@@ -481,14 +497,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
makeOptionLabel(row, "Steinfarben:");
createColorSelectionPanel();
colorLabelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
-
- GridBagConstraints c = new GridBagConstraints();
- c.gridx = 1;
- c.gridy = row;
- c.fill = GridBagConstraints.BOTH;
- c.weightx = 1;
- c.weighty = 1;
- optionsPanel.add(makeFiller(), c);
+ return row;
}
private void removeOptionPanelComponentsAndLabels() {