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.SubstanceComplexTheme;
043: import org.jvnet.substance.theme.SubstanceTheme;
044: import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
045: import org.jvnet.substance.watermark.SubstanceNullWatermark;
046:
047: /**
048: * <code>Mist Silver</code> skin. This class is experimental.
049: *
050: * @author Kirill Grouchnikov
051: * @since version 4.0
052: */
053: public class MistSilverSkin extends SubstanceAbstractSkin {
054: /**
055: * Display name for <code>this</code> skin.
056: */
057: public static String NAME = "Mist Silver";
058:
059: /**
060: * Color scheme for active visual state.
061: *
062: * @author Kirill Grouchnikov
063: */
064: protected static class ActiveTitleScheme implements ColorScheme {
065: /**
066: * The main ultra-light color.
067: */
068: private static final Color mainUltraLightColor = new Color(197,
069: 197, 197);
070:
071: /**
072: * The main extra-light color.
073: */
074: private static final Color mainExtraLightColor = new Color(185,
075: 185, 185);
076:
077: /**
078: * The main light color.
079: */
080: private static final Color mainLightColor = new Color(170, 170,
081: 170);
082:
083: /**
084: * The main medium color.
085: */
086: private static final Color mainMidColor = new Color(152, 152,
087: 152);
088:
089: /**
090: * The main dark color.
091: */
092: private static final Color mainDarkColor = new Color(152, 152,
093: 152);
094:
095: /**
096: * The main ultra-dark color.
097: */
098: private static final Color mainUltraDarkColor = new Color(152,
099: 152, 152);
100:
101: /**
102: * The foreground color.
103: */
104: private static final Color foregroundColor = Color
105: .decode("#000000");
106:
107: /*
108: * (non-Javadoc)
109: *
110: * @see org.jvnet.substance.color.ColorScheme#getForegroundColor()
111: */
112: public Color getForegroundColor() {
113: return ActiveTitleScheme.foregroundColor;
114: }
115:
116: /*
117: * (non-Javadoc)
118: *
119: * @see org.jvnet.substance.color.ColorScheme#getUltraLightColor()
120: */
121: public Color getUltraLightColor() {
122: return ActiveTitleScheme.mainUltraLightColor;
123: }
124:
125: /*
126: * (non-Javadoc)
127: *
128: * @see org.jvnet.substance.color.ColorScheme#getExtraLightColor()
129: */
130: public Color getExtraLightColor() {
131: return ActiveTitleScheme.mainExtraLightColor;
132: }
133:
134: /*
135: * (non-Javadoc)
136: *
137: * @see org.jvnet.substance.color.ColorScheme#getLightColor()
138: */
139: public Color getLightColor() {
140: return ActiveTitleScheme.mainLightColor;
141: }
142:
143: /*
144: * (non-Javadoc)
145: *
146: * @see org.jvnet.substance.color.ColorScheme#getMidColor()
147: */
148: public Color getMidColor() {
149: return ActiveTitleScheme.mainMidColor;
150: }
151:
152: /*
153: * (non-Javadoc)
154: *
155: * @see org.jvnet.substance.color.ColorScheme#getDarkColor()
156: */
157: public Color getDarkColor() {
158: return ActiveTitleScheme.mainDarkColor;
159: }
160:
161: /*
162: * (non-Javadoc)
163: *
164: * @see org.jvnet.substance.color.ColorScheme#getUltraDarkColor()
165: */
166: public Color getUltraDarkColor() {
167: return ActiveTitleScheme.mainUltraDarkColor;
168: }
169: }
170:
171: /**
172: * Creates a new <code>Silver</code> skin.
173: */
174: public MistSilverSkin() {
175: SubstanceTheme activeTheme = new SubstanceTheme(
176: new MetallicColorScheme(), "Tint Metallic",
177: ThemeKind.COLD).tint(0.1);
178: SubstanceTheme defaultTheme = new SubstanceTheme(
179: new MetallicColorScheme(), "Shade Metallic",
180: ThemeKind.COLD).shade(0.05);
181: SubstanceTheme disabledTheme = defaultTheme.getDisabledTheme();
182: SubstanceTheme activeTitleTheme = new SubstanceTheme(
183: new ActiveTitleScheme(), "Silver Active Title",
184: ThemeKind.COLD);
185:
186: SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
187: ThemeKind.COLD, activeTheme, defaultTheme,
188: disabledTheme, activeTitleTheme);
189: theme.registerDecorationAreaTheme(activeTitleTheme, false,
190: DecorationAreaType.PRIMARY_TITLE_PANE,
191: DecorationAreaType.SECONDARY_TITLE_PANE,
192: DecorationAreaType.HEADER, DecorationAreaType.GENERAL,
193: DecorationAreaType.TOOLBAR);
194:
195: // theme.registerComponentHighlightStateTheme(new SubstanceBlendBiTheme(
196: // new SubstanceTerracottaTheme(), new SubstanceSunGlareTheme(),
197: // 0.5).tint(0.2));
198: theme.setSelectedTabFadeStart(0.6);
199: theme.setSelectedTabFadeEnd(1.0);
200: theme
201: .setNonActivePainter(new SimplisticSoftBorderReverseGradientPainter());
202: this .theme = theme;
203: // theme.addPaintAsActive(JScrollBar.class);
204: this .buttonShaper = new StandardButtonShaper();
205: this .watermark = new SubstanceNullWatermark();
206: this .gradientPainter = new MatteGradientPainter();
207: this .borderPainter = new ClassicBorderPainter();
208:
209: this .decorationPainter = new MatteDecorationPainter();
210: this .highlightPainter = new ClassicHighlightPainter();
211:
212: this .tabBackgroundComposite = new AlphaControlBackgroundComposite(
213: 0.5f);
214: }
215:
216: /*
217: * (non-Javadoc)
218: *
219: * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
220: */
221: public String getDisplayName() {
222: return NAME;
223: }
224: }
|