summaryrefslogtreecommitdiff
path: root/altosui/AltosFlashUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-03-24 16:15:21 -0700
committerKeith Packard <keithp@keithp.com>2013-03-24 16:15:21 -0700
commit26b60e16c984255e869300b4aeafc12dd37fbd09 (patch)
tree1ebe600881ec75e226e90c2ef7dde65b909c5c7f /altosui/AltosFlashUI.java
parent4e606d05f4523a5afc46fbb7cdd8fd3c12836ab9 (diff)
altosui/altoslib: Move more flashing code from altosui to altoslib
Required a bit of refactoring to eliminate swing types from the flashing code, but nothing major. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosFlashUI.java')
-rw-r--r--altosui/AltosFlashUI.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java
index e5176278..f4e52218 100644
--- a/altosui/AltosFlashUI.java
+++ b/altosui/AltosFlashUI.java
@@ -215,15 +215,30 @@ public class AltosFlashUI
}
}
- class flash_task implements Runnable {
+ class flash_task implements Runnable, AltosFlashListener {
AltosFlashUI ui;
Thread t;
AltosFlash flash;
+ public void position(String in_s, int in_percent) {
+ final String s = in_s;
+ final int percent = in_percent;
+ Runnable r = new Runnable() {
+ public void run() {
+ try {
+ ui.actionPerformed(new ActionEvent(this,
+ percent,
+ s));
+ } catch (Exception ex) {
+ }
+ }
+ };
+ SwingUtilities.invokeLater(r);
+ }
+
public void run () {
try {
- flash = new AltosFlash(ui.file, ui.debug_dongle);
- flash.addActionListener(ui);
+ flash = new AltosFlash(ui.file, new AltosSerial(ui.debug_dongle), this);
final AltosRomconfig current_config = flash.romconfig();