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.button.ClassicButtonShaper;
036: import org.jvnet.substance.color.MetallicColorScheme;
037: import org.jvnet.substance.painter.*;
038: import org.jvnet.substance.painter.decoration.*;
039: import org.jvnet.substance.painter.highlight.ClassicHighlightPainter;
040: import org.jvnet.substance.theme.*;
041: import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
042: import org.jvnet.substance.utils.SubstanceConstants.ColorShiftKind;
043: import org.jvnet.substance.watermark.SubstanceNullWatermark;
044:
045: /**
046: * <code>Business</code> skin. This class is part of officially supported API.
047: *
048: * @author Kirill Grouchnikov
049: * @since version 3.1
050: */
051: public class BusinessSkin extends SubstanceAbstractSkin {
052: /**
053: * Display name for <code>this</code> skin.
054: */
055: public static String NAME = "Business";
056:
057: /**
058: * Creates a new <code>Business</code> skin.
059: */
060: public BusinessSkin() {
061: SubstanceTheme activeTheme = new SubstanceTheme(
062: new MetallicColorScheme(), "Tint Metallic",
063: ThemeKind.COLD).tint(0.15);
064: SubstanceTheme defaultTheme = new SubstanceTheme(
065: new MetallicColorScheme(), "Shade Metallic",
066: ThemeKind.COLD).shade(0.1);
067: SubstanceTheme disabledTheme = defaultTheme.getDisabledTheme()
068: .tint(0.2);
069: SubstanceTheme activeTitleTheme = defaultTheme;
070:
071: SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
072: ThemeKind.COLD, activeTheme, defaultTheme,
073: disabledTheme, activeTitleTheme) {
074: @Override
075: public Color getLightBackgroundColor() {
076: return disabledTheme.getBackgroundColor();
077: }
078: };
079: theme
080: .registerComponentHighlightStateTheme(new SubstanceBlendBiTheme(
081: new SubstanceTerracottaTheme(),
082: new SubstanceSunGlareTheme(), 0.5).tint(0.2));
083:
084: theme.registerDecorationAreaTheme(activeTitleTheme, false,
085: DecorationAreaType.PRIMARY_TITLE_PANE,
086: DecorationAreaType.SECONDARY_TITLE_PANE,
087: DecorationAreaType.HEADER, DecorationAreaType.GENERAL,
088: DecorationAreaType.TOOLBAR);
089:
090: theme.setSelectedTabFadeStart(0.6);
091: theme.setSelectedTabFadeEnd(1.0);
092: theme
093: .setNonActivePainter(new SimplisticSoftBorderReverseGradientPainter());
094: this .theme = theme;
095: // theme.addPaintAsActive(JScrollBar.class);
096: this .buttonShaper = new ClassicButtonShaper();
097: this .watermark = new SubstanceNullWatermark();
098: this .gradientPainter = new ClassicGradientPainter();
099: this .borderPainter = new ClassicInnerBorderPainter(0.8f,
100: ColorShiftKind.TINT);
101:
102: BrushedMetalDecorationPainter decorationPainter = new BrushedMetalDecorationPainter();
103: decorationPainter
104: .setBaseDecorationPainter(new ArcDecorationPainter());
105: decorationPainter.setTextureAlpha(0.2f);
106: this .decorationPainter = decorationPainter;
107:
108: this .highlightPainter = new ClassicHighlightPainter();
109:
110: this .tabBackgroundComposite = new AlphaControlBackgroundComposite(
111: 0.5f);
112:
113: this .borderPainter = new ClassicInnerBorderPainter(0.9f,
114: ColorShiftKind.TINT);
115: }
116:
117: /*
118: * (non-Javadoc)
119: *
120: * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
121: */
122: public String getDisplayName() {
123: return NAME;
124: }
125: }
|