Multi thread AS search

This commit is contained in:
honfika@gmail.com
2016-12-24 18:52:09 +01:00
parent 40e31a5f99
commit 5f2ffd0089
18 changed files with 1277 additions and 789 deletions

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler;
import com.jpexs.decompiler.flash.ApplicationInfo;
import com.jpexs.decompiler.flash.DecompilerPool;
import com.jpexs.decompiler.flash.EventListener;
import com.jpexs.decompiler.flash.ReadOnlyTagList;
import com.jpexs.decompiler.flash.SWF;
@@ -245,6 +246,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
private final MainFrameStatusPanel statusPanel;
private Thread taskThread;
private final MainFrameMenu mainMenu;
private final JProgressBar progressBar = new JProgressBar(0, 100);
@@ -843,6 +846,29 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
}
mainMenu.updateComponents(swf);
if (taskThread != null) {
taskThread.interrupt();
}
Thread t = new Thread() {
@Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
DecompilerPool d = swf.getDecompilerPool();
statusPanel.setStatus(swf.getFileTitle() + " " + d.getStat());
try {
Thread.sleep(100);
} catch (InterruptedException ex) {
break;
}
}
}
};
t.start();
taskThread = t;
}
private void updateUi() {