KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jgoodies > looks > demo > Settings


1 /*
2  * Copyright (c) 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * o Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * o Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * o Neither the name of JGoodies Karsten Lentzsch nor the names of
15  * its contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */

30
31 package com.jgoodies.looks.demo;
32
33 import javax.swing.LookAndFeel JavaDoc;
34
35 import com.jgoodies.looks.BorderStyle;
36 import com.jgoodies.looks.FontSizeHints;
37 import com.jgoodies.looks.HeaderStyle;
38 import com.jgoodies.looks.plastic.PlasticLookAndFeel;
39 import com.jgoodies.looks.plastic.PlasticTheme;
40 import com.jgoodies.looks.plastic.PlasticXPLookAndFeel;
41
42
43 /**
44  * Describes most of the optional settings of the JGoodies Looks.
45  * Used by the <code>DemoFrame</code> to configure the UI.
46  *
47  * @author Karsten Lentzsch
48  * @version $Revision: 1.7 $
49  *
50  * @see com.jgoodies.looks.BorderStyle
51  * @see com.jgoodies.looks.FontSizeHints
52  * @see com.jgoodies.looks.HeaderStyle
53  * @see com.jgoodies.looks.Options
54  */

55 public final class Settings {
56     
57     private LookAndFeel JavaDoc selectedLookAndFeel;
58
59     private PlasticTheme selectedTheme;
60
61     private Boolean JavaDoc useSystemFonts;
62     
63     private FontSizeHints fontSizeHints;
64
65     private boolean useNarrowButtons;
66
67     private boolean tabIconsEnabled;
68     
69     private Boolean JavaDoc popupDropShadowEnabled;
70     
71     private String JavaDoc plasticTabStyle;
72     
73     private boolean plasticHighContrastFocusEnabled;
74
75     private HeaderStyle menuBarHeaderStyle;
76
77     private BorderStyle menuBarPlasticBorderStyle;
78
79     private BorderStyle menuBarWindowsBorderStyle;
80
81     private Boolean JavaDoc menuBar3DHint;
82         
83     private HeaderStyle toolBarHeaderStyle;
84
85     private BorderStyle toolBarPlasticBorderStyle;
86
87     private BorderStyle toolBarWindowsBorderStyle;
88
89     private Boolean JavaDoc toolBar3DHint;
90
91     
92     // Instance Creation ******************************************************
93

94     private Settings() {
95         // Override default constructor; prevents instantiability.
96
}
97
98     public static Settings createDefault() {
99         Settings settings = new Settings();
100         settings.setSelectedLookAndFeel(new PlasticXPLookAndFeel());
101         settings.setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme());
102         settings.setUseSystemFonts(Boolean.TRUE);
103         settings.setFontSizeHints(FontSizeHints.MIXED);
104         settings.setUseNarrowButtons(false);
105         settings.setTabIconsEnabled(true);
106         settings.setPlasticTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
107         settings.setPlasticHighContrastFocusEnabled(false);
108         settings.setMenuBarHeaderStyle(null);
109         settings.setMenuBarPlasticBorderStyle(null);
110         settings.setMenuBarWindowsBorderStyle(null);
111         settings.setMenuBar3DHint(null);
112         settings.setToolBarHeaderStyle(null);
113         settings.setToolBarPlasticBorderStyle(null);
114         settings.setToolBarWindowsBorderStyle(null);
115         settings.setToolBar3DHint(null);
116         return settings;
117     }
118
119
120     // Accessors **************************************************************
121

122     public FontSizeHints getFontSizeHints() {
123         return fontSizeHints;
124     }
125
126     public void setFontSizeHints(FontSizeHints fontSizeHints) {
127         this.fontSizeHints = fontSizeHints;
128     }
129
130     public Boolean JavaDoc getMenuBar3DHint() {
131         return menuBar3DHint;
132     }
133
134     public void setMenuBar3DHint(Boolean JavaDoc menuBar3DHint) {
135         this.menuBar3DHint = menuBar3DHint;
136     }
137
138     public HeaderStyle getMenuBarHeaderStyle() {
139         return menuBarHeaderStyle;
140     }
141
142     public void setMenuBarHeaderStyle(HeaderStyle menuBarHeaderStyle) {
143         this.menuBarHeaderStyle = menuBarHeaderStyle;
144     }
145
146     public BorderStyle getMenuBarPlasticBorderStyle() {
147         return menuBarPlasticBorderStyle;
148     }
149
150     public void setMenuBarPlasticBorderStyle(BorderStyle menuBarPlasticBorderStyle) {
151         this.menuBarPlasticBorderStyle = menuBarPlasticBorderStyle;
152     }
153
154     public BorderStyle getMenuBarWindowsBorderStyle() {
155         return menuBarWindowsBorderStyle;
156     }
157
158     public void setMenuBarWindowsBorderStyle(BorderStyle menuBarWindowsBorderStyle) {
159         this.menuBarWindowsBorderStyle = menuBarWindowsBorderStyle;
160     }
161
162     public Boolean JavaDoc isPopupDropShadowEnabled() {
163         return popupDropShadowEnabled;
164     }
165
166     public void setPopupDropShadowEnabled(Boolean JavaDoc popupDropShadowEnabled) {
167         this.popupDropShadowEnabled = popupDropShadowEnabled;
168     }
169
170     public boolean isPlasticHighContrastFocusEnabled() {
171         return plasticHighContrastFocusEnabled;
172     }
173
174     public void setPlasticHighContrastFocusEnabled(boolean plasticHighContrastFocusEnabled) {
175         this.plasticHighContrastFocusEnabled = plasticHighContrastFocusEnabled;
176     }
177
178     public String JavaDoc getPlasticTabStyle() {
179         return plasticTabStyle;
180     }
181
182     public void setPlasticTabStyle(String JavaDoc plasticTabStyle) {
183         this.plasticTabStyle = plasticTabStyle;
184     }
185
186     public LookAndFeel JavaDoc getSelectedLookAndFeel() {
187         return selectedLookAndFeel;
188     }
189
190     public void setSelectedLookAndFeel(LookAndFeel JavaDoc selectedLookAndFeel) {
191         this.selectedLookAndFeel = selectedLookAndFeel;
192     }
193
194     public PlasticTheme getSelectedTheme() {
195         return selectedTheme;
196     }
197
198     public void setSelectedTheme(PlasticTheme selectedTheme) {
199         this.selectedTheme = selectedTheme;
200     }
201
202     public boolean isTabIconsEnabled() {
203         return tabIconsEnabled;
204     }
205
206     public void setTabIconsEnabled(boolean tabIconsEnabled) {
207         this.tabIconsEnabled = tabIconsEnabled;
208     }
209
210     public Boolean JavaDoc getToolBar3DHint() {
211         return toolBar3DHint;
212     }
213
214     public void setToolBar3DHint(Boolean JavaDoc toolBar3DHint) {
215         this.toolBar3DHint = toolBar3DHint;
216     }
217
218     public HeaderStyle getToolBarHeaderStyle() {
219         return toolBarHeaderStyle;
220     }
221
222     public void setToolBarHeaderStyle(HeaderStyle toolBarHeaderStyle) {
223         this.toolBarHeaderStyle = toolBarHeaderStyle;
224     }
225
226     public BorderStyle getToolBarPlasticBorderStyle() {
227         return toolBarPlasticBorderStyle;
228     }
229
230     public void setToolBarPlasticBorderStyle(BorderStyle toolBarPlasticBorderStyle) {
231         this.toolBarPlasticBorderStyle = toolBarPlasticBorderStyle;
232     }
233
234     public BorderStyle getToolBarWindowsBorderStyle() {
235         return toolBarWindowsBorderStyle;
236     }
237
238     public void setToolBarWindowsBorderStyle(BorderStyle toolBarWindowsBorderStyle) {
239         this.toolBarWindowsBorderStyle = toolBarWindowsBorderStyle;
240     }
241
242     public boolean isUseNarrowButtons() {
243         return useNarrowButtons;
244     }
245
246     public void setUseNarrowButtons(boolean useNarrowButtons) {
247         this.useNarrowButtons = useNarrowButtons;
248     }
249
250     public Boolean JavaDoc isUseSystemFonts() {
251         return useSystemFonts;
252     }
253
254     public void setUseSystemFonts(Boolean JavaDoc useSystemFonts) {
255         this.useSystemFonts = useSystemFonts;
256     }
257
258 }
Popular Tags