Anonymous avatar Anonymous committed 9ae65f7

Moved main designer entry point to a new Launcher class (so no UI is loaded for wrong JDK, and we don't load JFrame.class for the splash)
Set OSX app name

Comments (0)

Files changed (4)

     <jar jarfile="${dist}/designer.jar">
 	    <manifest>
 				<attribute name="Built-By" value="${user.name}"/>
-		    <attribute name="Main-Class" value="com.opensymphony.workflow.designer.WorkflowDesigner" />
+		    <attribute name="Main-Class" value="com.opensymphony.workflow.designer.Launcher" />
 		    <attribute name="Class-Path" value="../lib/designer/looks.jar ../lib/designer/forms.jar ../lib/designer/syntax.jar ../lib/designer/jgraph.jar ../lib/designer/foxtrot.jar ../lib/core/${oscore.jar}" />
 	    </manifest>
 	    <fileset dir="${build.client}" />

src/designer/com/opensymphony/workflow/designer/Launcher.java

+package com.opensymphony.workflow.designer;
+
+import java.awt.*;
+import javax.swing.*;
+
+import com.jgoodies.plaf.LookUtils;
+import com.jgoodies.plaf.Options;
+import com.opensymphony.workflow.designer.swing.Splash;
+
+/**
+ * @author hani Date: Apr 25, 2004 Time: 2:17:41 AM
+ */
+public class Launcher
+{
+  public static void main(String[] args)
+  {
+    System.getProperties().put("apple.laf.useScreenMenuBar", "true");
+    System.getProperties().put("com.apple.mrj.application.apple.menu.about.name", "OSWorkflow Designer");
+    String spec = System.getProperty("java.specification.version");
+    if(spec.startsWith("1.3") || spec.startsWith("1.2") || spec.startsWith("1.1"))
+    {
+      System.out.println("Workflow Designer requires JDK 1.4.0 or higher");
+      System.exit(1);
+    }
+    Splash splash = new Splash(new Frame(), new ImageIcon(Splash.class.getResource("/images/splash.gif")).getImage(), "OSWorkflow Designer", true);
+    splash.openSplash();
+    splash.setProgress(10);
+
+    if(LookUtils.class.getClassLoader() != null)
+    {
+      UIManager.put("ClassLoader", LookUtils.class.getClassLoader());
+    }
+    Options.setGlobalFontSizeHints(com.jgoodies.plaf.FontSizeHints.MIXED);
+    Options.setDefaultIconSize(new Dimension(18, 18));
+    Options.setUseNarrowButtons(true);
+    UIManager.put(com.jgoodies.plaf.Options.DEFAULT_ICON_SIZE_KEY, new Dimension(18, 18));
+    if(LookUtils.IS_OS_WINDOWS_MODERN)
+    {
+      try
+      {
+        UIManager.setLookAndFeel((LookAndFeel)Class.forName("com.jgoodies.plaf.windows.ExtWindowsLookAndFeel", true, com.jgoodies.plaf.windows.ExtWindowsLookAndFeel.class.getClassLoader()).newInstance());
+      }
+      catch(Exception e)
+      {
+        e.printStackTrace();
+      }
+    }
+    //all other platforms except for OSX get the plastic LAF
+    else
+    {
+      try
+      {
+        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+      }
+      catch(Exception e)
+      {
+      }
+    }
+
+    splash.setProgress(20);
+
+    WorkflowDesigner d = new WorkflowDesigner(splash);
+    splash.setProgress(80);
+    d.pack();
+    splash.setProgress(90);
+    d.show();
+    splash.setProgress(100);
+    splash.closeSplash();
+    splash = null;
+    d.checkWorkspaceExists();
+  }
+
+}

src/designer/com/opensymphony/workflow/designer/WorkflowDesigner.java

 import com.opensymphony.workflow.loader.PaletteDescriptor;
 import com.opensymphony.workflow.loader.WorkflowDescriptor;
 import com.opensymphony.workflow.loader.Workspace;
-import com.jgoodies.plaf.Options;
-import com.jgoodies.plaf.LookUtils;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.DocumentBuilder;
   private FramePanel detailFramePanel;
   public static WorkflowDesigner INSTANCE = null;
   private PaletteDescriptor palette = null;
-  private static Splash splash;
   public StatusBar statusBar;
 
-  public WorkflowDesigner()
+  public WorkflowDesigner(Splash splash)
   {
     super(ResourceManager.getString("app.name"));
     INSTANCE = this;
       e.printStackTrace();
     }
   }
-
-  public static void main(String[] args)
-  {
-    System.getProperties().put("apple.laf.useScreenMenuBar", "true");
-    String spec = System.getProperty("java.specification.version");
-    if(spec.startsWith("1.3") || spec.startsWith("1.2") || spec.startsWith("1.1"))
-    {
-      System.out.println("Workflow Designer requires JDK 1.4.0 or higher");
-      System.exit(1);
-    }
-    splash = new Splash(new Frame(), ResourceManager.getIcon("splash").getImage(), ResourceManager.getString("app.name"), true);
-    splash.openSplash();
-    splash.setProgress(10);
-
-    if(LookUtils.class.getClassLoader() != null)
-    {
-      UIManager.put("ClassLoader", LookUtils.class.getClassLoader());
-    }
-    Options.setGlobalFontSizeHints(com.jgoodies.plaf.FontSizeHints.MIXED);
-    Options.setDefaultIconSize(new Dimension(18, 18));
-    Options.setUseNarrowButtons(true);
-    UIManager.put(com.jgoodies.plaf.Options.DEFAULT_ICON_SIZE_KEY, new Dimension(18, 18));
-    if(LookUtils.IS_OS_WINDOWS_MODERN)
-    {
-      try
-      {
-        UIManager.setLookAndFeel((LookAndFeel)Class.forName("com.jgoodies.plaf.windows.ExtWindowsLookAndFeel", true, com.jgoodies.plaf.windows.ExtWindowsLookAndFeel.class.getClassLoader()).newInstance());
-      }
-      catch(Exception e)
-      {
-	      e.printStackTrace();
-      }
-    }
-    //all other platforms except for OSX get the plastic LAF
-    else
-    {
-      try
-      {
-        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-      }
-      catch(Exception e)
-      {
-      }
-    }
-
-    splash.setProgress(20);
-
-    WorkflowDesigner d = new WorkflowDesigner();
-    splash.setProgress(80);
-    d.pack();
-    splash.setProgress(90);
-    d.show();
-    splash.setProgress(100);
-    splash.closeSplash();
-    splash = null;
-    d.checkWorkspaceExists();
-  }
 }

src/designer/com/opensymphony/workflow/designer/swing/Splash.java

   private Rectangle progressBarBounds;
   private int percent;
 
-  public Splash(Frame owner, Image image, String text, boolean showProgress)
+  public Splash(Window owner, Image image, String text, boolean showProgress)
   {
     super(owner);
     this.image = image;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.