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 org.jvnet.substance.border.ClassicInnerBorderPainter;
033: import org.jvnet.substance.button.ClassicButtonShaper;
034: import org.jvnet.substance.color.*;
035: import org.jvnet.substance.painter.ClassicGradientPainter;
036: import org.jvnet.substance.painter.decoration.BrushedMetalDecorationPainter;
037: import org.jvnet.substance.painter.decoration.DecorationAreaType;
038: import org.jvnet.substance.painter.highlight.ClassicHighlightPainter;
039: import org.jvnet.substance.theme.*;
040: import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
041: import org.jvnet.substance.utils.ComponentState;
042: import org.jvnet.substance.utils.SubstanceConstants.ColorShiftKind;
043: import org.jvnet.substance.watermark.SubstanceStripeWatermark;
044:
045: /**
046: * <code>Office Silver 2007</code> skin. This class is part of officially
047: * supported API.
048: *
049: * @author Kirill Grouchnikov
050: */
051: public class OfficeSilver2007Skin extends SubstanceAbstractSkin {
052: /**
053: * Display name for <code>this</code> skin.
054: */
055: public static final String NAME = "Office Silver 2007";
056:
057: /**
058: * Creates a new <code>Office Silver 2007</code> skin.
059: */
060: public OfficeSilver2007Skin() {
061: SubstanceTheme activeTheme = new SubstanceOrangeTheme()
062: .saturate(-0.1);
063: SubstanceTheme defaultTheme = new SubstanceTheme(
064: new BlendBiColorScheme(new MetallicColorScheme(),
065: new LightGrayColorScheme(), 0.7), "Metallic",
066: ThemeKind.COLD).tint(0.1);
067: SubstanceTheme disabledTheme = new SubstanceTheme(
068: new LightGrayColorScheme(), "Metallic", ThemeKind.COLD)
069: .tint(0.2);
070: SubstanceTheme activeTitleTheme = defaultTheme;
071:
072: SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
073: ThemeKind.BRIGHT, activeTheme, defaultTheme,
074: disabledTheme, activeTitleTheme);
075:
076: // register state-specific themes on rollovers and selections
077: theme.registerComponentStateTheme(new SubstanceBlendBiTheme(
078: new SubstanceOrangeTheme(),
079: new SubstanceSunGlareTheme().saturate(-0.1), 0.4),
080: false, ComponentState.ROLLOVER_UNSELECTED);
081: theme.registerComponentStateTheme(new SubstanceBlendBiTheme(
082: new SubstanceOrangeTheme(), new SubstanceSunsetTheme(),
083: 0.3), false, ComponentState.ROLLOVER_SELECTED);
084: theme.registerComponentStateTheme(new SubstanceBlendBiTheme(
085: new SubstanceRaspberryTheme(),
086: new SubstanceSunsetTheme(), 0.6).saturate(0.2), false,
087: ComponentState.PRESSED_SELECTED);
088: theme.registerComponentStateTheme(new SubstanceBlendBiTheme(
089: new SubstanceRaspberryTheme(),
090: new SubstanceSunsetTheme(), 0.2), false,
091: ComponentState.PRESSED_UNSELECTED);
092:
093: // register state-specific highlight themes on rollover and selections
094: theme.registerComponentHighlightStateTheme(
095: new SubstanceBlendBiTheme(new SubstanceOrangeTheme(),
096: new SubstanceSunGlareTheme(), 0.3)
097: .saturate(0.3), 0.5f,
098: ComponentState.ROLLOVER_UNSELECTED);
099: theme.registerComponentHighlightStateTheme(
100: new SubstanceBlendBiTheme(new SubstanceOrangeTheme(),
101: new SubstanceSunsetTheme(), 0.8), 0.5f,
102: ComponentState.SELECTED);
103: theme.registerComponentHighlightStateTheme(
104: new SubstanceBlendBiTheme(new SubstanceOrangeTheme(),
105: new SubstanceSunsetTheme(), 0.2), 0.7f,
106: ComponentState.ROLLOVER_SELECTED);
107: theme.registerComponentHighlightStateTheme(
108: new SubstanceBlendBiTheme(new SubstanceOrangeTheme(),
109: new SubstanceSunsetTheme(), 0.8), 0.7f,
110: ComponentState.ARMED, ComponentState.ROLLOVER_ARMED);
111:
112: theme.registerDecorationAreaTheme(activeTitleTheme, false,
113: DecorationAreaType.PRIMARY_TITLE_PANE,
114: DecorationAreaType.SECONDARY_TITLE_PANE,
115: DecorationAreaType.HEADER, DecorationAreaType.GENERAL);
116:
117: theme.setSelectedTabFadeStart(0.1);
118: theme.setSelectedTabFadeEnd(0.3);
119:
120: theme.setPaintingToolbarDropShadows();
121:
122: this .theme = theme;
123: this .buttonShaper = new ClassicButtonShaper();
124: this .watermark = new SubstanceStripeWatermark();
125: this .gradientPainter = new ClassicGradientPainter();
126: this .borderPainter = new ClassicInnerBorderPainter(0.8f,
127: ColorShiftKind.TINT);
128:
129: BrushedMetalDecorationPainter decorationPainter = new BrushedMetalDecorationPainter();
130: decorationPainter.setPaintingSeparators(true);
131: decorationPainter.setTextureAlpha(0.45f);
132: this .decorationPainter = decorationPainter;
133:
134: this .highlightPainter = new ClassicHighlightPainter();
135: }
136:
137: /*
138: * (non-Javadoc)
139: *
140: * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
141: */
142: public String getDisplayName() {
143: return NAME;
144: }
145: }
|