diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index a214d633d..b726ce991 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -447,9 +447,9 @@ public final class SWF implements SWFContainerItem, Timelined { for (Tag t : tags) { if (t instanceof SymbolClassTag) { SymbolClassTag sc = (SymbolClassTag) t; - for (int i = 0; i < sc.tags.length; i++) { - if (sc.tags[i] == 0) { - return sc.names[i]; + for (int i = 0; i < sc.tags.size(); i++) { + if (sc.tags.get(i) == 0) { + return sc.names.get(i); } } } @@ -952,9 +952,9 @@ public final class SWF implements SWFContainerItem, Timelined { for (Tag t : tags) { if (t instanceof SymbolClassTag) { SymbolClassTag sct = (SymbolClassTag) t; - for (int i = 0; i < sct.tags.length; i++) { - if ((!classes.containsKey(sct.tags[i])) && (!classes.containsValue(sct.names[i]))) { - classes.put(sct.tags[i], sct.names[i]); + for (int i = 0; i < sct.tags.size(); i++) { + if ((!classes.containsKey(sct.tags.get(i))) && (!classes.containsValue(sct.names.get(i)))) { + classes.put(sct.tags.get(i), sct.names.get(i)); } } } @@ -1882,10 +1882,10 @@ public final class SWF implements SWFContainerItem, Timelined { for (Tag tag : tags) { if (tag instanceof SymbolClassTag) { SymbolClassTag sc = (SymbolClassTag) tag; - for (int i = 0; i < sc.names.length; i++) { - String newname = deobfuscation.deobfuscateNameWithPackage(true, sc.names[i], deobfuscated, renameType, deobfuscated); + for (int i = 0; i < sc.names.size(); i++) { + String newname = deobfuscation.deobfuscateNameWithPackage(true, sc.names.get(i), deobfuscated, renameType, deobfuscated); if (newname != null) { - sc.names[i] = newname; + sc.names.set(i, newname); } } sc.setModified(true); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/SymbolClassExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/SymbolClassExporter.java new file mode 100644 index 000000000..de940dc2a --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/SymbolClassExporter.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.exporters; + +import com.jpexs.decompiler.flash.EventListener; +import com.jpexs.decompiler.flash.tags.ExportAssetsTag; +import com.jpexs.decompiler.flash.tags.SymbolClassTag; +import com.jpexs.decompiler.flash.tags.Tag; +import com.jpexs.helpers.Helper; +import com.jpexs.helpers.utf8.Utf8OutputStreamWriter; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class SymbolClassExporter { + + public static final String SYMBOL_CLASS_EXPORT_FILENAME = "symbols.csv"; + + public List exportNames(final String outdir, List tags, EventListener evl) throws IOException { + List ret = new ArrayList<>(); + int count = 0; + for (Tag t : tags) { + if (t instanceof ExportAssetsTag || t instanceof SymbolClassTag) { + count++; + } + } + + if (count == 0) { + return ret; + } + + File foutdir = new File(outdir); + if (!foutdir.exists()) { + if (!foutdir.mkdirs()) { + if (!foutdir.exists()) { + throw new IOException("Cannot create directory " + outdir); + } + } + } + + final File file = new File(outdir + File.separator + SYMBOL_CLASS_EXPORT_FILENAME); + try (Writer writer = new BufferedWriter(new Utf8OutputStreamWriter(new FileOutputStream(file)))) { + for (Tag t : tags) { + if (t instanceof ExportAssetsTag) { + ExportAssetsTag eat = (ExportAssetsTag) t; + for (int i = 0; i < eat.tags.size(); i++) { + writer.append(eat.tags.get(i) + ";" + eat.names.get(i) + Helper.newLine); + } + } else if (t instanceof SymbolClassTag) { + SymbolClassTag sct = (SymbolClassTag) t; + for (int i = 0; i < sct.tags.size(); i++) { + writer.append(sct.tags.get(i) + ";" + sct.names.get(i) + Helper.newLine); + } + } + } + } + + ret.add(file); + return ret; + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/modes/SymbolClassExportMode.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/modes/SymbolClassExportMode.java new file mode 100644 index 000000000..4c2a3a89e --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/modes/SymbolClassExportMode.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.exporters.modes; + +/** + * + * @author JPEXS + */ +public enum SymbolClassExportMode { + + CSV +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/SymbolClassImporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/SymbolClassImporter.java new file mode 100644 index 000000000..0d2fe6ae5 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/SymbolClassImporter.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.importers; + +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.tags.ExportAssetsTag; +import com.jpexs.decompiler.flash.tags.SymbolClassTag; +import com.jpexs.decompiler.flash.tags.Tag; +import com.jpexs.helpers.Helper; +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author JPEXS + */ +public class SymbolClassImporter { + + public void importSymbolClasses(File importFile, SWF swf) { + String texts = Helper.readTextFile(importFile.getPath()); + String[] lines = texts.split(Helper.newLine); + Map nameMap = new HashMap<>(); + for (String line : lines) { + String[] pair = line.split(";"); + int characterId = Integer.parseInt(pair[0]); + String name = pair[1]; + nameMap.put(characterId, name); + } + + for (Tag tag : swf.tags) { + if (tag instanceof ExportAssetsTag) { + ExportAssetsTag eat = (ExportAssetsTag) tag; + for (int i = 0; i < eat.tags.size(); i++) { + int id = eat.tags.get(i); + if (nameMap.containsKey(id)) { + eat.names.set(i, nameMap.get(id)); + eat.setModified(true); + } + } + } else if (tag instanceof SymbolClassTag) { + SymbolClassTag sct = (SymbolClassTag) tag; + for (int i = 0; i < sct.tags.size(); i++) { + int id = sct.tags.get(i); + if (nameMap.containsKey(id)) { + sct.names.set(i, nameMap.get(id)); + sct.setModified(true); + } + } + } + } + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java index bc9ecfc02..0ac28093f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.annotations.SWFArray; import com.jpexs.decompiler.flash.types.annotations.SWFType; @@ -34,7 +35,7 @@ import java.util.List; * * @author JPEXS */ -public class ExportAssetsTag extends Tag { +public class ExportAssetsTag extends SymbolClassTypeTag { /** * HashMap with assets @@ -78,8 +79,8 @@ public class ExportAssetsTag extends Tag { names = new ArrayList<>(); for (int i = 0; i < count; i++) { int characterId = sis.readUI16("characterId"); - tags.add(characterId); String name = sis.readString("name"); + tags.add(characterId); names.add(name); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java index aded07cf0..8432e2fe0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.annotations.SWFArray; import com.jpexs.decompiler.flash.types.annotations.SWFType; @@ -26,15 +27,17 @@ import com.jpexs.helpers.ByteArrayRange; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; -public class SymbolClassTag extends Tag { +public class SymbolClassTag extends SymbolClassTypeTag { @SWFType(value = BasicType.UI16) @SWFArray(value = "tag", countField = "numSymbols") - public int[] tags; + public List tags; @SWFArray(value = "name", countField = "numSymbols") - public String[] names; + public List names; public static final int ID = 76; @@ -45,8 +48,8 @@ public class SymbolClassTag extends Tag { */ public SymbolClassTag(SWF swf) { super(swf, ID, "SymbolClass", null); - tags = new int[0]; - names = new String[0]; + tags = new ArrayList<>(); + names = new ArrayList<>(); } public SymbolClassTag(SWFInputStream sis, ByteArrayRange data) throws IOException { @@ -57,13 +60,13 @@ public class SymbolClassTag extends Tag { @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { int numSymbols = sis.readUI16("numSymbols"); - tags = new int[numSymbols]; - names = new String[numSymbols]; - for (int ii = 0; ii < numSymbols; ii++) { + tags = new ArrayList<>(numSymbols); + names = new ArrayList<>(numSymbols); + for (int i = 0; i < numSymbols; i++) { int tagID = sis.readUI16("tagID"); String className = sis.readString("className"); - tags[ii] = tagID; - names[ii] = className; + tags.add(tagID); + names.add(className); } } @@ -78,11 +81,11 @@ public class SymbolClassTag extends Tag { OutputStream os = baos; SWFOutputStream sos = new SWFOutputStream(os, getVersion()); try { - int numSymbols = tags.length; + int numSymbols = tags.size(); sos.writeUI16(numSymbols); - for (int ii = 0; ii < numSymbols; ii++) { - sos.writeUI16(tags[ii]); - sos.writeString(names[ii]); + for (int i = 0; i < numSymbols; i++) { + sos.writeUI16(tags.get(i)); + sos.writeString(names.get(i)); } } catch (IOException e) { throw new Error("This should never happen.", e); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java index bbf172920..8986151b9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -90,7 +90,7 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable { @Override public String getExportFileName() { - return getName(); + return tagName; } /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java index dff572efe..e2af5e4b9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java @@ -58,7 +58,7 @@ public abstract class CharacterIdTag extends Tag { @Override public String getExportFileName() { - String result = super.getName() + "_" + getCharacterId(); + String result = super.getExportFileName() + "_" + getCharacterId(); return result + (exportName != null ? "_" + exportName : ""); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java index e5af04803..ce8f7d2d6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java @@ -48,13 +48,13 @@ public abstract class CharacterTag extends CharacterIdTag { if (className != null) { nameAppend = ": " + className; } - if (getCharacterId() != -1) { - return tagName + " (" + getCharacterId() + nameAppend + ")"; - } - if (!nameAppend.isEmpty()) { - return tagName + " (" + nameAppend + ")"; - } - return tagName; + return tagName + " (" + getCharacterId() + nameAppend + ")"; + } + + @Override + public String getExportFileName() { + String result = super.getExportFileName(); + return result + (className != null ? "_" + className : ""); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java index 2a26398f2..b4c7936d0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -170,6 +170,16 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable return tagName + " (" + getCharacterId() + nameAppend + ")"; } + @Override + public String getExportFileName() { + String result = super.getExportFileName(); + String fontName = getFontNameIntag(); + if (fontName != null) { + fontName = fontName.replace(" ", "_"); + } + return result + (fontName != null ? "_" + fontName : ""); + } + public String getSystemFontName() { Map fontPairs = Configuration.getFontToNameMap(); String key = swf.getShortFileName() + "_" + getFontId() + "_" + getFontNameIntag(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/SymbolClassTypeTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/SymbolClassTypeTag.java new file mode 100644 index 000000000..a83b35bd4 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/SymbolClassTypeTag.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.tags.base; + +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.tags.Tag; +import com.jpexs.helpers.ByteArrayRange; + +/** + * + * @author JPEXS + */ +public abstract class SymbolClassTypeTag extends Tag { + + public SymbolClassTypeTag(SWF swf, int id, String name, ByteArrayRange data) { + super(swf, id, name, data); + } +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index 43be1c4ff..ad51dc2f6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -2307,9 +2307,9 @@ public class XFLConverter { for (Tag t : tags) { if (t instanceof SymbolClassTag) { SymbolClassTag sc = (SymbolClassTag) t; - for (int i = 0; i < sc.tags.length; i++) { - if (!ret.containsKey(sc.tags[i]) && !ret.containsValue(sc.names[i])) { - ret.put(sc.tags[i], sc.names[i]); + for (int i = 0; i < sc.tags.size(); i++) { + if (!ret.containsKey(sc.tags.get(i)) && !ret.containsValue(sc.names.get(i))) { + ret.put(sc.tags.get(i), sc.names.get(i)); } } } diff --git a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java index 269e2ab7e..6cb844901 100644 --- a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java @@ -152,7 +152,7 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener ConfigurationCategory cat = field.getAnnotation(ConfigurationCategory.class); String scat = cat == null ? "other" : cat.value(); if (!categorized.containsKey(scat)) { - categorized.put(scat, new HashMap()); + categorized.put(scat, new HashMap<>()); } categorized.get(scat).put(name, field); } diff --git a/src/com/jpexs/decompiler/flash/gui/ExportDialog.java b/src/com/jpexs/decompiler/flash/gui/ExportDialog.java index 2db0d00a6..994b1cb39 100644 --- a/src/com/jpexs/decompiler/flash/gui/ExportDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/ExportDialog.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.exporters.modes.MovieExportMode; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.exporters.modes.ShapeExportMode; import com.jpexs.decompiler.flash.exporters.modes.SoundExportMode; +import com.jpexs.decompiler.flash.exporters.modes.SymbolClassExportMode; import com.jpexs.decompiler.flash.exporters.modes.TextExportMode; import com.jpexs.decompiler.flash.gui.tagtree.TagTreeModel; import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag; @@ -37,6 +38,7 @@ import com.jpexs.decompiler.flash.tags.base.ImageTag; import com.jpexs.decompiler.flash.tags.base.MorphShapeTag; import com.jpexs.decompiler.flash.tags.base.ShapeTag; import com.jpexs.decompiler.flash.tags.base.SoundTag; +import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag; import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.timeline.Frame; import com.jpexs.decompiler.flash.treeitems.TreeItem; @@ -75,7 +77,8 @@ public class ExportDialog extends AppDialog { TagTreeModel.FOLDER_BINARY_DATA, TagTreeModel.FOLDER_FRAMES, TagTreeModel.FOLDER_FONTS, - TagTreeModel.FOLDER_MORPHSHAPES + TagTreeModel.FOLDER_MORPHSHAPES, + "symbolclass" }; //Display options only when these classes found @@ -89,7 +92,8 @@ public class ExportDialog extends AppDialog { {DefineBinaryDataTag.class}, {Frame.class}, {FontTag.class}, - {MorphShapeTag.class} + {MorphShapeTag.class}, + {SymbolClassTypeTag.class} }; //Enum classes for values @@ -103,7 +107,8 @@ public class ExportDialog extends AppDialog { BinaryDataExportMode.class, FramesExportMode.class, FontExportMode.class, - MorphShapeExportMode.class + MorphShapeExportMode.class, + SymbolClassExportMode.class }; Class[] zoomClasses = { diff --git a/src/com/jpexs/decompiler/flash/gui/GenericTagPanel.java b/src/com/jpexs/decompiler/flash/gui/GenericTagPanel.java index 4bfc17504..136304ee0 100644 --- a/src/com/jpexs/decompiler/flash/gui/GenericTagPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/GenericTagPanel.java @@ -179,7 +179,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener { private void generateEditControls(Tag tag, boolean readonly) { clear(); - generateEditControlsRecursive(tag, "", new ArrayList(), new ArrayList(), readonly); + generateEditControlsRecursive(tag, "", new ArrayList<>(), new ArrayList<>(), readonly); change(null); } diff --git a/src/com/jpexs/decompiler/flash/gui/GraphDialog.java b/src/com/jpexs/decompiler/flash/gui/GraphDialog.java index 94267ae06..abd16f14e 100644 --- a/src/com/jpexs/decompiler/flash/gui/GraphDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/GraphDialog.java @@ -65,7 +65,7 @@ public class GraphDialog extends AppDialog { public GraphPanel(Graph graph) throws InterruptedException { graph.init(null); - size = getPartPositions(head = graph.heads.get(0), SPACE_VERTICAL + SPACE_VERTICAL + BLOCK_HEIGHT / 2, getPartWidth(graph.heads.get(0), new HashSet()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2 - SPACE_HORIZONTAL, partPos, true); + size = getPartPositions(head = graph.heads.get(0), SPACE_VERTICAL + SPACE_VERTICAL + BLOCK_HEIGHT / 2, getPartWidth(graph.heads.get(0), new HashSet<>()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2 - SPACE_HORIZONTAL, partPos, true); backLinksLeft = 1; backLinksRight = 1; for (GraphPart part : partPos.keySet()) { diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index 57c280ec5..4004b9a58 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -562,7 +562,7 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis stillFrame = true; zoomAvailable = false; iconPanel.setImg(image); - iconPanel.setOutlines(new ArrayList(), new ArrayList()); + iconPanel.setOutlines(new ArrayList<>(), new ArrayList<>()); drawReady = true; } @@ -596,13 +596,13 @@ public final class ImagePanel extends JPanel implements ActionListener, MediaDis } iconPanel.setImg(image); - iconPanel.setOutlines(new ArrayList(), new ArrayList()); + iconPanel.setOutlines(new ArrayList<>(), new ArrayList<>()); drawReady = true; } private synchronized void clearImagePanel() { iconPanel.setImg(null); - iconPanel.setOutlines(new ArrayList(), new ArrayList()); + iconPanel.setOutlines(new ArrayList<>(), new ArrayList<>()); } @Override diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 9eafac4cf..888d29dec 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -162,6 +162,10 @@ public abstract class MainFrameMenu { mainFrame.getPanel().importText(swf); } + protected void importSymbolClass() { + mainFrame.getPanel().importSymbolClass(swf); + } + protected boolean export(boolean onlySelected) { if (swf != null) { mainFrame.getPanel().export(onlySelected); diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java index f203d41f4..03c27c1d2 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java @@ -137,6 +137,8 @@ public class MainFrameRibbonMenu extends MainFrameMenu implements ActionListener private static final String ACTION_IMPORT_TEXT = "IMPORTTEXT"; + private static final String ACTION_IMPORT_SYMBOL_CLASS = "IMPORTSYMBOLCLASS"; + private static final String ACTION_CHECK_UPDATES = "CHECKUPDATES"; private static final String ACTION_HELP_US = "HELPUS"; @@ -201,6 +203,8 @@ public class MainFrameRibbonMenu extends MainFrameMenu implements ActionListener private JCommandButton importTextCommandButton; + private JCommandButton importSymbolClassCommandButton; + private JCommandButton importXmlCommandButton; private JCommandButton exportXmlCommandButton; @@ -446,11 +450,15 @@ public class MainFrameRibbonMenu extends MainFrameMenu implements ActionListener importTextCommandButton = new JCommandButton(fixCommandTitle(translate("menu.file.import.text")), View.getResizableIcon("importtext32")); assignListener(importTextCommandButton, ACTION_IMPORT_TEXT); + importSymbolClassCommandButton = new JCommandButton(fixCommandTitle(translate("menu.file.import.symbolClass")), View.getResizableIcon("importtext32")); + assignListener(importSymbolClassCommandButton, ACTION_IMPORT_SYMBOL_CLASS); + importXmlCommandButton = new JCommandButton(fixCommandTitle(translate("menu.file.import.xml")), View.getResizableIcon("importxml32")); assignListener(importXmlCommandButton, ACTION_IMPORT_SWF_XML); importBand.addCommandButton(importXmlCommandButton, RibbonElementPriority.TOP); importBand.addCommandButton(importTextCommandButton, RibbonElementPriority.TOP); + importBand.addCommandButton(importSymbolClassCommandButton, RibbonElementPriority.TOP); JRibbonBand viewBand = new JRibbonBand(translate("menu.view"), null); viewBand.setResizePolicies(getResizePolicies(viewBand)); @@ -738,6 +746,7 @@ public class MainFrameRibbonMenu extends MainFrameMenu implements ActionListener exportXmlCommandButton.setEnabled(swfLoaded); exportSelectionCommandButton.setEnabled(swfLoaded); importTextCommandButton.setEnabled(swfLoaded); + importSymbolClassCommandButton.setEnabled(swfLoaded); importXmlCommandButton.setEnabled(swfLoaded); reloadCommandButton.setEnabled(swfLoaded); @@ -949,6 +958,9 @@ public class MainFrameRibbonMenu extends MainFrameMenu implements ActionListener case ACTION_IMPORT_TEXT: importText(); break; + case ACTION_IMPORT_SYMBOL_CLASS: + importSymbolClass(); + break; case ACTION_EXPORT_SWF_XML: mainFrame.getPanel().exportSwfXml(); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 62e34b649..a9588884f 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -37,6 +37,7 @@ import com.jpexs.decompiler.flash.exporters.MorphShapeExporter; import com.jpexs.decompiler.flash.exporters.MovieExporter; import com.jpexs.decompiler.flash.exporters.ShapeExporter; import com.jpexs.decompiler.flash.exporters.SoundExporter; +import com.jpexs.decompiler.flash.exporters.SymbolClassExporter; import com.jpexs.decompiler.flash.exporters.TextExporter; import com.jpexs.decompiler.flash.exporters.modes.BinaryDataExportMode; import com.jpexs.decompiler.flash.exporters.modes.FontExportMode; @@ -77,6 +78,7 @@ import com.jpexs.decompiler.flash.importers.BinaryDataImporter; import com.jpexs.decompiler.flash.importers.ImageImporter; import com.jpexs.decompiler.flash.importers.ShapeImporter; import com.jpexs.decompiler.flash.importers.SwfXmlImporter; +import com.jpexs.decompiler.flash.importers.SymbolClassImporter; import com.jpexs.decompiler.flash.importers.TextImporter; import com.jpexs.decompiler.flash.tags.ABCContainerTag; import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag; @@ -98,6 +100,7 @@ import com.jpexs.decompiler.flash.tags.base.MorphShapeTag; import com.jpexs.decompiler.flash.tags.base.ShapeTag; import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag; import com.jpexs.decompiler.flash.tags.base.SoundTag; +import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag; import com.jpexs.decompiler.flash.tags.base.TextImportErrorHandler; import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.tags.text.TextAlign; @@ -380,7 +383,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec private JPanel createFolderPreviewCard() { JPanel folderPreviewCard = new JPanel(new BorderLayout()); - folderPreviewPanel = new FolderPreviewPanel(this, new ArrayList()); + folderPreviewPanel = new FolderPreviewPanel(this, new ArrayList<>()); folderPreviewCard.add(new JScrollPane(folderPreviewPanel), BorderLayout.CENTER); return folderPreviewCard; @@ -1012,6 +1015,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec List binaryData = new ArrayList<>(); Map> frames = new HashMap<>(); List fonts = new ArrayList<>(); + List symbolNames = new ArrayList<>(); SWF swf = allSwfs.get(j); for (TreeItem d : sel) { @@ -1060,6 +1064,11 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec if (nodeType == TreeNodeType.FONT) { fonts.add((Tag) d); } + if (nodeType == TreeNodeType.OTHER_TAG) { + if (d instanceof SymbolClassTypeTag) { + symbolNames.add((Tag) d); + } + } } if (d instanceof Frame) { @@ -1071,7 +1080,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec parentId = ((CharacterTag) parent).getCharacterId(); } if (!frames.containsKey(parentId)) { - frames.put(parentId, new ArrayList()); + frames.put(parentId, new ArrayList<>()); } frames.get(parentId).add(frame); } @@ -1106,11 +1115,14 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class)), evl)); ret.addAll(new FontExporter().exportFonts(handler, selFile + File.separator + "fonts", fonts, new FontExportSettings(export.getValue(FontExportMode.class)), evl)); + ret.addAll(new SymbolClassExporter().exportNames(selFile, symbolNames, evl)); FrameExporter frameExporter = new FrameExporter(); FramesExportSettings fes = new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom()); for (Entry> entry : frames.entrySet()) { - ret.addAll(frameExporter.exportFrames(handler, selFile + File.separator + "frames", swf, entry.getKey(), entry.getValue(), fes, evl)); + int containerId = entry.getKey(); + String subFolder = containerId == 0 ? "frames" : "sprites"; + ret.addAll(frameExporter.exportFrames(handler, selFile + File.separator + subFolder, swf, containerId, entry.getValue(), fes, evl)); } if (swf.isAS3()) { @@ -1145,13 +1157,14 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class)), evl); new FontExporter().exportFonts(handler, selFile + File.separator + "fonts", swf.tags, new FontExportSettings(export.getValue(FontExportMode.class)), evl); + new SymbolClassExporter().exportNames(selFile, swf.tags, evl); FrameExporter frameExporter = new FrameExporter(); FramesExportSettings fes = new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom()); frameExporter.exportFrames(handler, selFile + File.separator + "frames", swf, 0, null, fes, evl); for (CharacterTag c : swf.getCharacters().values()) { if (c instanceof DefineSpriteTag) { - frameExporter.exportFrames(handler, selFile + File.separator + "frames", swf, c.getCharacterId(), null, fes, evl); + frameExporter.exportFrames(handler, selFile + File.separator + "sprites", swf, c.getCharacterId(), null, fes, evl); } } @@ -1660,6 +1673,23 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } } + public void importSymbolClass(final SWF swf) { + JFileChooser chooser = new JFileChooser(); + chooser.setCurrentDirectory(new File(Configuration.lastExportDir.get())); + chooser.setDialogTitle(translate("import.select.directory")); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + chooser.setAcceptAllFileFilterUsed(false); + if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { + String selFile = Helper.fixDialogFile(chooser.getSelectedFile()).getAbsolutePath(); + File importFile = new File(Path.combine(selFile, SymbolClassExporter.SYMBOL_CLASS_EXPORT_FILENAME)); + SymbolClassImporter importer = new SymbolClassImporter(); + + if (importFile.exists()) { + importer.importSymbolClasses(importFile, swf); + } + } + } + private String selectExportDir() { JFileChooser chooser = new JFileChooser(); chooser.setCurrentDirectory(new File(Configuration.lastExportDir.get())); @@ -2784,7 +2814,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec if (tim != null) { return tim; } - tim = new Timeline(tag.getSwf(), null, new ArrayList(), ((CharacterTag) tag).getCharacterId(), getRect()); + tim = new Timeline(tag.getSwf(), null, new ArrayList<>(), ((CharacterTag) tag).getCharacterId(), getRect()); if (tag instanceof MorphShapeTag) { tim.frameRate = MORPH_SHAPE_ANIMATION_FRAME_RATE; int framesCnt = tim.frameRate * MORPH_SHAPE_ANIMATION_LENGTH; @@ -2822,7 +2852,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec @Override public RECT getRect() { - return getRect(new HashSet()); + return getRect(new HashSet<>()); } @Override diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 284958f25..58fe6b38e 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -866,7 +866,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se nskind = newTraitDialog.getNamespaceKind(); name = newTraitDialog.getTraitName(); isStatic = newTraitDialog.getStatic(); - m = new Multiname(Multiname.QNAME, abc.constants.getStringId(name, true), abc.constants.getNamespaceId(new Namespace(nskind, abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList()); + m = new Multiname(Multiname.QNAME, abc.constants.getStringId(name, true), abc.constants.getNamespaceId(new Namespace(nskind, abc.constants.getStringId("", true)), 0, true), 0, 0, new ArrayList<>()); int mid = abc.constants.getMultinameId(m); if (mid == 0) { break; diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java index e65b60ebb..29f905a98 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java @@ -33,7 +33,6 @@ import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; import com.jpexs.decompiler.flash.tags.Tag; -import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.helpers.Helper; import java.io.IOException; @@ -180,7 +179,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi public void graph() { try { - AVM2Graph gr = new AVM2Graph(abc.bodies.get(bodyIndex).getCode(), abc, abc.bodies.get(bodyIndex), false, -1, -1, new HashMap(), new ScopeStack(), new HashMap(), new ArrayList(), new HashMap(), abc.bodies.get(bodyIndex).getCode().visitCode(abc.bodies.get(bodyIndex))); + AVM2Graph gr = new AVM2Graph(abc.bodies.get(bodyIndex).getCode(), abc, abc.bodies.get(bodyIndex), false, -1, -1, new HashMap<>(), new ScopeStack(), new HashMap<>(), new ArrayList<>(), new HashMap<>(), abc.bodies.get(bodyIndex).getCode().visitCode(abc.bodies.get(bodyIndex))); (new GraphDialog(getAbcPanel().getMainPanel().getMainFrame().getWindow(), gr, name)).setVisible(true); } catch (InterruptedException ex) { Logger.getLogger(ASMSourceEditorPane.class.getName()).log(Level.SEVERE, null, ex); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ConstantsListModel.java b/src/com/jpexs/decompiler/flash/gui/abc/ConstantsListModel.java index 7e4f46d8b..17c8b0146 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ConstantsListModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ConstantsListModel.java @@ -97,7 +97,7 @@ public class ConstantsListModel implements ListModel { case TYPE_NAMESPACESET: return (index + 1) + ":" + constants.getNamespaceSet(index + 1).toString(constants); case TYPE_MULTINAME: - return (index + 1) + ":" + constants.getMultiname(index + 1).toString(constants, new ArrayList()); + return (index + 1) + ":" + constants.getMultiname(index + 1).toString(constants, new ArrayList<>()); } return null; } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 468f2f1a0..96f4b0bbc 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -350,7 +350,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL InstanceInfo ii = a.instance_info.get(cindex); for (int j = 0; j < ii.instance_traits.traits.size(); j++) { Trait tr = ii.instance_traits.traits.get(j); - if (ident.equals(tr.getName(a).getName(a.constants, new ArrayList(), false /*NOT RAW!*/))) { + if (ident.equals(tr.getName(a).getName(a.constants, new ArrayList<>(), false /*NOT RAW!*/))) { classIndex.setVal(cindex); abcIndex.setVal(i); traitIndex.setVal(j); @@ -365,7 +365,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL ClassInfo ci = a.class_info.get(cindex); for (int j = 0; j < ci.static_traits.traits.size(); j++) { Trait tr = ci.static_traits.traits.get(j); - if (ident.equals(tr.getName(a).getName(a.constants, new ArrayList(), false /*NOT RAW!*/))) { + if (ident.equals(tr.getName(a).getName(a.constants, new ArrayList<>(), false /*NOT RAW!*/))) { classIndex.setVal(cindex); abcIndex.setVal(i); traitIndex.setVal(j); @@ -541,7 +541,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL currentTrait = getCurrentTrait(); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { - name += ":" + currentTrait.getName(abc).getName(abc.constants, new ArrayList(), false); + name += ":" + currentTrait.getName(abc).getName(abc.constants, new ArrayList<>(), false); } } } @@ -582,7 +582,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL currentTrait = getCurrentTrait(); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { - name += ":" + currentTrait.getName(abc).getName(abc.constants, new ArrayList(), false); + name += ":" + currentTrait.getName(abc).getName(abc.constants, new ArrayList<>(), false); } displayMethod(pos, abc.findMethodIdByTraitId(classIndex, lastTraitIndex), name, currentTrait, isStatic); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java index fcdece3c9..e569c0b3c 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java @@ -190,7 +190,7 @@ public class DetailPanel extends JPanel implements ActionListener { traitNameLabel.setText("-"); } else { if (abcPanel != null) { - traitNameLabel.setText(trait.getName(abcPanel.abc).getName(abcPanel.abc.constants, new ArrayList(), false)); + traitNameLabel.setText(trait.getName(abcPanel.abc).getName(abcPanel.abc.constants, new ArrayList<>(), false)); } } } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java b/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java index b437760e0..f866590a6 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java @@ -77,9 +77,9 @@ public class TraitsListItem { public String toStringName() { if ((type != Type.INITIALIZER) && isStatic) { - return abc.class_info.get(classIndex).static_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList(), false); + return abc.class_info.get(classIndex).static_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList<>(), false); } else if ((type != Type.INITIALIZER) && (!isStatic)) { - return abc.instance_info.get(classIndex).instance_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList(), false); + return abc.instance_info.get(classIndex).instance_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList<>(), false); } else if (!isStatic) { return "__" + STR_INSTANCE_INITIALIZER; } else { @@ -92,14 +92,14 @@ public class TraitsListItem { String s = ""; try { if ((type != Type.INITIALIZER) && isStatic) { - abc.class_info.get(classIndex).static_traits.traits.get(index).convertHeader(null, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + abc.class_info.get(classIndex).static_traits.traits.get(index).convertHeader(null, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<>(), false); HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false); - abc.class_info.get(classIndex).static_traits.traits.get(index).toStringHeader(null, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); + abc.class_info.get(classIndex).static_traits.traits.get(index).toStringHeader(null, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<>(), false); s = writer.toString(); } else if ((type != Type.INITIALIZER) && (!isStatic)) { - abc.instance_info.get(classIndex).instance_traits.traits.get(index).convertHeader(null, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + abc.instance_info.get(classIndex).instance_traits.traits.get(index).convertHeader(null, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<>(), false); HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false); - abc.instance_info.get(classIndex).instance_traits.traits.get(index).toStringHeader(null, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList(), false); + abc.instance_info.get(classIndex).instance_traits.traits.get(index).toStringHeader(null, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<>(), false); s = writer.toString(); } else if (!isStatic) { s = STR_INSTANCE_INITIALIZER; diff --git a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java index c8112cbf2..c125480e7 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java @@ -128,7 +128,7 @@ public class MultinameTableModel implements TableModel { if (abc.constants.getMultiname(rowIndex).name_index == -1) { return ""; } - return abc.constants.getMultiname(rowIndex).getName(abc.constants, new ArrayList(), true); + return abc.constants.getMultiname(rowIndex).getName(abc.constants, new ArrayList<>(), true); case 3: if (rowIndex == 0) { return ""; diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index 7281c93c0..1f04eae60 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -48,7 +48,6 @@ import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.graph.CompilationException; -import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Helper; import java.awt.BorderLayout; @@ -752,7 +751,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene case ACTION_GRAPH: if (lastCode != null) { try { - GraphDialog gf = new GraphDialog(mainPanel.getMainFrame().getWindow(), new ActionGraph(lastCode, new HashMap(), new HashMap(), new HashMap(), SWF.DEFAULT_VERSION), ""); + GraphDialog gf = new GraphDialog(mainPanel.getMainFrame().getWindow(), new ActionGraph(lastCode, new HashMap<>(), new HashMap<>(), new HashMap<>(), SWF.DEFAULT_VERSION), ""); gf.setVisible(true); } catch (InterruptedException ex) { Logger.getLogger(ActionPanel.class.getName()).log(Level.SEVERE, null, ex); diff --git a/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog.properties index 26df560e7..5feeccb52 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog.properties @@ -73,3 +73,6 @@ fonts.woff = WOFF zoom = Zoom zoom.percent = % zoom.invalid = Invalid zoom value. + +symbolclass = Symbol Class +symbolclass.csv = CSV diff --git a/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog_hu.properties b/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog_hu.properties index aec23757b..4e00b3774 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog_hu.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/ExportDialog_hu.properties @@ -73,3 +73,6 @@ fonts.woff = WOFF zoom = Nagy\u00edt\u00e1s zoom.percent = % zoom.invalid = \u00c9rv\u00e9nytelen nagy\u00edt\u00e1si \u00e9rt\u00e9k. + +symbolclass = Szimb\u00f3lum oszt\u00e1ly +symbolclass.csv = CSV diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 3996039bf..d22102d7a 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -575,3 +575,4 @@ text.align.translatex.increase = Increase TranslateX selectPreviousTag = Select previous tag selectNextTag = Select next tag button.ignoreAll = Ignore All +menu.file.import.symbolClass = Symbol Class diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties index c5106fab1..7a0bd11dc 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties @@ -573,4 +573,5 @@ menu.file.export.xml = Exportar SWF XML text.align.translatex.decrease = Decrementar TranslateX text.align.translatex.increase = Incrementar TranslateX selectPreviousTag = Seleccionar etiqueta previa -selectNextTag = Seleccionar siguiente etiqueta \ No newline at end of file +selectNextTag = Seleccionar siguiente etiqueta +button.ignoreAll = Ignorar todo diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties index be670242d..80e6ce53e 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties @@ -573,4 +573,5 @@ text.align.translatex.decrease = TranslateX cs\u00f6kkent\u00e9se text.align.translatex.increase = TranslateX n\u00f6vel\u00e9se selectPreviousTag = El\u0151z\u0151 tag kiv\u00e1laszt\u00e1sa selectNextTag = K\u00f6vetkez\u0151 tag kiv\u00e1laszt\u00e1sa -button.ignoreAll = Mell\u0151z mindet \ No newline at end of file +button.ignoreAll = Mell\u0151z mindet +menu.file.import.symbolClass = Szimb\u00f3lum oszt\u00e1ly diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties index da956a0f7..b99169f05 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties @@ -574,3 +574,4 @@ text.align.translatex.decrease = \u0423\u043c\u0435\u043d\u044c\u0448\u0438\u044 text.align.translatex.increase = \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c TranslateX selectPreviousTag = \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0442\u044d\u0433 selectNextTag = \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u044d\u0433 +button.ignoreAll = \u0418\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java index 301ed69c2..d4119c704 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java @@ -97,6 +97,7 @@ import com.jpexs.decompiler.flash.tags.base.ButtonTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import com.jpexs.decompiler.flash.tags.base.MorphShapeTag; import com.jpexs.decompiler.flash.tags.base.ShapeTag; +import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag; import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; import com.jpexs.decompiler.flash.timeline.AS2Package; @@ -506,6 +507,11 @@ public class TagTree extends JTree { if (nodeType == TreeNodeType.FONT) { ret.add(d); } + if (nodeType == TreeNodeType.OTHER_TAG) { + if (d instanceof SymbolClassTypeTag) { + ret.add(d); + } + } } if (d instanceof Frame) {