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.fantasia; |
24 |
|
25 |
import javax.swing.Icon; |
26 |
import javax.swing.JDialog; |
27 |
import javax.swing.JFrame; |
28 |
import javax.swing.UIManager; |
29 |
|
30 |
import org.jsampler.JSPrefs; |
31 |
|
32 |
import org.jsampler.view.InstrumentsDbTableView; |
33 |
import org.jsampler.view.InstrumentsDbTreeView; |
34 |
import org.jsampler.view.JSViewConfig; |
35 |
|
36 |
import org.jvnet.substance.SubstanceLookAndFeel; |
37 |
import org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel; |
38 |
|
39 |
/** |
40 |
* |
41 |
* @author Grigor Iliev |
42 |
*/ |
43 |
public class ViewConfig extends JSViewConfig { |
44 |
private InstrumentsDbTreeView instrumentsDbTreeView = new TreeView(); |
45 |
private InstrumentsDbTableView instrumentsDbTableView = new TableView(); |
46 |
|
47 |
/** Creates a new instance of <code>ViewConfig</code> */ |
48 |
public |
49 |
ViewConfig() { |
50 |
try { |
51 |
UIManager.setLookAndFeel(new SubstanceRavenGraphiteLookAndFeel()); |
52 |
UIManager.put(SubstanceLookAndFeel.WATERMARK_IGNORE, Boolean.TRUE); |
53 |
javax.swing.JFrame.setDefaultLookAndFeelDecorated(true); |
54 |
javax.swing.JDialog.setDefaultLookAndFeelDecorated(true); |
55 |
} catch(Exception e) { |
56 |
e.printStackTrace(); |
57 |
} |
58 |
} |
59 |
|
60 |
public JSPrefs |
61 |
preferences() { return FantasiaPrefs.preferences(); } |
62 |
|
63 |
public InstrumentsDbTreeView |
64 |
getInstrumentsDbTreeView() { return instrumentsDbTreeView; } |
65 |
|
66 |
public InstrumentsDbTableView |
67 |
getInstrumentsDbTableView() { return instrumentsDbTableView; } |
68 |
|
69 |
private class TreeView implements InstrumentsDbTreeView { |
70 |
public Icon |
71 |
getRootIcon() { return Res.iconDb16; } |
72 |
|
73 |
public Icon |
74 |
getClosedIcon() { return Res.iconFolder16; } |
75 |
|
76 |
public Icon |
77 |
getOpenIcon() { return Res.iconFolderOpen16; } |
78 |
|
79 |
public Icon |
80 |
getInstrumentIcon() { return Res.iconInstrument16; } |
81 |
|
82 |
public Icon |
83 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
84 |
} |
85 |
|
86 |
private static class TableView implements InstrumentsDbTableView { |
87 |
public Icon |
88 |
getFolderIcon() { return Res.iconFolder16; } |
89 |
|
90 |
public Icon |
91 |
getInstrumentIcon() { return Res.iconInstrument16; } |
92 |
|
93 |
public Icon |
94 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
95 |
} |
96 |
|
97 |
public boolean |
98 |
getInstrumentsDbSupport() { return true; } |
99 |
} |