diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index d7a6779ca..0a310f206 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -169,7 +169,7 @@ public final class MethodBody implements Cloneable { getCode().toASMSource(constants, trait, method_info.get(this.method_info), this, exportMode, writer); } else { if (!Configuration.decompile.get()) { - writer.appendNoHilight("//" + AppResources.translate("decompilation.skipped")).newLine(); + writer.appendNoHilight(Helper.getDecompilationSkippedComment()).newLine(); return; } int timeout = Configuration.decompilationTimeoutSingleMethod.get(); @@ -209,7 +209,7 @@ public final class MethodBody implements Cloneable { } else { if (!Configuration.decompile.get()) { //writer.startMethod(this.method_info); - writer.appendNoHilight("//" + AppResources.translate("decompilation.skipped")).newLine(); + writer.appendNoHilight(Helper.getDecompilationSkippedComment()).newLine(); //writer.endMethod(); return writer; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java index 0dcdeb7a1..f70889832 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java @@ -32,7 +32,7 @@ public class UnsupportedActionItem extends ActionItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("//" + AppResources.translate("decompilation.unsupported") + ":" + value); + return writer.append("// " + AppResources.translate("decompilation.unsupported") + ":" + value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/SoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/SoundTag.java index 31f5c6d64..1d9a1c172 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/SoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/SoundTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags.base; +import com.jpexs.decompiler.flash.treeitems.TreeItem; import com.jpexs.decompiler.flash.types.sound.SoundFormat; import java.io.InputStream; import java.util.List; @@ -24,7 +25,7 @@ import java.util.List; * * @author JPEXS */ -public interface SoundTag { +public interface SoundTag extends TreeItem { public String getExportFormat(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java index f55c5fce4..9c916a49f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/MarkItem.java @@ -35,7 +35,7 @@ public class MarkItem extends GraphTargetItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append("//" + AppResources.translate("decompilerMark") + ":" + mark); + return writer.append("// " + AppResources.translate("decompilerMark") + ":" + mark); } public String getMark() { diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/CancellableWorker.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/CancellableWorker.java index 7cf7c21af..7972127d9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/CancellableWorker.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/CancellableWorker.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.helpers; import java.util.ArrayList; @@ -40,13 +41,12 @@ public abstract class CancellableWorker implements RunnableFuture { public CancellableWorker() { super(); - Callable callable - = new Callable() { - @Override - public T call() throws Exception { - return doInBackground(); - } - }; + Callable callable = new Callable() { + @Override + public T call() throws Exception { + return doInBackground(); + } + }; future = new FutureTask(callable) { @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java index 348ba4e71..5a040e8aa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java @@ -794,6 +794,10 @@ public class Helper { } } + public static String getDecompilationSkippedComment() { + return "// " + AppResources.translate("decompilation.skipped"); + } + public static void appendTimeoutComment(GraphTextWriter writer, int timeout) { writer.appendNoHilight("/*").newLine(); writer.appendNoHilight(" * ").appendNoHilight(AppResources.translate("decompilationError")).newLine(); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 0fec97c42..fa5b1d4e5 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -2195,9 +2195,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec try { get(); } catch (CancellationException ex) { - getABCPanel().decompiledTextArea.setText("//" + AppStrings.translate("work.canceled")); + getABCPanel().decompiledTextArea.setText("// " + AppStrings.translate("work.canceled")); } catch (Exception ex) { - getABCPanel().decompiledTextArea.setText("//" + AppStrings.translate("decompilationError") + ": " + ex); + getABCPanel().decompiledTextArea.setText("// " + AppStrings.translate("decompilationError") + ": " + ex); } } }); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 8001a22e9..3330478fa 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -640,7 +640,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL this.script = scriptLeaf; return; } - setText("//" + AppStrings.translate("pleasewait") + "..."); + setText("// " + AppStrings.translate("pleasewait") + "..."); this.abc = abc; this.abcList = abcList; diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index c64c14ed6..1e5646804 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -357,6 +357,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene if (((newpercent > percent) || (!this.phase.equals(phase))) && newpercent <= 100) { percent = newpercent; this.phase = phase; + // todo: honfika: it is very slow to show every percent setEditorText("; " + AppStrings.translate("work.disassembling") + " - " + phase + " " + percent + "%...", "text/flasm"); } } @@ -394,7 +395,10 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene protected Void doInBackground() throws Exception { setEditorText("; " + AppStrings.translate("work.disassembling") + "...", "text/flasm"); if (Configuration.decompile.get()) { - setDecompiledText("//" + AppStrings.translate("work.waitingfordissasembly") + "..."); + setDecompiledText("// " + AppStrings.translate("work.waitingfordissasembly") + "..."); + } else { + lastDecompiled = Helper.getDecompilationSkippedComment(); + setDecompiledText(lastDecompiled); } DisassemblyListener listener = getDisassemblyListener(); asm.addDisassemblyListener(listener); @@ -406,7 +410,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene srcHexOnly = null; setHex(getExportMode()); if (Configuration.decompile.get()) { - setDecompiledText("//" + AppStrings.translate("work.decompiling") + "..."); + setDecompiledText("// " + AppStrings.translate("work.decompiling") + "..."); if (!useCache) { SWF.uncache(asm); } @@ -435,7 +439,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene } catch (CancellationException ex) { setEditorText("; " + AppStrings.translate("work.canceled"), "text/flasm"); } catch (Exception ex) { - setDecompiledText("//" + AppStrings.translate("decompilationError") + ": " + ex); + setDecompiledText("// " + AppStrings.translate("decompilationError") + ": " + ex); } } }); diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java index f448b3681..8aa91cc22 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java @@ -92,11 +92,11 @@ public class TagTreeModel implements TreeModel { return AppStrings.translate(key); } - private List getSoundStreams(DefineSpriteTag sprite) { - List ret = new ArrayList<>(); + private List getSoundStreams(DefineSpriteTag sprite) { + List ret = new ArrayList<>(); for (Tag t : sprite.subTags) { if (t instanceof SoundStreamHeadTypeTag) { - ret.add(t); + ret.add((SoundStreamHeadTypeTag) t); } } return ret;