001: package com.opensymphony.workflow.designer;
002:
003: import java.awt.*;
004: import javax.swing.*;
005:
006: import com.jgoodies.plaf.LookUtils;
007: import com.jgoodies.plaf.Options;
008: import com.opensymphony.workflow.designer.swing.Splash;
009:
010: /**
011: * @author hani Date: Apr 25, 2004 Time: 2:17:41 AM
012: */
013: public class Launcher {
014: public static void main(String[] args) {
015: // test - simulate System properties via JNLP
016: if (args.length > 0) {
017: if (args[0].equals("testnew")) {
018: System.getProperties().put(
019: "com.opensymphony.workflow.jws.verb", "new");
020: System.getProperties().put(
021: "com.opensymphony.workflow.jws.service",
022: "http://localhost:8000/workflow");
023: System.getProperties().put(
024: "com.opensymphony.workflow.jws.workspace",
025: "DocWay");
026: } else if (args[0].equals("testmodify")) {
027: System.getProperties().put(
028: "com.opensymphony.workflow.jws.verb", "modify");
029: System.getProperties().put(
030: "com.opensymphony.workflow.jws.service",
031: "http://localhost:8080/workflow");
032: System.getProperties().put(
033: "com.opensymphony.workflow.jws.workspace",
034: "DocWay");
035: System.getProperties().put(
036: "com.opensymphony.workflow.jws.id_1",
037: "MD00000008");
038: System.getProperties().put(
039: "com.opensymphony.workflow.jws.name_1",
040: "test doc");
041: }
042: }
043:
044: System.getProperties()
045: .put("apple.laf.useScreenMenuBar", "true");
046: System.getProperties().put(
047: "com.apple.mrj.application.apple.menu.about.name",
048: "OSWorkflow Designer");
049: String spec = System.getProperty("java.specification.version");
050: if (spec.startsWith("1.3") || spec.startsWith("1.2")
051: || spec.startsWith("1.1")) {
052: System.out
053: .println("Workflow Designer requires JDK 1.4.0 or higher");
054: System.exit(1);
055: }
056: Splash splash = new Splash(new Frame(), new ImageIcon(
057: Splash.class.getResource("/images/splash.gif"))
058: .getImage(), "OSWorkflow Designer", true);
059: splash.openSplash();
060: splash.setProgress(10);
061:
062: if (LookUtils.class.getClassLoader() != null) {
063: UIManager.put("ClassLoader", LookUtils.class
064: .getClassLoader());
065: }
066: Options
067: .setGlobalFontSizeHints(com.jgoodies.plaf.FontSizeHints.MIXED);
068: Options.setDefaultIconSize(new Dimension(18, 18));
069: Options.setUseNarrowButtons(true);
070: UIManager.put(com.jgoodies.plaf.Options.DEFAULT_ICON_SIZE_KEY,
071: new Dimension(18, 18));
072: if (LookUtils.IS_OS_WINDOWS_MODERN) {
073: try {
074: UIManager
075: .setLookAndFeel((LookAndFeel) Class
076: .forName(
077: "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel",
078: true,
079: com.jgoodies.plaf.windows.ExtWindowsLookAndFeel.class
080: .getClassLoader())
081: .newInstance());
082: } catch (Exception e) {
083: e.printStackTrace();
084: }
085: }
086: //all other platforms except for OSX get the plastic LAF
087: else {
088: try {
089: UIManager.setLookAndFeel(UIManager
090: .getSystemLookAndFeelClassName());
091: } catch (Exception e) {
092: }
093: }
094:
095: splash.setProgress(20);
096:
097: WorkflowDesigner d = new WorkflowDesigner(splash);
098: splash.setProgress(80);
099: d.pack();
100: splash.setProgress(90);
101: d.show();
102: splash.setProgress(100);
103: splash.closeSplash();
104: d.checkWorkspaceExists();
105: }
106:
107: }
|