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.*;
038: import org.jvnet.substance.painter.decoration.ArcDecorationPainter;
039: import org.jvnet.substance.painter.decoration.DecorationAreaType;
040: import org.jvnet.substance.painter.highlight.GlassHighlightPainter;
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 Glass</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 RavenGraphiteGlassSkin extends SubstanceAbstractSkin {
055: /**
056: * Display name for <code>this</code> skin.
057: */
058: public static String NAME = "Raven Graphite Glass";
059:
060: /**
061: * Creates a new <code>Raven Graphite</code> skin.
062: */
063: public RavenGraphiteGlassSkin() {
064: SubstanceTheme activeTheme = new SubstanceEbonyTheme()
065: .tint(0.2);
066: SubstanceTheme defaultTheme = activeTheme.shade(0.2);
067: ColorScheme disabledScheme = new ToneColorScheme(
068: new EbonyColorScheme(), 0.35) {
069: Color foreColor = new Color(32, 32, 32);
070:
071: @Override
072: public Color getForegroundColor() {
073: return foreColor;
074: }
075: };
076: ColorScheme selectedDisabledScheme = new TintColorScheme(
077: new EbonyColorScheme(), 0.2) {
078: Color foreColor = new Color(32, 32, 32);
079:
080: @Override
081: public Color getForegroundColor() {
082: return foreColor;
083: }
084: };
085: SubstanceTheme disabledTheme = new SubstanceTheme(
086: disabledScheme, "Raven Graphite Glass Disabled",
087: ThemeKind.DARK);
088: SubstanceTheme selectedDisabledTheme = new SubstanceTheme(
089: selectedDisabledScheme,
090: "Raven Graphite Glass Selected Disabled",
091: ThemeKind.DARK);
092:
093: SubstanceTheme activeTitleTheme = defaultTheme;
094:
095: SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
096: ThemeKind.DARK, activeTheme, defaultTheme,
097: disabledTheme, activeTitleTheme);
098: theme
099: .setNonActivePainter(new SimplisticSoftBorderReverseGradientPainter());
100: theme.setSelectedTabFadeStart(0.3);
101: theme.setSelectedTabFadeEnd(0.6);
102:
103: // register highlight alphas
104: SubstanceTheme highlightTheme = new SubstanceEbonyTheme();
105: theme.registerComponentHighlightStateTheme(highlightTheme,
106: 0.4f, ComponentState.ROLLOVER_UNSELECTED);
107: theme.registerComponentHighlightStateTheme(highlightTheme,
108: 0.55f, ComponentState.SELECTED);
109: theme.registerComponentHighlightStateTheme(highlightTheme,
110: 0.7f, ComponentState.ROLLOVER_SELECTED);
111: theme.registerComponentHighlightStateTheme(highlightTheme,
112: 0.65f, ComponentState.ARMED,
113: ComponentState.ROLLOVER_ARMED);
114:
115: // register theme for disabled states
116: theme.registerComponentStateTheme(disabledTheme, 0.5f, false,
117: ComponentState.DISABLED_UNSELECTED);
118: theme.registerComponentStateTheme(selectedDisabledTheme, 0.5f,
119: false, ComponentState.DISABLED_SELECTED);
120:
121: theme.registerDecorationAreaTheme(activeTitleTheme, false,
122: DecorationAreaType.PRIMARY_TITLE_PANE,
123: DecorationAreaType.SECONDARY_TITLE_PANE,
124: DecorationAreaType.HEADER, DecorationAreaType.GENERAL,
125: DecorationAreaType.TOOLBAR);
126:
127: this .theme = theme;
128: this .buttonShaper = new ClassicButtonShaper();
129: this .watermark = new SubstanceCrosshatchWatermark();
130: this .gradientPainter = new GlassGradientPainter();
131: this .decorationPainter = new ArcDecorationPainter();
132: this .highlightPainter = new GlassHighlightPainter();
133: this .tabBackgroundComposite = new AlphaControlBackgroundComposite(
134: 0.5f);
135: this .borderPainter = new ClassicInnerBorderPainter(0.5f,
136: ColorShiftKind.TONE);
137: }
138:
139: /*
140: * (non-Javadoc)
141: *
142: * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
143: */
144: public String getDisplayName() {
145: return NAME;
146: }
147: }
|