/[svn]/jsampler/trunk/src/org/jsampler/view/fantasia/ViewConfig.java
ViewVC logotype

Contents of /jsampler/trunk/src/org/jsampler/view/fantasia/ViewConfig.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1496 - (show annotations) (download)
Mon Nov 19 22:22:22 2007 UTC (16 years, 5 months ago) by iliev
File size: 3047 byte(s)
* Added option for turning off the custom window decoration
  (choose Edit/Preferences, then click the `View' tab)
* Added new menu item: Help/Online Tutorial
* Fantasia: first step of implementing a theme manager
* Fantasia: fixed the view of the channel's stream/voice count statistic
* some minor GUI fixes and enhancements

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
54 if(!preferences().getBoolProperty("TurnOffCustomWindowDecoration")) {
55 javax.swing.JFrame.setDefaultLookAndFeelDecorated(true);
56 javax.swing.JDialog.setDefaultLookAndFeelDecorated(true);
57 }
58
59 Res.loadTheme(preferences().getStringProperty("Theme"));
60 } catch(Exception e) {
61 e.printStackTrace();
62 }
63 }
64
65 public JSPrefs
66 preferences() { return FantasiaPrefs.preferences(); }
67
68 public InstrumentsDbTreeView
69 getInstrumentsDbTreeView() { return instrumentsDbTreeView; }
70
71 public InstrumentsDbTableView
72 getInstrumentsDbTableView() { return instrumentsDbTableView; }
73
74 private class TreeView implements InstrumentsDbTreeView {
75 public Icon
76 getRootIcon() { return Res.iconDb16; }
77
78 public Icon
79 getClosedIcon() { return Res.iconFolder16; }
80
81 public Icon
82 getOpenIcon() { return Res.iconFolderOpen16; }
83
84 public Icon
85 getInstrumentIcon() { return Res.iconInstrument16; }
86
87 public Icon
88 getGigInstrumentIcon() { return Res.iconInstrument16; }
89 }
90
91 private static class TableView implements InstrumentsDbTableView {
92 public Icon
93 getFolderIcon() { return Res.iconFolder16; }
94
95 public Icon
96 getInstrumentIcon() { return Res.iconInstrument16; }
97
98 public Icon
99 getGigInstrumentIcon() { return Res.iconInstrument16; }
100 }
101
102 public boolean
103 getInstrumentsDbSupport() { return true; }
104 }

  ViewVC Help
Powered by ViewVC