1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
80 |
* @author Grigor Iliev |
* @author Grigor Iliev |
81 |
*/ |
*/ |
82 |
public class PrefsDlg extends EnhancedDialog { |
public class PrefsDlg extends EnhancedDialog { |
83 |
|
private final JTabbedPane tabbedPane = new JTabbedPane(); |
84 |
|
|
85 |
private final GeneralPane genPane = new GeneralPane(); |
private final GeneralPane genPane = new GeneralPane(); |
86 |
private final ViewPane viewPane = new ViewPane(); |
private final ViewPane viewPane = new ViewPane(); |
87 |
private final ConsolePane consolePane = new ConsolePane(); |
private final ConsolePane consolePane = new ConsolePane(); |
102 |
installListeners(); |
installListeners(); |
103 |
|
|
104 |
setLocation(JuifeUtils.centerLocation(this, frm)); |
setLocation(JuifeUtils.centerLocation(this, frm)); |
105 |
|
|
106 |
|
int i = preferences().getIntProperty("PrefsDlg.tabIndex"); |
107 |
|
|
108 |
|
if(i >= 0 && i < tabbedPane.getTabCount()) tabbedPane.setSelectedIndex(i); |
109 |
} |
} |
110 |
|
|
111 |
private void |
private void |
112 |
initPrefsDlg() { |
initPrefsDlg() { |
113 |
JTabbedPane tp = new JTabbedPane(); |
JTabbedPane tp = tabbedPane; |
114 |
|
tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); |
115 |
|
|
116 |
tp.addTab(i18n.getLabel("PrefsDlg.tabGeneral"), genPane); |
tp.addTab(i18n.getLabel("PrefsDlg.tabGeneral"), genPane); |
117 |
tp.addTab(i18n.getLabel("PrefsDlg.tabView"), viewPane); |
tp.addTab(i18n.getLabel("PrefsDlg.tabView"), viewPane); |
118 |
tp.addTab(i18n.getLabel("PrefsDlg.tabConsole"), consolePane); |
tp.addTab(i18n.getLabel("PrefsDlg.tabConsole"), consolePane); |
178 |
connectionPane.apply(); |
connectionPane.apply(); |
179 |
defaultsPane.apply(); |
defaultsPane.apply(); |
180 |
|
|
181 |
|
preferences().setIntProperty("PrefsDlg.tabIndex", tabbedPane.getSelectedIndex()); |
182 |
|
|
183 |
setVisible(false); |
setVisible(false); |
184 |
} |
} |
185 |
|
|