restorecontrolflow removed

This commit is contained in:
2015-11-28 19:12:17 +01:00
parent 568f41b45e
commit 981cc62f16
9 changed files with 12 additions and 314 deletions
@@ -17,7 +17,6 @@
package com.jpexs.decompiler.flash.gui;
import com.jpexs.debugger.flash.DebuggerCommands;
import com.jpexs.debugger.flash.messages.out.OutStepContinue;
import com.jpexs.decompiler.flash.ApplicationInfo;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFBundle;
@@ -29,7 +28,6 @@ import com.jpexs.decompiler.flash.gui.helpers.CheckResources;
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.Cache;
import com.jpexs.helpers.CancellableWorker;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.utf8.Utf8Helper;
import com.sun.jna.Platform;
@@ -44,21 +42,15 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractButton;
@@ -79,6 +71,7 @@ public abstract class MainFrameMenu implements MenuBuilder {
private KeyEventDispatcher keyEventDispatcher;
private SWF swf;
protected final Map<String, HotKey> menuHotkeys = new HashMap<>();
@Override
@@ -326,26 +319,6 @@ public abstract class MainFrameMenu implements MenuBuilder {
return false;
}
protected void restoreControlFlow(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
restoreControlFlow(false);
}
protected void restoreControlFlowAll(ActionEvent evt) {
if (Main.isWorking()) {
return;
}
restoreControlFlow(true);
}
protected void restoreControlFlow(boolean all) {
mainFrame.getPanel().restoreControlFlow(all);
}
protected void showProxyActionPerformed(ActionEvent evt) {
if (Main.isWorking()) {
return;
@@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFBundle;
import com.jpexs.decompiler.flash.SWFSourceInfo;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.ClassPath;
import com.jpexs.decompiler.flash.abc.RenameType;
import com.jpexs.decompiler.flash.abc.ScriptPack;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
@@ -84,7 +83,6 @@ import com.jpexs.decompiler.flash.gui.controls.JPersistentSplitPane;
import com.jpexs.decompiler.flash.gui.dumpview.DumpTree;
import com.jpexs.decompiler.flash.gui.dumpview.DumpTreeModel;
import com.jpexs.decompiler.flash.gui.dumpview.DumpViewPanel;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.gui.helpers.ObservableList;
import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel;
import com.jpexs.decompiler.flash.gui.tagtree.TagTree;
@@ -142,7 +140,6 @@ import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
import com.jpexs.decompiler.flash.xfl.FLAVersion;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.CancellableWorker;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.Path;
@@ -2275,47 +2272,6 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
}
}
public void restoreControlFlow(final boolean all) {
if ((!all) || confirmExperimental()) {
new CancellableWorker<Void>() {
@Override
protected Void doInBackground() throws Exception {
ABCPanel abcPanel = getABCPanel();
if (all) {
for (ABCContainerTag tag : abcPanel.getAbcList()) {
tag.getABC().restoreControlFlow();
}
} else {
ABC abc = abcPanel.abc;
int bi = abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
abc.bodies.get(bi).restoreControlFlow(abc.constants, abcPanel.decompiledTextArea.getCurrentTrait(), abc.method_info.get(abc.bodies.get(bi).method_info));
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, abc, abcPanel.decompiledTextArea.getCurrentTrait(), abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getScriptIndex());
}
return null;
}
@Override
protected void onStart() {
Main.startWork(translate("work.restoringControlFlow"), this);
}
@Override
protected void done() {
View.execInEventDispatch(() -> {
Main.stopWork();
View.showMessageDialog(null, translate("work.restoringControlFlow.complete"));
getABCPanel().reload();
updateClassesList();
});
}
}.execute();
}
}
public void renameIdentifiers(final SWF swf) {
if (swf == null) {
return;