GuiOptions.java
001 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
002  *
003  * Copyright 2000-2013,  Michael Meyling <mime@qedeq.org>.
004  *
005  * "Hilbert II" is free software; you can redistribute
006  * it and/or modify it under the terms of the GNU General Public
007  * License as published by the Free Software Foundation; either
008  * version 2 of the License, or (at your option) any later version.
009  *
010  * This program is distributed in the hope that it will be useful,
011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013  * GNU General Public License for more details.
014  */
015 
016 package org.qedeq.gui.se.main;
017 
018 import javax.swing.LookAndFeel;
019 
020 import org.qedeq.base.trace.Trace;
021 
022 import com.jgoodies.looks.BorderStyle;
023 import com.jgoodies.looks.HeaderStyle;
024 import com.jgoodies.looks.plastic.PlasticLookAndFeel;
025 import com.jgoodies.looks.plastic.PlasticTheme;
026 import com.jgoodies.looks.plastic.PlasticXPLookAndFeel;
027 
028 
029 /**
030  * Container for GUI design settings for JGoodies.
031  *
032  @author  Michael Meyling
033  */
034 public final class GuiOptions {
035 
036     /** This class. */
037     private static final Class CLASS = GuiOptions.class;
038 
039     /** JGoodies option .*/
040     private boolean useNarrowButtons;
041 
042     /** JGoodies option .*/
043     private boolean tabIconsEnabled;
044 
045     /** JGoodies option .*/
046     private String plasticTabStyle;
047 
048     /** JGoodies option .*/
049     private boolean plasticHighContrastFocusEnabled;
050 
051     /** JGoodies option .*/
052     private Boolean popupDropShadowEnabled;
053 
054     /** JGoodies option .*/
055     private HeaderStyle menuBarHeaderStyle;
056 
057     /** JGoodies option .*/
058     private BorderStyle menuBarPlasticBorderStyle;
059 
060     /** JGoodies option .*/
061     private BorderStyle menuBarWindowsBorderStyle;
062 
063     /** JGoodies option .*/
064     private Boolean menuBar3DHint;
065 
066     /** JGoodies option .*/
067     private HeaderStyle toolBarHeaderStyle;
068 
069     /** JGoodies option .*/
070     private BorderStyle toolBarPlasticBorderStyle;
071 
072     /** JGoodies option .*/
073     private BorderStyle toolBarWindowsBorderStyle;
074 
075     /** JGoodies option .*/
076     private Boolean toolBar3DHint;
077 
078     /** JGoodies option .*/
079     private LookAndFeel selectedLookAndFeel;
080 
081     /** JGoodies option .*/
082     private PlasticTheme selectedTheme;
083 
084     /**
085      * Constructor.
086      */
087     public GuiOptions() {
088         setSelectedLookAndFeel(new PlasticXPLookAndFeel());
089         setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme());
090         setUseNarrowButtons(true);
091         setTabIconsEnabled(true);
092         setPlasticTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
093         setPlasticHighContrastFocusEnabled(false);
094         setPopupDropShadowEnabled(null);
095         setMenuBarHeaderStyle(null);
096         setMenuBarPlasticBorderStyle(null);
097         setMenuBarWindowsBorderStyle(null);
098         setMenuBar3DHint(null);
099         setToolBarHeaderStyle(null);
100         setToolBarPlasticBorderStyle(null);
101         setToolBarWindowsBorderStyle(null);
102         setToolBar3DHint(null);
103     }
104 
105     public Boolean getMenuBar3DHint() {
106         return menuBar3DHint;
107     }
108 
109     public void setMenuBar3DHint(final Boolean menuBar3DHint) {
110         this.menuBar3DHint = menuBar3DHint;
111     }
112 
113     public HeaderStyle getMenuBarHeaderStyle() {
114         return menuBarHeaderStyle;
115     }
116 
117     public void setMenuBarHeaderStyle(final HeaderStyle menuBarHeaderStyle) {
118         this.menuBarHeaderStyle = menuBarHeaderStyle;
119     }
120 
121     public BorderStyle getMenuBarPlasticBorderStyle() {
122         return menuBarPlasticBorderStyle;
123     }
124 
125     public void setMenuBarPlasticBorderStyle(final BorderStyle menuBarPlasticBorderStyle) {
126         this.menuBarPlasticBorderStyle = menuBarPlasticBorderStyle;
127     }
128 
129     public BorderStyle getMenuBarWindowsBorderStyle() {
130         return menuBarWindowsBorderStyle;
131     }
132 
133     public void setMenuBarWindowsBorderStyle(final BorderStyle menuBarWindowsBorderStyle) {
134         this.menuBarWindowsBorderStyle = menuBarWindowsBorderStyle;
135     }
136 
137     public Boolean isPopupDropShadowEnabled() {
138         return popupDropShadowEnabled;
139     }
140 
141     public void setPopupDropShadowEnabled(final Boolean popupDropShadowEnabled) {
142         this.popupDropShadowEnabled = popupDropShadowEnabled;
143     }
144 
145     public boolean isPlasticHighContrastFocusEnabled() {
146         return plasticHighContrastFocusEnabled;
147     }
148 
149     public void setPlasticHighContrastFocusEnabled(final boolean plasticHighContrastFocusEnabled) {
150         this.plasticHighContrastFocusEnabled = plasticHighContrastFocusEnabled;
151     }
152 
153     public String getPlasticTabStyle() {
154         return plasticTabStyle;
155     }
156 
157     public void setPlasticTabStyle(final String plasticTabStyle) {
158         this.plasticTabStyle = plasticTabStyle;
159     }
160 
161     public LookAndFeel getSelectedLookAndFeel() {
162         return selectedLookAndFeel;
163     }
164 
165     public void setSelectedLookAndFeel(final LookAndFeel selectedLookAndFeel) {
166         this.selectedLookAndFeel = selectedLookAndFeel;
167     }
168 
169     public void setSelectedLookAndFeel(final String selectedLookAndFeelClassName) {
170         try {
171             Class theClass = Class.forName(selectedLookAndFeelClassName);
172             setSelectedLookAndFeel((LookAndFeeltheClass.newInstance());
173         catch (Exception e) {
174             Trace.trace(CLASS, this, "setSelectedLookAndFeel", e);
175             Trace.info(CLASS, this, "setSelectedLookAndFeel""Can't create instance for "
176                     + selectedLookAndFeelClassName);
177         }
178     }
179 
180     public PlasticTheme getSelectedTheme() {
181         return selectedTheme;
182     }
183 
184     public void setSelectedTheme(final PlasticTheme selectedTheme) {
185         this.selectedTheme = selectedTheme;
186     }
187 
188     public boolean isTabIconsEnabled() {
189         return tabIconsEnabled;
190     }
191 
192     public void setTabIconsEnabled(final boolean tabIconsEnabled) {
193         this.tabIconsEnabled = tabIconsEnabled;
194     }
195 
196     public Boolean getToolBar3DHint() {
197         return toolBar3DHint;
198     }
199 
200     public void setToolBar3DHint(final Boolean toolBar3DHint) {
201         this.toolBar3DHint = toolBar3DHint;
202     }
203 
204     public HeaderStyle getToolBarHeaderStyle() {
205         return toolBarHeaderStyle;
206     }
207 
208     public void setToolBarHeaderStyle(final HeaderStyle toolBarHeaderStyle) {
209         this.toolBarHeaderStyle = toolBarHeaderStyle;
210     }
211 
212     public BorderStyle getToolBarPlasticBorderStyle() {
213         return toolBarPlasticBorderStyle;
214     }
215 
216     public void setToolBarPlasticBorderStyle(final BorderStyle toolBarPlasticBorderStyle) {
217         this.toolBarPlasticBorderStyle = toolBarPlasticBorderStyle;
218     }
219 
220     public BorderStyle getToolBarWindowsBorderStyle() {
221         return toolBarWindowsBorderStyle;
222     }
223 
224     public void setToolBarWindowsBorderStyle(final BorderStyle toolBarWindowsBorderStyle) {
225         this.toolBarWindowsBorderStyle = toolBarWindowsBorderStyle;
226     }
227 
228     public boolean isUseNarrowButtons() {
229         return useNarrowButtons;
230     }
231 
232     public void setUseNarrowButtons(final boolean useNarrowButtons) {
233         this.useNarrowButtons = useNarrowButtons;
234     }
235 
236 }