1 |
iliev |
1205 |
/* |
2 |
|
|
* JSampler - a java front-end for LinuxSampler |
3 |
|
|
* |
4 |
|
|
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
5 |
|
|
* |
6 |
|
|
* This file is part of JSampler. |
7 |
|
|
* |
8 |
|
|
* JSampler is free software; you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License version 2 |
10 |
|
|
* as published by the Free Software Foundation. |
11 |
|
|
* |
12 |
|
|
* JSampler is distributed in the hope that it will be useful, |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
* GNU General Public License for more details. |
16 |
|
|
* |
17 |
|
|
* You should have received a copy of the GNU General Public License |
18 |
|
|
* along with JSampler; if not, write to the Free Software |
19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
|
|
* MA 02111-1307 USA |
21 |
|
|
*/ |
22 |
|
|
|
23 |
|
|
package org.jsampler.view.classic; |
24 |
|
|
|
25 |
|
|
import java.awt.BorderLayout; |
26 |
|
|
import java.awt.Dimension; |
27 |
|
|
|
28 |
|
|
import java.awt.event.ActionEvent; |
29 |
|
|
import java.awt.event.ActionListener; |
30 |
|
|
import java.awt.event.ItemEvent; |
31 |
|
|
import java.awt.event.ItemListener; |
32 |
|
|
import java.awt.event.KeyEvent; |
33 |
|
|
import java.awt.event.WindowAdapter; |
34 |
|
|
import java.awt.event.WindowEvent; |
35 |
|
|
|
36 |
iliev |
1705 |
import java.util.List; |
37 |
iliev |
1205 |
import java.util.logging.Level; |
38 |
|
|
|
39 |
|
|
import javax.swing.AbstractAction; |
40 |
|
|
import javax.swing.Action; |
41 |
|
|
import javax.swing.BorderFactory; |
42 |
|
|
import javax.swing.BoxLayout; |
43 |
iliev |
1285 |
import javax.swing.Icon; |
44 |
iliev |
1205 |
import javax.swing.JCheckBox; |
45 |
|
|
import javax.swing.JComponent; |
46 |
|
|
import javax.swing.JFrame; |
47 |
|
|
import javax.swing.JMenu; |
48 |
|
|
import javax.swing.JMenuBar; |
49 |
|
|
import javax.swing.JMenuItem; |
50 |
|
|
import javax.swing.JPanel; |
51 |
|
|
import javax.swing.JScrollPane; |
52 |
|
|
import javax.swing.JSplitPane; |
53 |
|
|
import javax.swing.JTextField; |
54 |
|
|
import javax.swing.JToggleButton; |
55 |
|
|
import javax.swing.JToolBar; |
56 |
|
|
import javax.swing.KeyStroke; |
57 |
iliev |
1705 |
import javax.swing.RowSorter.SortKey; |
58 |
|
|
import javax.swing.SortOrder; |
59 |
iliev |
1205 |
|
60 |
iliev |
1688 |
import javax.swing.event.ChangeEvent; |
61 |
|
|
import javax.swing.event.ChangeListener; |
62 |
iliev |
1205 |
import javax.swing.event.ListSelectionEvent; |
63 |
|
|
import javax.swing.event.ListSelectionListener; |
64 |
iliev |
1705 |
import javax.swing.event.RowSorterEvent; |
65 |
|
|
import javax.swing.event.RowSorterListener; |
66 |
iliev |
1205 |
import javax.swing.event.TreeSelectionEvent; |
67 |
|
|
import javax.swing.event.TreeSelectionListener; |
68 |
|
|
|
69 |
|
|
import javax.swing.plaf.ToolBarUI; |
70 |
|
|
|
71 |
|
|
import net.sf.juife.InformationDialog; |
72 |
|
|
import net.sf.juife.NavigationPage; |
73 |
|
|
import net.sf.juife.NavigationPane; |
74 |
|
|
|
75 |
|
|
import net.sf.juife.DefaultNavigationHistoryModel; |
76 |
|
|
import net.sf.juife.Task; |
77 |
|
|
|
78 |
|
|
import net.sf.juife.event.TaskEvent; |
79 |
|
|
import net.sf.juife.event.TaskListener; |
80 |
|
|
|
81 |
|
|
import org.jsampler.CC; |
82 |
|
|
import org.jsampler.HF; |
83 |
|
|
import org.jsampler.JSI18n; |
84 |
|
|
|
85 |
|
|
import org.jsampler.task.InstrumentsDb; |
86 |
|
|
|
87 |
|
|
import org.jsampler.view.DbDirectoryTreeNode; |
88 |
|
|
import org.jsampler.view.InstrumentsDbTableModel; |
89 |
iliev |
1285 |
import org.jsampler.view.InstrumentsDbTableView; |
90 |
|
|
import org.jsampler.view.std.JSInstrumentsDbTable; |
91 |
|
|
import org.jsampler.view.std.JSInstrumentsDbTree; |
92 |
iliev |
1205 |
|
93 |
|
|
import org.linuxsampler.lscp.DbDirectoryInfo; |
94 |
|
|
import org.linuxsampler.lscp.DbInstrumentInfo; |
95 |
|
|
import org.linuxsampler.lscp.DbSearchQuery; |
96 |
|
|
|
97 |
iliev |
1705 |
import static javax.swing.event.RowSorterEvent.Type.SORT_ORDER_CHANGED; |
98 |
iliev |
1205 |
import static org.jsampler.view.classic.ClassicI18n.i18n; |
99 |
iliev |
1285 |
import static org.jsampler.view.classic.ClassicPrefs.preferences; |
100 |
iliev |
1705 |
import static org.jsampler.view.fantasia.FantasiaPrefs.INSTRUMENTS_DB_FRAME_SORT_ORDER; |
101 |
iliev |
1205 |
|
102 |
|
|
/** |
103 |
|
|
* |
104 |
|
|
* @author Grigor Iliev |
105 |
|
|
*/ |
106 |
|
|
public class InstrumentsDbFrame extends JFrame { |
107 |
|
|
private final JMenuBar menuBar = new JMenuBar(); |
108 |
iliev |
1285 |
private final JSInstrumentsDbTree instrumentsDbTree; |
109 |
iliev |
1205 |
private final SidePane sidePane; |
110 |
|
|
private final JSplitPane splitPane; |
111 |
|
|
private final MainPane mainPane; |
112 |
|
|
|
113 |
|
|
private final GoUp goUp = new GoUp(); |
114 |
|
|
private final GoBack goBack = new GoBack(); |
115 |
|
|
private final GoForward goForward = new GoForward(); |
116 |
|
|
|
117 |
|
|
private final NavigationHistoryModel navigationHistoryModel = new NavigationHistoryModel(); |
118 |
|
|
|
119 |
|
|
private JMenu loadInstrumentMenu; |
120 |
|
|
private JMenu addToMidiMapMenu; |
121 |
|
|
private JMenu addToOrchestraMenu; |
122 |
|
|
|
123 |
|
|
/** |
124 |
|
|
* Creates a new instance of <code>InstrumentsDbFrame</code> |
125 |
|
|
*/ |
126 |
|
|
public |
127 |
|
|
InstrumentsDbFrame() { |
128 |
|
|
setTitle(i18n.getLabel("InstrumentsDbFrame.title")); |
129 |
|
|
if(Res.appIcon != null) setIconImage(Res.appIcon.getImage()); |
130 |
|
|
|
131 |
iliev |
1285 |
instrumentsDbTree = new JSInstrumentsDbTree(CC.getInstrumentsDbTreeModel()); |
132 |
iliev |
1688 |
CC.addInstrumentsDbChangeListener(new ChangeListener() { |
133 |
|
|
public void |
134 |
|
|
stateChanged(ChangeEvent e) { |
135 |
|
|
instrumentsDbTree.setModel(CC.getInstrumentsDbTreeModel()); |
136 |
|
|
|
137 |
|
|
CC.scheduleInTaskQueue(new Runnable() { |
138 |
|
|
public void |
139 |
|
|
run() { |
140 |
|
|
instrumentsDbTree.setSelectedDirectory("/"); |
141 |
|
|
navigationHistoryModel.clearHistory(); |
142 |
|
|
} |
143 |
|
|
}); |
144 |
|
|
} |
145 |
|
|
}); |
146 |
iliev |
1205 |
|
147 |
|
|
sidePane = new SidePane(); |
148 |
|
|
mainPane = new MainPane(); |
149 |
|
|
|
150 |
|
|
instrumentsDbTree.setSelectedDirectory("/"); |
151 |
|
|
|
152 |
|
|
getContentPane().add(new ToolbarBar(), BorderLayout.NORTH); |
153 |
|
|
|
154 |
|
|
splitPane = new JSplitPane ( |
155 |
|
|
JSplitPane.HORIZONTAL_SPLIT, |
156 |
|
|
true, // continuousLayout |
157 |
|
|
sidePane, |
158 |
|
|
mainPane |
159 |
|
|
); |
160 |
|
|
|
161 |
|
|
splitPane.setDividerSize(3); |
162 |
|
|
splitPane.setDividerLocation(200); |
163 |
|
|
|
164 |
|
|
addMenu(); |
165 |
|
|
|
166 |
|
|
pack(); |
167 |
|
|
setSavedSize(); |
168 |
|
|
|
169 |
|
|
getContentPane().add(splitPane); |
170 |
|
|
mainPane.getInstrumentsTable().loadColumnWidths(); |
171 |
|
|
|
172 |
|
|
addWindowListener(new WindowAdapter() { |
173 |
|
|
public void |
174 |
|
|
windowClosing(WindowEvent we) { onWindowClose(); } |
175 |
|
|
}); |
176 |
|
|
|
177 |
|
|
instrumentsDbTree.addTreeSelectionListener(goUp); |
178 |
|
|
instrumentsDbTree.addTreeSelectionListener(navigationHistoryModel); |
179 |
|
|
installKeyboardListeners(); |
180 |
|
|
} |
181 |
|
|
|
182 |
|
|
private void |
183 |
|
|
addMenu() { |
184 |
|
|
JMenu m; |
185 |
|
|
JMenuItem mi; |
186 |
|
|
|
187 |
|
|
setJMenuBar(menuBar); |
188 |
|
|
|
189 |
|
|
// Actions |
190 |
|
|
m = new JMenu(i18n.getMenuLabel("instrumentsdb.actions")); |
191 |
|
|
menuBar.add(m); |
192 |
|
|
|
193 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().createDirectoryAction); |
194 |
|
|
mi.setIcon(null); |
195 |
|
|
m.add(mi); |
196 |
|
|
|
197 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().deleteAction); |
198 |
|
|
mi.setIcon(null); |
199 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); |
200 |
|
|
m.add(mi); |
201 |
|
|
|
202 |
|
|
JMenu addInstrumentsMenu = |
203 |
|
|
new JMenu(i18n.getMenuLabel("instrumentsdb.actions.addInstruments")); |
204 |
|
|
m.add(addInstrumentsMenu); |
205 |
|
|
|
206 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().addInstrumentsFromFileAction); |
207 |
|
|
mi.setIcon(null); |
208 |
|
|
addInstrumentsMenu.add(mi); |
209 |
|
|
|
210 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().addInstrumentsFromDirAction); |
211 |
|
|
mi.setIcon(null); |
212 |
|
|
addInstrumentsMenu.add(mi); |
213 |
|
|
|
214 |
|
|
m.addSeparator(); |
215 |
|
|
|
216 |
iliev |
1355 |
mi = new JMenuItem(i18n.getMenuLabel("instrumentsdb.actions.format")); |
217 |
|
|
m.add(mi); |
218 |
|
|
mi.addActionListener(new ActionListener() { |
219 |
|
|
public void |
220 |
|
|
actionPerformed(ActionEvent e) { |
221 |
|
|
String s = i18n.getMessage("InstrumentsDbFrame.formatDatabase?"); |
222 |
|
|
if(!HF.showYesNoDialog(InstrumentsDbFrame.this, s)) return; |
223 |
|
|
CC.getTaskQueue().add(new InstrumentsDb.Format()); |
224 |
|
|
} |
225 |
|
|
}); |
226 |
|
|
|
227 |
|
|
m.addSeparator(); |
228 |
|
|
|
229 |
iliev |
1205 |
loadInstrumentMenu = |
230 |
|
|
new JMenu(i18n.getMenuLabel("instrumentsdb.actions.loadInstrument")); |
231 |
|
|
m.add(loadInstrumentMenu); |
232 |
|
|
mainPane.getInstrumentsTable().registerLoadInstrumentMenus(loadInstrumentMenu); |
233 |
|
|
|
234 |
|
|
addToMidiMapMenu = |
235 |
|
|
new JMenu(i18n.getMenuLabel("instrumentsdb.actions.addToMidiMap")); |
236 |
|
|
m.add(addToMidiMapMenu); |
237 |
|
|
mainPane.getInstrumentsTable().registerAddToMidiMapMenu(addToMidiMapMenu); |
238 |
|
|
|
239 |
|
|
addToOrchestraMenu = |
240 |
|
|
new JMenu(i18n.getMenuLabel("instrumentsdb.actions.addToOrchestra")); |
241 |
|
|
m.add(addToOrchestraMenu); |
242 |
|
|
mainPane.getInstrumentsTable().registerAddToOrchestraMenu(addToOrchestraMenu); |
243 |
|
|
|
244 |
|
|
m.addSeparator(); |
245 |
|
|
|
246 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().reloadAction); |
247 |
|
|
mi.setIcon(null); |
248 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); |
249 |
|
|
m.add(mi); |
250 |
|
|
|
251 |
|
|
m.addSeparator(); |
252 |
|
|
|
253 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().propertiesAction); |
254 |
|
|
mi.setIcon(null); |
255 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.ALT_MASK)); |
256 |
|
|
m.add(mi); |
257 |
|
|
|
258 |
|
|
m = new JMenu(i18n.getMenuLabel("instrumentsdb.edit")); |
259 |
|
|
menuBar.add(m); |
260 |
|
|
|
261 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().cutAction); |
262 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK)); |
263 |
|
|
mi.setIcon(null); |
264 |
|
|
m.add(mi); |
265 |
|
|
|
266 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().copyAction); |
267 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK)); |
268 |
|
|
mi.setIcon(null); |
269 |
|
|
m.add(mi); |
270 |
|
|
|
271 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().pasteAction); |
272 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK)); |
273 |
|
|
mi.setIcon(null); |
274 |
|
|
m.add(mi); |
275 |
|
|
|
276 |
|
|
m.addSeparator(); |
277 |
|
|
|
278 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().renameAction); |
279 |
|
|
mi.setIcon(null); |
280 |
|
|
m.add(mi); |
281 |
|
|
|
282 |
|
|
mi = new JMenuItem(mainPane.getInstrumentsTable().changeDescriptionAction); |
283 |
|
|
mi.setIcon(null); |
284 |
|
|
m.add(mi); |
285 |
|
|
|
286 |
|
|
m = new JMenu(i18n.getMenuLabel("instrumentsdb.go")); |
287 |
|
|
menuBar.add(m); |
288 |
|
|
|
289 |
|
|
mi = new JMenuItem(goUp); |
290 |
|
|
mi.setIcon(null); |
291 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_MASK)); |
292 |
|
|
m.add(mi); |
293 |
|
|
|
294 |
|
|
mi = new JMenuItem(goBack); |
295 |
|
|
mi.setIcon(null); |
296 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.ALT_MASK)); |
297 |
|
|
m.add(mi); |
298 |
|
|
|
299 |
|
|
mi = new JMenuItem(goForward); |
300 |
|
|
mi.setIcon(null); |
301 |
|
|
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.ALT_MASK)); |
302 |
|
|
m.add(mi); |
303 |
|
|
} |
304 |
|
|
|
305 |
|
|
private void |
306 |
|
|
installKeyboardListeners() { |
307 |
|
|
getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put ( |
308 |
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), |
309 |
|
|
"goUp" |
310 |
|
|
); |
311 |
|
|
|
312 |
|
|
getRootPane().getActionMap().put ("goUp", new AbstractAction() { |
313 |
|
|
public void |
314 |
|
|
actionPerformed(ActionEvent e) { |
315 |
|
|
if(!goUp.isEnabled()) return; |
316 |
|
|
goUp.actionPerformed(null); |
317 |
|
|
} |
318 |
|
|
}); |
319 |
|
|
} |
320 |
|
|
|
321 |
|
|
/** Invoked when this window is about to close. */ |
322 |
|
|
private void |
323 |
|
|
onWindowClose() { |
324 |
|
|
boolean b = (getExtendedState() & MAXIMIZED_BOTH) == MAXIMIZED_BOTH; |
325 |
|
|
ClassicPrefs.setWindowMaximized("InstrumentsDbFrame", b); |
326 |
|
|
if(b) return; |
327 |
|
|
|
328 |
|
|
java.awt.Point p = getLocation(); |
329 |
|
|
Dimension d = getSize(); |
330 |
|
|
StringBuffer sb = new StringBuffer(); |
331 |
|
|
sb.append(p.x).append(',').append(p.y).append(','); |
332 |
|
|
sb.append(d.width).append(',').append(d.height); |
333 |
|
|
ClassicPrefs.setWindowSizeAndLocation("InstrumentsDbFrame", sb.toString()); |
334 |
|
|
int i = splitPane.getDividerLocation(); |
335 |
iliev |
1285 |
preferences().setIntProperty("InstrumentsDbFrame.dividerLocation", i); |
336 |
iliev |
1205 |
|
337 |
|
|
mainPane.getInstrumentsTable().saveColumnsVisibleState(); |
338 |
|
|
mainPane.getInstrumentsTable().saveColumnWidths(); |
339 |
|
|
} |
340 |
|
|
|
341 |
|
|
private void |
342 |
|
|
setDefaultSize() { |
343 |
|
|
Dimension dimension = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); |
344 |
|
|
double width = dimension.getWidth(); |
345 |
|
|
double height = dimension.getHeight(); |
346 |
|
|
setBounds(100, 100, (int) width - 200, (int) height - 200); |
347 |
|
|
} |
348 |
|
|
|
349 |
|
|
private void |
350 |
|
|
setSavedSize() { |
351 |
|
|
String s = ClassicPrefs.getWindowSizeAndLocation("InstrumentsDbFrame"); |
352 |
|
|
if(s == null) { |
353 |
|
|
setDefaultSize(); |
354 |
|
|
return; |
355 |
|
|
} |
356 |
|
|
|
357 |
|
|
try { |
358 |
|
|
int i = s.indexOf(','); |
359 |
|
|
int x = Integer.parseInt(s.substring(0, i)); |
360 |
|
|
|
361 |
|
|
s = s.substring(i + 1); |
362 |
|
|
i = s.indexOf(','); |
363 |
|
|
int y = Integer.parseInt(s.substring(0, i)); |
364 |
|
|
|
365 |
|
|
s = s.substring(i + 1); |
366 |
|
|
i = s.indexOf(','); |
367 |
|
|
int width = Integer.parseInt(s.substring(0, i)); |
368 |
|
|
|
369 |
|
|
s = s.substring(i + 1); |
370 |
|
|
int height = Integer.parseInt(s); |
371 |
|
|
|
372 |
|
|
setBounds(x, y, width, height); |
373 |
|
|
|
374 |
iliev |
1285 |
i = preferences().getIntProperty("InstrumentsDbFrame.dividerLocation"); |
375 |
iliev |
1205 |
if(i != 0) splitPane.setDividerLocation(i); |
376 |
|
|
|
377 |
|
|
} catch(Exception x) { |
378 |
|
|
String msg = "Parsing of window size and location string failed"; |
379 |
|
|
CC.getLogger().log(Level.INFO, msg, x); |
380 |
|
|
setDefaultSize(); |
381 |
|
|
} |
382 |
|
|
|
383 |
|
|
if(ClassicPrefs.getWindowMaximized("InstrumentsDbFrame")) |
384 |
|
|
setExtendedState(getExtendedState() | MAXIMIZED_BOTH); |
385 |
|
|
} |
386 |
|
|
|
387 |
|
|
private void |
388 |
|
|
addSidePane() { |
389 |
|
|
getContentPane().remove(mainPane); |
390 |
|
|
splitPane.setRightComponent(mainPane); |
391 |
|
|
getContentPane().add(splitPane); |
392 |
iliev |
1285 |
int i = preferences().getIntProperty("InstrumentsDbFrame.dividerLocation"); |
393 |
iliev |
1205 |
if(i != 0) splitPane.setDividerLocation(i); |
394 |
|
|
} |
395 |
|
|
|
396 |
|
|
private void |
397 |
|
|
removeSidePane() { |
398 |
|
|
int i = splitPane.getDividerLocation(); |
399 |
iliev |
1285 |
preferences().setIntProperty("InstrumentsDbFrame.dividerLocation", i); |
400 |
iliev |
1205 |
getContentPane().remove(splitPane); |
401 |
|
|
getContentPane().add(mainPane); |
402 |
|
|
} |
403 |
|
|
|
404 |
|
|
private class GoUp extends AbstractAction implements TreeSelectionListener { |
405 |
|
|
GoUp() { |
406 |
|
|
super(i18n.getMenuLabel("instrumentsdb.go.up")); |
407 |
|
|
|
408 |
|
|
String s = i18n.getMenuLabel("instrumentsdb.go.up.tt"); |
409 |
|
|
putValue(SHORT_DESCRIPTION, s); |
410 |
|
|
putValue(Action.SMALL_ICON, Res.iconGoUp22); |
411 |
|
|
setEnabled(false); |
412 |
|
|
} |
413 |
|
|
|
414 |
|
|
public void |
415 |
|
|
actionPerformed(ActionEvent e) { |
416 |
|
|
DbDirectoryTreeNode node = instrumentsDbTree.getSelectedDirectoryNode(); |
417 |
|
|
if(node == null) return; |
418 |
|
|
instrumentsDbTree.setSelectedDirectoryNode(node.getParent()); |
419 |
|
|
} |
420 |
|
|
|
421 |
|
|
public void |
422 |
|
|
valueChanged(TreeSelectionEvent e) { |
423 |
|
|
DbDirectoryTreeNode n = instrumentsDbTree.getSelectedDirectoryNode(); |
424 |
|
|
if(n == null) { |
425 |
|
|
setEnabled(false); |
426 |
|
|
return; |
427 |
|
|
} |
428 |
|
|
|
429 |
|
|
setEnabled(n.getParent() != null); |
430 |
|
|
} |
431 |
|
|
} |
432 |
|
|
|
433 |
|
|
private class GoBack extends AbstractAction { |
434 |
|
|
GoBack() { |
435 |
|
|
super(i18n.getMenuLabel("instrumentsdb.go.back")); |
436 |
|
|
|
437 |
|
|
String s = i18n.getMenuLabel("instrumentsdb.go.back.tt"); |
438 |
|
|
putValue(SHORT_DESCRIPTION, s); |
439 |
|
|
putValue(Action.SMALL_ICON, Res.iconGoBack22); |
440 |
|
|
setEnabled(false); |
441 |
|
|
} |
442 |
|
|
|
443 |
|
|
public void |
444 |
|
|
actionPerformed(ActionEvent e) { |
445 |
|
|
navigationHistoryModel.goBack(); |
446 |
|
|
} |
447 |
|
|
} |
448 |
|
|
|
449 |
|
|
private class GoForward extends AbstractAction { |
450 |
|
|
GoForward() { |
451 |
|
|
super(i18n.getMenuLabel("instrumentsdb.go.forward")); |
452 |
|
|
|
453 |
|
|
String s = i18n.getMenuLabel("instrumentsdb.go.forward.tt"); |
454 |
|
|
putValue(SHORT_DESCRIPTION, s); |
455 |
|
|
putValue(Action.SMALL_ICON, Res.iconGoForward22); |
456 |
|
|
setEnabled(false); |
457 |
|
|
} |
458 |
|
|
|
459 |
|
|
public void |
460 |
|
|
actionPerformed(ActionEvent e) { |
461 |
|
|
navigationHistoryModel.goForward(); |
462 |
|
|
} |
463 |
|
|
} |
464 |
|
|
|
465 |
|
|
class ToolbarBar extends JToolBar { |
466 |
|
|
private final ToggleButton btnFolders = new ToggleButton(); |
467 |
|
|
private final ToggleButton btnFind = new ToggleButton(); |
468 |
|
|
|
469 |
|
|
private final ToolbarButton btnGoUp = new ToolbarButton(goUp); |
470 |
|
|
private final ToolbarButton btnGoBack = new ToolbarButton(goBack); |
471 |
|
|
private final ToolbarButton btnGoForward = new ToolbarButton(goForward); |
472 |
|
|
private final ToolbarButton btnReload = |
473 |
|
|
new ToolbarButton(mainPane.getInstrumentsTable().reloadAction); |
474 |
|
|
|
475 |
|
|
private final ToolbarButton btnPreferences = new ToolbarButton(); |
476 |
|
|
|
477 |
|
|
public ToolbarBar() { |
478 |
|
|
super(i18n.getLabel("InstrumentsDbFrame.ToolbarBar.name")); |
479 |
|
|
setFloatable(false); |
480 |
|
|
|
481 |
|
|
btnFolders.setIcon(Res.iconFolderOpen22); |
482 |
|
|
btnFolders.doClick(0); |
483 |
|
|
btnFind.setIcon(Res.iconFind22); |
484 |
|
|
btnPreferences.setIcon(Res.iconPreferences22); |
485 |
|
|
|
486 |
|
|
add(btnFolders); |
487 |
|
|
add(btnFind); |
488 |
|
|
addSeparator(); |
489 |
|
|
add(btnGoBack); |
490 |
|
|
add(btnGoForward); |
491 |
|
|
add(btnGoUp); |
492 |
|
|
add(btnReload); |
493 |
|
|
addSeparator(); |
494 |
|
|
add(btnPreferences); |
495 |
|
|
|
496 |
|
|
|
497 |
|
|
btnFolders.addActionListener(new ActionListener() { |
498 |
|
|
public void |
499 |
|
|
actionPerformed(ActionEvent e) { |
500 |
|
|
if(!btnFolders.isSelected() && !btnFind.isSelected()) { |
501 |
|
|
removeSidePane(); |
502 |
|
|
} |
503 |
|
|
|
504 |
|
|
if(!btnFolders.isSelected()) return; |
505 |
|
|
|
506 |
|
|
if(btnFind.isSelected()) btnFind.doClick(0); |
507 |
|
|
else addSidePane(); |
508 |
|
|
|
509 |
|
|
sidePane.showFoldersPage(); |
510 |
|
|
} |
511 |
|
|
}); |
512 |
|
|
|
513 |
|
|
btnFind.addActionListener(new ActionListener() { |
514 |
|
|
public void |
515 |
|
|
actionPerformed(ActionEvent e) { |
516 |
|
|
if(!btnFolders.isSelected() && !btnFind.isSelected()) { |
517 |
|
|
removeSidePane(); |
518 |
|
|
} |
519 |
|
|
|
520 |
|
|
if(!btnFind.isSelected()) return; |
521 |
|
|
|
522 |
|
|
if(btnFolders.isSelected()) btnFolders.doClick(0); |
523 |
|
|
else addSidePane(); |
524 |
|
|
|
525 |
|
|
sidePane.showSearchPage(); |
526 |
|
|
} |
527 |
|
|
}); |
528 |
|
|
|
529 |
|
|
btnPreferences.addActionListener(new ActionListener() { |
530 |
|
|
public void |
531 |
|
|
actionPerformed(ActionEvent e) { |
532 |
|
|
new PreferencesDlg().setVisible(true); |
533 |
|
|
} |
534 |
|
|
}); |
535 |
|
|
} |
536 |
|
|
} |
537 |
|
|
|
538 |
|
|
class ToggleButton extends JToggleButton { |
539 |
|
|
ToggleButton() { |
540 |
|
|
setBorderPainted(false); |
541 |
|
|
setContentAreaFilled(false); |
542 |
|
|
setFocusPainted(false); |
543 |
|
|
|
544 |
|
|
addActionListener(new ActionListener() { |
545 |
|
|
public void |
546 |
|
|
actionPerformed(ActionEvent e) { |
547 |
|
|
setBorderPainted(isSelected()); |
548 |
|
|
} |
549 |
|
|
}); |
550 |
|
|
} |
551 |
|
|
} |
552 |
|
|
|
553 |
|
|
private class NavigationHistoryModel |
554 |
|
|
extends DefaultNavigationHistoryModel<DbDirectoryTreeNode> |
555 |
|
|
implements TreeSelectionListener, ActionListener { |
556 |
|
|
|
557 |
|
|
private boolean lock = false; |
558 |
|
|
|
559 |
|
|
NavigationHistoryModel() { |
560 |
|
|
addActionListener(this); |
561 |
|
|
} |
562 |
|
|
|
563 |
|
|
public DbDirectoryTreeNode |
564 |
|
|
goBack() { |
565 |
|
|
lock = true; |
566 |
|
|
DbDirectoryTreeNode node = selectDirectory(super.goBack()); |
567 |
|
|
lock = false; |
568 |
|
|
return node; |
569 |
|
|
} |
570 |
|
|
|
571 |
|
|
public DbDirectoryTreeNode |
572 |
|
|
goForward() { |
573 |
|
|
lock = true; |
574 |
|
|
DbDirectoryTreeNode node = selectDirectory(super.goForward()); |
575 |
|
|
lock = false; |
576 |
|
|
return node; |
577 |
|
|
} |
578 |
|
|
|
579 |
|
|
private DbDirectoryTreeNode |
580 |
|
|
selectDirectory(DbDirectoryTreeNode node) { |
581 |
|
|
if(node == null) return null; |
582 |
|
|
|
583 |
|
|
if(node == mainPane.getSearchResultsNode()) { |
584 |
|
|
mainPane.showSearchResultsNode(); |
585 |
|
|
return node; |
586 |
|
|
} |
587 |
|
|
|
588 |
|
|
String path = node.getInfo().getDirectoryPath(); |
589 |
|
|
if(CC.getInstrumentsDbTreeModel().getNodeByPath(path) != null) { |
590 |
|
|
getInstrumentsDbTree().setSelectedDirectory(path); |
591 |
|
|
return node; |
592 |
|
|
} |
593 |
|
|
|
594 |
|
|
removePage(); |
595 |
|
|
fireActionPerformed(); |
596 |
|
|
String s = i18n.getMessage("InstrumentsDbFrame.unknownDirectory!", path); |
597 |
|
|
HF.showErrorMessage(s, InstrumentsDbFrame.this); |
598 |
|
|
return node; |
599 |
|
|
} |
600 |
|
|
|
601 |
|
|
public void |
602 |
|
|
addPage(DbDirectoryTreeNode node) { |
603 |
|
|
if(lock) return; |
604 |
|
|
if(node == null) return; |
605 |
|
|
super.addPage(node); |
606 |
|
|
} |
607 |
|
|
|
608 |
|
|
public void |
609 |
|
|
valueChanged(TreeSelectionEvent e) { |
610 |
|
|
addPage(instrumentsDbTree.getSelectedDirectoryNode()); |
611 |
|
|
} |
612 |
|
|
|
613 |
|
|
public void |
614 |
|
|
actionPerformed(ActionEvent e) { |
615 |
|
|
goBack.setEnabled(hasBack()); |
616 |
|
|
goForward.setEnabled(hasForward()); |
617 |
|
|
} |
618 |
|
|
} |
619 |
|
|
|
620 |
iliev |
1285 |
public JSInstrumentsDbTree |
621 |
iliev |
1205 |
getInstrumentsDbTree() { return instrumentsDbTree; } |
622 |
|
|
|
623 |
|
|
public void |
624 |
|
|
setSearchResults(DbDirectoryInfo[] directories) { |
625 |
|
|
setSearchResults(directories, null); |
626 |
|
|
} |
627 |
|
|
|
628 |
|
|
public void |
629 |
|
|
setSearchResults(DbInstrumentInfo[] instruments) { |
630 |
|
|
setSearchResults(null, instruments); |
631 |
|
|
} |
632 |
|
|
|
633 |
|
|
public void |
634 |
|
|
setSearchResults(DbDirectoryInfo[] directories, DbInstrumentInfo[] instruments) { |
635 |
|
|
DbDirectoryTreeNode node = mainPane.getSearchResultsNode(); |
636 |
|
|
node.removeAllDirectories(); |
637 |
|
|
node.removeAllInstruments(); |
638 |
|
|
|
639 |
|
|
if(instruments != null) { |
640 |
|
|
for(DbInstrumentInfo i : instruments) i.setShowAbsolutePath(true); |
641 |
|
|
node.addInstruments(instruments); |
642 |
|
|
} |
643 |
|
|
|
644 |
|
|
if(directories != null) { |
645 |
|
|
DbDirectoryTreeNode[] nodeS = new DbDirectoryTreeNode[directories.length]; |
646 |
|
|
for(int i = 0; i < directories.length; i++) { |
647 |
|
|
DbDirectoryInfo d = directories[i]; |
648 |
|
|
d.setShowAbsolutePath(true); |
649 |
|
|
nodeS[i] = new DbDirectoryTreeNode(d); |
650 |
|
|
|
651 |
|
|
|
652 |
|
|
} |
653 |
|
|
node.addDirectories(nodeS); |
654 |
|
|
} |
655 |
|
|
|
656 |
|
|
mainPane.showSearchResultsNode(); |
657 |
|
|
} |
658 |
|
|
|
659 |
|
|
class MainPane extends JPanel { |
660 |
iliev |
1285 |
private final JSInstrumentsDbTable instrumentsTable = |
661 |
|
|
new JSInstrumentsDbTable(instrumentsDbTree); |
662 |
iliev |
1205 |
|
663 |
|
|
private final DbDirectoryTreeNode searchResultsNode = new DbDirectoryTreeNode(null); |
664 |
|
|
|
665 |
|
|
MainPane() { |
666 |
|
|
setLayout(new BorderLayout()); |
667 |
|
|
JScrollPane sp = new JScrollPane(instrumentsTable); |
668 |
|
|
add(sp); |
669 |
iliev |
1285 |
instrumentsTable.reloadAction.putValue(Action.SMALL_ICON, Res.iconReload22); |
670 |
|
|
|
671 |
|
|
instrumentsTable.createDirectoryAction.putValue ( |
672 |
|
|
Action.SMALL_ICON, Res.iconNew16 |
673 |
|
|
); |
674 |
|
|
|
675 |
iliev |
1205 |
instrumentsTable.getParent().setBackground(instrumentsTable.getBackground()); |
676 |
iliev |
1705 |
|
677 |
|
|
int i = preferences().getIntProperty(INSTRUMENTS_DB_FRAME_SORT_ORDER); |
678 |
|
|
boolean descending = i < 0; |
679 |
|
|
if(i < 0) i *= -1; |
680 |
|
|
|
681 |
|
|
instrumentsTable.getRowSorter().toggleSortOrder(--i); |
682 |
|
|
if(descending) instrumentsTable.getRowSorter().toggleSortOrder(i); |
683 |
iliev |
1205 |
searchResultsNode.setDetached(true); |
684 |
iliev |
1705 |
|
685 |
|
|
RowSorterListener l = new RowSorterListener() { |
686 |
|
|
public void |
687 |
|
|
sorterChanged(RowSorterEvent e) { |
688 |
|
|
if(e.getType() != SORT_ORDER_CHANGED) return; |
689 |
|
|
rowSorterChanged(); |
690 |
|
|
} |
691 |
|
|
}; |
692 |
|
|
|
693 |
|
|
instrumentsTable.getRowSorter().addRowSorterListener(l); |
694 |
iliev |
1205 |
} |
695 |
|
|
|
696 |
iliev |
1705 |
private void |
697 |
|
|
rowSorterChanged() { |
698 |
|
|
List<? extends SortKey> list = instrumentsTable.getRowSorter().getSortKeys(); |
699 |
|
|
if(list.isEmpty()) return; |
700 |
|
|
SortKey k = list.get(0); |
701 |
|
|
int i = k.getColumn() + 1; |
702 |
|
|
if(k.getSortOrder() == SortOrder.UNSORTED) return; |
703 |
|
|
if(k.getSortOrder() == SortOrder.DESCENDING) i *= -1; |
704 |
|
|
preferences().setIntProperty(INSTRUMENTS_DB_FRAME_SORT_ORDER, i); |
705 |
|
|
} |
706 |
|
|
|
707 |
iliev |
1285 |
public JSInstrumentsDbTable |
708 |
iliev |
1205 |
getInstrumentsTable() { return instrumentsTable; } |
709 |
|
|
|
710 |
|
|
public DbDirectoryTreeNode |
711 |
|
|
getSearchResultsNode() { return searchResultsNode; } |
712 |
|
|
|
713 |
|
|
public void |
714 |
|
|
showSearchResultsNode() { |
715 |
|
|
instrumentsDbTree.clearSelection(); |
716 |
|
|
instrumentsTable.setParentDirectoryNode(searchResultsNode); |
717 |
|
|
navigationHistoryModel.addPage(searchResultsNode); |
718 |
|
|
} |
719 |
|
|
} |
720 |
|
|
|
721 |
|
|
|
722 |
|
|
class SidePane extends NavigationPane { |
723 |
|
|
private final NavigationPage foldersPage = new NavigationPage(); |
724 |
|
|
private final DbSearchPage searchPage = new DbSearchPage(InstrumentsDbFrame.this); |
725 |
|
|
|
726 |
|
|
SidePane() { |
727 |
|
|
setTitlebarVisiblie(false); |
728 |
|
|
|
729 |
|
|
foldersPage.setTitle(i18n.getLabel("InstrumentsDbFrame.folders")); |
730 |
|
|
foldersPage.setLayout(new BorderLayout()); |
731 |
|
|
foldersPage.add(new JScrollPane(instrumentsDbTree)); |
732 |
|
|
|
733 |
|
|
NavigationPage[] pages = { foldersPage, searchPage }; |
734 |
|
|
setPages(pages); |
735 |
|
|
showFoldersPage(); |
736 |
|
|
} |
737 |
|
|
|
738 |
|
|
/** Shows the folders page in the left pane. */ |
739 |
|
|
public void |
740 |
|
|
showFoldersPage() { getModel().addPage(foldersPage); } |
741 |
|
|
|
742 |
|
|
/** Shows the search page in the left pane. */ |
743 |
|
|
public void |
744 |
|
|
showSearchPage() { getModel().addPage(searchPage); } |
745 |
|
|
} |
746 |
|
|
|
747 |
|
|
private final EventHandler eventHandler = new EventHandler(); |
748 |
|
|
|
749 |
|
|
private EventHandler |
750 |
|
|
getHandler() { return eventHandler; } |
751 |
|
|
|
752 |
|
|
private class EventHandler implements ListSelectionListener { |
753 |
|
|
public void |
754 |
|
|
valueChanged(ListSelectionEvent e) { |
755 |
|
|
|
756 |
|
|
} |
757 |
|
|
} |
758 |
|
|
|
759 |
|
|
class PreferencesDlg extends InformationDialog implements ItemListener { |
760 |
|
|
private final JCheckBox checkShowSizeColumn = |
761 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.SIZE")); |
762 |
|
|
|
763 |
|
|
private final JCheckBox checkShowFormatFamilyColumn = |
764 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.FORMAT_FAMILY")); |
765 |
|
|
|
766 |
|
|
private final JCheckBox checkShowFormatVersionColumn = |
767 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.FORMAT_VERSION")); |
768 |
|
|
|
769 |
|
|
private final JCheckBox checkShowIsDrumColumn = |
770 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.IS_DRUM")); |
771 |
|
|
|
772 |
|
|
private final JCheckBox checkShowCreatedColumn = |
773 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.CREATED")); |
774 |
|
|
|
775 |
|
|
private final JCheckBox checkShowModifiedColumn = |
776 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.MODIFIED")); |
777 |
|
|
|
778 |
|
|
private final JCheckBox checkShowProductColumn = |
779 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.PRODUCT")); |
780 |
|
|
|
781 |
|
|
private final JCheckBox checkShowArtistsColumn = |
782 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.ARTISTS")); |
783 |
|
|
|
784 |
|
|
private final JCheckBox checkShowInstrumentFileColumn |
785 |
|
|
= new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.INSTRUMENT_FILE")); |
786 |
|
|
|
787 |
|
|
private final JCheckBox checkShowInstrumentNrColumn = |
788 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.INSTRUMENT_NR")); |
789 |
|
|
|
790 |
|
|
private final JCheckBox checkShowKeywordsColumn = |
791 |
|
|
new JCheckBox(JSI18n.i18n.getLabel("InstrumentsDbTableModel.KEYWORDS")); |
792 |
|
|
|
793 |
|
|
PreferencesDlg() { |
794 |
|
|
super(InstrumentsDbFrame.this); |
795 |
|
|
InstrumentsDbTableModel m = mainPane.instrumentsTable.getModel(); |
796 |
|
|
|
797 |
|
|
checkShowSizeColumn.setSelected(m.getShowSizeColumn()); |
798 |
|
|
checkShowFormatFamilyColumn.setSelected(m.getShowFormatFamilyColumn()); |
799 |
|
|
checkShowFormatVersionColumn.setSelected(m.getShowFormatVersionColumn()); |
800 |
|
|
checkShowIsDrumColumn.setSelected(m.getShowIsDrumColumn()); |
801 |
|
|
checkShowCreatedColumn.setSelected(m.getShowCreatedColumn()); |
802 |
|
|
checkShowModifiedColumn.setSelected(m.getShowModifiedColumn()); |
803 |
|
|
checkShowProductColumn.setSelected(m.getShowProductColumn()); |
804 |
|
|
checkShowArtistsColumn.setSelected(m.getShowArtistsColumn()); |
805 |
|
|
checkShowInstrumentFileColumn.setSelected(m.getShowInstrumentFileColumn()); |
806 |
|
|
checkShowInstrumentNrColumn.setSelected(m.getShowInstrumentNrColumn()); |
807 |
|
|
checkShowKeywordsColumn.setSelected(m.getShowKeywordsColumn()); |
808 |
|
|
|
809 |
|
|
checkShowSizeColumn.addItemListener(this); |
810 |
|
|
checkShowFormatFamilyColumn.addItemListener(this); |
811 |
|
|
checkShowFormatVersionColumn.addItemListener(this); |
812 |
|
|
checkShowIsDrumColumn.addItemListener(this); |
813 |
|
|
checkShowCreatedColumn.addItemListener(this); |
814 |
|
|
checkShowModifiedColumn.addItemListener(this); |
815 |
|
|
checkShowProductColumn.addItemListener(this); |
816 |
|
|
checkShowArtistsColumn.addItemListener(this); |
817 |
|
|
checkShowInstrumentFileColumn.addItemListener(this); |
818 |
|
|
checkShowInstrumentNrColumn.addItemListener(this); |
819 |
|
|
checkShowKeywordsColumn.addItemListener(this); |
820 |
|
|
|
821 |
|
|
JPanel p = new JPanel(); |
822 |
|
|
p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); |
823 |
|
|
p.add(checkShowSizeColumn); |
824 |
|
|
p.add(checkShowFormatFamilyColumn); |
825 |
|
|
p.add(checkShowFormatVersionColumn); |
826 |
|
|
p.add(checkShowIsDrumColumn); |
827 |
|
|
p.add(checkShowCreatedColumn); |
828 |
|
|
p.add(checkShowModifiedColumn); |
829 |
|
|
p.add(checkShowProductColumn); |
830 |
|
|
p.add(checkShowArtistsColumn); |
831 |
|
|
p.add(checkShowInstrumentFileColumn); |
832 |
|
|
p.add(checkShowInstrumentNrColumn); |
833 |
|
|
p.add(checkShowKeywordsColumn); |
834 |
|
|
String s = i18n.getLabel("InstrumentsDbFrame.columns"); |
835 |
|
|
p.setBorder(BorderFactory.createTitledBorder(s)); |
836 |
|
|
|
837 |
|
|
setMainPane(p); |
838 |
|
|
} |
839 |
|
|
|
840 |
|
|
public void |
841 |
|
|
itemStateChanged(ItemEvent e) { |
842 |
|
|
mainPane.getInstrumentsTable().saveColumnWidths(); |
843 |
|
|
|
844 |
|
|
InstrumentsDbTableModel m = mainPane.instrumentsTable.getModel(); |
845 |
|
|
|
846 |
|
|
Object source = e.getItemSelectable(); |
847 |
|
|
if(source == checkShowSizeColumn) { |
848 |
|
|
m.setShowSizeColumn(checkShowSizeColumn.isSelected()); |
849 |
|
|
} else if(source == checkShowFormatFamilyColumn) { |
850 |
|
|
boolean b = checkShowFormatFamilyColumn.isSelected(); |
851 |
|
|
m.setShowFormatFamilyColumn(b); |
852 |
|
|
} else if(source == checkShowFormatVersionColumn) { |
853 |
|
|
boolean b = checkShowFormatVersionColumn.isSelected(); |
854 |
|
|
m.setShowFormatVersionColumn(b); |
855 |
|
|
} else if(source == checkShowIsDrumColumn) { |
856 |
|
|
m.setShowIsDrumColumn(checkShowIsDrumColumn.isSelected()); |
857 |
|
|
} else if(source == checkShowCreatedColumn) { |
858 |
|
|
m.setShowCreatedColumn(checkShowCreatedColumn.isSelected()); |
859 |
|
|
} else if(source == checkShowModifiedColumn) { |
860 |
|
|
m.setShowModifiedColumn(checkShowModifiedColumn.isSelected()); |
861 |
|
|
} else if(source == checkShowProductColumn) { |
862 |
|
|
m.setShowProductColumn(checkShowProductColumn.isSelected()); |
863 |
|
|
} else if(source == checkShowArtistsColumn) { |
864 |
|
|
m.setShowArtistsColumn(checkShowArtistsColumn.isSelected()); |
865 |
|
|
} else if(source == checkShowInstrumentFileColumn) { |
866 |
|
|
boolean b = checkShowInstrumentFileColumn.isSelected(); |
867 |
|
|
m.setShowInstrumentFileColumn(b); |
868 |
|
|
} else if(source == checkShowInstrumentNrColumn) { |
869 |
|
|
boolean b = checkShowInstrumentNrColumn.isSelected(); |
870 |
|
|
m.setShowInstrumentNrColumn(b); |
871 |
|
|
} else if(source == checkShowKeywordsColumn) { |
872 |
|
|
m.setShowKeywordsColumn(checkShowKeywordsColumn.isSelected()); |
873 |
|
|
} |
874 |
|
|
|
875 |
|
|
mainPane.getInstrumentsTable().loadColumnWidths(); |
876 |
|
|
mainPane.getInstrumentsTable().getRowSorter().toggleSortOrder(0); |
877 |
|
|
} |
878 |
|
|
} |
879 |
|
|
} |