Source Code Cross Referenced for MetalLookAndFeelTest.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.plaf.ColorUIResource;
024:        import javax.swing.plaf.FontUIResource;
025:
026:        public class MetalLookAndFeelTest extends SwingTestCase {
027:            private DefaultMetalTheme defaultMetalTheme;
028:
029:            @Override
030:            public void setUp() {
031:                defaultMetalTheme = new DefaultMetalTheme();
032:            }
033:
034:            @Override
035:            public void tearDown() {
036:                defaultMetalTheme = null;
037:            }
038:
039:            public void testSize() throws Exception {
040:                if (isHarmony()) {
041:                    assertEquals(559, new MetalLookAndFeel().getDefaults()
042:                            .size());
043:                }
044:            }
045:
046:            public void testGetAcceleratorForeground() {
047:                checkColor(MetalLookAndFeel.getAcceleratorForeground(),
048:                        defaultMetalTheme.getAcceleratorForeground());
049:            }
050:
051:            public void testGetAcceleratorSelectedForeground() {
052:                checkColor(MetalLookAndFeel.getAcceleratorSelectedForeground(),
053:                        defaultMetalTheme.getAcceleratorSelectedForeground());
054:            }
055:
056:            public void testGetBlack() {
057:                checkColor(MetalLookAndFeel.getBlack(), defaultMetalTheme
058:                        .getBlack());
059:            }
060:
061:            public void testGetControl() {
062:                checkColor(MetalLookAndFeel.getControl(), defaultMetalTheme
063:                        .getControl());
064:            }
065:
066:            public void testGetControlDarkShadow() {
067:                checkColor(MetalLookAndFeel.getControlDarkShadow(),
068:                        defaultMetalTheme.getControlDarkShadow());
069:            }
070:
071:            public void testGetControlDisabled() {
072:                checkColor(MetalLookAndFeel.getControlDisabled(),
073:                        defaultMetalTheme.getControlDisabled());
074:            }
075:
076:            public void testGetControlHighlight() {
077:                checkColor(MetalLookAndFeel.getControlHighlight(),
078:                        defaultMetalTheme.getControlHighlight());
079:            }
080:
081:            public void testGetControlInfo() {
082:                checkColor(MetalLookAndFeel.getControlInfo(), defaultMetalTheme
083:                        .getControlInfo());
084:            }
085:
086:            public void testGetControlShadow() {
087:                checkColor(MetalLookAndFeel.getControlShadow(),
088:                        defaultMetalTheme.getControlShadow());
089:            }
090:
091:            public void testGetControlTextColor() {
092:                checkColor(MetalLookAndFeel.getControlTextColor(),
093:                        defaultMetalTheme.getControlTextColor());
094:            }
095:
096:            public void testGetControlTextFont() {
097:                FontUIResource font = MetalLookAndFeel.getControlTextFont();
098:                assertNotNull(font);
099:                assertEquals(defaultMetalTheme.getControlTextFont(), font);
100:            }
101:
102:            public void testGetDeskTopColor() {
103:                checkColor(MetalLookAndFeel.getDesktopColor(),
104:                        defaultMetalTheme.getDesktopColor());
105:            }
106:
107:            public void testGetFocusColor() {
108:                checkColor(MetalLookAndFeel.getFocusColor(), defaultMetalTheme
109:                        .getFocusColor());
110:            }
111:
112:            public void testGetHighlightedTextColor() {
113:                checkColor(MetalLookAndFeel.getHighlightedTextColor(),
114:                        defaultMetalTheme.getHighlightedTextColor());
115:            }
116:
117:            public void testGetInactiveControlTextColor() {
118:                checkColor(MetalLookAndFeel.getInactiveControlTextColor(),
119:                        defaultMetalTheme.getInactiveControlTextColor());
120:            }
121:
122:            public void testGetInactiveSystemTextColor() {
123:                checkColor(MetalLookAndFeel.getInactiveSystemTextColor(),
124:                        defaultMetalTheme.getInactiveSystemTextColor());
125:            }
126:
127:            public void testGetMenuBackground() {
128:                checkColor(MetalLookAndFeel.getMenuBackground(),
129:                        defaultMetalTheme.getMenuBackground());
130:            }
131:
132:            public void testGetMenuDisabledBackground() {
133:                checkColor(MetalLookAndFeel.getMenuDisabledForeground(),
134:                        defaultMetalTheme.getMenuDisabledForeground());
135:            }
136:
137:            public void testGetMenuForeground() {
138:                checkColor(MetalLookAndFeel.getMenuForeground(),
139:                        defaultMetalTheme.getMenuForeground());
140:            }
141:
142:            public void testGetMenuSelectedBackground() {
143:                checkColor(MetalLookAndFeel.getMenuSelectedBackground(),
144:                        defaultMetalTheme.getMenuSelectedBackground());
145:            }
146:
147:            public void testGetMenuSelectedForeground() {
148:                checkColor(MetalLookAndFeel.getMenuSelectedForeground(),
149:                        defaultMetalTheme.getMenuSelectedForeground());
150:            }
151:
152:            public void testGetMenuTextFont() {
153:                FontUIResource font = MetalLookAndFeel.getMenuTextFont();
154:                assertNotNull(font);
155:                assertEquals(defaultMetalTheme.getMenuTextFont(), font);
156:            }
157:
158:            public void testGetName() {
159:                assertNotNull(new MetalLookAndFeel().getName());
160:            }
161:
162:            public void testGetId() {
163:                assertNotNull(new MetalLookAndFeel().getID());
164:            }
165:
166:            public void testGetPrimaryControl() {
167:                checkColor(MetalLookAndFeel.getPrimaryControl(),
168:                        defaultMetalTheme.getPrimaryControl());
169:            }
170:
171:            public void testGetPrimaryControlDarkShadow() {
172:                checkColor(MetalLookAndFeel.getPrimaryControlDarkShadow(),
173:                        defaultMetalTheme.getPrimaryControlDarkShadow());
174:            }
175:
176:            public void testGetPrimaryControlHighlight() {
177:                checkColor(MetalLookAndFeel.getPrimaryControlHighlight(),
178:                        defaultMetalTheme.getPrimaryControlHighlight());
179:            }
180:
181:            public void testGetPrimaryControlInfo() {
182:                checkColor(MetalLookAndFeel.getPrimaryControlInfo(),
183:                        defaultMetalTheme.getPrimaryControlInfo());
184:            }
185:
186:            public void testGetPrimaryControlShadow() {
187:                checkColor(MetalLookAndFeel.getPrimaryControlShadow(),
188:                        defaultMetalTheme.getPrimaryControlShadow());
189:            }
190:
191:            public void testGetSeparatorBackground() {
192:                checkColor(MetalLookAndFeel.getSeparatorBackground(),
193:                        defaultMetalTheme.getSeparatorBackground());
194:            }
195:
196:            public void testGetSeparatorForeground() {
197:                checkColor(MetalLookAndFeel.getSeparatorForeground(),
198:                        defaultMetalTheme.getSeparatorForeground());
199:            }
200:
201:            public void testSubTextFont() {
202:                FontUIResource font = MetalLookAndFeel.getSubTextFont();
203:                assertNotNull(font);
204:                assertEquals(defaultMetalTheme.getSubTextFont(), font);
205:            }
206:
207:            public void testGetSupportWindowDecorations() {
208:                assertTrue(new MetalLookAndFeel()
209:                        .getSupportsWindowDecorations());
210:            }
211:
212:            public void testGetSystemTestColor() {
213:                checkColor(MetalLookAndFeel.getSystemTextColor(),
214:                        defaultMetalTheme.getSystemTextColor());
215:            }
216:
217:            public void testSystemTextFont() {
218:                FontUIResource font = MetalLookAndFeel.getSystemTextFont();
219:                assertNotNull(font);
220:                assertEquals(defaultMetalTheme.getSystemTextFont(), font);
221:            }
222:
223:            public void testGetTextHighlightColor() {
224:                checkColor(MetalLookAndFeel.getTextHighlightColor(),
225:                        defaultMetalTheme.getTextHighlightColor());
226:            }
227:
228:            public void testUserTextFont() {
229:                FontUIResource font = MetalLookAndFeel.getUserTextFont();
230:                assertNotNull(font);
231:                assertEquals(defaultMetalTheme.getUserTextFont(), font);
232:            }
233:
234:            public void testGetUserTextColor() {
235:                checkColor(MetalLookAndFeel.getUserTextColor(),
236:                        defaultMetalTheme.getUserTextColor());
237:            }
238:
239:            public void testGetWhite() {
240:                checkColor(MetalLookAndFeel.getWhite(), defaultMetalTheme
241:                        .getWhite());
242:            }
243:
244:            public void testGetWindowBackground() {
245:                checkColor(MetalLookAndFeel.getWindowBackground(),
246:                        defaultMetalTheme.getWindowBackground());
247:            }
248:
249:            public void testGetWindowTitleBackground() {
250:                checkColor(MetalLookAndFeel.getWindowTitleBackground(),
251:                        defaultMetalTheme.getWindowTitleBackground());
252:            }
253:
254:            public void testGetWindowTitleFont() {
255:                FontUIResource font = MetalLookAndFeel.getWindowTitleFont();
256:                assertNotNull(font);
257:                assertEquals(defaultMetalTheme.getWindowTitleFont(), font);
258:            }
259:
260:            public void testGetWindowTitleForeground() {
261:                checkColor(MetalLookAndFeel.getWindowTitleForeground(),
262:                        defaultMetalTheme.getWindowTitleForeground());
263:            }
264:
265:            public void testGetWindowTitleInactiveBackground() {
266:                checkColor(MetalLookAndFeel.getWindowTitleInactiveBackground(),
267:                        defaultMetalTheme.getWindowTitleInactiveBackground());
268:            }
269:
270:            public void testGetWindowTitleInactiveForeground() {
271:                checkColor(MetalLookAndFeel.getWindowTitleInactiveForeground(),
272:                        defaultMetalTheme.getWindowTitleInactiveForeground());
273:            }
274:
275:            public void testIsNativeLookAndFeel() {
276:                assertFalse(new MetalLookAndFeel().isNativeLookAndFeel());
277:            }
278:
279:            public void testIsSupportedLookAndFeel() {
280:                assertTrue(new MetalLookAndFeel().isSupportedLookAndFeel());
281:            }
282:
283:            private void checkColor(final ColorUIResource color,
284:                    final ColorUIResource themeColor) {
285:                assertNotNull(color);
286:                assertSame(color, themeColor);
287:            }
288:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.