KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > Launcher


1 package com.opensymphony.workflow.designer;
2
3 import java.awt.*;
4 import javax.swing.*;
5
6 import com.jgoodies.plaf.LookUtils;
7 import com.jgoodies.plaf.Options;
8 import com.opensymphony.workflow.designer.swing.Splash;
9
10 /**
11  * @author hani Date: Apr 25, 2004 Time: 2:17:41 AM
12  */

13 public class Launcher
14 {
15   public static void main(String JavaDoc[] args)
16   {
17     System.getProperties().put("apple.laf.useScreenMenuBar", "true");
18     System.getProperties().put("com.apple.mrj.application.apple.menu.about.name", "OSWorkflow Designer");
19     String JavaDoc spec = System.getProperty("java.specification.version");
20     if(spec.startsWith("1.3") || spec.startsWith("1.2") || spec.startsWith("1.1"))
21     {
22       System.out.println("Workflow Designer requires JDK 1.4.0 or higher");
23       System.exit(1);
24     }
25     Splash splash = new Splash(new Frame(), new ImageIcon(Splash.class.getResource("/images/splash.gif")).getImage(), "OSWorkflow Designer", true);
26     splash.openSplash();
27     splash.setProgress(10);
28
29     if(LookUtils.class.getClassLoader() != null)
30     {
31       UIManager.put("ClassLoader", LookUtils.class.getClassLoader());
32     }
33     Options.setGlobalFontSizeHints(com.jgoodies.plaf.FontSizeHints.MIXED);
34     Options.setDefaultIconSize(new Dimension(18, 18));
35     Options.setUseNarrowButtons(true);
36     UIManager.put(com.jgoodies.plaf.Options.DEFAULT_ICON_SIZE_KEY, new Dimension(18, 18));
37     if(LookUtils.IS_OS_WINDOWS_MODERN)
38     {
39       try
40       {
41         UIManager.setLookAndFeel((LookAndFeel)Class.forName("com.jgoodies.plaf.windows.ExtWindowsLookAndFeel", true, com.jgoodies.plaf.windows.ExtWindowsLookAndFeel.class.getClassLoader()).newInstance());
42       }
43       catch(Exception JavaDoc e)
44       {
45         e.printStackTrace();
46       }
47     }
48     //all other platforms except for OSX get the plastic LAF
49
else
50     {
51       try
52       {
53         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
54       }
55       catch(Exception JavaDoc e)
56       {
57       }
58     }
59
60     splash.setProgress(20);
61
62     WorkflowDesigner d = new WorkflowDesigner(splash);
63     splash.setProgress(80);
64     d.pack();
65     splash.setProgress(90);
66     d.show();
67     splash.setProgress(100);
68     splash.closeSplash();
69     splash = null;
70     d.checkWorkspaceExists();
71   }
72
73 }
74
Popular Tags