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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1752 - (hide annotations) (download)
Mon Aug 11 22:51:24 2008 UTC (15 years, 8 months ago) by iliev
File size: 3805 byte(s)
* Added toolbar to the Database Instrument Chooser dialog
* Instrument Chooser and Database Instrument Chooser dialogs
  are now resizable
* Fantasia: Added toolbar to the Right-Side Pane's Instruments Database

1 iliev 1286 /*
2     * JSampler - a java front-end for LinuxSampler
3     *
4 iliev 1752 * Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com>
5 iliev 1286 *
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 iliev 1752 import org.jsampler.CC;
31 iliev 1286 import org.jsampler.JSPrefs;
32    
33     import org.jsampler.view.InstrumentsDbTableView;
34     import org.jsampler.view.InstrumentsDbTreeView;
35 iliev 1752 import org.jsampler.view.BasicIconSet;
36 iliev 1286 import org.jsampler.view.JSViewConfig;
37    
38 iliev 1743 import org.jvnet.substance.api.SubstanceConstants;
39 iliev 1286 import org.jvnet.substance.SubstanceLookAndFeel;
40     import org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel;
41    
42     /**
43     *
44     * @author Grigor Iliev
45     */
46     public class ViewConfig extends JSViewConfig {
47     private InstrumentsDbTreeView instrumentsDbTreeView = new TreeView();
48     private InstrumentsDbTableView instrumentsDbTableView = new TableView();
49 iliev 1752 private BasicIconSet basicIconSet = new IconSet();
50 iliev 1286
51     /** Creates a new instance of <code>ViewConfig</code> */
52     public
53     ViewConfig() {
54     try {
55     UIManager.setLookAndFeel(new SubstanceRavenGraphiteLookAndFeel());
56 iliev 1743 UIManager.put(SubstanceLookAndFeel.WATERMARK_VISIBLE, Boolean.FALSE);
57 iliev 1496
58 iliev 1729 UIManager.put (
59     SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND,
60     SubstanceConstants.TabContentPaneBorderKind.SINGLE_FULL
61     );
62    
63 iliev 1496 if(!preferences().getBoolProperty("TurnOffCustomWindowDecoration")) {
64     javax.swing.JFrame.setDefaultLookAndFeelDecorated(true);
65     javax.swing.JDialog.setDefaultLookAndFeelDecorated(true);
66     }
67    
68     Res.loadTheme(preferences().getStringProperty("Theme"));
69 iliev 1286 } catch(Exception e) {
70     e.printStackTrace();
71     }
72     }
73    
74     public JSPrefs
75     preferences() { return FantasiaPrefs.preferences(); }
76    
77     public InstrumentsDbTreeView
78     getInstrumentsDbTreeView() { return instrumentsDbTreeView; }
79    
80     public InstrumentsDbTableView
81     getInstrumentsDbTableView() { return instrumentsDbTableView; }
82    
83 iliev 1752 public BasicIconSet
84     getBasicIconSet() { return basicIconSet; }
85    
86 iliev 1286 private class TreeView implements InstrumentsDbTreeView {
87     public Icon
88     getRootIcon() { return Res.iconDb16; }
89    
90     public Icon
91     getClosedIcon() { return Res.iconFolder16; }
92    
93     public Icon
94     getOpenIcon() { return Res.iconFolderOpen16; }
95    
96     public Icon
97     getInstrumentIcon() { return Res.iconInstrument16; }
98    
99     public Icon
100     getGigInstrumentIcon() { return Res.iconInstrument16; }
101     }
102    
103     private static class TableView implements InstrumentsDbTableView {
104     public Icon
105     getFolderIcon() { return Res.iconFolder16; }
106    
107     public Icon
108     getInstrumentIcon() { return Res.iconInstrument16; }
109    
110     public Icon
111     getGigInstrumentIcon() { return Res.iconInstrument16; }
112     }
113    
114 iliev 1752 private class IconSet implements BasicIconSet {
115     public Icon
116     getBack16Icon() { return Res.iconBack16; }
117    
118     public Icon
119     getUp16Icon() { return Res.iconUp16; }
120    
121     public Icon
122     getForward16Icon() { return Res.iconNext16; }
123    
124     public Icon
125     getReload16Icon() { return Res.iconReload16; }
126    
127     public Icon
128     getPreferences16Icon() { return Res.iconPreferences16; }
129     }
130    
131 iliev 1286 public boolean
132     getInstrumentsDbSupport() { return true; }
133     }

  ViewVC Help
Powered by ViewVC