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


001:        /*
002:         * Copyright 2005-2008 Kirill Grouchnikov, based on work by
003:         * Sun Microsystems, Inc. All rights reserved.
004:         *
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation; either
008:         * version 2.1 of the License, or (at your option) any later version.
009:         *
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         * Lesser General Public License for more details.
014:         *
015:         * You should have received a copy of the GNU Lesser General Public
016:         * License along with this library; if not, write to the Free Software
017:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
018:         */
019:        package test;
020:
021:        import java.awt.*;
022:        import java.awt.event.ActionEvent;
023:        import java.awt.event.ActionListener;
024:        import java.net.MalformedURLException;
025:        import java.net.URL;
026:        import java.util.*;
027:
028:        import javax.swing.*;
029:        import javax.swing.border.EmptyBorder;
030:        import javax.swing.event.ChangeEvent;
031:        import javax.swing.event.ChangeListener;
032:        import javax.swing.plaf.FontUIResource;
033:
034:        import org.jdesktop.swingx.*;
035:        import org.jdesktop.swingx.calendar.DateSelectionModel;
036:        import org.jdesktop.swingx.error.ErrorInfo;
037:        import org.jdesktop.swingx.tips.TipLoader;
038:        import org.jdesktop.swingx.tips.TipOfTheDayModel;
039:        import org.jvnet.substance.SubstanceLookAndFeel;
040:        import org.jvnet.substance.fonts.FontPolicy;
041:        import org.jvnet.substance.fonts.FontSet;
042:
043:        public class TestSwingXFrame extends JFrame {
044:            private static class WrapperFontSet implements  FontSet {
045:                private int extra;
046:
047:                private FontSet delegate;
048:
049:                public WrapperFontSet(FontSet delegate, int extra) {
050:                    super ();
051:                    this .delegate = delegate;
052:                    this .extra = extra;
053:                }
054:
055:                private FontUIResource getWrappedFont(FontUIResource systemFont) {
056:                    return new FontUIResource(systemFont.getFontName(),
057:                            systemFont.getStyle(), systemFont.getSize()
058:                                    + this .extra);
059:                }
060:
061:                public FontUIResource getControlFont() {
062:                    return this .getWrappedFont(this .delegate.getControlFont());
063:                }
064:
065:                public FontUIResource getMenuFont() {
066:                    return this .getWrappedFont(this .delegate.getMenuFont());
067:                }
068:
069:                public FontUIResource getMessageFont() {
070:                    return this .getWrappedFont(this .delegate.getMessageFont());
071:                }
072:
073:                public FontUIResource getSmallFont() {
074:                    return this .getWrappedFont(this .delegate.getSmallFont());
075:                }
076:
077:                public FontUIResource getTitleFont() {
078:                    return this .getWrappedFont(this .delegate.getTitleFont());
079:                }
080:
081:                public FontUIResource getWindowTitleFont() {
082:                    // FontUIResource f = this.getWrappedFont(this.delegate
083:                    // .getWindowTitleFont());
084:                    // return new FontUIResource(f.deriveFont(Font.BOLD, f.getSize() +
085:                    // 1));
086:                    return this .getWrappedFont(this .delegate
087:                            .getWindowTitleFont());
088:                }
089:            }
090:
091:            TestSwingXFrame() {
092:                super ("SwingX testing bed");
093:
094:                Calendar cal = Calendar.getInstance();
095:                cal.add(Calendar.DAY_OF_MONTH, 4);
096:                Date[] unselDates = new Date[3];
097:                unselDates[0] = cal.getTime();
098:                cal.add(Calendar.DAY_OF_MONTH, 3);
099:                unselDates[1] = cal.getTime();
100:                cal.add(Calendar.DAY_OF_MONTH, 3);
101:                unselDates[2] = cal.getTime();
102:                long[] flaggedDates = new long[3];
103:                cal.add(Calendar.DAY_OF_MONTH, 1);
104:                flaggedDates[0] = cal.getTimeInMillis();
105:                cal.add(Calendar.DAY_OF_MONTH, 2);
106:                flaggedDates[1] = cal.getTimeInMillis();
107:                cal.add(Calendar.DAY_OF_MONTH, 2);
108:                flaggedDates[2] = cal.getTimeInMillis();
109:
110:                JXTaskPaneContainer taskPaneContainer = new JXTaskPaneContainer() {
111:                    @Override
112:                    public boolean getScrollableTracksViewportWidth() {
113:                        return false;
114:                    }
115:                };
116:
117:                JXTaskPane taskPane = new JXTaskPane();
118:                taskPane.setTitle("JXMonthView and JXDatePicker");
119:                taskPaneContainer.add(taskPane);
120:                JXMonthView monthView = new JXMonthView();
121:                // monthView.setFlaggedDates(flaggedDates);
122:                // monthView.setUnselectableDates(unselDates);
123:                monthView.setShowingLeadingDays(true);
124:                monthView.setShowingTrailingDays(true);
125:                monthView.setShowingWeekNumber(true);
126:                monthView
127:                        .setSelectionMode(DateSelectionModel.SelectionMode.MULTIPLE_INTERVAL_SELECTION);
128:                monthView.setTraversable(true);
129:                // monthView.setFlaggedDates(unselDates);
130:                taskPane.add(monthView);
131:
132:                JXDatePicker datePicker = new JXDatePicker();
133:                datePicker.getMonthView().setUnselectableDates(unselDates);
134:                taskPane.add(datePicker);
135:
136:                taskPane = new JXTaskPane();
137:                taskPane.setTitle("JXHyperlink and JXTitledSeparator");
138:                taskPane.setSpecial(true);
139:                taskPaneContainer.add(taskPane);
140:                JXHyperlink link = new JXHyperlink();
141:                link.setText("My first link");
142:                taskPane.add(link);
143:                taskPane.add(new JXTitledSeparator("Titled separator"));
144:
145:                JXTaskPane taskPaneVarious = new JXTaskPane();
146:                taskPaneVarious.setTitle("Various SwingX components");
147:                taskPaneContainer.add(taskPaneVarious);
148:                JButton headerButton = new JButton("Test JXHeader");
149:                headerButton.addActionListener(new ActionListener() {
150:                    public void actionPerformed(ActionEvent e) {
151:                        JDialog dialog = new JDialog(TestSwingXFrame.this ,
152:                                "JXHeader test", true);
153:                        JXHeader header = new JXHeader();
154:                        header.setTitle("Sample header title");
155:                        header
156:                                .setDescription("Sample long long\nlong header description");
157:                        dialog.add(header, BorderLayout.NORTH);
158:                        dialog.add(new JPanel() {
159:                            @Override
160:                            public Dimension getPreferredSize() {
161:                                return new Dimension(400, 200);
162:                            }
163:                        }, BorderLayout.CENTER);
164:                        dialog.pack();
165:                        dialog.setLocationRelativeTo(TestSwingXFrame.this );
166:                        dialog
167:                                .setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
168:                        dialog.setVisible(true);
169:                    }
170:                });
171:                taskPaneVarious.add(headerButton);
172:
173:                JButton showLoginDialog = new JButton("Show JXLoginDialog");
174:                showLoginDialog.addActionListener(new ActionListener() {
175:                    public void actionPerformed(ActionEvent e) {
176:                        JXLoginDialog loginDialog = new JXLoginDialog(
177:                                TestSwingXFrame.this , "Sample login dialog",
178:                                true);
179:                        // loginDialog.setUndecorated(true);
180:                        // loginDialog.setLocationRelativeTo(null);
181:                        loginDialog.getPanel().setMessage(
182:                                "Sample login message");
183:                        loginDialog.getPanel().setBannerText("Sample banner");
184:                        loginDialog.setVisible(true);
185:                    }
186:                });
187:                taskPaneVarious.add(showLoginDialog);
188:
189:                JButton showTopOfTheDayDialog = new JButton(
190:                        "Show JXTipOfTheDay");
191:                showTopOfTheDayDialog.addActionListener(new ActionListener() {
192:                    public void actionPerformed(ActionEvent e) {
193:                        Properties tips = new Properties();
194:                        try {
195:                            tips
196:                                    .load(TestSwingXFrame.class
197:                                            .getClassLoader()
198:                                            .getResourceAsStream(
199:                                                    "test/tips.properties"));
200:                        } catch (Exception exc) {
201:                        }
202:
203:                        TipOfTheDayModel model = TipLoader.load(tips);
204:                        JXTipOfTheDay totd = new JXTipOfTheDay(model);
205:
206:                        // FadeTracker.DEBUG_MODE = true;
207:                        totd.showDialog(TestSwingXFrame.this );
208:                    }
209:                });
210:                taskPaneVarious.add(showTopOfTheDayDialog);
211:
212:                JButton titledPanelButton = new JButton("Test JXTitledPanel");
213:                titledPanelButton.addActionListener(new ActionListener() {
214:                    public void actionPerformed(ActionEvent e) {
215:                        JFrame dialog = new JFrame("JXTitledPanel test");
216:                        dialog.add(new JXTitledPanel("Left panel"),
217:                                BorderLayout.WEST);
218:                        JPanel center = new JPanel(new GridLayout(2, 1, 0, 0));
219:                        center.add(new JXTitledPanel("Top panel"));
220:                        center.add(new JXTitledPanel("Bottom panel"));
221:                        dialog.add(center, BorderLayout.CENTER);
222:                        dialog.setSize(600, 300);
223:                        dialog.setLocationRelativeTo(TestSwingXFrame.this );
224:                        dialog
225:                                .setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
226:                        dialog.setVisible(true);
227:                    }
228:                });
229:                taskPaneVarious.add(titledPanelButton);
230:
231:                JButton errorPaneButton = new JButton("Test JXErrorPane");
232:                errorPaneButton.addActionListener(new ActionListener() {
233:                    public void actionPerformed(ActionEvent e) {
234:                        try {
235:                            URL url = new URL("some wrong URL string");
236:                        } catch (MalformedURLException murle) {
237:                            String msg = "<html>An error just happened. Possible reasons:"
238:                                    + "<ol><li>Development team hoped nobody would notice."
239:                                    + "<li>The testers missed this scenario. Wait, we don't have testers."
240:                                    + "<li>Didn't your momma teach you not to use Linux?"
241:                                    + "</ol>"
242:                                    + "In any case, it's all open source so it's all good. Fix it yourself.";
243:                            String details = "<html>Web resources should begin with \"http://\""
244:                                    + " and cannot contain any spaces. Below are a few"
245:                                    + " more guidelines.<ul></ul></html>";
246:                            JXErrorPane.showDialog(TestSwingXFrame.this ,
247:                                    new ErrorInfo(
248:                                            "Reformatting the disk complete",
249:                                            msg, details, null, murle, null,
250:                                            null));
251:                        }
252:                    }
253:                });
254:                taskPaneVarious.add(errorPaneButton);
255:
256:                taskPaneVarious.add(new JTextField("Field 1"));
257:
258:                JScrollPane scrollPane = new JScrollPane(taskPaneContainer);
259:                scrollPane.setBorder(new EmptyBorder(0, 0, 0, 0));
260:                this .add(scrollPane, BorderLayout.WEST);
261:
262:                final JTabbedPane mainPane = new JTabbedPane();
263:                mainPane.addTab("JXTable", new TablePanel());
264:                mainPane.addTab("JXTreeTable", new TreeTablePanel());
265:                this .add(mainPane, BorderLayout.CENTER);
266:
267:                JXStatusBar statusBar = new JXStatusBar();
268:                this .add(statusBar, BorderLayout.SOUTH);
269:
270:                // final JLabel statusLabel = new JLabel("");
271:                // JXStatusBar.Constraint cStatusLabel = new JXStatusBar.Constraint();
272:                // cStatusLabel.setFixedWidth(100);
273:                // statusBar.add(statusLabel, cStatusLabel);
274:                // try {
275:                // Toolkit.getDefaultToolkit().addAWTEventListener(
276:                // new AWTEventListener() {
277:                // public void eventDispatched(AWTEvent event) {
278:                // if (event instanceof MouseEvent) {
279:                // MouseEvent me = (MouseEvent) event;
280:                // if (me.getID() == MouseEvent.MOUSE_MOVED) {
281:                // Point p = me.getPoint();
282:                // statusLabel.setText(p.x + ":" + p.y);
283:                // }
284:                // }
285:                // }
286:                // }, AWTEvent.MOUSE_MOTION_EVENT_MASK);
287:                // } catch (AccessControlException ace) {
288:                // // running in JNLP - ignore
289:                // }
290:
291:                JXStatusBar.Constraint c2 = new JXStatusBar.Constraint(
292:                        JXStatusBar.Constraint.ResizeBehavior.FILL);
293:                final JLabel tabLabel = new JLabel("");
294:                statusBar.add(tabLabel, c2);
295:                mainPane.getModel().addChangeListener(new ChangeListener() {
296:                    public void stateChanged(ChangeEvent e) {
297:                        int selectedIndex = mainPane.getSelectedIndex();
298:                        if (selectedIndex < 0)
299:                            tabLabel.setText("No selected tab");
300:                        else
301:                            tabLabel.setText("Tab "
302:                                    + mainPane.getTitleAt(selectedIndex)
303:                                    + " selected");
304:                    }
305:                });
306:
307:                final JSlider fontSizeSlider = new JSlider(-3, 6, 0);
308:                fontSizeSlider.setFocusable(false);
309:                fontSizeSlider.setOpaque(false);
310:                fontSizeSlider
311:                        .setToolTipText("Controls the global font set size. Resets Substance as the current LAF.");
312:                fontSizeSlider.addChangeListener(new ChangeListener() {
313:                    public void stateChanged(ChangeEvent e) {
314:                        // if the value is adjusting - ignore. This is done
315:                        // to make CPU usage better.
316:                        if (!fontSizeSlider.getModel().getValueIsAdjusting()) {
317:                            final int newValue = fontSizeSlider.getValue();
318:                            SwingUtilities.invokeLater(new Runnable() {
319:                                public void run() {
320:                                    SubstanceLookAndFeel.setFontPolicy(null);
321:                                    final FontSet substanceCoreFontSet = SubstanceLookAndFeel
322:                                            .getFontPolicy().getFontSet(
323:                                                    "Substance", null);
324:                                    FontPolicy newFontPolicy = new FontPolicy() {
325:                                        public FontSet getFontSet(
326:                                                String lafName, UIDefaults table) {
327:                                            return new WrapperFontSet(
328:                                                    substanceCoreFontSet,
329:                                                    newValue);
330:                                        }
331:                                    };
332:
333:                                    try {
334:                                        TestSwingXFrame.this 
335:                                                .setCursor(Cursor
336:                                                        .getPredefinedCursor(Cursor.WAIT_CURSOR));
337:                                        SubstanceLookAndFeel
338:                                                .setFontPolicy(newFontPolicy);
339:                                        UIManager
340:                                                .setLookAndFeel(new SubstanceLookAndFeel());
341:                                        SwingUtilities
342:                                                .updateComponentTreeUI(TestSwingXFrame.this );
343:                                        TestSwingXFrame.this .setCursor(Cursor
344:                                                .getDefaultCursor());
345:                                    } catch (Exception exc) {
346:                                        exc.printStackTrace();
347:                                    }
348:                                }
349:                            });
350:                        }
351:                    }
352:                });
353:                JXStatusBar.Constraint statusBarSliderConstraints = new JXStatusBar.Constraint();
354:                statusBarSliderConstraints.setFixedWidth(140);
355:                JPanel sliderPanel = new JPanel(new BorderLayout());
356:                sliderPanel.setOpaque(false);
357:                sliderPanel.add(fontSizeSlider, BorderLayout.CENTER);
358:                sliderPanel.add(new JLabel(new Icon() {
359:                    public int getIconHeight() {
360:                        return 16;
361:                    }
362:
363:                    public int getIconWidth() {
364:                        return 20;
365:                    }
366:
367:                    public void paintIcon(Component c, Graphics g, int x, int y) {
368:                        Graphics2D graphics = (Graphics2D) g.create();
369:                        graphics.setColor(SubstanceLookAndFeel
370:                                .getDefaultColorScheme().getMidColor());
371:                        graphics.drawRect(11, 7, 6, 6);
372:                        graphics.setColor(SubstanceLookAndFeel
373:                                .getDefaultColorScheme().getDarkColor());
374:                        graphics.drawRect(12, 6, 6, 6);
375:                        graphics.dispose();
376:                    }
377:                }), BorderLayout.WEST);
378:                sliderPanel.add(new JLabel(new Icon() {
379:                    public int getIconHeight() {
380:                        return 16;
381:                    }
382:
383:                    public int getIconWidth() {
384:                        return 14;
385:                    }
386:
387:                    public void paintIcon(Component c, Graphics g, int x, int y) {
388:                        Graphics2D graphics = (Graphics2D) g.create();
389:                        graphics.setColor(SubstanceLookAndFeel
390:                                .getDefaultColorScheme().getMidColor());
391:                        graphics.drawRect(1, 4, 12, 12);
392:                        graphics.setColor(SubstanceLookAndFeel
393:                                .getDefaultColorScheme().getDarkColor());
394:                        graphics.drawRect(0, 3, 12, 12);
395:                        graphics.dispose();
396:                    }
397:                }), BorderLayout.EAST);
398:
399:                statusBar.add(sliderPanel, statusBarSliderConstraints);
400:
401:                this .setSize(800, 600);
402:                this .setLocationRelativeTo(null);
403:                this .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
404:
405:                // LAF changing
406:                JMenu lafMenu = new JMenu("Look & feel");
407:                JMenu substanceMenus = new JMenu("Substance family");
408:                substanceMenus.add(LafChanger.getMenuItem(this , "Substance",
409:                        "org.jvnet.substance.SubstanceLookAndFeel"));
410:                substanceMenus.add(LafChanger.getMenuItem(this , "Default",
411:                        "org.jvnet.substance.SubstanceDefaultLookAndFeel"));
412:                substanceMenus.addSeparator();
413:                substanceMenus
414:                        .add(LafChanger
415:                                .getMenuItem(this , "Business",
416:                                        "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"));
417:                substanceMenus
418:                        .add(LafChanger
419:                                .getMenuItem(this , "Business Black Steel",
420:                                        "org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel"));
421:                substanceMenus
422:                        .add(LafChanger
423:                                .getMenuItem(this , "Business Blue Steel",
424:                                        "org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel"));
425:                substanceMenus.add(LafChanger.getMenuItem(this , "Creme",
426:                        "org.jvnet.substance.skin.SubstanceCremeLookAndFeel"));
427:                substanceMenus
428:                        .add(LafChanger
429:                                .getMenuItem(this , "Moderate",
430:                                        "org.jvnet.substance.skin.SubstanceModerateLookAndFeel"));
431:                substanceMenus.add(LafChanger.getMenuItem(this , "Nebula",
432:                        "org.jvnet.substance.skin.SubstanceNebulaLookAndFeel"));
433:                substanceMenus
434:                        .add(LafChanger
435:                                .getMenuItem(this , "Nebula Brick Wall",
436:                                        "org.jvnet.substance.skin.SubstanceNebulaBrickWallLookAndFeel"));
437:                substanceMenus
438:                        .add(LafChanger
439:                                .getMenuItem(this , "Office Silver 2007",
440:                                        "org.jvnet.substance.skin.SubstanceOfficeSilver2007LookAndFeel"));
441:                substanceMenus.add(LafChanger.getMenuItem(this , "Sahara",
442:                        "org.jvnet.substance.skin.SubstanceSaharaLookAndFeel"));
443:                substanceMenus.addSeparator();
444:                substanceMenus
445:                        .add(LafChanger
446:                                .getMenuItem(this , "Field of Wheat",
447:                                        "org.jvnet.substance.skin.SubstanceFieldOfWheatLookAndFeel"));
448:                substanceMenus
449:                        .add(LafChanger
450:                                .getMenuItem(this , "Green Magic",
451:                                        "org.jvnet.substance.skin.SubstanceGreenMagicLookAndFeel"));
452:                substanceMenus.add(LafChanger.getMenuItem(this , "Mango",
453:                        "org.jvnet.substance.skin.SubstanceMangoLookAndFeel"));
454:                substanceMenus
455:                        .add(LafChanger
456:                                .getMenuItem(this , "Office Blue 2007",
457:                                        "org.jvnet.substance.skin.SubstanceOfficeBlue2007LookAndFeel"));
458:                substanceMenus.addSeparator();
459:                substanceMenus
460:                        .add(LafChanger
461:                                .getMenuItem(this , "Challenger Deep",
462:                                        "org.jvnet.substance.skin.SubstanceChallengerDeepLookAndFeel"));
463:                substanceMenus
464:                        .add(LafChanger
465:                                .getMenuItem(this , "Emerald Dusk",
466:                                        "org.jvnet.substance.skin.SubstanceEmeraldDuskLookAndFeel"));
467:                substanceMenus.add(LafChanger.getMenuItem(this , "Magma",
468:                        "org.jvnet.substance.skin.SubstanceMagmaLookAndFeel"));
469:                substanceMenus.add(LafChanger.getMenuItem(this , "Raven",
470:                        "org.jvnet.substance.skin.SubstanceRavenLookAndFeel"));
471:                substanceMenus
472:                        .add(LafChanger
473:                                .getMenuItem(this , "Raven Graphite",
474:                                        "org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel"));
475:                substanceMenus
476:                        .add(LafChanger
477:                                .getMenuItem(this , "Raven Graphite Glass",
478:                                        "org.jvnet.substance.skin.SubstanceRavenGraphiteGlassLookAndFeel"));
479:                lafMenu.add(substanceMenus);
480:                lafMenu.addSeparator();
481:                JMenu coreLafMenus = new JMenu("Core LAFs");
482:                lafMenu.add(coreLafMenus);
483:                coreLafMenus.add(LafChanger.getMenuItem(this , "Metal",
484:                        "javax.swing.plaf.metal.MetalLookAndFeel"));
485:                coreLafMenus.add(LafChanger.getMenuItem(this , "Windows",
486:                        "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"));
487:                coreLafMenus
488:                        .add(LafChanger
489:                                .getMenuItem(this , "Windows Classic",
490:                                        "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"));
491:                coreLafMenus.add(LafChanger.getMenuItem(this , "Motif",
492:                        "com.sun.java.swing.plaf.motif.MotifLookAndFeel"));
493:
494:                JMenu customLafMenus = new JMenu("Custom LAFs");
495:                lafMenu.add(customLafMenus);
496:                JMenu jgoodiesMenu = new JMenu("JGoodies family");
497:                customLafMenus.add(jgoodiesMenu);
498:                jgoodiesMenu.add(LafChanger.getMenuItem(this ,
499:                        "JGoodies Plastic",
500:                        "com.jgoodies.looks.plastic.PlasticLookAndFeel"));
501:                jgoodiesMenu.add(LafChanger.getMenuItem(this ,
502:                        "JGoodies PlasticXP",
503:                        "com.jgoodies.looks.plastic.PlasticXPLookAndFeel"));
504:                jgoodiesMenu.add(LafChanger.getMenuItem(this ,
505:                        "JGoodies Plastic3D",
506:                        "com.jgoodies.looks.plastic.Plastic3DLookAndFeel"));
507:
508:                JMenu jtattooMenu = new JMenu("JTattoo family");
509:                customLafMenus.add(jtattooMenu);
510:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo Acryl",
511:                        "com.jtattoo.plaf.acryl.AcrylLookAndFeel"));
512:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo Aero",
513:                        "com.jtattoo.plaf.aero.AeroLookAndFeel"));
514:                jtattooMenu.add(LafChanger.getMenuItem(this ,
515:                        "JTattoo Aluminium",
516:                        "com.jtattoo.plaf.aluminium.AluminiumLookAndFeel"));
517:                jtattooMenu.add(LafChanger.getMenuItem(this ,
518:                        "JTattoo Bernstein",
519:                        "com.jtattoo.plaf.bernstein.BernsteinLookAndFeel"));
520:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo Fast",
521:                        "com.jtattoo.plaf.fast.FastLookAndFeel"));
522:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo HiFi",
523:                        "com.jtattoo.plaf.hifi.HiFiLookAndFeel"));
524:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo Luna",
525:                        "com.jtattoo.plaf.luna.LunaLookAndFeel"));
526:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo McWin",
527:                        "com.jtattoo.plaf.mcwin.McWinLookAndFeel"));
528:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo Mint",
529:                        "com.jtattoo.plaf.mint.MintLookAndFeel"));
530:                jtattooMenu.add(LafChanger.getMenuItem(this , "JTattoo Smart",
531:                        "com.jtattoo.plaf.smart.SmartLookAndFeel"));
532:
533:                JMenu syntheticaMenu = new JMenu("Synthetica family");
534:                customLafMenus.add(syntheticaMenu);
535:                syntheticaMenu
536:                        .add(LafChanger
537:                                .getMenuItem(this , "Synthetica base",
538:                                        "de.javasoft.plaf.synthetica.SyntheticaStandardLookAndFeel"));
539:                syntheticaMenu
540:                        .add(LafChanger
541:                                .getMenuItem(this , "Synthetica BlackMoon",
542:                                        "de.javasoft.plaf.synthetica.SyntheticaBlackMoonLookAndFeel"));
543:                syntheticaMenu
544:                        .add(LafChanger
545:                                .getMenuItem(this , "Synthetica BlackStar",
546:                                        "de.javasoft.plaf.synthetica.SyntheticaBlackStarLookAndFeel"));
547:                syntheticaMenu
548:                        .add(LafChanger
549:                                .getMenuItem(this , "Synthetica BlueIce",
550:                                        "de.javasoft.plaf.synthetica.SyntheticaBlueIceLookAndFeel"));
551:                syntheticaMenu
552:                        .add(LafChanger
553:                                .getMenuItem(this , "Synthetica BlueMoon",
554:                                        "de.javasoft.plaf.synthetica.SyntheticaBlueMoonLookAndFeel"));
555:                syntheticaMenu
556:                        .add(LafChanger
557:                                .getMenuItem(this , "Synthetica BlueSteel",
558:                                        "de.javasoft.plaf.synthetica.SyntheticaBlueSteelLookAndFeel"));
559:                syntheticaMenu
560:                        .add(LafChanger
561:                                .getMenuItem(this , "Synthetica GreenDream",
562:                                        "de.javasoft.plaf.synthetica.SyntheticaGreenDreamLookAndFeel"));
563:                syntheticaMenu
564:                        .add(LafChanger
565:                                .getMenuItem(this , "Synthetica OrangeMetallic",
566:                                        "de.javasoft.plaf.synthetica.SyntheticaOrangeMetallicLookAndFeel"));
567:                syntheticaMenu
568:                        .add(LafChanger
569:                                .getMenuItem(this , "Synthetica SilverMoon",
570:                                        "de.javasoft.plaf.synthetica.SyntheticaSilverMoonLookAndFeel"));
571:
572:                JMenu officeMenu = new JMenu("Office family");
573:                customLafMenus.add(officeMenu);
574:                officeMenu.add(LafChanger.getMenuItem(this , "Office 2003",
575:                        "org.fife.plaf.Office2003.Office2003LookAndFeel"));
576:                officeMenu.add(LafChanger.getMenuItem(this , "Office XP",
577:                        "org.fife.plaf.OfficeXP.OfficeXPLookAndFeel"));
578:                officeMenu
579:                        .add(LafChanger
580:                                .getMenuItem(this , "Visual Studio 2005",
581:                                        "org.fife.plaf.VisualStudio2005.VisualStudio2005LookAndFeel"));
582:
583:                customLafMenus.add(LafChanger.getMenuItem(this , "A03",
584:                        "apprising.api.swing.plaf.a03.A03LookAndFeel"));
585:                customLafMenus.add(LafChanger.getMenuItem(this , "Alloy",
586:                        "com.incors.plaf.alloy.AlloyLookAndFeel"));
587:                customLafMenus.add(LafChanger.getMenuItem(this , "FH",
588:                        "com.shfarr.ui.plaf.fh.FhLookAndFeel"));
589:                customLafMenus.add(LafChanger.getMenuItem(this , "Hippo",
590:                        "se.diod.hippo.plaf.HippoLookAndFeel"));
591:                customLafMenus.add(LafChanger.getMenuItem(this , "Kuntstoff",
592:                        "com.incors.plaf.kunststoff.KunststoffLookAndFeel"));
593:                customLafMenus.add(LafChanger.getMenuItem(this , "Liquid",
594:                        "com.birosoft.liquid.LiquidLookAndFeel"));
595:                customLafMenus.add(LafChanger.getMenuItem(this , "Lipstik",
596:                        "com.lipstikLF.LipstikLookAndFeel"));
597:                customLafMenus.add(LafChanger.getMenuItem(this , "Metouia",
598:                        "net.sourceforge.mlf.metouia.MetouiaLookAndFeel"));
599:                customLafMenus.add(LafChanger.getMenuItem(this , "Napkin",
600:                        "net.sourceforge.napkinlaf.NapkinLookAndFeel"));
601:                customLafMenus.add(LafChanger.getMenuItem(this , "NimROD",
602:                        "com.nilo.plaf.nimrod.NimRODLookAndFeel"));
603:                customLafMenus.add(LafChanger.getMenuItem(this , "Oyoaha",
604:                        "com.oyoaha.swing.plaf.oyoaha.OyoahaLookAndFeel"));
605:                customLafMenus.add(LafChanger.getMenuItem(this , "Pagosoft",
606:                        "com.pagosoft.plaf.PgsLookAndFeel"));
607:                customLafMenus.add(LafChanger.getMenuItem(this , "Simple",
608:                        "com.memoire.slaf.SlafLookAndFeel"));
609:                customLafMenus.add(LafChanger.getMenuItem(this , "Skin",
610:                        "com.l2fprod.gui.plaf.skin.SkinLookAndFeel"));
611:                customLafMenus.add(LafChanger.getMenuItem(this , "Smooth Metal",
612:                        "smooth.metal.SmoothLookAndFeel"));
613:                customLafMenus.add(LafChanger.getMenuItem(this , "Squareness",
614:                        "net.beeger.squareness.SquarenessLookAndFeel"));
615:                customLafMenus.add(LafChanger.getMenuItem(this , "Tiny",
616:                        "de.muntjak.tinylookandfeel.TinyLookAndFeel"));
617:                customLafMenus.add(LafChanger.getMenuItem(this , "Tonic",
618:                        "com.digitprop.tonic.TonicLookAndFeel"));
619:                customLafMenus.add(LafChanger.getMenuItem(this , "Trendy",
620:                        "com.Trendy.swing.plaf.TrendyLookAndFeel"));
621:
622:                JMenuBar jmb = new JMenuBar();
623:                jmb.add(lafMenu);
624:                this .setJMenuBar(jmb);
625:
626:                this .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
627:            }
628:
629:            public static void main(String[] args) {
630:                // FadeTracker.DEBUG_MODE = true;
631:                JDialog.setDefaultLookAndFeelDecorated(true);
632:                JFrame.setDefaultLookAndFeelDecorated(true);
633:                try {
634:                    UIManager
635:                            .setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel");
636:                } catch (Exception ex) {
637:                    ex.printStackTrace();
638:                }
639:
640:                SwingUtilities.invokeLater(new Runnable() {
641:                    public void run() {
642:                        new TestSwingXFrame().setVisible(true);
643:                    }
644:                });
645:            }
646:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.