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.*;
037: import org.jvnet.substance.painter.AlphaControlBackgroundComposite;
038: import org.jvnet.substance.painter.SimplisticSoftBorderReverseGradientPainter;
039: import org.jvnet.substance.painter.decoration.FlatDecorationPainter;
040: import org.jvnet.substance.painter.highlight.ClassicHighlightPainter;
041: import org.jvnet.substance.theme.*;
042: import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
043: import org.jvnet.substance.utils.ComponentState;
044: import org.jvnet.substance.utils.SubstanceConstants.ColorShiftKind;
045: import org.jvnet.substance.watermark.SubstanceCrosshatchWatermark;
046:
047: /**
048: * <code>Raven Graphite</code> skin. This class is part of officially
049: * supported API.
050: *
051: * @author Kirill Grouchnikov
052: * @since version 3.3
053: */
054: public class RavenGraphiteSkin extends SubstanceAbstractSkin {
055: /**
056: * Display name for <code>this</code> skin.
057: */
058: public static String NAME = "Raven Graphite";
059:
060: /**
061: * Creates a new <code>Raven Graphite</code> skin.
062: */
063: public RavenGraphiteSkin() {
064: ColorScheme activeScheme = new TintColorScheme(
065: new EbonyColorScheme(), 0.2) {
066: Color foreColor = new Color(200, 200, 200);
067:
068: @Override
069: public Color getForegroundColor() {
070: return foreColor;
071: }
072: };
073: ColorScheme selectedDisabledScheme = new TintColorScheme(
074: new EbonyColorScheme(), 0.2) {
075: Color foreColor = new Color(32, 32, 32);
076:
077: @Override
078: public Color getForegroundColor() {
079: return foreColor;
080: }
081: };
082: ColorScheme disabledScheme = new ToneColorScheme(
083: new EbonyColorScheme(), 0.35) {
084: Color foreColor = new Color(32, 32, 32);
085:
086: @Override
087: public Color getForegroundColor() {
088: return foreColor;
089: }
090: };
091: SubstanceTheme activeTheme = new SubstanceTheme(activeScheme,
092: "Raven Graphite Active", ThemeKind.DARK);
093: SubstanceTheme defaultTheme = activeTheme.shade(0.2);
094: SubstanceTheme disabledTheme = new SubstanceTheme(
095: disabledScheme, "Raven Graphite Disabled",
096: ThemeKind.DARK);
097: SubstanceTheme selectedDisabledTheme = new SubstanceTheme(
098: selectedDisabledScheme,
099: "Raven Graphite Selected Disabled", ThemeKind.DARK);
100: SubstanceTheme activeTitleTheme = defaultTheme;
101:
102: SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
103: ThemeKind.DARK, activeTheme, defaultTheme,
104: disabledTheme, activeTitleTheme);
105: theme
106: .setNonActivePainter(new SimplisticSoftBorderReverseGradientPainter());
107: theme.setSelectedTabFadeStart(0.3);
108: theme.setSelectedTabFadeEnd(0.6);
109: theme.registerComponentHighlightStateTheme(
110: new SubstanceEbonyTheme(), 0.8f);
111: // ComponentState.ROLLOVER_ARMED,
112: // ComponentState.ROLLOVER_SELECTED,
113: // ComponentState.ROLLOVER_UNSELECTED,
114: // ComponentState.ARMED);
115: theme.registerComponentStateTheme(disabledTheme, 0.5f, false,
116: ComponentState.DISABLED_UNSELECTED);
117: theme.registerComponentStateTheme(selectedDisabledTheme, 0.5f,
118: false, ComponentState.DISABLED_SELECTED);
119:
120: this .theme = theme;
121: this .buttonShaper = new ClassicButtonShaper();
122: this .watermark = new SubstanceCrosshatchWatermark();
123: this .gradientPainter = new SimplisticSoftBorderReverseGradientPainter() {
124: @Override
125: public Color getBottomFillColor(
126: ColorScheme interpolationScheme1,
127: ColorScheme interpolationScheme2, double cycleCoef,
128: boolean useCyclePosAsInterpolation) {
129: return getMidFillColorBottom(interpolationScheme1,
130: interpolationScheme2, cycleCoef,
131: useCyclePosAsInterpolation);
132: }
133: };
134: this .decorationPainter = new FlatDecorationPainter();
135: this .highlightPainter = new ClassicHighlightPainter();
136: tabBackgroundComposite = new AlphaControlBackgroundComposite(
137: 0.5f);
138: this .borderPainter = new ClassicInnerBorderPainter(0.55f,
139: ColorShiftKind.TONE);
140: }
141:
142: /*
143: * (non-Javadoc)
144: *
145: * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
146: */
147: public String getDisplayName() {
148: return NAME;
149: }
150: }
|