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.ClassicInnerBorderPainter;
035: import org.jvnet.substance.border.GlassInnerBorderPainter;
036: import org.jvnet.substance.button.ClassicButtonShaper;
037: import org.jvnet.substance.color.ColorScheme;
038: import org.jvnet.substance.color.LightGrayColorScheme;
039: import org.jvnet.substance.painter.*;
040: import org.jvnet.substance.painter.decoration.ArcDecorationPainter;
041: import org.jvnet.substance.painter.decoration.DecorationAreaType;
042: import org.jvnet.substance.painter.highlight.ClassicHighlightPainter;
043: import org.jvnet.substance.theme.*;
044: import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
045: import org.jvnet.substance.utils.SubstanceConstants.ColorShiftKind;
046: import org.jvnet.substance.watermark.SubstanceNullWatermark;
047:
048: /**
049: * <code>Creme Coffee</code> skin. This class is part of officially supported
050: * API.
051: *
052: * @author Kirill Grouchnikov
053: * @since version 4.1
054: */
055: public class CremeCoffeeSkin extends SubstanceAbstractSkin {
056: /**
057: * Color scheme for active visual state.
058: *
059: * @author Kirill Grouchnikov
060: */
061: protected static class ActiveScheme implements ColorScheme {
062: /**
063: * The main ultra-light color.
064: */
065: private static final Color mainUltraLightColor = new Color(244,
066: 229, 192);
067:
068: /**
069: * The main extra-light color.
070: */
071: private static final Color mainExtraLightColor = new Color(240,
072: 222, 179);
073:
074: /**
075: * The main light color.
076: */
077: private static final Color mainLightColor = new Color(235, 215,
078: 166);
079:
080: /**
081: * The main medium color.
082: */
083: private static final Color mainMidColor = new Color(200, 162,
084: 110);
085:
086: /**
087: * The main dark color.
088: */
089: private static final Color mainDarkColor = new Color(170, 131,
090: 99);
091:
092: /**
093: * The main ultra-dark color.
094: */
095: private static final Color mainUltraDarkColor = new Color(141,
096: 97, 44);
097:
098: /**
099: * The foreground color.
100: */
101: private static final Color foregroundColor = new Color(50, 34,
102: 15);
103:
104: /*
105: * (non-Javadoc)
106: *
107: * @see org.jvnet.substance.color.ColorScheme#getForegroundColor()
108: */
109: public Color getForegroundColor() {
110: return ActiveScheme.foregroundColor;
111: }
112:
113: /*
114: * (non-Javadoc)
115: *
116: * @see org.jvnet.substance.color.ColorScheme#getUltraLightColor()
117: */
118: public Color getUltraLightColor() {
119: return ActiveScheme.mainUltraLightColor;
120: }
121:
122: /*
123: * (non-Javadoc)
124: *
125: * @see org.jvnet.substance.color.ColorScheme#getExtraLightColor()
126: */
127: public Color getExtraLightColor() {
128: return ActiveScheme.mainExtraLightColor;
129: }
130:
131: /*
132: * (non-Javadoc)
133: *
134: * @see org.jvnet.substance.color.ColorScheme#getLightColor()
135: */
136: public Color getLightColor() {
137: return ActiveScheme.mainLightColor;
138: }
139:
140: /*
141: * (non-Javadoc)
142: *
143: * @see org.jvnet.substance.color.ColorScheme#getMidColor()
144: */
145: public Color getMidColor() {
146: return ActiveScheme.mainMidColor;
147: }
148:
149: /*
150: * (non-Javadoc)
151: *
152: * @see org.jvnet.substance.color.ColorScheme#getDarkColor()
153: */
154: public Color getDarkColor() {
155: return ActiveScheme.mainDarkColor;
156: }
157:
158: /*
159: * (non-Javadoc)
160: *
161: * @see org.jvnet.substance.color.ColorScheme#getUltraDarkColor()
162: */
163: public Color getUltraDarkColor() {
164: return ActiveScheme.mainUltraDarkColor;
165: }
166: }
167:
168: /**
169: * Display name for <code>this</code> skin.
170: */
171: public static String NAME = "Creme Coffee";
172:
173: /**
174: * Creates a new <code>Creme Coffee</code> skin.
175: */
176: public CremeCoffeeSkin() {
177: SubstanceTheme activeTheme = new SubstanceTheme(
178: new ActiveScheme(), "Creme Coffee Active",
179: ThemeKind.COLD);
180: //
181: // new SubstanceBrownTheme().tint(0.7)
182: // .saturate(0.2);
183: SubstanceTheme defaultTheme = new SubstanceCremeTheme();
184: SubstanceTheme disabledTheme = new SubstanceTheme(
185: new LightGrayColorScheme(), "Tint Light Gray",
186: ThemeKind.COLD).tint(0.35);
187: SubstanceTheme activeTitleTheme = defaultTheme;
188:
189: SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
190: ThemeKind.COLD, activeTheme, defaultTheme,
191: disabledTheme, activeTitleTheme);
192:
193: theme.registerDecorationAreaTheme(activeTitleTheme, false,
194: DecorationAreaType.PRIMARY_TITLE_PANE,
195: DecorationAreaType.SECONDARY_TITLE_PANE,
196: DecorationAreaType.HEADER, DecorationAreaType.GENERAL,
197: DecorationAreaType.TOOLBAR);
198:
199: theme
200: .setNonActivePainter(new SimplisticSoftBorderReverseGradientPainter());
201: theme.setSelectedTabFadeStart(0.1);
202: theme.setSelectedTabFadeEnd(0.3);
203: this .theme = theme;
204:
205: this .buttonShaper = new ClassicButtonShaper();
206: this .watermark = new SubstanceNullWatermark();
207: this .gradientPainter = new MatteGradientPainter();
208: this .decorationPainter = new ArcDecorationPainter();
209: this .borderPainter = new ClassicInnerBorderPainter(0.8f,
210: ColorShiftKind.TINT);
211: this .highlightPainter = new ClassicHighlightPainter();
212:
213: this .tabBackgroundComposite = new AlphaControlBackgroundComposite(
214: 0.75f);
215:
216: this .borderPainter = new GlassInnerBorderPainter(0.8f,
217: ColorShiftKind.TINT);
218: }
219:
220: /*
221: * (non-Javadoc)
222: *
223: * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
224: */
225: public String getDisplayName() {
226: return NAME;
227: }
228: }
|