67 |
import org.jsampler.task.InstrumentsDb; |
import org.jsampler.task.InstrumentsDb; |
68 |
|
|
69 |
import static org.jsampler.view.std.StdI18n.i18n; |
import static org.jsampler.view.std.StdI18n.i18n; |
70 |
|
import static org.linuxsampler.lscp.Parser.*; |
71 |
|
|
72 |
/** |
/** |
73 |
* |
* |
92 |
private final JComboBox cbInstruments = new JComboBox(); |
private final JComboBox cbInstruments = new JComboBox(); |
93 |
|
|
94 |
|
|
95 |
private final JComboBox cbDbInstrument = new JComboBox(); |
private final JComboBox cbDbInstrument = createComboBox(); |
96 |
private final JButton btnBrowseDb; |
private final JButton btnBrowseDb; |
97 |
|
|
98 |
private final JLabel lFilename = new JLabel(i18n.getLabel("JSInstrumentChooser.lFilename")); |
private final JLabel lFilename = new JLabel(i18n.getLabel("JSInstrumentChooser.lFilename")); |
99 |
private final JLabel lIndex = new JLabel(i18n.getLabel("JSInstrumentChooser.lIndex")); |
private final JLabel lIndex = new JLabel(i18n.getLabel("JSInstrumentChooser.lIndex")); |
100 |
|
|
101 |
private final JComboBox cbFilename = new JComboBox(); |
private final JComboBox cbFilename = createComboBox(); |
102 |
private final JSpinner spinnerIndex = new JSpinner(new SpinnerNumberModel(0, 0, 500, 1)); |
private final JSpinner spinnerIndex = new JSpinner(new SpinnerNumberModel(0, 0, 500, 1)); |
103 |
|
|
104 |
private final JButton btnBrowse; |
private final JButton btnBrowse; |
280 |
return p; |
return p; |
281 |
} |
} |
282 |
|
|
283 |
|
protected JComboBox |
284 |
|
createComboBox() { return new JComboBox(); } |
285 |
|
|
286 |
protected JSPrefs |
protected JSPrefs |
287 |
preferences() { return CC.getViewConfig().preferences(); } |
preferences() { return CC.getViewConfig().preferences(); } |
288 |
|
|
471 |
String s = preferences().getStringProperty("lastInstrumentLocation"); |
String s = preferences().getStringProperty("lastInstrumentLocation"); |
472 |
JFileChooser fc = new JFileChooser(s); |
JFileChooser fc = new JFileChooser(s); |
473 |
int result = fc.showOpenDialog(this); |
int result = fc.showOpenDialog(this); |
474 |
if(result == JFileChooser.APPROVE_OPTION) { |
if(result != JFileChooser.APPROVE_OPTION) return; |
475 |
cbFilename.setSelectedItem(fc.getSelectedFile().getPath()); |
|
476 |
btnOk.requestFocusInWindow(); |
String path = fc.getSelectedFile().getAbsolutePath(); |
477 |
|
if(java.io.File.separatorChar == '\\') { |
478 |
String path = fc.getCurrentDirectory().getAbsolutePath(); |
path.replace('\\', '/'); |
|
preferences().setStringProperty("lastInstrumentLocation", path); |
|
479 |
} |
} |
480 |
|
cbFilename.setSelectedItem(toEscapedString(path)); |
481 |
|
btnOk.requestFocusInWindow(); |
482 |
|
|
483 |
|
path = fc.getCurrentDirectory().getAbsolutePath(); |
484 |
|
preferences().setStringProperty("lastInstrumentLocation", path); |
485 |
} |
} |
486 |
|
|
487 |
private void |
private void |