Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / altosui / AltosFlash.java
index 802adc8cd771aed965dfe6b91c1e1582d5632519..996456fda7c13717e1d934184c124d7cd10b75b9 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package altosui;
+package AltosUI;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -27,8 +27,9 @@ import java.util.*;
 import java.text.*;
 import java.util.prefs.*;
 import java.util.concurrent.LinkedBlockingQueue;
+import org.altusmetrum.AltosLib.*;
 
-public class AltosFlash implements Runnable {
+public class AltosFlash {
        File            file;
        FileInputStream input;
        AltosHexfile    image;
@@ -252,9 +253,7 @@ public class AltosFlash implements Runnable {
                throw new IOException("Failed to execute program on target");
        }
 
-       Thread thread;
-
-       public void run() {
+       public void flash() {
                try {
                        if (!check_rom_config())
                                throw new IOException("Invalid rom config settings");
@@ -333,15 +332,14 @@ public class AltosFlash implements Runnable {
                }
        }
 
-       public void flash() {
-               thread = new Thread(this);
-               thread.start();
+       public void close() {
+               if (debug != null)
+                       debug.close();
        }
 
        synchronized public void abort() {
                aborted = true;
-               if (debug != null)
-                       debug.close();
+               close();
        }
 
        public void addActionListener(ActionListener l) {