Source Code Cross Referenced for MetalThemeTest.java in  » Apache-Harmony-Java-SE » javax-package » javax » swing » plaf » metal » 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 » Apache Harmony Java SE » javax package » javax.swing.plaf.metal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:        /**
018:         * @author Sergey Burlak
019:         * @version $Revision$
020:         */package javax.swing.plaf.metal;
021:
022:        import javax.swing.SwingTestCase;
023:        import javax.swing.UIDefaults;
024:        import javax.swing.plaf.ColorUIResource;
025:        import javax.swing.plaf.FontUIResource;
026:
027:        public class MetalThemeTest extends SwingTestCase {
028:            private TestMetalTheme metalTheme;
029:
030:            @Override
031:            public void setUp() {
032:                metalTheme = new TestMetalTheme();
033:            }
034:
035:            @Override
036:            public void tearDown() {
037:                metalTheme = null;
038:            }
039:
040:            public void testGetWindowTitleInactiveForeground() {
041:                assertSame(metalTheme.getWindowTitleInactiveForeground(),
042:                        metalTheme.getBlackPublic());
043:            }
044:
045:            public void testGetWindowTitleInactiveBackground() {
046:                assertEquals(metalTheme.getSecondary3(), metalTheme
047:                        .getWindowTitleInactiveBackground());
048:            }
049:
050:            public void testGetWindowTitleForeground() {
051:                assertSame(metalTheme.getWindowTitleForeground(), metalTheme
052:                        .getBlackPublic());
053:            }
054:
055:            public void testGetWindowTitleBackground() {
056:                assertEquals(metalTheme.getPrimary3(), metalTheme
057:                        .getWindowTitleBackground());
058:            }
059:
060:            public void testGetWindowBackground() {
061:                assertSame(metalTheme.getWindowBackground(), metalTheme
062:                        .getWhitePublic());
063:            }
064:
065:            public void testGetWhite() {
066:                assertEquals(new ColorUIResource(255, 255, 255), metalTheme
067:                        .getWhitePublic());
068:            }
069:
070:            public void testGetUserTextColor() {
071:                assertSame(metalTheme.getUserTextColor(), metalTheme
072:                        .getBlackPublic());
073:            }
074:
075:            public void testGetTextHighlightColor() {
076:                assertEquals(metalTheme.getPrimary3(), metalTheme
077:                        .getTextHighlightColor());
078:            }
079:
080:            public void testGetSystemTextColor() {
081:                assertSame(metalTheme.getSystemTextColor(), metalTheme
082:                        .getBlackPublic());
083:            }
084:
085:            public void testGetSeparatorForeground() {
086:                assertEquals(metalTheme.getPrimary1(), metalTheme
087:                        .getSeparatorForeground());
088:            }
089:
090:            public void testGetSeparatorBackground() {
091:                assertSame(metalTheme.getSeparatorBackground(), metalTheme
092:                        .getWhitePublic());
093:            }
094:
095:            public void testGetPrimaryControlShadow() {
096:                assertEquals(metalTheme.getPrimary2(), metalTheme
097:                        .getPrimaryControlShadow());
098:            }
099:
100:            public void testGetPrimaryControlInfo() {
101:                assertSame(metalTheme.getPrimaryControlInfo(), metalTheme
102:                        .getBlackPublic());
103:            }
104:
105:            public void testGetPrimaryControlHighlight() {
106:                assertSame(metalTheme.getPrimaryControlHighlight(), metalTheme
107:                        .getWhitePublic());
108:            }
109:
110:            public void testGetPrimaryControlDarkShadow() {
111:                assertEquals(metalTheme.getPrimary1(), metalTheme
112:                        .getPrimaryControlDarkShadow());
113:            }
114:
115:            public void testGetPrimaryControl() {
116:                assertEquals(metalTheme.getPrimary3(), metalTheme
117:                        .getPrimaryControl());
118:            }
119:
120:            public void testGetMenuSelectedForeground() {
121:                assertSame(metalTheme.getMenuSelectedForeground(), metalTheme
122:                        .getBlackPublic());
123:            }
124:
125:            public void testGetMenuSelectedBackground() {
126:                assertEquals(metalTheme.getPrimary2(), metalTheme
127:                        .getMenuSelectedBackground());
128:            }
129:
130:            public void testGetMenuForeground() {
131:                assertSame(metalTheme.getMenuForeground(), metalTheme
132:                        .getBlackPublic());
133:            }
134:
135:            public void testGetMenuDisabledForeground() {
136:                assertEquals(metalTheme.getSecondary2(), metalTheme
137:                        .getMenuDisabledForeground());
138:            }
139:
140:            public void testGetMenuBackground() {
141:                assertEquals(metalTheme.getSecondary3(), metalTheme
142:                        .getMenuBackground());
143:            }
144:
145:            public void testGetInactiveSystemTextColor() {
146:                assertEquals(metalTheme.getSecondary2(), metalTheme
147:                        .getInactiveSystemTextColor());
148:            }
149:
150:            public void testGetInactiveControlTextColor() {
151:                assertEquals(metalTheme.getSecondary2(), metalTheme
152:                        .getInactiveControlTextColor());
153:            }
154:
155:            public void testGetHighlightedTextColor() {
156:                assertSame(metalTheme.getHighlightedTextColor(), metalTheme
157:                        .getBlackPublic());
158:            }
159:
160:            public void testGetFocusColor() {
161:                assertEquals(metalTheme.getPrimary2(), metalTheme
162:                        .getFocusColor());
163:            }
164:
165:            public void testGetDesktopColor() {
166:                assertEquals(metalTheme.getPrimary2(), metalTheme
167:                        .getDesktopColor());
168:            }
169:
170:            public void testGetControlTextColor() {
171:                assertSame(metalTheme.getControlTextColor(), metalTheme
172:                        .getBlackPublic());
173:            }
174:
175:            public void testGetControlShadow() {
176:                assertEquals(metalTheme.getSecondary2(), metalTheme
177:                        .getControlShadow());
178:            }
179:
180:            public void testGetControlInfo() {
181:                assertSame(metalTheme.getControlInfo(), metalTheme
182:                        .getBlackPublic());
183:            }
184:
185:            public void testGetControlHighlight() {
186:                assertSame(metalTheme.getControlHighlight(), metalTheme
187:                        .getWhitePublic());
188:            }
189:
190:            public void testGetControlDisabled() {
191:                assertEquals(metalTheme.getSecondary2(), metalTheme
192:                        .getControlDisabled());
193:            }
194:
195:            public void testGetControlDarkShadow() {
196:                assertEquals(metalTheme.getSecondary1(), metalTheme
197:                        .getControlDarkShadow());
198:            }
199:
200:            public void testGetControl() {
201:                assertEquals(metalTheme.getSecondary3(), metalTheme
202:                        .getControl());
203:            }
204:
205:            public void testGetBlack() {
206:                assertEquals(new ColorUIResource(0, 0, 0), metalTheme
207:                        .getBlackPublic());
208:            }
209:
210:            public void testGetAcceleratorSelectedForeground() {
211:                assertSame(metalTheme.getAcceleratorSelectedForeground(),
212:                        metalTheme.getBlackPublic());
213:            }
214:
215:            public void testGetAcceleratorForeground() {
216:                assertEquals(metalTheme.getPrimary1(), metalTheme
217:                        .getAcceleratorForeground());
218:            }
219:
220:            public void testAddCustomEntriesToTable() {
221:                UIDefaults defs = new UIDefaults();
222:                metalTheme.addCustomEntriesToTable(defs);
223:                assertEquals(0, defs.size());
224:                metalTheme.addCustomEntriesToTable(null);
225:            }
226:        }
227:
228:        class TestMetalTheme extends MetalTheme {
229:            public ColorUIResource getWhitePublic() {
230:                return getWhite();
231:            }
232:
233:            public ColorUIResource getBlackPublic() {
234:                return getBlack();
235:            }
236:
237:            @Override
238:            public String getName() {
239:                return "name";
240:            }
241:
242:            @Override
243:            protected ColorUIResource getPrimary1() {
244:                return new ColorUIResource(1, 1, 1);
245:            }
246:
247:            @Override
248:            protected ColorUIResource getPrimary2() {
249:                return new ColorUIResource(1, 1, 2);
250:            }
251:
252:            @Override
253:            protected ColorUIResource getPrimary3() {
254:                return new ColorUIResource(1, 1, 3);
255:            }
256:
257:            @Override
258:            protected ColorUIResource getSecondary1() {
259:                return new ColorUIResource(1, 1, 4);
260:            }
261:
262:            @Override
263:            protected ColorUIResource getSecondary2() {
264:                return new ColorUIResource(1, 1, 5);
265:            }
266:
267:            @Override
268:            protected ColorUIResource getSecondary3() {
269:                return new ColorUIResource(1, 1, 6);
270:            }
271:
272:            @Override
273:            public FontUIResource getControlTextFont() {
274:                return null;
275:            }
276:
277:            @Override
278:            public FontUIResource getMenuTextFont() {
279:                return null;
280:            }
281:
282:            @Override
283:            public FontUIResource getSubTextFont() {
284:                return null;
285:            }
286:
287:            @Override
288:            public FontUIResource getSystemTextFont() {
289:                return null;
290:            }
291:
292:            @Override
293:            public FontUIResource getUserTextFont() {
294:                return null;
295:            }
296:
297:            @Override
298:            public FontUIResource getWindowTitleFont() {
299:                return null;
300:            }
301:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.