Reset settings panel selected tab
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@405 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
182d3b499b
commit
9c553786f2
2 changed files with 10 additions and 1 deletions
|
@ -60,6 +60,7 @@ import jrummikub.view.ISettingsPanel;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
class SettingsPanel extends JPanel implements ISettingsPanel {
|
class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
|
private JTabbedPane tabbedPane;
|
||||||
private JPanel playerSetupPanel;
|
private JPanel playerSetupPanel;
|
||||||
private JPanel playerSettingsViewport;
|
private JPanel playerSettingsViewport;
|
||||||
private JPanel optionsPanel;
|
private JPanel optionsPanel;
|
||||||
|
@ -422,7 +423,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
SettingsPanel() {
|
SettingsPanel() {
|
||||||
setLayout(new GridBagLayout());
|
setLayout(new GridBagLayout());
|
||||||
|
|
||||||
final JTabbedPane tabbedPane = new JTabbedPane();
|
tabbedPane = new JTabbedPane();
|
||||||
|
|
||||||
createPlayerSetupPanel();
|
createPlayerSetupPanel();
|
||||||
tabbedPane.addTab("Spieler", playerSetupPanel);
|
tabbedPane.addTab("Spieler", playerSetupPanel);
|
||||||
|
@ -461,6 +462,10 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
|
||||||
10, 10, 10, 10)));
|
10, 10, 10, 10)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void resetTabbedPane() {
|
||||||
|
tabbedPane.setSelectedIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
private JButton addButton(String title, final Event event,
|
private JButton addButton(String title, final Event event,
|
||||||
GridBagConstraints c) {
|
GridBagConstraints c) {
|
||||||
JButton button = new JButton(title);
|
JButton button = new JButton(title);
|
||||||
|
|
|
@ -350,6 +350,10 @@ public class View extends JFrame implements IView {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showSettingsPanel(boolean show) {
|
public void showSettingsPanel(boolean show) {
|
||||||
|
if (show) {
|
||||||
|
settingsPanel.resetTabbedPane();
|
||||||
|
}
|
||||||
|
|
||||||
settingsPanel.setVisible(show);
|
settingsPanel.setVisible(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue