diff --git a/trunk/src/com/jpexs/asdec/EventListener.java b/trunk/src/com/jpexs/asdec/EventListener.java index 87ae29e60..9e3d28f8e 100644 --- a/trunk/src/com/jpexs/asdec/EventListener.java +++ b/trunk/src/com/jpexs/asdec/EventListener.java @@ -21,5 +21,6 @@ package com.jpexs.asdec; * @author Jindra */ public interface EventListener { - public void handleEvent(String event,Object data); + + public void handleEvent(String event, Object data); } diff --git a/trunk/src/com/jpexs/asdec/Main.java b/trunk/src/com/jpexs/asdec/Main.java index 9890bc826..ac320b595 100644 --- a/trunk/src/com/jpexs/asdec/Main.java +++ b/trunk/src/com/jpexs/asdec/Main.java @@ -18,19 +18,13 @@ package com.jpexs.asdec; import com.jpexs.asdec.abc.NotSameException; import com.jpexs.asdec.abc.avm2.AVM2Code; -import com.jpexs.asdec.action.TagNode; import com.jpexs.asdec.gui.AboutDialog; import com.jpexs.asdec.gui.LoadingDialog; import com.jpexs.asdec.gui.ModeFrame; import com.jpexs.asdec.gui.View; import com.jpexs.asdec.gui.proxy.ProxyFrame; -import com.jpexs.asdec.helpers.Highlighting; -import com.jpexs.asdec.tags.ASMSource; -import com.jpexs.asdec.tags.DefineSpriteTag; import com.jpexs.asdec.tags.DoABCTag; -import com.jpexs.asdec.tags.DoInitActionTag; import com.jpexs.asdec.tags.Tag; -import com.jpexs.asdec.tags.TagName; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -41,8 +35,6 @@ import java.net.Socket; import java.util.ArrayList; import java.util.Calendar; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.JFileChooser; diff --git a/trunk/src/com/jpexs/asdec/SWF.java b/trunk/src/com/jpexs/asdec/SWF.java index b4d63e920..2bbf5a858 100644 --- a/trunk/src/com/jpexs/asdec/SWF.java +++ b/trunk/src/com/jpexs/asdec/SWF.java @@ -283,18 +283,15 @@ public class SWF { } return true; } - - - public boolean exportActionScript(String outdir, boolean isPcode) throws Exception { - boolean asV3Found = false; - final EventListener evl=new EventListener(){ + public boolean exportActionScript(String outdir, boolean isPcode) throws Exception { + boolean asV3Found = false; + final EventListener evl = new EventListener() { public void handleEvent(String event, Object data) { - if(event.equals("export")){ + if (event.equals("export")) { informListeners(event, data); } } - }; for (Tag t : tags) { if (t instanceof DoABCTag) { @@ -334,7 +331,7 @@ public class SWF { if (node.subItems.isEmpty()) { if (node.tag instanceof ASMSource) { try { - String f = outdir + File.separatorChar + name + ".as"; + String f = outdir + File.separatorChar + name + ".as"; informListeners("export", "Exporting " + f + " ..."); String ret = ""; if (isPcode) { @@ -359,18 +356,18 @@ public class SWF { } return true; } - - - protected HashSet listeners=new HashSet(); - - public void addEventListener(EventListener listener){ + protected HashSet listeners = new HashSet(); + + public void addEventListener(EventListener listener) { listeners.add(listener); } - public void removeEventListener(EventListener listener){ + + public void removeEventListener(EventListener listener) { listeners.remove(listener); } - protected void informListeners(String event,Object data){ - for(EventListener listener:listeners){ + + protected void informListeners(String event, Object data) { + for (EventListener listener : listeners) { listener.handleEvent(event, data); } } diff --git a/trunk/src/com/jpexs/asdec/abc/ABC.java b/trunk/src/com/jpexs/asdec/abc/ABC.java index 9baaf6da4..8c80a0a49 100644 --- a/trunk/src/com/jpexs/asdec/abc/ABC.java +++ b/trunk/src/com/jpexs/asdec/abc/ABC.java @@ -17,7 +17,6 @@ package com.jpexs.asdec.abc; import com.jpexs.asdec.EventListener; -import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.avm2.AVM2Code; import com.jpexs.asdec.abc.avm2.ConstantPool; import com.jpexs.asdec.abc.avm2.UnknownInstructionCode; @@ -57,23 +56,22 @@ public class ABC { public static String IDENT_STRING = " "; public static final int MINORwithDECIMAL = 17; public static final boolean AUTOINIT_STATIC_VARIABLES = false; + protected HashSet listeners = new HashSet(); - protected HashSet listeners=new HashSet(); - - public void addEventListener(EventListener listener){ + public void addEventListener(EventListener listener) { listeners.add(listener); } - public void removeEventListener(EventListener listener){ + + public void removeEventListener(EventListener listener) { listeners.remove(listener); } - protected void informListeners(String event,Object data){ - for(EventListener listener:listeners){ + + protected void informListeners(String event, Object data) { + for (EventListener listener : listeners) { listener.handleEvent(event, data); } } - - - + public int deobfuscateIdentifiers() { int ret = 0; for (int i = 1; i < constants.constant_multiname.length; i++) { @@ -251,11 +249,11 @@ public class ABC { method_info[mb.method_info].setBody(mb); bodyIdxFromMethodIdx[mb.method_info] = i; } - + /*for(ScriptInfo si:script_info){ - System.out.println("--------------------------------------------"); - System.out.println(findBody(si.init_index).toString(true, false, -1, this, constants, method_info,new Stack())); - }*/ + System.out.println("--------------------------------------------"); + System.out.println(findBody(si.init_index).toString(true, false, -1, this, constants, method_info,new Stack())); + }*/ } public void saveToStream(OutputStream os) throws IOException { @@ -632,7 +630,7 @@ public class ABC { String bodyStr = ""; int bodyIndex = findBodyIndex(class_info[i].cinit_index); if (bodyIndex != -1) { - bodyStr = addTabs(bodies[bodyIndex].toString(pcode, true, i, this, constants, method_info, new Stack(),highlight), 3); + bodyStr = addTabs(bodies[bodyIndex].toString(pcode, true, i, this, constants, method_info, new Stack(), highlight), 3); } // if (!bodyStr.equals("")) { toPrint = IDENT_STRING + IDENT_STRING + "{\r\n" + bodyStr + "\r\n" + IDENT_STRING + IDENT_STRING + "}"; @@ -661,7 +659,7 @@ public class ABC { bodyStr = ""; bodyIndex = findBodyIndex(instance_info[i].iinit_index); if (bodyIndex != -1) { - bodyStr = addTabs(bodies[bodyIndex].toString(pcode, false, i, this, constants, method_info, new Stack(),highlight), 3); + bodyStr = addTabs(bodies[bodyIndex].toString(pcode, false, i, this, constants, method_info, new Stack(), highlight), 3); constructorParams = method_info[instance_info[i].iinit_index].getParamStr(constants, bodies[bodyIndex], this); } else { constructorParams = method_info[instance_info[i].iinit_index].getParamStr(constants, null, this); @@ -739,7 +737,7 @@ public class ABC { if ((packageName != null) && (!packageName.equals(""))) { fullName = packageName + "." + fullName; } - informListeners("export", "Exporting " + (i + 1) + "/" + instance_info.length + " " + fullName + " ..."); + informListeners("export", "Exporting " + (i + 1) + "/" + instance_info.length + " " + fullName + " ..."); File outDir = new File(directory + File.separatorChar + packageName.replace('.', File.separatorChar)); if (!outDir.exists()) { outDir.mkdirs(); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java index 5124ae787..b60562dbf 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java @@ -22,7 +22,6 @@ import com.jpexs.asdec.abc.CopyOutputStream; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; import com.jpexs.asdec.abc.avm2.instructions.arithmetic.*; import com.jpexs.asdec.abc.avm2.instructions.bitwise.*; import com.jpexs.asdec.abc.avm2.instructions.comparsion.*; @@ -41,8 +40,6 @@ import com.jpexs.asdec.abc.avm2.treemodel.*; import com.jpexs.asdec.abc.avm2.treemodel.clauses.*; import com.jpexs.asdec.abc.avm2.treemodel.operations.AndTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.operations.OrTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.operations.PreDecrementTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.operations.PreIncrementTreeItem; import com.jpexs.asdec.abc.types.ABCException; import com.jpexs.asdec.abc.types.MethodBody; import com.jpexs.asdec.abc.types.MethodInfo; @@ -1491,12 +1488,12 @@ public class AVM2Code { } } } - if(!isKilled(reg, ip, end)){ + if (!isKilled(reg, ip, end)) { TreeItem v = (TreeItem) stack.pop(); - stack.push(new LocalRegTreeItem(ins, reg,v)); + stack.push(new LocalRegTreeItem(ins, reg, v)); stack.push(v); - }else{ - ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc, localRegNames); + } else { + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc, localRegNames); } ip++; addr = pos2adr(ip); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java index aed5e8c53..c0ca141cf 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java @@ -43,7 +43,7 @@ public class NewFunctionIns extends InstructionDefinition { String bodyStr = ""; String paramStr = ""; if (mybody != null) { - bodyStr = Highlighting.hilighMethodEnd() + mybody.toString(false, isStatic, classIndex, abc, constants, method_info,scopeStack, true) + Highlighting.hilighMethodBegin(body.method_info); + bodyStr = Highlighting.hilighMethodEnd() + mybody.toString(false, isStatic, classIndex, abc, constants, method_info, scopeStack, true) + Highlighting.hilighMethodBegin(body.method_info); paramStr = method_info[methodIndex].getParamStr(constants, mybody, abc); } stack.push(new NewFunctionTreeItem(ins, paramStr, method_info[methodIndex].getReturnTypeStr(constants), bodyStr)); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal0Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal0Ins.java index 4dd0989c6..452d117cd 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal0Ins.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal0Ins.java @@ -16,27 +16,14 @@ */ package com.jpexs.asdec.abc.avm2.instructions.localregs; -import com.jpexs.asdec.abc.ABC; -import com.jpexs.asdec.abc.avm2.ConstantPool; -import com.jpexs.asdec.abc.avm2.LocalDataArea; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; -import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -import com.jpexs.asdec.abc.types.MethodInfo; -import java.util.HashMap; -import java.util.List; -import java.util.Stack; public class SetLocal0Ins extends SetLocalTypeIns { public SetLocal0Ins() { super(0xd4, "setlocal_0", new int[]{}); } - + public int getRegisterId(AVM2Instruction ins) { return 0; } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal1Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal1Ins.java index 75e97a24b..1e0a31c43 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal1Ins.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal1Ins.java @@ -16,20 +16,7 @@ */ package com.jpexs.asdec.abc.avm2.instructions.localregs; -import com.jpexs.asdec.abc.ABC; -import com.jpexs.asdec.abc.avm2.ConstantPool; -import com.jpexs.asdec.abc.avm2.LocalDataArea; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; -import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -import com.jpexs.asdec.abc.types.MethodInfo; -import java.util.HashMap; -import java.util.List; -import java.util.Stack; public class SetLocal1Ins extends SetLocalTypeIns { @@ -40,5 +27,4 @@ public class SetLocal1Ins extends SetLocalTypeIns { public int getRegisterId(AVM2Instruction ins) { return 1; } - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal2Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal2Ins.java index 9fbef3e60..6d09df963 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal2Ins.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal2Ins.java @@ -16,20 +16,7 @@ */ package com.jpexs.asdec.abc.avm2.instructions.localregs; -import com.jpexs.asdec.abc.ABC; -import com.jpexs.asdec.abc.avm2.ConstantPool; -import com.jpexs.asdec.abc.avm2.LocalDataArea; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; -import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -import com.jpexs.asdec.abc.types.MethodInfo; -import java.util.HashMap; -import java.util.List; -import java.util.Stack; public class SetLocal2Ins extends SetLocalTypeIns { diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal3Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal3Ins.java index 7c8d375cc..d0185eb4a 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal3Ins.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal3Ins.java @@ -16,20 +16,7 @@ */ package com.jpexs.asdec.abc.avm2.instructions.localregs; -import com.jpexs.asdec.abc.ABC; -import com.jpexs.asdec.abc.avm2.ConstantPool; -import com.jpexs.asdec.abc.avm2.LocalDataArea; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; -import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -import com.jpexs.asdec.abc.types.MethodInfo; -import java.util.HashMap; -import java.util.List; -import java.util.Stack; public class SetLocal3Ins extends SetLocalTypeIns { diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalIns.java index 4a1882368..c62108816 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalIns.java @@ -16,21 +16,8 @@ */ package com.jpexs.asdec.abc.avm2.instructions.localregs; -import com.jpexs.asdec.abc.ABC; import com.jpexs.asdec.abc.avm2.AVM2Code; -import com.jpexs.asdec.abc.avm2.ConstantPool; -import com.jpexs.asdec.abc.avm2.LocalDataArea; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; -import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; -import com.jpexs.asdec.abc.types.MethodInfo; -import java.util.HashMap; -import java.util.List; -import java.util.Stack; public class SetLocalIns extends SetLocalTypeIns { diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalTypeIns.java index ff327a687..e8c85a51f 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -23,7 +23,6 @@ import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; import com.jpexs.asdec.abc.avm2.treemodel.DecrementTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.GetPropertyTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.IncrementTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; @@ -55,7 +54,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S if (value instanceof FindPropertyTreeItem) { return; } - if (value.getNotCoerced() instanceof IncrementTreeItem) { + if (value.getNotCoerced() instanceof IncrementTreeItem) { TreeItem inside = ((IncrementTreeItem) value.getNotCoerced()).object.getNotCoerced(); if (inside instanceof LocalRegTreeItem) { if (((LocalRegTreeItem) inside).regIndex == regId) { @@ -78,7 +77,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S } } - if (value.getNotCoerced() instanceof DecrementTreeItem) { + if (value.getNotCoerced() instanceof DecrementTreeItem) { TreeItem inside = ((DecrementTreeItem) value.getNotCoerced()).object.getNotCoerced(); if (inside instanceof LocalRegTreeItem) { if (((LocalRegTreeItem) inside).regIndex == regId) { @@ -100,7 +99,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S } } } - + //if(val.startsWith("catchscope ")) return; //if(val.startsWith("newactivation()")) return; output.add(new SetLocalTreeItem(ins, regId, value)); diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalScopeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalScopeIns.java index 2ad19f029..c15c6efed 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalScopeIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalScopeIns.java @@ -21,7 +21,6 @@ import com.jpexs.asdec.abc.avm2.ConstantPool; import com.jpexs.asdec.abc.avm2.LocalDataArea; import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.asdec.abc.avm2.treemodel.ClassTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; import com.jpexs.asdec.abc.types.MethodInfo; import java.util.HashMap; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSlotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSlotIns.java index 585a219f6..9f6d6485f 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSlotIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSlotIns.java @@ -46,11 +46,11 @@ public class GetSlotIns extends InstructionDefinition { Multiname slotname = null; if (obj instanceof ExceptionTreeItem) { slotname = constants.constant_multiname[((ExceptionTreeItem) obj).exception.name_index]; - } else if(obj instanceof ClassTreeItem){ - slotname=((ClassTreeItem)obj).className; - } else if(obj instanceof ThisTreeItem){ - slotname=((ThisTreeItem)obj).className; - }else{ + } else if (obj instanceof ClassTreeItem) { + slotname = ((ClassTreeItem) obj).className; + } else if (obj instanceof ThisTreeItem) { + slotname = ((ThisTreeItem) obj).className; + } else { for (int t = 0; t < body.traits.traits.length; t++) { if (body.traits.traits[t] instanceof TraitSlotConst) { if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSlotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSlotIns.java index 8d0dd3e1a..a240fe1da 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSlotIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSlotIns.java @@ -25,7 +25,6 @@ import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; import com.jpexs.asdec.abc.avm2.treemodel.DecrementTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.GetSlotTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.IncrementTreeItem; -import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.PostDecrementTreeItem; import com.jpexs.asdec.abc.avm2.treemodel.PostIncrementTreeItem; @@ -73,14 +72,13 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { return; } } - - if (value.getNotCoerced() instanceof IncrementTreeItem) { + + if (value.getNotCoerced() instanceof IncrementTreeItem) { TreeItem inside = ((IncrementTreeItem) value.getNotCoerced()).object.getThroughRegister().getNotCoerced(); if (inside instanceof GetSlotTreeItem) { - GetSlotTreeItem slotItem=(GetSlotTreeItem)inside; - if ((slotItem.scope.getThroughRegister()==obj.getThroughRegister()) - &&(slotItem.slotName==slotname)) - { + GetSlotTreeItem slotItem = (GetSlotTreeItem) inside; + if ((slotItem.scope.getThroughRegister() == obj.getThroughRegister()) + && (slotItem.slotName == slotname)) { if (stack.size() > 0) { TreeItem top = stack.peek().getNotCoerced(); if (top == inside) { @@ -99,14 +97,13 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } } } - - if (value.getNotCoerced() instanceof DecrementTreeItem) { + + if (value.getNotCoerced() instanceof DecrementTreeItem) { TreeItem inside = ((DecrementTreeItem) value.getNotCoerced()).object.getThroughRegister().getNotCoerced(); if (inside instanceof GetSlotTreeItem) { - GetSlotTreeItem slotItem=(GetSlotTreeItem)inside; - if ((slotItem.scope.getThroughRegister()==obj.getThroughRegister()) - &&(slotItem.slotName==slotname)) - { + GetSlotTreeItem slotItem = (GetSlotTreeItem) inside; + if ((slotItem.scope.getThroughRegister() == obj.getThroughRegister()) + && (slotItem.slotName == slotname)) { if (stack.size() > 0) { TreeItem top = stack.peek().getNotCoerced(); if (top == inside) { @@ -125,7 +122,7 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } } } - + output.add(new SetSlotTreeItem(ins, obj, slotname, value)); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/DupIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/DupIns.java index 098b14406..4554e472d 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/DupIns.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/DupIns.java @@ -43,7 +43,7 @@ public class DupIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc, HashMap localRegNames) { TreeItem v = (TreeItem) stack.pop(); - stack.push(v); + stack.push(v); stack.push(v); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallTreeItem.java index 8ec72a078..53b659ad1 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallTreeItem.java @@ -44,12 +44,12 @@ public class CallTreeItem extends TreeItem { args = args + arguments.get(a).toString(constants, localRegNames); } /*String recPart = ""; receiver.toString(constants, localRegNames) + hilight("."); - if (receiver instanceof NewActivationTreeItem) { - recPart = ""; - } - if (receiver instanceof ThisTreeItem) { - recPart = ""; - }*/ + if (receiver instanceof NewActivationTreeItem) { + recPart = ""; + } + if (receiver instanceof ThisTreeItem) { + recPart = ""; + }*/ return function.toString(constants, localRegNames) + hilight("(") + args + hilight(")"); } } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConvertTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConvertTreeItem.java index a49f7e62c..e39ff6485 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConvertTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConvertTreeItem.java @@ -36,7 +36,7 @@ public class ConvertTreeItem extends TreeItem { //return hilight("("+type+")")+ return value.toString(constants, localRegNames); } - + @Override public TreeItem getNotCoerced() { return value; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java index a6e84a720..89deb9da1 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java @@ -24,8 +24,8 @@ public class FullMultinameTreeItem extends TreeItem { public int multinameIndex; public TreeItem name; - public TreeItem namespace; - + public TreeItem namespace; + public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex, TreeItem name) { super(instruction, PRECEDENCE_PRIMARY); this.multinameIndex = multinameIndex; @@ -69,35 +69,34 @@ public class FullMultinameTreeItem extends TreeItem { } return ret; } - - public boolean compareSame(FullMultinameTreeItem other) - { - if(multinameIndex!=other.multinameIndex){ + + public boolean compareSame(FullMultinameTreeItem other) { + if (multinameIndex != other.multinameIndex) { return false; } - TreeItem tiName=name; - while(tiName instanceof LocalRegTreeItem){ - tiName=((LocalRegTreeItem)tiName).computedValue; + TreeItem tiName = name; + while (tiName instanceof LocalRegTreeItem) { + tiName = ((LocalRegTreeItem) tiName).computedValue; } - - TreeItem tiName2=other.name; - while(tiName2 instanceof LocalRegTreeItem){ - tiName2=((LocalRegTreeItem)tiName2).computedValue; + + TreeItem tiName2 = other.name; + while (tiName2 instanceof LocalRegTreeItem) { + tiName2 = ((LocalRegTreeItem) tiName2).computedValue; } - if(tiName!=tiName2){ + if (tiName != tiName2) { return false; } - - TreeItem tiNameSpace=namespace; - while(tiNameSpace instanceof LocalRegTreeItem){ - tiNameSpace=((LocalRegTreeItem)tiNameSpace).computedValue; + + TreeItem tiNameSpace = namespace; + while (tiNameSpace instanceof LocalRegTreeItem) { + tiNameSpace = ((LocalRegTreeItem) tiNameSpace).computedValue; } - - TreeItem tiNameSpace2=other.namespace; - while(tiNameSpace2 instanceof LocalRegTreeItem){ - tiNameSpace2=((LocalRegTreeItem)tiNameSpace2).computedValue; + + TreeItem tiNameSpace2 = other.namespace; + while (tiNameSpace2 instanceof LocalRegTreeItem) { + tiNameSpace2 = ((LocalRegTreeItem) tiNameSpace2).computedValue; } - if(tiNameSpace!=tiNameSpace2){ + if (tiNameSpace != tiNameSpace2) { return false; } return true; diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/LocalRegTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/LocalRegTreeItem.java index 731272796..e15e22c0b 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/LocalRegTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/LocalRegTreeItem.java @@ -53,6 +53,4 @@ public class LocalRegTreeItem extends TreeItem { public TreeItem getThroughRegister() { return computedValue.getThroughRegister(); } - - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThisTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThisTreeItem.java index 29ac40fd8..28e5aea7a 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThisTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThisTreeItem.java @@ -23,9 +23,10 @@ import java.util.HashMap; public class ThisTreeItem extends TreeItem { public Multiname className; + public ThisTreeItem(Multiname className) { super(null, PRECEDENCE_PRIMARY); - this.className=className; + this.className = className; } @Override diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java index e307fecda..e2db589a5 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java @@ -42,16 +42,16 @@ public abstract class TreeItem { public static final int NOPRECEDENCE = 16; public int precedence = NOPRECEDENCE; public AVM2Instruction instruction; - + public TreeItem(AVM2Instruction instruction, int precedence) { this.instruction = instruction; this.precedence = precedence; } public abstract String toString(ConstantPool constants, HashMap localRegNames); - - public String toStringNoH(ConstantPool constants, HashMap localRegNames){ - return Highlighting.stripHilights(toString(constants,localRegNames)); + + public String toStringNoH(ConstantPool constants, HashMap localRegNames) { + return Highlighting.stripHilights(toString(constants, localRegNames)); } public String toStringSemicoloned(ConstantPool constants, HashMap localRegNames) { @@ -108,7 +108,7 @@ public abstract class TreeItem { public TreeItem getNotCoerced() { return this; } - + public TreeItem getThroughRegister() { return this; } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/DeclarationTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/DeclarationTreeItem.java index b9bb1ce8c..4c8b7bfe5 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/DeclarationTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/DeclarationTreeItem.java @@ -35,36 +35,35 @@ public class DeclarationTreeItem extends TreeItem { public TreeItem assignment; public String type; - public DeclarationTreeItem(TreeItem assignment,String type){ - super(assignment.instruction,assignment.precedence); - this.type=type; - this.assignment=assignment; + + public DeclarationTreeItem(TreeItem assignment, String type) { + super(assignment.instruction, assignment.precedence); + this.type = type; + this.assignment = assignment; } - - public DeclarationTreeItem(TreeItem assignment){ - this(assignment,null); + + public DeclarationTreeItem(TreeItem assignment) { + this(assignment, null); } - + @Override public String toString(ConstantPool constants, HashMap localRegNames) { - if(assignment instanceof SetLocalTreeItem) - { - SetLocalTreeItem lti=(SetLocalTreeItem)assignment; - String type="*"; - if(lti.value instanceof CoerceTreeItem){ - type = ((CoerceTreeItem)lti.value).type; + if (assignment instanceof SetLocalTreeItem) { + SetLocalTreeItem lti = (SetLocalTreeItem) assignment; + String type = "*"; + if (lti.value instanceof CoerceTreeItem) { + type = ((CoerceTreeItem) lti.value).type; } - if(lti.value instanceof ConvertTreeItem){ - type = ((ConvertTreeItem)lti.value).type; + if (lti.value instanceof ConvertTreeItem) { + type = ((ConvertTreeItem) lti.value).type; } - return "var "+hilight(localRegName(localRegNames, lti.regIndex) + ":"+type+" = ") + lti.value.toString(constants, localRegNames); + return "var " + hilight(localRegName(localRegNames, lti.regIndex) + ":" + type + " = ") + lti.value.toString(constants, localRegNames); } - if(assignment instanceof SetSlotTreeItem) - { - SetSlotTreeItem ssti=(SetSlotTreeItem)assignment; - String ret=""; + if (assignment instanceof SetSlotTreeItem) { + SetSlotTreeItem ssti = (SetSlotTreeItem) assignment; + String ret = ""; if (!(ssti.scope instanceof NewActivationTreeItem)) { - ret = ssti.scope.toString(constants, localRegNames) + "."; + ret = ssti.scope.toString(constants, localRegNames) + "."; } if (ssti.scope instanceof LocalRegTreeItem) { if (((LocalRegTreeItem) ssti.scope).computedValue != null) { @@ -72,10 +71,9 @@ public class DeclarationTreeItem extends TreeItem { ret = ""; } } - } - return "var "+ret + hilight(ssti.slotName.getName(constants)) + ":"+type+hilight(" = ") + ssti.value.toString(constants, localRegNames); + } + return "var " + ret + hilight(ssti.slotName.getName(constants)) + ":" + type + hilight(" = ") + ssti.value.toString(constants, localRegNames); } - return "var "+assignment.toString(constants, localRegNames); + return "var " + assignment.toString(constants, localRegNames); } - } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java index 729c30cb1..be07af764 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForInTreeItem.java @@ -56,7 +56,7 @@ public class ForInTreeItem extends LoopTreeItem implements Block { public String toString(ConstantPool constants, HashMap localRegNames) { String ret = ""; ret += "loop" + loopBreak + ":\r\n"; - ret += hilight("for (") + expression.toString(constants, localRegNames) + hilight(")")+"\r\n{\r\n"; + ret += hilight("for (") + expression.toString(constants, localRegNames) + hilight(")") + "\r\n{\r\n"; for (TreeItem ti : commands) { ret += ti.toStringSemicoloned(constants, localRegNames) + "\r\n"; } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java index 5967dc4e4..f7976154c 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java @@ -40,7 +40,7 @@ public class IfTreeItem extends TreeItem implements Block { @Override public String toString(ConstantPool constants, HashMap localRegNames) { String ret = ""; - ret = hilight("if(") + expression.toString(constants, localRegNames) + hilight(")")+"\r\n{\r\n"; + ret = hilight("if(") + expression.toString(constants, localRegNames) + hilight(")") + "\r\n{\r\n"; for (TreeItem ti : onTrue) { ret += ti.toStringSemicoloned(constants, localRegNames) + "\r\n"; } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java index 82929816d..b4933a205 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java @@ -19,7 +19,6 @@ package com.jpexs.asdec.abc.gui; import com.jpexs.asdec.Configuration; import com.jpexs.asdec.Main; import com.jpexs.asdec.abc.ABC; -import com.jpexs.asdec.EventListener; import com.jpexs.asdec.abc.gui.tablemodels.*; import com.jpexs.asdec.gui.LoadingPanel; import com.jpexs.asdec.gui.View; @@ -314,7 +313,7 @@ public class MainFrame extends JFrame implements ActionListener, ItemListener { JMenuItem miAbout = new JMenuItem("About..."); miAbout.setActionCommand("ABOUT"); miAbout.addActionListener(this); - + JMenuItem miCheckUpdates = new JMenuItem("Check for updates..."); miCheckUpdates.setActionCommand("CHECKUPDATES"); miCheckUpdates.addActionListener(this); @@ -418,8 +417,8 @@ public class MainFrame extends JFrame implements ActionListener, ItemListener { (new Thread() { @Override public void run() { - try { - Main.swf.exportActionScript(selFile, isPcode); + try { + Main.swf.exportActionScript(selFile, isPcode); } catch (Exception ignored) { JOptionPane.showMessageDialog(null, "Cannot write to the file"); } @@ -430,9 +429,9 @@ public class MainFrame extends JFrame implements ActionListener, ItemListener { } } - + if (e.getActionCommand().equals("CHECKUPDATES")) { - if(!Main.checkForUpdates()){ + if (!Main.checkForUpdates()) { JOptionPane.showMessageDialog(null, "No new version available."); } } diff --git a/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java b/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java index ac87c1117..09c55acc3 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java @@ -74,7 +74,7 @@ public class MethodBody implements Cloneable { } public String toString(boolean pcode, boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], Stack scopeStack) { - return toString(pcode, isStatic, classIndex, abc, constants, method_info, scopeStack,false); + return toString(pcode, isStatic, classIndex, abc, constants, method_info, scopeStack, false); } public String toString(boolean pcode, boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], Stack scopeStack, boolean hilight) { @@ -86,7 +86,7 @@ public class MethodBody implements Cloneable { s += code.toASMSource(constants, this); } else { try { - s += code.toSource(isStatic, classIndex, abc, constants, method_info, this, hilight, getLocalRegNames(abc),scopeStack); + s += code.toSource(isStatic, classIndex, abc, constants, method_info, this, hilight, getLocalRegNames(abc), scopeStack); s = s.trim(); if (hilight) { s = Highlighting.hilighMethod(s, this.method_info); diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java index 1b9fefdd3..a3a97f477 100644 --- a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java @@ -42,16 +42,16 @@ public class TraitSlotConst extends Trait { return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " SlotConst " + abc.constants.constant_multiname[name_index].toString(abc.constants) + " slot=" + slot_id + " type=" + typeStr + " value=" + (new ValueKind(value_index, value_kind)).toString(abc.constants) + " metadata=" + Helper.intArrToString(metadata); } - public String getType(ConstantPool constants){ + public String getType(ConstantPool constants) { String typeStr = "*"; if (type_index > 0) { typeStr = constants.constant_multiname[type_index].getName(constants); } return typeStr; } - + public String getNameValueStr(ConstantPool constants) { - + String typeStr = getType(constants); String valueStr = ""; if (value_kind != 0) { diff --git a/trunk/src/com/jpexs/asdec/action/Action.java b/trunk/src/com/jpexs/asdec/action/Action.java index fd695ca08..efb4b735e 100644 --- a/trunk/src/com/jpexs/asdec/action/Action.java +++ b/trunk/src/com/jpexs/asdec/action/Action.java @@ -578,12 +578,12 @@ public class Action { * @return String with Source code */ public static String actionsToSource(List actions, int version) { - try{ - List tree = actionsToTree(new HashMap(), actions, version); - - return treeToString(tree); - }catch(Exception ex){ - return "//Decompilation error :"+ex.getLocalizedMessage(); + try { + List tree = actionsToTree(new HashMap(), actions, version); + + return treeToString(tree); + } catch (Exception ex) { + return "//Decompilation error :" + ex.getLocalizedMessage(); } } diff --git a/trunk/src/com/jpexs/asdec/action/TagNode.java b/trunk/src/com/jpexs/asdec/action/TagNode.java index 5fd0ce833..996b88799 100644 --- a/trunk/src/com/jpexs/asdec/action/TagNode.java +++ b/trunk/src/com/jpexs/asdec/action/TagNode.java @@ -41,7 +41,7 @@ public class TagNode { public String toString() { return tag.toString(); } - + public static List createTagList(List list) { List ret = new ArrayList(); int frame = 1; diff --git a/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java index bddc9b0e4..f73db50b5 100644 --- a/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java +++ b/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java @@ -17,15 +17,14 @@ package com.jpexs.asdec.action.gui; import com.jpexs.asdec.Configuration; -import com.jpexs.asdec.action.TagNode; import com.jpexs.asdec.Main; +import com.jpexs.asdec.action.TagNode; import com.jpexs.asdec.action.parser.ASMParser; import com.jpexs.asdec.action.parser.ParseException; import com.jpexs.asdec.gui.LoadingPanel; import com.jpexs.asdec.gui.View; import com.jpexs.asdec.helpers.Highlighting; import com.jpexs.asdec.tags.ASMSource; -import com.jpexs.asdec.tags.DoABCTag; import com.jpexs.asdec.tags.Tag; import java.awt.BorderLayout; import java.awt.Container; @@ -39,7 +38,6 @@ import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import javax.swing.*; import javax.swing.border.BevelBorder; @@ -313,13 +311,13 @@ public class MainFrame extends JFrame implements TreeSelectionListener, ActionLi if (e.getActionCommand().equals("OPEN")) { Main.openFileDialog(); } - + if (e.getActionCommand().equals("CHECKUPDATES")) { - if(!Main.checkForUpdates()){ + if (!Main.checkForUpdates()) { JOptionPane.showMessageDialog(null, "No new version available."); } } - + if (e.getActionCommand().equals("EXPORT") || e.getActionCommand().equals("EXPORTPCODE")) { JFileChooser chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File((String) Configuration.getConfig("lastExportDir", "."))); diff --git a/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java b/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java index 7e0810712..feb381fd3 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineButton2Tag.java @@ -35,7 +35,7 @@ import java.util.List; * * @author JPEXS */ -public class DefineButton2Tag extends Tag implements Container,TagName { +public class DefineButton2Tag extends Tag implements Container, TagName { /** * ID for this character @@ -166,9 +166,9 @@ public class DefineButton2Tag extends Tag implements Container,TagName { } public String getName() { - return "DefineButton2Tag"+buttonId; + return "DefineButton2Tag" + buttonId; } - + public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { diff --git a/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java b/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java index 70b0730e2..85db26a86 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineButtonTag.java @@ -34,7 +34,7 @@ import java.util.List; * * @author JPEXS */ -public class DefineButtonTag extends Tag implements ASMSource,TagName { +public class DefineButtonTag extends Tag implements ASMSource, TagName { /** * ID for this character @@ -99,11 +99,9 @@ public class DefineButtonTag extends Tag implements ASMSource,TagName { } public String getName() { - return "DefineButtonTag"+buttonId; + return "DefineButtonTag" + buttonId; } - - public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { diff --git a/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java b/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java index 86d2ce4e4..0fa90cd04 100644 --- a/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DefineSpriteTag.java @@ -30,7 +30,7 @@ import java.util.List; /** * Defines a sprite character */ -public class DefineSpriteTag extends Tag implements Container,TagName { +public class DefineSpriteTag extends Tag implements Container, TagName { /** * Character ID of sprite @@ -96,11 +96,9 @@ public class DefineSpriteTag extends Tag implements Container,TagName { @Override public String getName() { - return "DefineSpriteTag"+spriteId; + return "DefineSpriteTag" + spriteId; } - - public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { diff --git a/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java b/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java index 563343cc3..a1c3416d6 100644 --- a/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/asdec/tags/DoInitActionTag.java @@ -25,7 +25,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -public class DoInitActionTag extends Tag implements ASMSource,TagName { +public class DoInitActionTag extends Tag implements ASMSource, TagName { /** * Identifier of Sprite @@ -76,7 +76,6 @@ public class DoInitActionTag extends Tag implements ASMSource,TagName { return baos.toByteArray(); } - public String toString() { String name = ""; for (ExportAssetsTag eat : exportAssetsTags) { @@ -88,11 +87,9 @@ public class DoInitActionTag extends Tag implements ASMSource,TagName { } public String getName() { - return "DoInitActionTag"+spriteId; + return "DoInitActionTag" + spriteId; } - - /** * Whether or not this object contains ASM source * diff --git a/trunk/src/com/jpexs/asdec/tags/TagName.java b/trunk/src/com/jpexs/asdec/tags/TagName.java index e66845a96..f767edbd3 100644 --- a/trunk/src/com/jpexs/asdec/tags/TagName.java +++ b/trunk/src/com/jpexs/asdec/tags/TagName.java @@ -21,5 +21,6 @@ package com.jpexs.asdec.tags; * @author JPEXS */ public interface TagName { + public String getName(); }