001: /*
002: * Copyright (c) 2005-2008 Substance Kirill Grouchnikov. All Rights Reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * o Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * o Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * o Neither the name of Substance Kirill Grouchnikov nor the names of
015: * its contributors may be used to endorse or promote products derived
016: * from this software without specific prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
020: * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
021: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
022: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
023: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
025: * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
026: * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
027: * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
028: * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029: */
030: package org.jvnet.substance.skin;
031:
032: import java.awt.Color;
033:
034: import org.jvnet.substance.border.ClassicBorderPainter;
035: import org.jvnet.substance.button.StandardButtonShaper;
036: import org.jvnet.substance.color.ColorScheme;
037: import org.jvnet.substance.color.MetallicColorScheme;
038: import org.jvnet.substance.painter.*;
039: import org.jvnet.substance.painter.decoration.DecorationAreaType;
040: import org.jvnet.substance.painter.decoration.MatteDecorationPainter;
041: import org.jvnet.substance.painter.highlight.ClassicHighlightPainter;
042: import org.jvnet.substance.theme.*;
043: import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
044: import org.jvnet.substance.watermark.SubstanceNullWatermark;
045:
046: /**
047: * <code>Mist Aqua</code> skin. This class is experimental.
048: *
049: * @author Kirill Grouchnikov
050: * @since version 4.0
051: */
052: public class MistAquaSkin extends SubstanceAbstractSkin {
053: /**
054: * Display name for <code>this</code> skin.
055: */
056: public static String NAME = "Mist Aqua";
057:
058: /**
059: * Color scheme for active visual state.
060: *
061: * @author Kirill Grouchnikov
062: */
063: protected static class ActiveTitleScheme implements ColorScheme {
064: /**
065: * The main ultra-light color.
066: */
067: private static final Color mainUltraLightColor = new Color(197,
068: 197, 197);
069:
070: /**
071: * The main extra-light color.
072: */
073: private static final Color mainExtraLightColor = new Color(185,
074: 185, 185);
075:
076: /**
077: * The main light color.
078: */
079: private static final Color mainLightColor = new Color(170, 170,
080: 170);
081:
082: /**
083: * The main medium color.
084: */
085: private static final Color mainMidColor = new Color(152, 152,
086: 152);
087:
088: /**
089: * The main dark color.
090: */
091: private static final Color mainDarkColor = new Color(152, 152,
092: 152);
093:
094: /**
095: * The main ultra-dark color.
096: */
097: private static final Color mainUltraDarkColor = new Color(152,
098: 152, 152);
099:
100: /**
101: * The foreground color.
102: */
103: private static final Color foregroundColor = Color
104: .decode("#000000");
105:
106: /*
107: * (non-Javadoc)
108: *
109: * @see org.jvnet.substance.color.ColorScheme#getForegroundColor()
110: */
111: public Color getForegroundColor() {
112: return ActiveTitleScheme.foregroundColor;
113: }
114:
115: /*
116: * (non-Javadoc)
117: *
118: * @see org.jvnet.substance.color.ColorScheme#getUltraLightColor()
119: */
120: public Color getUltraLightColor() {
121: return ActiveTitleScheme.mainUltraLightColor;
122: }
123:
124: /*
125: * (non-Javadoc)
126: *
127: * @see org.jvnet.substance.color.ColorScheme#getExtraLightColor()
128: */
129: public Color getExtraLightColor() {
130: return ActiveTitleScheme.mainExtraLightColor;
131: }
132:
133: /*
134: * (non-Javadoc)
135: *
136: * @see org.jvnet.substance.color.ColorScheme#getLightColor()
137: */
138: public Color getLightColor() {
139: return ActiveTitleScheme.mainLightColor;
140: }
141:
142: /*
143: * (non-Javadoc)
144: *
145: * @see org.jvnet.substance.color.ColorScheme#getMidColor()
146: */
147: public Color getMidColor() {
148: return ActiveTitleScheme.mainMidColor;
149: }
150:
151: /*
152: * (non-Javadoc)
153: *
154: * @see org.jvnet.substance.color.ColorScheme#getDarkColor()
155: */
156: public Color getDarkColor() {
157: return ActiveTitleScheme.mainDarkColor;
158: }
159:
160: /*
161: * (non-Javadoc)
162: *
163: * @see org.jvnet.substance.color.ColorScheme#getUltraDarkColor()
164: */
165: public Color getUltraDarkColor() {
166: return ActiveTitleScheme.mainUltraDarkColor;
167: }
168: }
169:
170: /**
171: * Creates a new <code>Silver Aqua</code> skin.
172: */
173: public MistAquaSkin() {
174: SubstanceTheme activeTheme = new SubstanceAquaTheme();
175: SubstanceTheme defaultTheme = new SubstanceTheme(
176: new MetallicColorScheme(), "Shade Metallic",
177: ThemeKind.COLD).shade(0.05);
178: SubstanceTheme disabledTheme = defaultTheme.getDisabledTheme();
179: SubstanceTheme activeTitleTheme = new SubstanceTheme(
180: new ActiveTitleScheme(), "Silver Active Title",
181: ThemeKind.COLD);
182:
183: SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
184: ThemeKind.COLD, activeTheme, defaultTheme,
185: disabledTheme, activeTitleTheme);
186: theme.registerDecorationAreaTheme(activeTitleTheme, false,
187: DecorationAreaType.PRIMARY_TITLE_PANE,
188: DecorationAreaType.SECONDARY_TITLE_PANE,
189: DecorationAreaType.HEADER, DecorationAreaType.GENERAL,
190: DecorationAreaType.TOOLBAR);
191:
192: // theme.registerComponentHighlightStateTheme(new SubstanceBlendBiTheme(
193: // new SubstanceTerracottaTheme(), new SubstanceSunGlareTheme(),
194: // 0.5).tint(0.2));
195: theme.setSelectedTabFadeStart(0.1);
196: theme.setSelectedTabFadeEnd(0.3);
197: theme
198: .setNonActivePainter(new SimplisticSoftBorderReverseGradientPainter());
199: this .theme = theme;
200: // theme.addPaintAsActive(JScrollBar.class);
201: this .buttonShaper = new StandardButtonShaper();
202: this .watermark = new SubstanceNullWatermark();
203: this .gradientPainter = new MatteGradientPainter();
204: this .borderPainter = new ClassicBorderPainter();
205:
206: this .decorationPainter = new MatteDecorationPainter();
207: this .highlightPainter = new ClassicHighlightPainter();
208:
209: this .tabBackgroundComposite = new AlphaControlBackgroundComposite(
210: 0.5f);
211: }
212:
213: /*
214: * (non-Javadoc)
215: *
216: * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
217: */
218: public String getDisplayName() {
219: return NAME;
220: }
221: }
|