Source Code Cross Referenced for AutumnSkin.java in  » Swing-Library » substance-look-feel » org » jvnet » substance » skin » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » substance look feel » org.jvnet.substance.skin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.ColorScheme;
037:        import org.jvnet.substance.painter.*;
038:        import org.jvnet.substance.painter.decoration.DecorationAreaType;
039:        import org.jvnet.substance.painter.decoration.MarbleNoiseDecorationPainter;
040:        import org.jvnet.substance.painter.highlight.ClassicHighlightPainter;
041:        import org.jvnet.substance.theme.SubstanceComplexTheme;
042:        import org.jvnet.substance.theme.SubstanceTheme;
043:        import org.jvnet.substance.theme.SubstanceTheme.ThemeKind;
044:        import org.jvnet.substance.utils.ComponentState;
045:        import org.jvnet.substance.utils.SubstanceColorUtilities;
046:        import org.jvnet.substance.utils.SubstanceConstants.ColorShiftKind;
047:        import org.jvnet.substance.watermark.SubstanceNullWatermark;
048:
049:        /**
050:         * <code>Autumn</code> skin. This class is part of officially supported API.
051:         * 
052:         * @author Kirill Grouchnikov
053:         * @since version 4.0
054:         */
055:        public class AutumnSkin extends SubstanceAbstractSkin {
056:            /**
057:             * Display name for <code>this</code> skin.
058:             */
059:            public static String NAME = "Autumn";
060:
061:            /**
062:             * Color scheme for active visual state.
063:             * 
064:             * @author Kirill Grouchnikov
065:             */
066:            protected static class ActiveScheme implements  ColorScheme {
067:                /**
068:                 * The main ultra-light color.
069:                 */
070:                private static final Color mainUltraLightColor = Color
071:                        .decode("#FDDDAC");
072:
073:                /**
074:                 * The main extra-light color.
075:                 */
076:                private static final Color mainExtraLightColor = Color
077:                        .decode("#FCEF9F");
078:
079:                /**
080:                 * The main light color.
081:                 */
082:                private static final Color mainLightColor = Color
083:                        .decode("#FCD592");
084:
085:                /**
086:                 * The main medium color.
087:                 */
088:                private static final Color mainMidColor = Color
089:                        .decode("#F9BE84");
090:
091:                /**
092:                 * The main dark color.
093:                 */
094:                private static final Color mainDarkColor = Color
095:                        .decode("#F8B87A");
096:
097:                /**
098:                 * The main ultra-dark color.
099:                 */
100:                // private static final Color mainUltraDarkColor =
101:                // Color.decode("#5B0E00");
102:                private static final Color mainUltraDarkColor = Color
103:                        .decode("#AC623B");
104:
105:                /**
106:                 * The foreground color.
107:                 */
108:                private static final Color foregroundColor = Color
109:                        .decode("#AC623B");
110:
111:                /*
112:                 * (non-Javadoc)
113:                 * 
114:                 * @see org.jvnet.substance.color.ColorScheme#getForegroundColor()
115:                 */
116:                public Color getForegroundColor() {
117:                    return ActiveScheme.foregroundColor;
118:                }
119:
120:                /*
121:                 * (non-Javadoc)
122:                 * 
123:                 * @see org.jvnet.substance.color.ColorScheme#getUltraLightColor()
124:                 */
125:                public Color getUltraLightColor() {
126:                    return ActiveScheme.mainUltraLightColor;
127:                }
128:
129:                /*
130:                 * (non-Javadoc)
131:                 * 
132:                 * @see org.jvnet.substance.color.ColorScheme#getExtraLightColor()
133:                 */
134:                public Color getExtraLightColor() {
135:                    return ActiveScheme.mainExtraLightColor;
136:                }
137:
138:                /*
139:                 * (non-Javadoc)
140:                 * 
141:                 * @see org.jvnet.substance.color.ColorScheme#getLightColor()
142:                 */
143:                public Color getLightColor() {
144:                    return ActiveScheme.mainLightColor;
145:                }
146:
147:                /*
148:                 * (non-Javadoc)
149:                 * 
150:                 * @see org.jvnet.substance.color.ColorScheme#getMidColor()
151:                 */
152:                public Color getMidColor() {
153:                    return ActiveScheme.mainMidColor;
154:                }
155:
156:                /*
157:                 * (non-Javadoc)
158:                 * 
159:                 * @see org.jvnet.substance.color.ColorScheme#getDarkColor()
160:                 */
161:                public Color getDarkColor() {
162:                    return ActiveScheme.mainDarkColor;
163:                }
164:
165:                /*
166:                 * (non-Javadoc)
167:                 * 
168:                 * @see org.jvnet.substance.color.ColorScheme#getUltraDarkColor()
169:                 */
170:                public Color getUltraDarkColor() {
171:                    return ActiveScheme.mainUltraDarkColor;
172:                }
173:            }
174:
175:            /**
176:             * Color scheme for default visual state.
177:             * 
178:             * @author Kirill Grouchnikov
179:             */
180:            protected static class DefaultScheme implements  ColorScheme {
181:                /**
182:                 * The main ultra-light color.
183:                 */
184:                private static final Color mainUltraLightColor = Color
185:                        .decode("#FFF2DF");
186:
187:                /**
188:                 * The main extra-light color.
189:                 */
190:                private static final Color mainExtraLightColor = Color
191:                        .decode("#FFE3C5");
192:
193:                /**
194:                 * The main light color.
195:                 */
196:                private static final Color mainLightColor = Color
197:                        .decode("#FDD1A4");
198:
199:                /**
200:                 * The main medium color.
201:                 */
202:                private static final Color mainMidColor = Color
203:                        .decode("#FBCD9C");
204:
205:                /**
206:                 * The main dark color.
207:                 */
208:                private static final Color mainDarkColor = Color
209:                        .decode("#FCC896");
210:
211:                /**
212:                 * The main ultra-dark color.
213:                 */
214:                // private static final Color mainUltraDarkColor =
215:                // Color.decode("#872A00");
216:                private static final Color mainUltraDarkColor = Color
217:                        .decode("#AC623B");
218:
219:                /**
220:                 * The foreground color.
221:                 */
222:                private static final Color foregroundColor = Color
223:                        .decode("#AC623B");
224:
225:                /*
226:                 * (non-Javadoc)
227:                 * 
228:                 * @see org.jvnet.substance.color.ColorScheme#getForegroundColor()
229:                 */
230:                public Color getForegroundColor() {
231:                    return DefaultScheme.foregroundColor;
232:                }
233:
234:                /*
235:                 * (non-Javadoc)
236:                 * 
237:                 * @see org.jvnet.substance.color.ColorScheme#getUltraLightColor()
238:                 */
239:                public Color getUltraLightColor() {
240:                    return DefaultScheme.mainUltraLightColor;
241:                }
242:
243:                /*
244:                 * (non-Javadoc)
245:                 * 
246:                 * @see org.jvnet.substance.color.ColorScheme#getExtraLightColor()
247:                 */
248:                public Color getExtraLightColor() {
249:                    return DefaultScheme.mainExtraLightColor;
250:                }
251:
252:                /*
253:                 * (non-Javadoc)
254:                 * 
255:                 * @see org.jvnet.substance.color.ColorScheme#getLightColor()
256:                 */
257:                public Color getLightColor() {
258:                    return DefaultScheme.mainLightColor;
259:                }
260:
261:                /*
262:                 * (non-Javadoc)
263:                 * 
264:                 * @see org.jvnet.substance.color.ColorScheme#getMidColor()
265:                 */
266:                public Color getMidColor() {
267:                    return DefaultScheme.mainMidColor;
268:                }
269:
270:                /*
271:                 * (non-Javadoc)
272:                 * 
273:                 * @see org.jvnet.substance.color.ColorScheme#getDarkColor()
274:                 */
275:                public Color getDarkColor() {
276:                    return DefaultScheme.mainDarkColor;
277:                }
278:
279:                /*
280:                 * (non-Javadoc)
281:                 * 
282:                 * @see org.jvnet.substance.color.ColorScheme#getUltraDarkColor()
283:                 */
284:                public Color getUltraDarkColor() {
285:                    return DefaultScheme.mainUltraDarkColor;
286:                }
287:            }
288:
289:            /**
290:             * Creates a new <code>Autumn</code> skin.
291:             */
292:            public AutumnSkin() {
293:                SubstanceTheme activeTheme = new SubstanceTheme(
294:                        new ActiveScheme(), "Autumn Active", ThemeKind.COLD);
295:                SubstanceTheme defaultTheme = new SubstanceTheme(
296:                        new DefaultScheme(), "Autumn Default", ThemeKind.COLD);
297:
298:                // final ColorScheme disabledScheme = new
299:                // BlendBiColorScheme(defaultTheme
300:                // .getColorScheme(), defaultTheme.getDisabledTheme()
301:                // .getColorScheme(), 0.6) {
302:                // Color foreColor = new Color(128, 131, 136);
303:                //
304:                // @Override
305:                // public Color getForegroundColor() {
306:                // return foreColor;
307:                // }
308:                // };
309:                SubstanceTheme disabledTheme = defaultTheme;
310:                // new SubstanceTheme(disabledScheme,
311:                // "Disabled Autumn", ThemeKind.COLD);
312:
313:                SubstanceTheme activeTitleTheme = defaultTheme;
314:
315:                SubstanceComplexTheme theme = new SubstanceComplexTheme(NAME,
316:                        ThemeKind.COLD, activeTheme, defaultTheme,
317:                        disabledTheme, activeTitleTheme) {
318:                    /*
319:                     * (non-Javadoc)
320:                     * 
321:                     * @see org.jvnet.substance.theme.SubstanceComplexTheme#getLightBackgroundColor()
322:                     */
323:                    @Override
324:                    public Color getLightBackgroundColor() {
325:                        return SubstanceColorUtilities.getInterpolatedColor(
326:                                defaultTheme.getColorScheme()
327:                                        .getUltraLightColor(), defaultTheme
328:                                        .getColorScheme().getExtraLightColor(),
329:                                0.5);
330:
331:                    }
332:
333:                    /*
334:                     * (non-Javadoc)
335:                     * 
336:                     * @see org.jvnet.substance.theme.SubstanceTheme#getDisabledForegroundColor()
337:                     */
338:                    @Override
339:                    public Color getDisabledForegroundColor() {
340:                        return SubstanceColorUtilities
341:                                .getInterpolatedColor(defaultTheme
342:                                        .getColorScheme().getForegroundColor(),
343:                                        defaultTheme.getColorScheme()
344:                                                .getLightColor(), 0.6f);
345:                    }
346:                };
347:                theme
348:                        .setNonActivePainter(new SimplisticSoftBorderReverseGradientPainter());
349:                theme.setSelectedTabFadeStart(0.1);
350:                theme.setSelectedTabFadeEnd(0.3);
351:                theme.registerComponentStateTheme(disabledTheme, 0.6f, false,
352:                        ComponentState.DISABLED_UNSELECTED);
353:                theme.registerComponentStateTheme(activeTheme, 0.6f, false,
354:                        ComponentState.DISABLED_SELECTED);
355:
356:                theme.registerDecorationAreaTheme(theme, false,
357:                        DecorationAreaType.PRIMARY_TITLE_PANE,
358:                        DecorationAreaType.SECONDARY_TITLE_PANE,
359:                        DecorationAreaType.HEADER);
360:
361:                theme.setPaintingToolbarDropShadows();
362:
363:                this .theme = theme;
364:                this .buttonShaper = new ClassicButtonShaper();
365:                this .watermark = new SubstanceNullWatermark();
366:                this .gradientPainter = new MatteGradientPainter();
367:                this .borderPainter = new ClassicInnerBorderPainter(0.8f,
368:                        ColorShiftKind.TINT);
369:
370:                this .highlightPainter = new ClassicHighlightPainter();
371:
372:                MarbleNoiseDecorationPainter decorationPainter = new MarbleNoiseDecorationPainter();
373:                decorationPainter.setPaintingSeparators(true);
374:                decorationPainter.setTextureAlpha(0.7f);
375:                this .decorationPainter = decorationPainter;
376:
377:                tabBackgroundComposite = new AlphaControlBackgroundComposite(
378:                        0.75f);
379:            }
380:
381:            /*
382:             * (non-Javadoc)
383:             * 
384:             * @see org.jvnet.substance.skin.SubstanceSkin#getDisplayName()
385:             */
386:            public String getDisplayName() {
387:                return NAME;
388:            }
389:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.