Source Code Cross Referenced for SubstanceComplexTheme.java in  » Swing-Library » substance-look-feel » org » jvnet » substance » theme » 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.theme 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * Copyright (c) 2005-2008 Substance Kirill Grouchnikov. All Rights Reserved.
0003:         *
0004:         * Redistribution and use in source and binary forms, with or without
0005:         * modification, are permitted provided that the following conditions are met:
0006:         *
0007:         *  o Redistributions of source code must retain the above copyright notice,
0008:         *    this list of conditions and the following disclaimer.
0009:         *
0010:         *  o Redistributions in binary form must reproduce the above copyright notice,
0011:         *    this list of conditions and the following disclaimer in the documentation
0012:         *    and/or other materials provided with the distribution.
0013:         *
0014:         *  o Neither the name of Substance Kirill Grouchnikov nor the names of
0015:         *    its contributors may be used to endorse or promote products derived
0016:         *    from this software without specific prior written permission.
0017:         *
0018:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0019:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
0020:         * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0021:         * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
0022:         * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0023:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0024:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
0025:         * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0026:         * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
0027:         * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
0028:         * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0029:         */
0030:        package org.jvnet.substance.theme;
0031:
0032:        import java.awt.Color;
0033:        import java.awt.Component;
0034:        import java.util.*;
0035:
0036:        import javax.swing.JTabbedPane;
0037:
0038:        import org.jvnet.lafwidget.animation.FadeKind;
0039:        import org.jvnet.substance.painter.SubstanceGradientPainter;
0040:        import org.jvnet.substance.painter.decoration.DecorationAreaType;
0041:        import org.jvnet.substance.theme.transform.ShiftTransform;
0042:        import org.jvnet.substance.theme.transform.ThemeTransform;
0043:        import org.jvnet.substance.utils.*;
0044:
0045:        /**
0046:         * Complex theme. A complex theme is defined by four separate themes:
0047:         * <ul>
0048:         * <li>Active theme - used for the active (selected, pressed, rolled over)
0049:         * controls.
0050:         * <li>Default theme - used for inactive enabled controls.
0051:         * <li>Disabled theme - used for disabled controls.
0052:         * <li>Active title pane theme - used for title panes of active windows.
0053:         * </ul>
0054:         * This class is part of officially supported API.
0055:         * 
0056:         * @author Kirill Grouchnikov
0057:         */
0058:        public class SubstanceComplexTheme extends SubstanceTheme {
0059:            /**
0060:             * Theme for controls in active visual state.
0061:             */
0062:            protected SubstanceTheme activeTheme;
0063:
0064:            /**
0065:             * Theme for controls in default visual state.
0066:             */
0067:            protected SubstanceTheme defaultTheme;
0068:
0069:            /**
0070:             * Theme for controls in disabled visual state.
0071:             */
0072:            protected SubstanceTheme disabledTheme;
0073:
0074:            /**
0075:             * Theme for title panes of active windows.
0076:             */
0077:            protected SubstanceTheme activeTitlePaneTheme;
0078:
0079:            /**
0080:             * Theme for title panes of inactive windows.
0081:             */
0082:            protected SubstanceTheme defaultTitlePaneTheme;
0083:
0084:            /**
0085:             * Theme for watermarks.
0086:             */
0087:            protected SubstanceTheme watermarkTheme;
0088:
0089:            /**
0090:             * Maps from component state to the matching themes. This map doesn't have
0091:             * to contain entries for all {@link ComponentState} instances.
0092:             */
0093:            protected Map<ComponentState, SubstanceTheme> stateThemeMap;
0094:
0095:            /**
0096:             * Maps from component state to the alpha channel applied on theme. This map
0097:             * doesn't have to contain entries for all {@link ComponentState} instances.
0098:             */
0099:            protected Map<ComponentState, Float> stateThemeAlphaMap;
0100:
0101:            /**
0102:             * Maps from component state to the matching themes for highlight themes.
0103:             * This map doesn't have to contain entries for all {@link ComponentState}
0104:             * instances.
0105:             */
0106:            protected Map<ComponentState, SubstanceTheme> stateHighlightThemeMap;
0107:
0108:            /**
0109:             * Maps from component state to the alpha channel applied on highlight
0110:             * theme. This map doesn't have to contain entries for all
0111:             * {@link ComponentState} instances.
0112:             */
0113:            protected Map<ComponentState, Float> stateHighlightThemeAlphaMap;
0114:
0115:            protected Map<DecorationAreaType, SubstanceTheme> decorationThemeMap;
0116:
0117:            protected Set<DecorationAreaType> decoratedAreaSet;
0118:
0119:            protected Set<DecorationAreaType> toUseDecorationOnActiveControls;
0120:
0121:            /**
0122:             * Painter for painting the non-active controls.
0123:             */
0124:            protected SubstanceGradientPainter nonActivePainter;
0125:
0126:            /**
0127:             * The start of fade effect on the selected tabs in {@link JTabbedPane}s.
0128:             * 
0129:             * @see #selectedTabFadeEnd
0130:             */
0131:            protected double selectedTabFadeStart;
0132:
0133:            /**
0134:             * The end of fade effect on the selected tabs in {@link JTabbedPane}s.
0135:             * 
0136:             * @see #selectedTabFadeStart
0137:             */
0138:            protected double selectedTabFadeEnd;
0139:
0140:            protected boolean isPaintingToolbarDropShadows;
0141:
0142:            /**
0143:             * If <code>true</code>, the light background color and the background
0144:             * color are the same.
0145:             * 
0146:             * @since version 4.0
0147:             */
0148:            protected boolean useSameBackgroundColor;
0149:
0150:            /**
0151:             * Creates a new complex theme.
0152:             * 
0153:             * @param displayName
0154:             *            Theme display name.
0155:             * @param themeKind
0156:             *            Theme kind.
0157:             * @param activeTheme
0158:             *            Active theme.
0159:             * @param defaultTheme
0160:             *            Default theme.
0161:             * @param disabledTheme
0162:             *            Disabled theme.
0163:             */
0164:            public SubstanceComplexTheme(String displayName,
0165:                    ThemeKind themeKind, SubstanceTheme activeTheme,
0166:                    SubstanceTheme defaultTheme, SubstanceTheme disabledTheme) {
0167:                this (displayName, themeKind, activeTheme, defaultTheme,
0168:                        disabledTheme, activeTheme, defaultTheme);
0169:            }
0170:
0171:            /**
0172:             * Creates a new complex theme.
0173:             * 
0174:             * @param displayName
0175:             *            Theme display name.
0176:             * @param themeKind
0177:             *            Theme kind.
0178:             * @param activeTheme
0179:             *            Active theme.
0180:             * @param defaultTheme
0181:             *            Default theme.
0182:             * @param disabledTheme
0183:             *            Disabled theme.
0184:             * @param activeTitlePaneTheme
0185:             *            Active title pane theme.
0186:             */
0187:            public SubstanceComplexTheme(String displayName,
0188:                    ThemeKind themeKind, SubstanceTheme activeTheme,
0189:                    SubstanceTheme defaultTheme, SubstanceTheme disabledTheme,
0190:                    SubstanceTheme activeTitlePaneTheme) {
0191:                this (displayName, themeKind, activeTheme, defaultTheme,
0192:                        disabledTheme, activeTitlePaneTheme, defaultTheme);
0193:            }
0194:
0195:            /**
0196:             * Creates a new complex theme.
0197:             * 
0198:             * @param displayName
0199:             *            Theme display name.
0200:             * @param themeKind
0201:             *            Theme kind.
0202:             * @param activeTheme
0203:             *            Active theme.
0204:             * @param defaultTheme
0205:             *            Default theme.
0206:             * @param disabledTheme
0207:             *            Disabled theme.
0208:             * @param activeTitlePaneTheme
0209:             *            Active title pane theme.
0210:             * @param watermarkTheme
0211:             *            Watermark theme.
0212:             */
0213:            public SubstanceComplexTheme(String displayName,
0214:                    ThemeKind themeKind, SubstanceTheme activeTheme,
0215:                    SubstanceTheme defaultTheme, SubstanceTheme disabledTheme,
0216:                    SubstanceTheme activeTitlePaneTheme,
0217:                    SubstanceTheme watermarkTheme) {
0218:                super (defaultTheme.getColorScheme(), displayName, themeKind);
0219:                this .activeTheme = SubstanceThemeUtilities
0220:                        .getConstantTheme(activeTheme);
0221:                this .defaultTheme = SubstanceThemeUtilities
0222:                        .getConstantTheme(defaultTheme);
0223:                this .disabledTheme = SubstanceThemeUtilities
0224:                        .getConstantTheme(disabledTheme);
0225:                this .activeTitlePaneTheme = SubstanceThemeUtilities
0226:                        .getConstantTheme(activeTitlePaneTheme);
0227:                this .watermarkTheme = SubstanceThemeUtilities
0228:                        .getConstantTheme(watermarkTheme);
0229:                this .selectedTabFadeStart = 1.0;
0230:                this .selectedTabFadeEnd = 1.0;
0231:                this .useSameBackgroundColor = false;
0232:
0233:                this .stateThemeMap = new HashMap<ComponentState, SubstanceTheme>();
0234:                this .stateThemeAlphaMap = new HashMap<ComponentState, Float>();
0235:                this .stateHighlightThemeMap = new HashMap<ComponentState, SubstanceTheme>();
0236:                this .stateHighlightThemeAlphaMap = new HashMap<ComponentState, Float>();
0237:                this .decoratedAreaSet = new HashSet<DecorationAreaType>();
0238:                this .decorationThemeMap = new HashMap<DecorationAreaType, SubstanceTheme>();
0239:                this .toUseDecorationOnActiveControls = new HashSet<DecorationAreaType>();
0240:
0241:                this .decorationThemeMap.put(
0242:                        DecorationAreaType.PRIMARY_TITLE_PANE,
0243:                        this .activeTitlePaneTheme);
0244:                this .decorationThemeMap.put(
0245:                        DecorationAreaType.SECONDARY_TITLE_PANE,
0246:                        this .activeTitlePaneTheme);
0247:                this .decoratedAreaSet
0248:                        .add(DecorationAreaType.PRIMARY_TITLE_PANE);
0249:                this .decoratedAreaSet
0250:                        .add(DecorationAreaType.SECONDARY_TITLE_PANE);
0251:            }
0252:
0253:            /*
0254:             * (non-Javadoc)
0255:             * 
0256:             * @see org.jvnet.substance.theme.SubstanceTheme#getActiveTheme()
0257:             */
0258:            @Override
0259:            public SubstanceTheme getActiveTheme() {
0260:                return this .activeTheme;
0261:            }
0262:
0263:            /*
0264:             * (non-Javadoc)
0265:             * 
0266:             * @see org.jvnet.substance.theme.SubstanceTheme#getDefaultTheme()
0267:             */
0268:            @Override
0269:            public SubstanceTheme getDefaultTheme() {
0270:                return this .defaultTheme;
0271:            }
0272:
0273:            /*
0274:             * (non-Javadoc)
0275:             * 
0276:             * @see org.jvnet.substance.theme.SubstanceTheme#getDisabledTheme()
0277:             */
0278:            @Override
0279:            public SubstanceTheme getDisabledTheme() {
0280:                return this .disabledTheme;
0281:            }
0282:
0283:            /*
0284:             * (non-Javadoc)
0285:             * 
0286:             * @see org.jvnet.substance.theme.SubstanceTheme#getActiveTitlePaneTheme()
0287:             */
0288:            @Override
0289:            public SubstanceTheme getActiveTitlePaneTheme() {
0290:                return this .activeTitlePaneTheme;
0291:            }
0292:
0293:            /*
0294:             * (non-Javadoc)
0295:             * 
0296:             * @see org.jvnet.substance.theme.SubstanceTheme#getDefaultTitlePaneTheme()
0297:             */
0298:            @Override
0299:            public SubstanceTheme getDefaultTitlePaneTheme() {
0300:                if (this .defaultTitlePaneTheme == null)
0301:                    return this .getActiveTitlePaneTheme();
0302:                return this .defaultTitlePaneTheme;
0303:            }
0304:
0305:            /*
0306:             * (non-Javadoc)
0307:             * 
0308:             * @see org.jvnet.substance.theme.SubstanceTheme#getLightBackgroundColor()
0309:             */
0310:            @Override
0311:            public Color getLightBackgroundColor() {
0312:                if (this .useSameBackgroundColor)
0313:                    return this .getBackgroundColor();
0314:                return super .getLightBackgroundColor();
0315:            }
0316:
0317:            /*
0318:             * (non-Javadoc)
0319:             * 
0320:             * @see org.jvnet.substance.theme.SubstanceTheme#getFirstTheme()
0321:             */
0322:            @Override
0323:            public SubstanceTheme getFirstTheme() {
0324:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0325:                        "First " + this .getDisplayName(), this .getKind(), this 
0326:                                .getActiveTheme().getFirstTheme(), this 
0327:                                .getDefaultTheme().getFirstTheme(), this 
0328:                                .getDisabledTheme().getFirstTheme(), this 
0329:                                .getActiveTitlePaneTheme().getFirstTheme());
0330:                this .copyTo(result, null);
0331:                return result;
0332:            }
0333:
0334:            /*
0335:             * (non-Javadoc)
0336:             * 
0337:             * @see org.jvnet.substance.theme.SubstanceTheme#getSecondTheme()
0338:             */
0339:            @Override
0340:            public SubstanceTheme getSecondTheme() {
0341:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0342:                        "Second " + this .getDisplayName(), this .getKind(), this 
0343:                                .getActiveTheme().getSecondTheme(), this 
0344:                                .getDefaultTheme().getSecondTheme(), this 
0345:                                .getDisabledTheme().getSecondTheme(), this 
0346:                                .getActiveTitlePaneTheme().getSecondTheme());
0347:                this .copyTo(result, null);
0348:                return result;
0349:            }
0350:
0351:            /*
0352:             * (non-Javadoc)
0353:             * 
0354:             * @see org.jvnet.substance.theme.SubstanceTheme#saturate(double, boolean)
0355:             */
0356:            @Override
0357:            public SubstanceTheme saturate(double saturateFactor,
0358:                    boolean toSaturateEverything) {
0359:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0360:                        "Saturated [" + toSaturateEverything + "] "
0361:                                + this .getDisplayName() + " "
0362:                                + (int) (100 * saturateFactor) + "%", this 
0363:                                .getKind(), this .getActiveTheme().saturate(
0364:                                saturateFactor, toSaturateEverything),
0365:                        toSaturateEverything ? this .getDefaultTheme().saturate(
0366:                                saturateFactor, true) : this .getDefaultTheme(),
0367:                        toSaturateEverything ? this .getDisabledTheme()
0368:                                .saturate(saturateFactor, true) : this 
0369:                                .getDisabledTheme(),
0370:                        toSaturateEverything ? this .getActiveTitlePaneTheme()
0371:                                .saturate(saturateFactor, true) : this 
0372:                                .getActiveTitlePaneTheme(),
0373:                        toSaturateEverything ? this .getWatermarkTheme()
0374:                                .saturate(saturateFactor, true) : this 
0375:                                .getWatermarkTheme());
0376:                this .copyTo(result, null);
0377:                return result;
0378:            }
0379:
0380:            @Override
0381:            public SubstanceTheme shift(Color backgroundShiftColor,
0382:                    double backgroundShiftFactor, Color foregroundShiftColor,
0383:                    double foregroundShiftFactor) {
0384:                ThemeTransform shiftTransform = new ShiftTransform(
0385:                        backgroundShiftColor, backgroundShiftFactor,
0386:                        foregroundShiftColor, foregroundShiftFactor);
0387:                ThemeTransform shiftDisabledTransform = new ShiftTransform(
0388:                        backgroundShiftColor, backgroundShiftFactor / 2.0,
0389:                        foregroundShiftColor, foregroundShiftFactor / 2.0);
0390:                // ThemeTransform shiftDisabledTransform = new ShiftDisabledTransform(
0391:                // backgroundShiftColor, backgroundShiftFactor,
0392:                // foregroundShiftColor, foregroundShiftFactor);
0393:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0394:                        "Shift " + this .getDisplayName() + " to ["
0395:                                + backgroundShiftColor + "] "
0396:                                + (int) (100 * backgroundShiftFactor) + "% * ["
0397:                                + foregroundShiftColor + "]"
0398:                                + (int) (100 * foregroundShiftFactor) + "%",
0399:                        this .getKind(), shiftTransform.transform(this 
0400:                                .getActiveTheme()), shiftTransform
0401:                                .transform(this .getDefaultTheme()),
0402:                        shiftDisabledTransform.transform(this 
0403:                                .getDisabledTheme()), shiftTransform
0404:                                .transform(this .getActiveTitlePaneTheme()),
0405:                        shiftTransform.transform(this .getWatermarkTheme()));
0406:                this .copyTo(result, shiftTransform);
0407:                return result;
0408:            }
0409:
0410:            /*
0411:             * (non-Javadoc)
0412:             * 
0413:             * @see org.jvnet.substance.theme.SubstanceTheme#shade(double)
0414:             */
0415:            @Override
0416:            public SubstanceTheme shade(double shadeFactor) {
0417:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0418:                        "Shade " + this .getDisplayName() + " "
0419:                                + (int) (100 * shadeFactor) + "%", this 
0420:                                .getKind(), this .getActiveTheme().shade(
0421:                                shadeFactor), this .getDefaultTheme().shade(
0422:                                shadeFactor), this .getDisabledTheme().shade(
0423:                                shadeFactor), this .getActiveTitlePaneTheme()
0424:                                .shade(shadeFactor), this .getWatermarkTheme()
0425:                                .shade(shadeFactor));
0426:                this .copyTo(result, null);
0427:                return result;
0428:            }
0429:
0430:            /*
0431:             * (non-Javadoc)
0432:             * 
0433:             * @see org.jvnet.substance.theme.SubstanceTheme#tint(double)
0434:             */
0435:            @Override
0436:            public SubstanceTheme tint(double tintFactor) {
0437:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0438:                        "Tint " + this .getDisplayName() + " "
0439:                                + (int) (100 * tintFactor) + "%", this 
0440:                                .getKind(), this .getActiveTheme().tint(
0441:                                tintFactor), this .getDefaultTheme().tint(
0442:                                tintFactor), this .getDisabledTheme().tint(
0443:                                tintFactor), this .getActiveTitlePaneTheme()
0444:                                .tint(tintFactor), this .getWatermarkTheme()
0445:                                .tint(tintFactor));
0446:                this .copyTo(result, null);
0447:                return result;
0448:            }
0449:
0450:            /*
0451:             * (non-Javadoc)
0452:             * 
0453:             * @see org.jvnet.substance.theme.SubstanceTheme#tone(double)
0454:             */
0455:            @Override
0456:            public SubstanceTheme tone(double toneFactor) {
0457:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0458:                        "Tone " + this .getDisplayName() + " "
0459:                                + (int) (100 * toneFactor) + "%", this 
0460:                                .getKind(), this .getActiveTheme().tone(
0461:                                toneFactor), this .getDefaultTheme().tone(
0462:                                toneFactor), this .getDisabledTheme().tone(
0463:                                toneFactor), this .getActiveTitlePaneTheme()
0464:                                .tone(toneFactor), this .getWatermarkTheme()
0465:                                .tone(toneFactor));
0466:                this .copyTo(result, null);
0467:                return result;
0468:            }
0469:
0470:            /*
0471:             * (non-Javadoc)
0472:             * 
0473:             * @see org.jvnet.substance.theme.SubstanceTheme#invert()
0474:             */
0475:            @Override
0476:            public SubstanceTheme invert() {
0477:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0478:                        "Inverted " + this .getDisplayName(), this .getKind(),
0479:                        this .getActiveTheme().invert(), this .getDefaultTheme()
0480:                                .invert(), this .getDisabledTheme().invert(),
0481:                        this .getActiveTitlePaneTheme().invert(), this 
0482:                                .getWatermarkTheme().invert());
0483:                this .copyTo(result, null);
0484:                return result;
0485:            }
0486:
0487:            /*
0488:             * (non-Javadoc)
0489:             * 
0490:             * @see org.jvnet.substance.theme.SubstanceTheme#negate()
0491:             */
0492:            @Override
0493:            public SubstanceTheme negate() {
0494:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0495:                        "Negated " + this .getDisplayName(), this .getKind(),
0496:                        this .getActiveTheme().negate(), this .getDefaultTheme()
0497:                                .negate(), this .getDisabledTheme().negate(),
0498:                        this .getActiveTitlePaneTheme().negate(), this 
0499:                                .getWatermarkTheme().negate());
0500:                this .copyTo(result, null);
0501:                return result;
0502:            }
0503:
0504:            /*
0505:             * (non-Javadoc)
0506:             * 
0507:             * @see org.jvnet.substance.theme.SubstanceTheme#hueShift(double)
0508:             */
0509:            @Override
0510:            public SubstanceTheme hueShift(double hueShiftFactor) {
0511:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0512:                        "Hue-shift " + this .getDisplayName() + " "
0513:                                + (int) (100 * hueShiftFactor) + "%",
0514:                        this .getKind(),
0515:                        this .getActiveTheme().hueShift(hueShiftFactor),
0516:                        this .getDefaultTheme().hueShift(hueShiftFactor),
0517:                        this .getDisabledTheme().hueShift(hueShiftFactor),
0518:                        this .getActiveTitlePaneTheme().hueShift(hueShiftFactor),
0519:                        this .getWatermarkTheme().hueShift(hueShiftFactor));
0520:                this .copyTo(result, null);
0521:                return result;
0522:            }
0523:
0524:            /*
0525:             * (non-Javadoc)
0526:             * 
0527:             * @see org.jvnet.substance.theme.SubstanceTheme#protanopia()
0528:             */
0529:            @Override
0530:            public SubstanceTheme protanopia() {
0531:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0532:                        "Protanopia " + this .getDisplayName(), this .getKind(),
0533:                        this .getActiveTheme().protanopia(), this 
0534:                                .getDefaultTheme().protanopia(), this 
0535:                                .getDisabledTheme().protanopia(), this 
0536:                                .getActiveTitlePaneTheme().protanopia(), this 
0537:                                .getWatermarkTheme().protanopia());
0538:                this .copyTo(result, null);
0539:                return result;
0540:            }
0541:
0542:            /*
0543:             * (non-Javadoc)
0544:             * 
0545:             * @see org.jvnet.substance.theme.SubstanceTheme#tritanopia()
0546:             */
0547:            @Override
0548:            public SubstanceTheme tritanopia() {
0549:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0550:                        "Tritanopia " + this .getDisplayName(), this .getKind(),
0551:                        this .getActiveTheme().tritanopia(), this 
0552:                                .getDefaultTheme().tritanopia(), this 
0553:                                .getDisabledTheme().tritanopia(), this 
0554:                                .getActiveTitlePaneTheme().tritanopia(), this 
0555:                                .getWatermarkTheme().tritanopia());
0556:                this .copyTo(result, null);
0557:                return result;
0558:            }
0559:
0560:            /*
0561:             * (non-Javadoc)
0562:             * 
0563:             * @see org.jvnet.substance.theme.SubstanceTheme#deuteranopia()
0564:             */
0565:            @Override
0566:            public SubstanceTheme deuteranopia() {
0567:                SubstanceComplexTheme result = new SubstanceComplexTheme(
0568:                        "Deuteranopia " + this .getDisplayName(),
0569:                        this .getKind(), this .getActiveTheme().deuteranopia(),
0570:                        this .getDefaultTheme().deuteranopia(), this 
0571:                                .getDisabledTheme().deuteranopia(), this 
0572:                                .getActiveTitlePaneTheme().deuteranopia(), this 
0573:                                .getWatermarkTheme().deuteranopia());
0574:                this .copyTo(result, null);
0575:                return result;
0576:            }
0577:
0578:            /*
0579:             * (non-Javadoc)
0580:             * 
0581:             * @see org.jvnet.substance.theme.SubstanceTheme#getWatermarkTheme()
0582:             */
0583:            @Override
0584:            public SubstanceTheme getWatermarkTheme() {
0585:                return this .watermarkTheme;
0586:            }
0587:
0588:            /*
0589:             * (non-Javadoc)
0590:             * 
0591:             * @see org.jvnet.substance.theme.SubstanceTheme#getScrollbarTrackPainter()
0592:             */
0593:            @Override
0594:            public SubstanceGradientPainter getNonActivePainter() {
0595:                if (this .nonActivePainter != null)
0596:                    return this .nonActivePainter;
0597:                return super .getNonActivePainter();
0598:            }
0599:
0600:            /**
0601:             * Sets the painter for painting the non-active controls.
0602:             * 
0603:             * @param nonActivePainter
0604:             *            Painter for painting the non-active controls.
0605:             * @deprecated This functionality will be moved to the base skin class in
0606:             *             version 5.0.
0607:             */
0608:            public void setNonActivePainter(
0609:                    SubstanceGradientPainter nonActivePainter) {
0610:                this .nonActivePainter = nonActivePainter;
0611:            }
0612:
0613:            /**
0614:             * Sets the theme for title panes of inactive windows.
0615:             * 
0616:             * @param defaultTitlePaneTheme
0617:             *            Theme for title panes of inactive windows.
0618:             * @since version 3.3
0619:             * @deprecated This functionality will be moved to the base skin class in
0620:             *             version 5.0.
0621:             */
0622:            public void setDefaultTitlePaneTheme(
0623:                    SubstanceTheme defaultTitlePaneTheme) {
0624:                this .defaultTitlePaneTheme = defaultTitlePaneTheme;
0625:            }
0626:
0627:            /**
0628:             * Sets the theme for the default visual state.
0629:             * 
0630:             * @param defaultTheme
0631:             *            The theme for the default visual state.
0632:             * @since version 4.0
0633:             * @deprecated This functionality will be moved to the base skin class in
0634:             *             version 5.0.
0635:             */
0636:            public void setDefaultTheme(SubstanceTheme defaultTheme) {
0637:                this .defaultTheme = defaultTheme;
0638:            }
0639:
0640:            /**
0641:             * Sets the theme for the disabled visual state.
0642:             * 
0643:             * @param disabledTheme
0644:             *            The theme for the disabled visual state.
0645:             * @since version 4.0
0646:             * @deprecated This functionality will be moved to the base skin class in
0647:             *             version 5.0.
0648:             */
0649:            public void setDisabledTheme(SubstanceTheme disabledTheme) {
0650:                this .disabledTheme = disabledTheme;
0651:            }
0652:
0653:            /**
0654:             * Sets the theme for the active visual state.
0655:             * 
0656:             * @param activeTheme
0657:             *            The theme for the active visual state.
0658:             * @since version 4.0
0659:             * @deprecated This functionality will be moved to the base skin class in
0660:             *             version 5.0.
0661:             */
0662:            public void setActiveTheme(SubstanceTheme activeTheme) {
0663:                this .activeTheme = activeTheme;
0664:            }
0665:
0666:            /**
0667:             * Sets the theme for the title panes of active windows.
0668:             * 
0669:             * @param activeTitlePaneTheme
0670:             *            The theme for the title panes of active windows.
0671:             * @since version 4.0
0672:             * @deprecated This functionality will be moved to the base skin class in
0673:             *             version 5.0.
0674:             */
0675:            public void setActiveTitlePaneTheme(
0676:                    SubstanceTheme activeTitlePaneTheme) {
0677:                this .activeTitlePaneTheme = activeTitlePaneTheme;
0678:
0679:                this .decorationThemeMap.put(
0680:                        DecorationAreaType.PRIMARY_TITLE_PANE,
0681:                        activeTitlePaneTheme);
0682:                this .decorationThemeMap.put(
0683:                        DecorationAreaType.SECONDARY_TITLE_PANE,
0684:                        activeTitlePaneTheme);
0685:            }
0686:
0687:            /**
0688:             * Sets the theme for the watermark.
0689:             * 
0690:             * @param watermarkTheme
0691:             *            The theme for the watermark.
0692:             * @since version 4.0
0693:             * @deprecated This functionality will be moved to the base skin class in
0694:             *             version 5.0.
0695:             */
0696:            public void setWatermarkTheme(SubstanceTheme watermarkTheme) {
0697:                this .watermarkTheme = watermarkTheme;
0698:            }
0699:
0700:            /*
0701:             * (non-Javadoc)
0702:             * 
0703:             * @see org.jvnet.substance.theme.SubstanceTheme#getSelectedTabFadeStart()
0704:             */
0705:            @Override
0706:            public double getSelectedTabFadeStart() {
0707:                return this .selectedTabFadeStart;
0708:            }
0709:
0710:            /*
0711:             * (non-Javadoc)
0712:             * 
0713:             * @see org.jvnet.substance.theme.SubstanceTheme#getSelectedTabFadeEnd()
0714:             */
0715:            @Override
0716:            public double getSelectedTabFadeEnd() {
0717:                return this .selectedTabFadeEnd;
0718:            }
0719:
0720:            /**
0721:             * Sets the end of fade effect on the selected tabs in {@link JTabbedPane}s.
0722:             * The value should be in 0.0-1.0 range.
0723:             * 
0724:             * @param selectedTabFadeEnd
0725:             *            The end of fade effect on the selected tabs in
0726:             *            {@link JTabbedPane}s. Should be in 0.0-1.0 range.
0727:             * @deprecated This functionality will be moved to the base skin class in
0728:             *             version 5.0.
0729:             */
0730:            public void setSelectedTabFadeEnd(double selectedTabFadeEnd) {
0731:                this .selectedTabFadeEnd = selectedTabFadeEnd;
0732:            }
0733:
0734:            /**
0735:             * Sets the start of fade effect on the selected tabs in {@link JTabbedPane}s.
0736:             * The value should be in 0.0-1.0 range.
0737:             * 
0738:             * @param selectedTabFadeStart
0739:             *            The start of fade effect on the selected tabs in
0740:             *            {@link JTabbedPane}s. Should be in 0.0-1.0 range.
0741:             * @deprecated This functionality will be moved to the base skin class in
0742:             *             version 5.0.
0743:             */
0744:            public void setSelectedTabFadeStart(double selectedTabFadeStart) {
0745:                this .selectedTabFadeStart = selectedTabFadeStart;
0746:            }
0747:
0748:            /**
0749:             * Sets usage of background color for light background color.
0750:             * 
0751:             * @param useSameBackgroundColor
0752:             *            if <code>true</code>, the light background color and the
0753:             *            background color are the same.
0754:             * @deprecated This functionality will be moved to the base skin class in
0755:             *             version 5.0.
0756:             */
0757:            public void setUseSameBackgroundColor(boolean useSameBackgroundColor) {
0758:                this .useSameBackgroundColor = useSameBackgroundColor;
0759:            }
0760:
0761:            /**
0762:             * Registers a theme for the specific component state.
0763:             * 
0764:             * @param stateTheme
0765:             *            Theme for the specified component state.
0766:             * @param alpha
0767:             *            Alpha channel for the theme.
0768:             * @param useForHighlights
0769:             *            if <code>true</code>, the specified theme will be used as
0770:             *            highlight theme as well (for the same component state).
0771:             * @param states
0772:             *            Component states.
0773:             * @deprecated This functionality will be moved to the base skin class in
0774:             *             version 5.0.
0775:             */
0776:            public void registerComponentStateTheme(SubstanceTheme stateTheme,
0777:                    float alpha, boolean useForHighlights,
0778:                    ComponentState... states) {
0779:                if (states != null) {
0780:                    for (ComponentState state : states) {
0781:                        this .stateThemeMap.put(state, stateTheme);
0782:                        this .stateThemeAlphaMap.put(state, alpha);
0783:                    }
0784:                }
0785:                if (useForHighlights) {
0786:                    this .registerComponentHighlightStateTheme(stateTheme,
0787:                            alpha, states);
0788:                }
0789:            }
0790:
0791:            /**
0792:             * Registers a theme for the specific component state.
0793:             * 
0794:             * @param stateTheme
0795:             *            Theme for the specified component state.
0796:             * @param useForHighlights
0797:             *            if <code>true</code>, the specified theme will be used as
0798:             *            highlight theme as well (for the same component state).
0799:             * @param states
0800:             *            Component states.
0801:             * @deprecated This functionality will be moved to the base skin class in
0802:             *             version 5.0.
0803:             */
0804:            public void registerComponentStateTheme(SubstanceTheme stateTheme,
0805:                    boolean useForHighlights, ComponentState... states) {
0806:                this .registerComponentStateTheme(stateTheme, 1.0f,
0807:                        useForHighlights, states);
0808:            }
0809:
0810:            /**
0811:             * Registers a highlight theme for the specific component state if the
0812:             * component state is not <code>null</code>, or a global highlight theme
0813:             * otherwise.
0814:             * 
0815:             * @param stateHighlightTheme
0816:             *            Highlight theme for the specified component state.
0817:             * @param states
0818:             *            Component states. If <code>null</code>, the specified theme
0819:             *            will be applied for all states left unspecified.
0820:             * @deprecated This functionality will be moved to the base skin class in
0821:             *             version 5.0.
0822:             */
0823:            public void registerComponentHighlightStateTheme(
0824:                    SubstanceTheme stateHighlightTheme,
0825:                    ComponentState... states) {
0826:                if ((states == null) || (states.length == 0)) {
0827:                    for (ComponentState state : ComponentState.values()) {
0828:                        if (this .stateHighlightThemeMap.containsKey(state))
0829:                            continue;
0830:                        if (!state.isKindActive(FadeKind.ENABLE))
0831:                            continue;
0832:                        if (state == ComponentState.DEFAULT)
0833:                            continue;
0834:                        this .stateHighlightThemeMap.put(state,
0835:                                stateHighlightTheme);
0836:                    }
0837:                } else {
0838:                    for (ComponentState state : states) {
0839:                        this .stateHighlightThemeMap.put(state,
0840:                                stateHighlightTheme);
0841:                    }
0842:                }
0843:            }
0844:
0845:            /**
0846:             * Registers a highlight theme for the specific component state if the
0847:             * component state is not <code>null</code>, or a global highlight theme
0848:             * otherwise.
0849:             * 
0850:             * @param stateHighlightTheme
0851:             *            Highlight theme for the specified component state.
0852:             * @param alpha
0853:             *            Alpha channel for the highlight theme.
0854:             * @param states
0855:             *            Component states. If <code>null</code>, the specified theme
0856:             *            will be applied for all states left unspecified.
0857:             * @deprecated This functionality will be moved to the base skin class in
0858:             *             version 5.0.
0859:             */
0860:            public void registerComponentHighlightStateTheme(
0861:                    SubstanceTheme stateHighlightTheme, float alpha,
0862:                    ComponentState... states) {
0863:                if ((states == null) || (states.length == 0)) {
0864:                    for (ComponentState state : ComponentState.values()) {
0865:                        if (!state.isKindActive(FadeKind.ENABLE))
0866:                            continue;
0867:                        if (state == ComponentState.DEFAULT)
0868:                            continue;
0869:                        if (!this .stateHighlightThemeMap.containsKey(state))
0870:                            this .stateHighlightThemeMap.put(state,
0871:                                    stateHighlightTheme);
0872:                        if (!this .stateHighlightThemeAlphaMap
0873:                                .containsKey(state))
0874:                            this .stateHighlightThemeAlphaMap.put(state, alpha);
0875:                    }
0876:                } else {
0877:                    for (ComponentState state : states) {
0878:                        this .stateHighlightThemeMap.put(state,
0879:                                stateHighlightTheme);
0880:                        this .stateHighlightThemeAlphaMap.put(state, alpha);
0881:                    }
0882:                }
0883:            }
0884:
0885:            @Override
0886:            public SubstanceTheme getTheme(Component comp,
0887:                    ComponentState componentState) {
0888:                return this .getTheme(comp, componentState, false);
0889:            }
0890:
0891:            @Override
0892:            public SubstanceTheme getTheme(Component comp,
0893:                    ComponentState componentState, boolean toIgnoreHighlights) {
0894:                if (!toIgnoreHighlights
0895:                        && SubstanceHighlightManager.getInstance()
0896:                                .toUseHighlightTheme(comp)) {
0897:                    SubstanceTheme registered = this .stateHighlightThemeMap
0898:                            .get(componentState);
0899:                    if (registered != null)
0900:                        return registered;
0901:                } else {
0902:                    SubstanceTheme registered = this .stateThemeMap
0903:                            .get(componentState);
0904:                    if (registered != null)
0905:                        return registered;
0906:                }
0907:                return super .getTheme(comp, componentState, toIgnoreHighlights);
0908:            }
0909:
0910:            /*
0911:             * (non-Javadoc)
0912:             * 
0913:             * @see org.jvnet.substance.theme.SubstanceTheme#getHighlightTheme(java.awt.Component,
0914:             *      org.jvnet.substance.utils.ComponentState)
0915:             */
0916:            @Override
0917:            public SubstanceTheme getHighlightTheme(Component comp,
0918:                    ComponentState componentState) {
0919:                SubstanceTheme registered = this .stateHighlightThemeMap
0920:                        .get(componentState);
0921:                if (registered != null)
0922:                    return registered;
0923:                return super .getHighlightTheme(comp, componentState);
0924:            }
0925:
0926:            /*
0927:             * (non-Javadoc)
0928:             * 
0929:             * @see org.jvnet.substance.theme.SubstanceTheme#getHighlightThemeAlpha(java.awt.Component,
0930:             *      org.jvnet.substance.utils.ComponentState)
0931:             */
0932:            @Override
0933:            public float getHighlightThemeAlpha(Component comp,
0934:                    ComponentState componentState) {
0935:                Float registered = this .stateHighlightThemeAlphaMap
0936:                        .get(componentState);
0937:                if (registered != null)
0938:                    return registered.floatValue();
0939:                return super .getHighlightThemeAlpha(comp, componentState);
0940:            }
0941:
0942:            /*
0943:             * (non-Javadoc)
0944:             * 
0945:             * @see org.jvnet.substance.theme.SubstanceTheme#getThemeAlpha(java.awt.Component,
0946:             *      org.jvnet.substance.utils.ComponentState)
0947:             */
0948:            @Override
0949:            public float getThemeAlpha(Component comp,
0950:                    ComponentState componentState) {
0951:                Float registered = this .stateThemeAlphaMap.get(componentState);
0952:                if (registered != null)
0953:                    return registered.floatValue();
0954:                return super .getThemeAlpha(comp, componentState);
0955:            }
0956:
0957:            /**
0958:             * Copies theme-agnostic settings of <code>this</code> theme to the
0959:             * specified theme.
0960:             * 
0961:             * @param dst
0962:             *            Theme to copy to.
0963:             * @param shiftTransform
0964:             *            Transformation to apply to the copied settings.
0965:             */
0966:            protected void copyTo(SubstanceComplexTheme dst,
0967:                    ThemeTransform shiftTransform) {
0968:                dst.setNonActivePainter(this .nonActivePainter);
0969:                dst.setSelectedTabFadeStart(this .selectedTabFadeStart);
0970:                dst.setSelectedTabFadeEnd(this .selectedTabFadeEnd);
0971:                dst.setUseSameBackgroundColor(this .useSameBackgroundColor);
0972:                for (Map.Entry<ComponentState, SubstanceTheme> entry : this .stateThemeMap
0973:                        .entrySet()) {
0974:                    float alpha = this .stateThemeAlphaMap.get(entry.getKey());
0975:                    if (shiftTransform == null)
0976:                        dst.registerComponentStateTheme(entry.getValue(),
0977:                                alpha, false, entry.getKey());
0978:                    else
0979:                        dst.registerComponentStateTheme(shiftTransform
0980:                                .transform(entry.getValue()), alpha, false,
0981:                                entry.getKey());
0982:                }
0983:                for (Map.Entry<ComponentState, SubstanceTheme> entry : this .stateHighlightThemeMap
0984:                        .entrySet()) {
0985:                    ComponentState state = entry.getKey();
0986:                    if (this .stateHighlightThemeAlphaMap.containsKey(state)) {
0987:                        float alpha = this .stateHighlightThemeAlphaMap
0988:                                .get(state);
0989:                        if (shiftTransform == null)
0990:                            dst.registerComponentHighlightStateTheme(entry
0991:                                    .getValue(), alpha, entry.getKey());
0992:                        else
0993:                            dst.registerComponentHighlightStateTheme(
0994:                                    shiftTransform.transform(entry.getValue()),
0995:                                    alpha, entry.getKey());
0996:                    } else {
0997:                        if (shiftTransform == null)
0998:                            dst.registerComponentHighlightStateTheme(entry
0999:                                    .getValue(), entry.getKey());
1000:                        else
1001:                            dst.registerComponentHighlightStateTheme(
1002:                                    shiftTransform.transform(entry.getValue()),
1003:                                    entry.getKey());
1004:                    }
1005:                }
1006:            }
1007:
1008:            /**
1009:             * Registers the specified theme to be used on controls in decoration areas.
1010:             * 
1011:             * @param decorationTheme
1012:             *            The theme to use on controls in decoration areas.
1013:             * @param toUseOnActiveControls
1014:             *            If <code>false</code>, the parameter theme will only be
1015:             *            used on controls in default state. In this case, controls in
1016:             *            disabled or active states will use the global theme.
1017:             * @param areaTypes
1018:             *            Enumerates the area types that are affected by the parameter
1019:             *            theme.
1020:             * @since version 4.3
1021:             * @deprecated This functionality will be moved to the base skin class in
1022:             *             version 5.0.
1023:             */
1024:            public void registerDecorationAreaTheme(
1025:                    SubstanceTheme decorationTheme,
1026:                    boolean toUseOnActiveControls,
1027:                    DecorationAreaType... areaTypes) {
1028:                if (decorationTheme == null)
1029:                    return;
1030:
1031:                SubstanceTheme theme = toUseOnActiveControls ? decorationTheme
1032:                        : SubstanceThemeUtilities
1033:                                .getConstantTheme(decorationTheme);
1034:                for (DecorationAreaType areaType : areaTypes) {
1035:                    this .decoratedAreaSet.add(areaType);
1036:                    this .decorationThemeMap.put(areaType, theme);
1037:                    if (toUseOnActiveControls) {
1038:                        this .toUseDecorationOnActiveControls.add(areaType);
1039:                    }
1040:                }
1041:            }
1042:
1043:            /*
1044:             * (non-Javadoc)
1045:             * 
1046:             * @see org.jvnet.substance.theme.SubstanceTheme#getDecorationTheme(org.jvnet.substance.painter.decoration.DecorationAreaType)
1047:             */
1048:            @Override
1049:            public SubstanceTheme getDecorationTheme(
1050:                    DecorationAreaType decorationType) {
1051:                SubstanceTheme result = this .decorationThemeMap
1052:                        .get(decorationType);
1053:                if (result != null)
1054:                    return result;
1055:                return this ;
1056:            }
1057:
1058:            /*
1059:             * (non-Javadoc)
1060:             * 
1061:             * @see org.jvnet.substance.theme.SubstanceTheme#toUseDecorationPainter(org.jvnet.substance.painter.decoration.DecorationAreaType)
1062:             */
1063:            @Override
1064:            public boolean toUseDecorationPainter(
1065:                    DecorationAreaType decorationType) {
1066:                return this .decoratedAreaSet.contains(decorationType);
1067:            }
1068:
1069:            /*
1070:             * (non-Javadoc)
1071:             * 
1072:             * @see org.jvnet.substance.theme.SubstanceTheme#toUseDecorationThemeOnActiveControls(org.jvnet.substance.painter.decoration.DecorationAreaType)
1073:             */
1074:            @Override
1075:            public boolean toUseDecorationThemeOnActiveControls(
1076:                    DecorationAreaType decorationType) {
1077:                return this .toUseDecorationOnActiveControls
1078:                        .contains(decorationType);
1079:            }
1080:
1081:            /*
1082:             * (non-Javadoc)
1083:             * 
1084:             * @see org.jvnet.substance.theme.SubstanceTheme#isPaintingToolbarDropShadows()
1085:             */
1086:            @Override
1087:            public boolean isPaintingToolbarDropShadows() {
1088:                return this .isPaintingToolbarDropShadows;
1089:            }
1090:
1091:            /**
1092:             * Marks the toolbars to have drop shadows on the top few pixels.
1093:             * 
1094:             * @since version 4.3
1095:             * @deprecated This functionality will be moved to the base skin class in
1096:             *             version 5.0.
1097:             */
1098:            public void setPaintingToolbarDropShadows() {
1099:                this .isPaintingToolbarDropShadows = true;
1100:            }
1101:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.