1 |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
4 |
* Copyright (C) 2005-2008 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.BasicIconSet; |
32 |
import org.jsampler.view.JSViewConfig; |
33 |
|
34 |
/** |
35 |
* |
36 |
* @author Grigor Iliev |
37 |
*/ |
38 |
public class ViewConfig extends JSViewConfig { |
39 |
private InstrumentsDbTreeView instrumentsDbTreeView = new TreeView(); |
40 |
private InstrumentsDbTableView instrumentsDbTableView = new TableView(); |
41 |
private IconSet basicIconSet = new IconSet(); |
42 |
|
43 |
/** Creates a new instance of <code>ViewConfig</code> */ |
44 |
public |
45 |
ViewConfig() { |
46 |
|
47 |
} |
48 |
|
49 |
public JSPrefs |
50 |
preferences() { return ClassicPrefs.preferences(); } |
51 |
|
52 |
public InstrumentsDbTreeView |
53 |
getInstrumentsDbTreeView() { return instrumentsDbTreeView; } |
54 |
|
55 |
public InstrumentsDbTableView |
56 |
getInstrumentsDbTableView() { return instrumentsDbTableView; } |
57 |
|
58 |
public BasicIconSet |
59 |
getBasicIconSet() { return basicIconSet; } |
60 |
|
61 |
private class TreeView implements InstrumentsDbTreeView { |
62 |
public Icon |
63 |
getRootIcon() { return Res.iconDb16; } |
64 |
|
65 |
public Icon |
66 |
getClosedIcon() { return Res.iconFolder16; } |
67 |
|
68 |
public Icon |
69 |
getOpenIcon() { return Res.iconFolderOpen16; } |
70 |
|
71 |
public Icon |
72 |
getInstrumentIcon() { return Res.iconInstrument16; } |
73 |
|
74 |
public Icon |
75 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
76 |
} |
77 |
|
78 |
private static class TableView implements InstrumentsDbTableView { |
79 |
public Icon |
80 |
getFolderIcon() { return Res.iconFolder16; } |
81 |
|
82 |
public Icon |
83 |
getInstrumentIcon() { return Res.iconInstrument16; } |
84 |
|
85 |
public Icon |
86 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
87 |
} |
88 |
|
89 |
private class IconSet implements BasicIconSet { |
90 |
public Icon |
91 |
getBack16Icon() { return Res.iconBack16; } |
92 |
|
93 |
public Icon |
94 |
getUp16Icon() { return Res.iconUp16; } |
95 |
|
96 |
public Icon |
97 |
getForward16Icon() { return Res.iconForward16; } |
98 |
|
99 |
public Icon |
100 |
getReload16Icon() { return Res.iconReload16; } |
101 |
|
102 |
public Icon |
103 |
getPreferences16Icon() { return Res.iconPreferences16; } |
104 |
} |
105 |
|
106 |
public boolean |
107 |
getInstrumentsDbSupport() { return true; } |
108 |
} |