From ae3b124b3731aabb6e1a052a0e2ee86ac92508f1 Mon Sep 17 00:00:00 2001 From: Honfika Date: Mon, 25 Nov 2013 21:56:29 +0100 Subject: [PATCH] ASM panel is empty after switching caching mode: fixed (selected methodbody was not cleared, but the text was cleared => no refresh) --- trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java | 2 +- trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java | 2 +- .../jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java | 6 ++++++ .../com/jpexs/decompiler/flash/gui/abc/ClassesListTree.java | 2 +- .../com/jpexs/decompiler/flash/gui/abc/MethodCodePanel.java | 4 ++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 6cd966a64..941559318 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -3097,7 +3097,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T break; } } - abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setCode(""); + abcPanel.detailPanel.methodTraitPanel.methodCodePanel.clear(); abcPanel.navigator.setABC(abcList, scriptLeaf.abc); abcPanel.navigator.setClassIndex(classIndex, scriptLeaf.scriptIndex); abcPanel.setAbc(scriptLeaf.abc); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 6ab2cb459..67f6211dc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -525,7 +525,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Fr switchAbc(listIndex); decompiledTextArea.clearScriptCache(); decompiledTextArea.reloadClass(); - detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(-1, abc, decompiledTextArea.getCurrentTrait()); + detailPanel.methodTraitPanel.methodCodePanel.clear(); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java index 8e8a8e9a8..746c2ec65 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java @@ -246,6 +246,12 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi setCaretPosition(0); } + public void clear() { + setText(""); + bodyIndex = -1; + setCaretPosition(0); + } + public void selectInstruction(int pos) { String text = getText(); int lineCnt = 1; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTree.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTree.java index 0b06cbe8e..e1a09fdd1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTree.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTree.java @@ -143,7 +143,7 @@ public final class ClassesListTree extends JTree implements TreeSelectionListene abcPanel.decompiledTextArea.setScript(scriptLeaf, abcList); abcPanel.decompiledTextArea.setClassIndex(classIndex); abcPanel.decompiledTextArea.setNoTrait(); - abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setCode(""); + abcPanel.detailPanel.methodTraitPanel.methodCodePanel.clear(); Main.stopWork(); } }).start(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/MethodCodePanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/MethodCodePanel.java index eb990105e..bb30886f5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/MethodCodePanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/MethodCodePanel.java @@ -78,8 +78,8 @@ public class MethodCodePanel extends JPanel implements ActionListener { return sourceTextArea.bodyIndex; } - public void setCode(String text) { - sourceTextArea.setText(text); + public void clear() { + sourceTextArea.clear(); } public boolean save(ConstantPool constants) {