mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-16 20:41:52 +00:00
no more string concatenation in graph text writer
This commit is contained in:
@@ -53,7 +53,7 @@ public class AlchemyLoadAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("l" + type + size + "(");
|
||||
writer.append("l").append(type).append(size).append("(");
|
||||
ofs.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("si" + size + "(");
|
||||
writer.append("si").append(size).append("(");
|
||||
value.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class AlchemyStoreAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("s" + type + size + "(");
|
||||
writer.append("s").append(type).append(size).append("(");
|
||||
ofs.toString(writer, localData);
|
||||
writer.append(",");
|
||||
value.toString(writer, localData);
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
@@ -40,7 +41,7 @@ public class FloatValueAVM2Item extends NumberValueAVM2Item {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,7 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item implements Integer
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append("" + value);
|
||||
return writer.append(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
@@ -35,7 +36,7 @@ public class ScriptAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append("script").append(scriptIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
@@ -43,7 +44,7 @@ public class SetGlobalSlotAVM2Item extends AVM2Item {
|
||||
writer.append("setglobalslot");
|
||||
writer.spaceBeforeCallParenthesies(2);
|
||||
writer.append("(");
|
||||
writer.append("(");
|
||||
writer.append(slotId).append(",");
|
||||
value.toString(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
@@ -48,7 +49,7 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
String localName = localRegName(localData.localRegNames, regIndex);
|
||||
srcData.localName = localName;
|
||||
srcData.localName = localName;
|
||||
writer.append(localName).append(" = ");
|
||||
return value.toString(writer, localData);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class StringAVM2Item extends AVM2Item implements SimpleValue {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append("\"" + Helper.escapeActionScriptString(value) + "\"");
|
||||
return writer.append("\"").append(Helper.escapeActionScriptString(value)).append("\"");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ForEachInAVM2Item extends LoopItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("for each");
|
||||
if (writer.getFormatting().spaceBeforeParenthesesForEachParentheses) {
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ForInAVM2Item extends LoopItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("for");
|
||||
if (writer.getFormatting().spaceBeforeParenthesesForParentheses) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class DefineRegisterActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append("var " + identifier);
|
||||
return writer.append("var ").append(identifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -172,10 +172,10 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue {
|
||||
}
|
||||
}
|
||||
if (value instanceof String) {
|
||||
return writer.append("\"" + Helper.escapeActionScriptString((String) value) + "\"");
|
||||
return writer.append("\"").append(Helper.escapeActionScriptString((String) value)).append("\"");
|
||||
}
|
||||
if (value instanceof ConstantIndex) {
|
||||
return writer.append("\"" + Helper.escapeActionScriptString(this.constants.get(((ConstantIndex) value).index)) + "\"");
|
||||
return writer.append("\"").append(Helper.escapeActionScriptString(this.constants.get(((ConstantIndex) value).index))).append("\"");
|
||||
}
|
||||
if (value instanceof RegisterNumber) {
|
||||
return writer.append(((RegisterNumber) value).translate());
|
||||
|
||||
@@ -55,7 +55,7 @@ public class GetPropertyActionItem extends ActionItem {
|
||||
return writer.append(Action.propertyNames[propertyIndex]);
|
||||
}
|
||||
target.toString(writer, localData);
|
||||
return writer.append("." + Action.propertyNames[propertyIndex]);
|
||||
return writer.append(".").append(Action.propertyNames[propertyIndex]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,7 +60,7 @@ public class GetURL2ActionItem extends ActionItem {
|
||||
urlString.toString(writer, localData);
|
||||
writer.append(",");
|
||||
targetString.toString(writer, localData);
|
||||
return writer.append(methodStr + ")");
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
|
||||
public GetURL2ActionItem(GraphSourceItem instruction, GraphTargetItem urlString, GraphTargetItem targetString, int method) {
|
||||
|
||||
@@ -37,7 +37,9 @@ public class GetURLActionItem extends ActionItem {
|
||||
writer.append("getUrl");
|
||||
writer.spaceBeforeCallParenthesies(2);
|
||||
writer.append("(\"");
|
||||
writer.append(Helper.escapeActionScriptString(urlString) + "\", \"" + Helper.escapeActionScriptString(targetString));
|
||||
writer.append(Helper.escapeActionScriptString(urlString));
|
||||
writer.append("\", \"");
|
||||
writer.append(Helper.escapeActionScriptString(targetString));
|
||||
return writer.append("\")");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
@@ -38,7 +39,7 @@ public class GotoFrameActionItem extends ActionItem {
|
||||
writer.append("gotoAndStop");
|
||||
writer.spaceBeforeCallParenthesies(1);
|
||||
writer.append("(");
|
||||
writer.append("(");
|
||||
writer.append(frame + 1);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class LoadMovieActionItem extends ActionItem {
|
||||
urlString.toString(writer, localData);
|
||||
writer.append(",");
|
||||
targetString.toString(writer, localData);
|
||||
return writer.append(methodStr + ")");
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,7 +71,7 @@ public class LoadMovieNumActionItem extends ActionItem {
|
||||
urlString.toString(writer, localData);
|
||||
writer.append(",");
|
||||
num.toString(writer, localData);
|
||||
return writer.append(methodStr + ")");
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -69,7 +69,7 @@ public class LoadVariablesActionItem extends ActionItem {
|
||||
urlString.toString(writer, localData);
|
||||
writer.append(",");
|
||||
targetString.toString(writer, localData);
|
||||
return writer.append(methodStr + ")");
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,7 +71,7 @@ public class LoadVariablesNumActionItem extends ActionItem {
|
||||
urlString.toString(writer, localData);
|
||||
writer.append(",");
|
||||
num.toString(writer, localData);
|
||||
return writer.append(methodStr + ")");
|
||||
return writer.append(methodStr).append(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,11 +77,11 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
if (isEmptyString(target)) {
|
||||
writer.append(Action.propertyNames[propertyIndex] + " = ");
|
||||
writer.append(Action.propertyNames[propertyIndex]).append(" = ");
|
||||
return value.toString(writer, localData);
|
||||
}
|
||||
target.toString(writer, localData);
|
||||
writer.append("." + Action.propertyNames[propertyIndex] + " = ");
|
||||
writer.append("." + Action.propertyNames[propertyIndex]).append(" = ");
|
||||
return value.toString(writer, localData);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction
|
||||
if (define) {
|
||||
writer.append("var ");
|
||||
}
|
||||
writer.append(register.translate() + " = ");
|
||||
writer.append(register.translate()).append(" = ");
|
||||
value.toString(writer, localData);
|
||||
}
|
||||
return writer;
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
@@ -32,7 +33,8 @@ public class StrictModeActionItem extends ActionItem {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
writer.append("StrictMode");
|
||||
writer.spaceBeforeCallParenthesies(0);
|
||||
writer.spaceBeforeCallParenthesies(0);
|
||||
// I still don't know how AS source of Strict Mode instruction looks like, assuming this...
|
||||
return writer.append("(").append(mode).append(");");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.AppResources;
|
||||
@@ -31,7 +32,7 @@ public class UnsupportedActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append("// ").append(AppResources.translate("decompilation.unsupported")).append(":").append(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,7 +81,7 @@ public class ForInActionItem extends LoopActionItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("for");
|
||||
if (writer.getFormatting().spaceBeforeParenthesesForParentheses) {
|
||||
|
||||
@@ -242,11 +242,11 @@ public class SwfJavaExporter {
|
||||
}
|
||||
}
|
||||
|
||||
writer.append("private " + className + " " + tagObjName + "(" + (isSwf ? "" : "SWF swf") + ") {").newLine();
|
||||
writer.append("private ").append(className).append(" ").append(tagObjName).append("(").append(isSwf ? "" : "SWF swf").append(") {").newLine();
|
||||
writer.indent();
|
||||
writer.append(className + " " + resultName + " = new " + className + "(" + (obj instanceof Tag ? "swf" : "") + ");" + Helper.newLine);
|
||||
writer.append(className).append(" ").append(resultName).append(" = new ").append(className).append("(").append(obj instanceof Tag ? "swf" : "").append(");").newLine();
|
||||
writer.append(sb2.toString());
|
||||
writer.append(indent + "return " + resultName + ";").newLine();
|
||||
writer.append(indent).append("return ").append(resultName).append(";").newLine();
|
||||
writer.unindent();
|
||||
writer.append("}").newLine().newLine();
|
||||
value = tagObjName + "(swf)";
|
||||
|
||||
@@ -130,6 +130,22 @@ public abstract class GraphTextWriter {
|
||||
|
||||
public abstract GraphTextWriter appendWithData(String str, HighlightData data);
|
||||
|
||||
public GraphTextWriter append(char value) {
|
||||
return append(Character.toString(value));
|
||||
}
|
||||
|
||||
public GraphTextWriter append(int value) {
|
||||
return append(Integer.toString(value));
|
||||
}
|
||||
|
||||
public GraphTextWriter append(long value) {
|
||||
return append(Long.toString(value));
|
||||
}
|
||||
|
||||
public GraphTextWriter append(double value) {
|
||||
return append(Double.toString(value));
|
||||
}
|
||||
|
||||
public abstract GraphTextWriter append(String str);
|
||||
|
||||
public abstract GraphTextWriter append(String str, long offset);
|
||||
|
||||
@@ -101,6 +101,24 @@ public class NulWriter extends GraphTextWriter {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter append(char value) {
|
||||
stringAdded = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter append(int value) {
|
||||
stringAdded = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter append(long value) {
|
||||
stringAdded = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NulWriter append(String str) {
|
||||
stringAdded = true;
|
||||
|
||||
@@ -505,10 +505,10 @@ public class DefineEditTextTag extends TextTag {
|
||||
alignment = "unknown";
|
||||
}
|
||||
writer.newLine();
|
||||
writer.append("xmin " + bounds.Xmin).newLine();
|
||||
writer.append("ymin " + bounds.Ymin).newLine();
|
||||
writer.append("xmax " + bounds.Xmax).newLine();
|
||||
writer.append("ymax " + bounds.Ymax).newLine();
|
||||
writer.append("xmin ").append(bounds.Xmin).newLine();
|
||||
writer.append("ymin ").append(bounds.Ymin).newLine();
|
||||
writer.append("xmax ").append(bounds.Xmax).newLine();
|
||||
writer.append("ymax ").append(bounds.Ymax).newLine();
|
||||
if (wordWrap) {
|
||||
writer.append("wordwrap 1").newLine();
|
||||
}
|
||||
@@ -540,27 +540,27 @@ public class DefineEditTextTag extends TextTag {
|
||||
writer.append("useoutlines 1").newLine();
|
||||
}
|
||||
if (hasFont) {
|
||||
writer.append("font " + fontId).newLine();
|
||||
writer.append("height " + fontHeight).newLine();
|
||||
writer.append("font ").append(fontId).newLine();
|
||||
writer.append("height ").append(fontHeight).newLine();
|
||||
}
|
||||
if (hasTextColor) {
|
||||
writer.append("color " + textColor.toHexARGB()).newLine();
|
||||
writer.append("color ").append(textColor.toHexARGB()).newLine();
|
||||
}
|
||||
if (hasFontClass) {
|
||||
writer.append("fontclass " + fontClass).newLine();
|
||||
writer.append("fontclass ").append(fontClass).newLine();
|
||||
}
|
||||
if (hasMaxLength) {
|
||||
writer.append("maxlength " + maxLength).newLine();
|
||||
writer.append("maxlength ").append(maxLength).newLine();
|
||||
}
|
||||
writer.append("align " + alignment).newLine();
|
||||
writer.append("align ").append(alignment).newLine();
|
||||
if (hasLayout) {
|
||||
writer.append("leftmargin " + leftMargin).newLine();
|
||||
writer.append("rightmargin " + rightMargin).newLine();
|
||||
writer.append("indent " + indent).newLine();
|
||||
writer.append("leading " + leading).newLine();
|
||||
writer.append("leftmargin ").append(leftMargin).newLine();
|
||||
writer.append("rightmargin ").append(rightMargin).newLine();
|
||||
writer.append("indent ").append(indent).newLine();
|
||||
writer.append("leading ").append(leading).newLine();
|
||||
}
|
||||
if (!variableName.isEmpty()) {
|
||||
writer.append("variablename " + variableName).newLine();
|
||||
writer.append("variablename ").append(variableName).newLine();
|
||||
}
|
||||
writer.append("]");
|
||||
if (hasText) {
|
||||
|
||||
@@ -231,23 +231,23 @@ public abstract class StaticTextTag extends TextTag {
|
||||
FontTag fnt = null;
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), true);
|
||||
writer.append("[").newLine();
|
||||
writer.append("xmin " + textBounds.Xmin).newLine();
|
||||
writer.append("ymin " + textBounds.Ymin).newLine();
|
||||
writer.append("xmax " + textBounds.Xmax).newLine();
|
||||
writer.append("ymax " + textBounds.Ymax).newLine();
|
||||
writer.append("xmin ").append(textBounds.Xmin).newLine();
|
||||
writer.append("ymin ").append(textBounds.Ymin).newLine();
|
||||
writer.append("xmax ").append(textBounds.Xmax).newLine();
|
||||
writer.append("ymax ").append(textBounds.Ymax).newLine();
|
||||
if (textMatrix.translateX != 0) {
|
||||
writer.append("translatex " + textMatrix.translateX).newLine();
|
||||
writer.append("translatex ").append(textMatrix.translateX).newLine();
|
||||
}
|
||||
if (textMatrix.translateY != 0) {
|
||||
writer.append("translatey " + textMatrix.translateY).newLine();
|
||||
writer.append("translatey ").append(textMatrix.translateY).newLine();
|
||||
}
|
||||
if (textMatrix.hasScale) {
|
||||
writer.append("scalex " + textMatrix.scaleX).newLine();
|
||||
writer.append("scaley " + textMatrix.scaleY).newLine();
|
||||
writer.append("scalex ").append(textMatrix.scaleX).newLine();
|
||||
writer.append("scaley ").append(textMatrix.scaleY).newLine();
|
||||
}
|
||||
if (textMatrix.hasRotate) {
|
||||
writer.append("rotateskew0 " + textMatrix.rotateSkew0).newLine();
|
||||
writer.append("rotateskew1 " + textMatrix.rotateSkew1).newLine();
|
||||
writer.append("rotateskew0 ").append(textMatrix.rotateSkew0).newLine();
|
||||
writer.append("rotateskew1 ").append(textMatrix.rotateSkew1).newLine();
|
||||
}
|
||||
writer.append("]");
|
||||
for (TEXTRECORD rec : textRecords) {
|
||||
@@ -258,21 +258,21 @@ public abstract class StaticTextTag extends TextTag {
|
||||
if (fnt2 != null) {
|
||||
fnt = fnt2;
|
||||
}
|
||||
writer.append("font " + rec.fontId).newLine();
|
||||
writer.append("height " + rec.textHeight).newLine();
|
||||
writer.append("font ").append(rec.fontId).newLine();
|
||||
writer.append("height ").append(rec.textHeight).newLine();
|
||||
}
|
||||
if (rec.styleFlagsHasColor) {
|
||||
if (getTextNum() == 1) {
|
||||
writer.append("color " + rec.textColor.toHexRGB()).newLine();
|
||||
writer.append("color ").append(rec.textColor.toHexRGB()).newLine();
|
||||
} else {
|
||||
writer.append("color " + rec.textColorA.toHexARGB()).newLine();
|
||||
writer.append("color ").append(rec.textColorA.toHexARGB()).newLine();
|
||||
}
|
||||
}
|
||||
if (rec.styleFlagsHasXOffset) {
|
||||
writer.append("x " + rec.xOffset).newLine();
|
||||
writer.append("x ").append(rec.xOffset).newLine();
|
||||
}
|
||||
if (rec.styleFlagsHasYOffset) {
|
||||
writer.append("y " + rec.yOffset).newLine();
|
||||
writer.append("y ").append(rec.yOffset).newLine();
|
||||
}
|
||||
writer.append("]");
|
||||
}
|
||||
|
||||
@@ -148,6 +148,10 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
|
||||
}
|
||||
|
||||
public GraphTextWriter toString(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
throw new InterruptedException();
|
||||
}
|
||||
|
||||
writer.startOffset(src, pos, srcData);
|
||||
appendTo(writer, localData);
|
||||
writer.endOffset();
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.graph;
|
||||
|
||||
import com.jpexs.decompiler.flash.AppResources;
|
||||
@@ -34,7 +35,7 @@ public class MarkItem extends GraphTargetItem {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append("// ").append(AppResources.translate("decompilerMark")).append(":").append(mark);
|
||||
}
|
||||
|
||||
public String getMark() {
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BreakItem extends GraphTargetItem {
|
||||
}
|
||||
}
|
||||
if (labelRequired) {
|
||||
writer.append(" loop" + loopId);
|
||||
writer.append(" loop").append(loopId);
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ContinueItem extends GraphTargetItem {
|
||||
}
|
||||
}
|
||||
if (labelRequired) {
|
||||
writer.append(" loop" + loopId);
|
||||
writer.append(" loop").append(loopId);
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class DoWhileItem extends LoopItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("do");
|
||||
writer.startBlock();
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ForItem extends LoopItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("for");
|
||||
if (writer.getFormatting().spaceBeforeParenthesesForParentheses) {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class GotoItem extends GraphTargetItem {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("§§goto(" + labelName + ")");
|
||||
writer.append("§§goto(").append(labelName).append(")");
|
||||
return writer;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ public class IntegerValueItem extends GraphTargetItem implements IntegerValueTyp
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append("" + intValue);
|
||||
return writer.append(intValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,7 @@ public class LabelItem extends GraphTargetItem {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append(labelName + ":");
|
||||
writer.append(labelName).append(":");
|
||||
return writer;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class SwitchItem extends LoopItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_SWITCH);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("switch");
|
||||
if (writer.getFormatting().spaceBeforeParenthesesSwitchParentheses) {
|
||||
|
||||
@@ -52,7 +52,7 @@ public class UniversalLoopItem extends LoopItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("while");
|
||||
if (writer.getFormatting().spaceBeforeParenthesesWhileParentheses) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class WhileItem extends LoopItem implements Block {
|
||||
((NulWriter) writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP);
|
||||
}
|
||||
if (labelUsed) {
|
||||
writer.append("loop" + loop.id + ":").newLine();
|
||||
writer.append("loop").append(loop.id).append(":").newLine();
|
||||
}
|
||||
writer.append("while");
|
||||
if (writer.getFormatting().spaceBeforeParenthesesWhileParentheses) {
|
||||
|
||||
Reference in New Issue
Block a user