1 |
/* |
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 javax.swing.Icon; |
26 |
|
27 |
import org.jsampler.JSPrefs; |
28 |
|
29 |
import org.jsampler.view.InstrumentsDbTableView; |
30 |
import org.jsampler.view.InstrumentsDbTreeView; |
31 |
import org.jsampler.view.JSViewConfig; |
32 |
|
33 |
/** |
34 |
* |
35 |
* @author Grigor Iliev |
36 |
*/ |
37 |
public class ViewConfig extends JSViewConfig { |
38 |
private InstrumentsDbTreeView instrumentsDbTreeView = new TreeView(); |
39 |
private InstrumentsDbTableView instrumentsDbTableView = new TableView(); |
40 |
|
41 |
/** Creates a new instance of <code>ViewConfig</code> */ |
42 |
public |
43 |
ViewConfig() { |
44 |
|
45 |
} |
46 |
|
47 |
public JSPrefs |
48 |
preferences() { return ClassicPrefs.preferences(); } |
49 |
|
50 |
public InstrumentsDbTreeView |
51 |
getInstrumentsDbTreeView() { return instrumentsDbTreeView; } |
52 |
|
53 |
public InstrumentsDbTableView |
54 |
getInstrumentsDbTableView() { return instrumentsDbTableView; } |
55 |
|
56 |
private class TreeView implements InstrumentsDbTreeView { |
57 |
public Icon |
58 |
getRootIcon() { return Res.iconDb16; } |
59 |
|
60 |
public Icon |
61 |
getClosedIcon() { return Res.iconFolder16; } |
62 |
|
63 |
public Icon |
64 |
getOpenIcon() { return Res.iconFolderOpen16; } |
65 |
|
66 |
public Icon |
67 |
getInstrumentIcon() { return Res.iconInstrument16; } |
68 |
|
69 |
public Icon |
70 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
71 |
} |
72 |
|
73 |
private static class TableView implements InstrumentsDbTableView { |
74 |
public Icon |
75 |
getFolderIcon() { return Res.iconFolder16; } |
76 |
|
77 |
public Icon |
78 |
getInstrumentIcon() { return Res.iconInstrument16; } |
79 |
|
80 |
public Icon |
81 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
82 |
} |
83 |
|
84 |
public boolean |
85 |
getInstrumentsDbSupport() { return true; } |
86 |
} |