[jsword-svn] r968 - in trunk: bibledesktop/etc/eclipse common/src/main/java/org/crosswire/common/progress common/src/main/java/org/crosswire/common/util

dmsmith at crosswire.org dmsmith at crosswire.org
Mon Jan 23 09:15:50 MST 2006


Author: dmsmith
Date: 2006-01-23 09:15:36 -0700 (Mon, 23 Jan 2006)
New Revision: 968

Modified:
   trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop.launch
   trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop15.launch
   trunk/common/src/main/java/org/crosswire/common/progress/Job.java
   trunk/common/src/main/java/org/crosswire/common/util/EventListenerList.java
Log:
Fixed launch.
Removed swing dependencies from Job.

Modified: trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop.launch
===================================================================
--- trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop.launch	2006-01-23 02:26:26 UTC (rev 967)
+++ trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop.launch	2006-01-23 16:15:36 UTC (rev 968)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.crosswire.bibledesktop.desktop.Desktop"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jsword-limbo"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="bibledesktop"/>
 <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m -ea"/>
 <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
 <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>

Modified: trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop15.launch
===================================================================
--- trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop15.launch	2006-01-23 02:26:26 UTC (rev 967)
+++ trunk/bibledesktop/etc/eclipse/bibledesktop-app-desktop15.launch	2006-01-23 16:15:36 UTC (rev 968)
@@ -3,7 +3,7 @@
 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.crosswire.bibledesktop.desktop.Desktop"/>
 <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
 <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jdk-1.5.0"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jsword-limbo"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="bibledesktop"/>
 <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m -ea"/>
 <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
 <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>

Modified: trunk/common/src/main/java/org/crosswire/common/progress/Job.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/progress/Job.java	2006-01-23 02:26:26 UTC (rev 967)
+++ trunk/common/src/main/java/org/crosswire/common/progress/Job.java	2006-01-23 16:15:36 UTC (rev 968)
@@ -21,7 +21,6 @@
  */
 package org.crosswire.common.progress;
 
-import java.awt.event.ActionEvent;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
 import java.io.IOException;
@@ -32,11 +31,9 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Timer;
+import java.util.TimerTask;
 
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.Timer;
-
 import org.crosswire.common.util.Logger;
 import org.crosswire.common.util.NetUtil;
 
@@ -71,9 +68,10 @@
 
         if (fakeupdates)
         {
-            Action actupdate = new PredictAction();
-            updater = new Timer(100, actupdate);
-            updater.start();
+            updater = new Timer();
+            updater.schedule(new PredictTask(),
+                             0,
+                             100);
         }
 
         // Set-up the timings files. It's not a disaster if it doesn't load
@@ -151,7 +149,8 @@
 
             if (updater != null)
             {
-                updater.stop();
+                updater.cancel();
+                updater = null;
             }
 
             current.put(statedesc, new Integer((int) (System.currentTimeMillis() - start)));
@@ -537,7 +536,7 @@
     private URL predicturl;
 
     /**
-     * The swing timer that lets us post fake progress events
+     * The timer that lets us post fake progress events
      */
     private Timer updater;
 
@@ -549,12 +548,12 @@
     /**
      * So we can fake progress for Jobs that don't tell us how they are doing
      */
-    private final class PredictAction extends AbstractAction
+    private final class PredictTask extends TimerTask
     {
         /* (non-Javadoc)
          * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
          */
-        public void actionPerformed(ActionEvent ev)
+        public void run()
         {
             guessProgress();
             JobManager.fireWorkProgressed(Job.this, true);

Modified: trunk/common/src/main/java/org/crosswire/common/util/EventListenerList.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/util/EventListenerList.java	2006-01-23 02:26:26 UTC (rev 967)
+++ trunk/common/src/main/java/org/crosswire/common/util/EventListenerList.java	2006-01-23 16:15:36 UTC (rev 968)
@@ -36,10 +36,10 @@
  * <p>If you inculde sw*ng code in non-gui code then you can end up not being
  * able to run your code in a headerless environment because X includes Y which
  * inculdes Font which tries to lookup font metrics and then everything dies.
- * I appreciate the Headerless changes in 1.4 , but my rule (from before 1.4)
- * was "Don't inculde swing code from non-swing code", and I enforced that by
- * making sure all my swing code was in a package with swing in the name and by
- * making sure that the word swing was not in any non-swing code (hence I
+ * I appreciate the Headerless changes in 1.4, but my rule (from before 1.4)
+ * was "Don't inculde sw*ng code from non-sw*ng code", and I enforced that by
+ * making sure all my sw*ng code was in a package with sw*ng in the name and by
+ * making sure that the word sw*ng was not in any non-sw*ng code (hence I
  * spelled it sw*ng in comments)
  * That way some simple greps will tell you if the servlet front end was likely
  * to die.



More information about the jsword-svn mailing list