mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 18:00:58 +00:00
using DottedChains (almost) everywhere
This commit is contained in:
@@ -24,9 +24,9 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
||||
import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
import javax.swing.event.TreeModelEvent;
|
||||
import javax.swing.event.TreeModelListener;
|
||||
import javax.swing.tree.TreeModel;
|
||||
@@ -81,17 +81,16 @@ public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel
|
||||
continue;
|
||||
}
|
||||
|
||||
String packageStr = item.getClassPath().packageStr;
|
||||
DottedChain packageStr = item.getClassPath().packageStr;
|
||||
AS3Package pkg = ensurePackage(packageStr);
|
||||
pkg.addScriptPack(item);
|
||||
}
|
||||
}
|
||||
|
||||
private AS3Package ensurePackage(String packageStr) {
|
||||
StringTokenizer st = new StringTokenizer(packageStr, ".");
|
||||
private AS3Package ensurePackage(DottedChain packageStr) {
|
||||
AS3Package parent = root;
|
||||
while (st.hasMoreTokens()) {
|
||||
String pathElement = st.nextToken();
|
||||
for (int i = 0; i < packageStr.size(); i++) {
|
||||
String pathElement = packageStr.get(i);
|
||||
AS3Package pkg = parent.getSubPackage(pathElement);
|
||||
if (pkg == null) {
|
||||
pkg = new AS3Package(pathElement, swf);
|
||||
|
||||
@@ -520,7 +520,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
if (tm != null) {
|
||||
String name = "";
|
||||
if (classIndex > -1) {
|
||||
name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString();
|
||||
name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString(true);
|
||||
}
|
||||
|
||||
Trait currentTrait = null;
|
||||
@@ -571,7 +571,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
}
|
||||
currentMethodHighlight = null;
|
||||
currentTrait = null;
|
||||
String name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString();
|
||||
String name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString(true);
|
||||
currentTrait = getCurrentTrait();
|
||||
isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex);
|
||||
if (currentTrait != null) {
|
||||
|
||||
@@ -92,7 +92,7 @@ public class UsageFrame extends AppDialog implements MouseListener {
|
||||
cont.add(new JScrollPane(usageList), BorderLayout.CENTER);
|
||||
cont.add(buttonsPanel, BorderLayout.SOUTH);
|
||||
setSize(400, 300);
|
||||
setTitle((definitions ? translate("dialog.title.declaration") : translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc.constants).toPrintableString());
|
||||
setTitle((definitions ? translate("dialog.title.declaration") : translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc.constants).toPrintableString(true));
|
||||
View.centerScreen(this);
|
||||
View.setWindowIcon(this);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class UsageFrame extends AppDialog implements MouseListener {
|
||||
settrait.run();
|
||||
} else {
|
||||
abcPanel.decompiledTextArea.addScriptListener(settrait);
|
||||
abcPanel.hilightScript(abcPanel.getSwf(), abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants).toPrintableString());
|
||||
abcPanel.hilightScript(abcPanel.getSwf(), abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants).toPrintableString(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.gui.abc.tablemodels;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import javax.swing.event.TableModelListener;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
@@ -124,11 +125,11 @@ public class NamespaceTableModel implements TableModel {
|
||||
if (rowIndex == 0) {
|
||||
return "-";
|
||||
}
|
||||
String val = abc.constants.getNamespace(rowIndex).getName(abc.constants, true);
|
||||
if (val == null) {
|
||||
val = "-";
|
||||
DottedChain chain = abc.constants.getNamespace(rowIndex).getName(abc.constants, true);
|
||||
if (chain == null) {
|
||||
return "-";
|
||||
}
|
||||
return val;
|
||||
return chain.toRawString();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DebuggerTools {
|
||||
for (ABCContainerTag ac : swf.getAbcList()) {
|
||||
ABC a = ac.getABC();
|
||||
for (ScriptPack m : a.getScriptPacks(DEBUGGER_PACKAGE, allAbcList)) {
|
||||
if (isDebuggerClass(m.getClassPath().packageStr, null)) {
|
||||
if (isDebuggerClass(m.getClassPath().packageStr.toRawString(), null)) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class DebuggerTools {
|
||||
|
||||
public static void replaceTraceCalls(SWF swf, String fname) {
|
||||
if (hasDebugger(swf)) {
|
||||
String debuggerPkg = getDebuggerScriptPack(swf).getClassPath().packageStr;
|
||||
String debuggerPkg = getDebuggerScriptPack(swf).getClassPath().packageStr.toRawString();
|
||||
//change trace to fname
|
||||
for (ABCContainerTag ct : swf.getAbcList()) {
|
||||
ABC a = ct.getABC();
|
||||
|
||||
Reference in New Issue
Block a user