diff options
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r-- | src/jrummikub/view/impl/SettingsPanel.java | 43 |
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() { |