mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-14 07:11:55 +00:00
Additional character info tags now placed under the character in the tree
Few icons for tags (metadata,fileattributes,setbackground,place and remove tags)
This commit is contained in:
@@ -352,7 +352,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
|
||||
di.getChildInfos().clear();
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, CharacterTag> getCharacters() {
|
||||
if (characters == null) {
|
||||
synchronized (this) {
|
||||
@@ -857,9 +857,11 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
this.tags = tags;
|
||||
if (!checkOnly) {
|
||||
checkInvalidSprites();
|
||||
Map<Integer, CharacterTag> chars = new HashMap<>();
|
||||
parseCharacters(tags, chars);
|
||||
characters = chars;
|
||||
assignExportNamesToSymbols();
|
||||
assignClassesToSymbols();
|
||||
|
||||
SWFDecompilerPlugin.fireSwfParsed(this);
|
||||
} else {
|
||||
boolean hasNonUnknownTag = false;
|
||||
@@ -950,8 +952,8 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
}
|
||||
for (Tag t : tags) {
|
||||
if (t instanceof CharacterIdTag) {
|
||||
CharacterIdTag ct = (CharacterIdTag) t;
|
||||
if (t instanceof CharacterTag) {
|
||||
CharacterTag ct = (CharacterTag) t;
|
||||
if (exportNames.containsKey(ct.getCharacterId())) {
|
||||
ct.setExportName(exportNames.get(ct.getCharacterId()));
|
||||
}
|
||||
@@ -1939,7 +1941,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
cnt++;
|
||||
informListeners("rename", "class " + cnt + "/" + classCount);
|
||||
DoInitActionTag dia = (DoInitActionTag) t;
|
||||
String exportName = dia.getExportName();
|
||||
String exportName = characters.containsKey(dia.spriteId)?characters.get(dia.spriteId).getExportName():"_unk_";
|
||||
final String pkgPrefix = "__Packages.";
|
||||
String[] classNameParts = null;
|
||||
if ((exportName != null) && exportName.startsWith(pkgPrefix)) {
|
||||
|
||||
@@ -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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
@@ -32,7 +33,7 @@ import java.io.OutputStream;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class CSMTextSettingsTag extends Tag {
|
||||
public class CSMTextSettingsTag extends Tag implements CharacterIdTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int textID;
|
||||
@@ -114,4 +115,9 @@ public class CSMTextSettingsTag extends Tag {
|
||||
sharpness = sis.readFLOAT("sharpness"); //F32 = FLOAT
|
||||
reserved2 = sis.readUI8("reserved2"); //reserved
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterId() {
|
||||
return textID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.CXFORM;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
@@ -32,7 +33,7 @@ import java.io.OutputStream;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DefineButtonCxformTag extends Tag {
|
||||
public class DefineButtonCxformTag extends Tag implements CharacterIdTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int buttonId;
|
||||
@@ -87,4 +88,9 @@ public class DefineButtonCxformTag extends Tag {
|
||||
buttonId = sis.readUI16("buttonId");
|
||||
buttonColorTransform = sis.readCXFORM("buttonColorTransform");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterId() {
|
||||
return buttonId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ 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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.SOUNDINFO;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
@@ -33,7 +34,7 @@ import java.io.OutputStream;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DefineButtonSoundTag extends CharacterIdTag {
|
||||
public class DefineButtonSoundTag extends CharacterTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int buttonId;
|
||||
|
||||
@@ -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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.ZONERECORD;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||
@@ -31,7 +32,7 @@ import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DefineFontAlignZonesTag extends Tag {
|
||||
public class DefineFontAlignZonesTag extends Tag implements CharacterIdTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int fontID;
|
||||
@@ -97,4 +98,9 @@ public class DefineFontAlignZonesTag extends Tag {
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterId() {
|
||||
return fontID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.LANGCODE;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||
@@ -36,7 +37,7 @@ import java.util.List;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DefineFontInfo2Tag extends Tag {
|
||||
public class DefineFontInfo2Tag extends Tag implements CharacterIdTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int fontID;
|
||||
@@ -145,4 +146,9 @@ public class DefineFontInfo2Tag extends Tag {
|
||||
codeTable.add(sis.readUI16("code"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterId() {
|
||||
return fontID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
@@ -35,7 +36,7 @@ import java.util.List;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DefineFontInfoTag extends Tag {
|
||||
public class DefineFontInfoTag extends Tag implements CharacterIdTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int fontId;
|
||||
@@ -146,4 +147,9 @@ public class DefineFontInfoTag extends Tag {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterId() {
|
||||
return fontId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
@@ -26,7 +27,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class DefineFontNameTag extends Tag {
|
||||
public class DefineFontNameTag extends Tag implements CharacterIdTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int fontId;
|
||||
@@ -79,4 +80,9 @@ public class DefineFontNameTag extends Tag {
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterId() {
|
||||
return fontId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.RECT;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
@@ -30,7 +31,7 @@ import java.io.OutputStream;
|
||||
/**
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DefineScalingGridTag extends Tag {
|
||||
public class DefineScalingGridTag extends Tag implements CharacterIdTag {
|
||||
|
||||
@SWFType(BasicType.UI16)
|
||||
public int characterId;
|
||||
@@ -78,4 +79,9 @@ public class DefineScalingGridTag extends Tag {
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterId() {
|
||||
return characterId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.HideInRawEdit;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
@@ -39,7 +40,7 @@ import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
||||
public class DoInitActionTag extends Tag implements CharacterIdTag,ASMSource {
|
||||
|
||||
/**
|
||||
* Identifier of Sprite
|
||||
@@ -193,7 +194,8 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
||||
|
||||
@Override
|
||||
public String getExportFileName() {
|
||||
String expName = getExportName();
|
||||
CharacterTag sprite=swf.getCharacter(spriteId);
|
||||
String expName = sprite!=null?sprite.getExportName():null;
|
||||
if ((expName == null) || expName.isEmpty()) {
|
||||
return super.getExportFileName();
|
||||
}
|
||||
@@ -208,7 +210,8 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
String expName = getExportName();
|
||||
CharacterTag sprite=swf.getCharacter(spriteId);
|
||||
String expName = sprite!=null?sprite.getExportName():null;
|
||||
if ((expName == null) || expName.isEmpty()) {
|
||||
return super.getName();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.io.OutputStream;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class RemoveObjectTag extends CharacterIdTag implements RemoveTag {
|
||||
public class RemoveObjectTag extends Tag implements CharacterIdTag,RemoveTag {
|
||||
|
||||
/**
|
||||
* ID of character to place
|
||||
|
||||
@@ -20,6 +20,7 @@ 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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
||||
@@ -40,7 +41,7 @@ import java.util.List;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class SoundStreamHead2Tag extends CharacterIdTag implements SoundStreamHeadTypeTag {
|
||||
public class SoundStreamHead2Tag extends CharacterTag implements SoundStreamHeadTypeTag {
|
||||
|
||||
@Reserved
|
||||
@SWFType(value = BasicType.UB, count = 4)
|
||||
|
||||
@@ -20,6 +20,7 @@ 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.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
||||
@@ -40,7 +41,7 @@ import java.util.List;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class SoundStreamHeadTag extends CharacterIdTag implements SoundStreamHeadTypeTag {
|
||||
public class SoundStreamHeadTag extends CharacterTag implements SoundStreamHeadTypeTag {
|
||||
|
||||
@Reserved
|
||||
@SWFType(value = BasicType.UB, count = 4)
|
||||
@@ -261,4 +262,6 @@ public class SoundStreamHeadTag extends CharacterIdTag implements SoundStreamHea
|
||||
final int[] rateMap = {5512, 11025, 22050, 44100};
|
||||
return new SoundFormat(getSoundFormatId(), rateMap[getSoundRate()], getSoundType());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,49 +24,10 @@ import com.jpexs.helpers.ByteArrayRange;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class CharacterIdTag extends Tag {
|
||||
public interface CharacterIdTag {
|
||||
|
||||
public CharacterIdTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||
super(swf, id, name, data);
|
||||
}
|
||||
|
||||
|
||||
public abstract int getCharacterId();
|
||||
|
||||
protected String exportName;
|
||||
|
||||
public void setExportName(String exportName) {
|
||||
if ("".equals(exportName)) {
|
||||
exportName = null;
|
||||
}
|
||||
this.exportName = exportName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
String nameAppend = "";
|
||||
if (exportName != null) {
|
||||
nameAppend = ": " + exportName;
|
||||
}
|
||||
if (getCharacterId() != -1) {
|
||||
return super.getName() + " (" + getCharacterId() + nameAppend + ")";
|
||||
}
|
||||
if (!nameAppend.isEmpty()) {
|
||||
return super.getName() + " (" + nameAppend + ")";
|
||||
}
|
||||
return super.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExportFileName() {
|
||||
String result = super.getExportFileName() + "_" + getCharacterId();
|
||||
return result + (exportName != null ? "_" + exportName : "");
|
||||
}
|
||||
|
||||
public String getCharacterExportFileName() {
|
||||
return getCharacterId() + (exportName != null ? "_" + exportName : "");
|
||||
}
|
||||
|
||||
public String getExportName() {
|
||||
return exportName;
|
||||
}
|
||||
public int getCharacterId();
|
||||
|
||||
}
|
||||
|
||||
@@ -17,13 +17,14 @@
|
||||
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 CharacterTag extends CharacterIdTag {
|
||||
public abstract class CharacterTag extends Tag implements CharacterIdTag {
|
||||
|
||||
protected String className;
|
||||
|
||||
@@ -57,8 +58,20 @@ public abstract class CharacterTag extends CharacterIdTag {
|
||||
return result + (className != null ? "_" + className : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCharacterExportFileName() {
|
||||
return getCharacterId() + (exportName != null ? "_" + exportName : "") + (className != null ? "_" + className : "");
|
||||
}
|
||||
|
||||
protected String exportName;
|
||||
|
||||
public void setExportName(String exportName) {
|
||||
if ("".equals(exportName)) {
|
||||
exportName = null;
|
||||
}
|
||||
this.exportName = exportName;
|
||||
}
|
||||
|
||||
public String getExportName() {
|
||||
return exportName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags.base;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
|
||||
import com.jpexs.decompiler.flash.types.ColorTransform;
|
||||
import com.jpexs.decompiler.flash.types.MATRIX;
|
||||
@@ -31,7 +32,7 @@ import java.util.List;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class PlaceObjectTypeTag extends CharacterIdTag {
|
||||
public abstract class PlaceObjectTypeTag extends Tag implements CharacterIdTag {
|
||||
|
||||
public PlaceObjectTypeTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||
super(swf, id, name, data);
|
||||
|
||||
@@ -360,7 +360,8 @@ public class Timeline {
|
||||
for (ASMSource asm : asmSources) {
|
||||
if (asm instanceof DoInitActionTag) {
|
||||
DoInitActionTag initAction = (DoInitActionTag) asm;
|
||||
String path = initAction.getExportName();
|
||||
CharacterTag cht=swf.getCharacter(initAction.spriteId);
|
||||
String path = cht!=null?cht.getExportName():"_unk_";
|
||||
if (path == null || path.isEmpty()) {
|
||||
path = initAction.getExportFileName();
|
||||
}
|
||||
|
||||
@@ -2733,7 +2733,10 @@ public class XFLConverter {
|
||||
DefineSpriteTag sprite = (DefineSpriteTag) characters.get(chid);
|
||||
if (sprite.subTags.isEmpty()) {
|
||||
String data = convertActionScript(dia);
|
||||
String expPath = dia.getExportName();
|
||||
CharacterTag spr=dia.getSwf().getCharacter(dia.spriteId);
|
||||
String expName = spr!=null?spr.getExportName():"_unk_";
|
||||
|
||||
String expPath = spr.getExportName();
|
||||
final String prefix = "__Packages.";
|
||||
if (expPath.startsWith(prefix)) {
|
||||
expPath = expPath.substring(prefix.length());
|
||||
|
||||
@@ -45,4 +45,9 @@ public enum TreeNodeType {
|
||||
BUNDLE_SWC,
|
||||
BUNDLE_BINARY,
|
||||
HEADER,
|
||||
SET_BACKGROUNDCOLOR,
|
||||
FILE_ATTRIBUTES,
|
||||
METADATA,
|
||||
PLACE_OBJECT,
|
||||
REMOVE_OBJECT
|
||||
}
|
||||
|
||||
BIN
src/com/jpexs/decompiler/flash/gui/graphics/fileattributes16.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/fileattributes16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 732 B |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/metadata16.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/metadata16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 568 B |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/placeobject16.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/placeobject16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 698 B |
BIN
src/com/jpexs/decompiler/flash/gui/graphics/removeobject16.png
Normal file
BIN
src/com/jpexs/decompiler/flash/gui/graphics/removeobject16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 695 B |
Binary file not shown.
|
After Width: | Height: | Size: 805 B |
@@ -96,6 +96,8 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
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.PlaceObjectTypeTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.TextTag;
|
||||
@@ -336,6 +338,21 @@ public class TagTree extends JTree {
|
||||
}
|
||||
}
|
||||
|
||||
if(t instanceof SetBackgroundColorTag){
|
||||
return TreeNodeType.SET_BACKGROUNDCOLOR;
|
||||
}
|
||||
if(t instanceof FileAttributesTag){
|
||||
return TreeNodeType.FILE_ATTRIBUTES;
|
||||
}
|
||||
if(t instanceof MetadataTag){
|
||||
return TreeNodeType.METADATA;
|
||||
}
|
||||
if(t instanceof PlaceObjectTypeTag){
|
||||
return TreeNodeType.PLACE_OBJECT;
|
||||
}
|
||||
if(t instanceof RemoveTag){
|
||||
return TreeNodeType.REMOVE_OBJECT;
|
||||
}
|
||||
if (t instanceof Tag) {
|
||||
return TreeNodeType.OTHER_TAG;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import com.jpexs.decompiler.flash.tags.SoundStreamBlockTag;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSourceContainer;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
|
||||
import com.jpexs.decompiler.flash.timeline.AS2Package;
|
||||
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
||||
@@ -190,7 +192,7 @@ public class TagTreeModel implements TreeModel {
|
||||
List<TreeItem> sounds = new ArrayList<>();
|
||||
List<TreeItem> binaryData = new ArrayList<>();
|
||||
List<TreeItem> others = new ArrayList<>();
|
||||
|
||||
Map<Integer, List<TreeItem>> mappedTags = new HashMap<>();
|
||||
for (Tag t : swf.tags) {
|
||||
TreeNodeType ttype = TagTree.getTreeNodeType(t);
|
||||
switch (ttype) {
|
||||
@@ -229,7 +231,20 @@ public class TagTreeModel implements TreeModel {
|
||||
break;
|
||||
default:
|
||||
if (t.getId() != ShowFrameTag.ID && !ShowFrameTag.isNestedTagType(t.getId())) {
|
||||
others.add(t);
|
||||
boolean parentFound = false;
|
||||
if ((t instanceof CharacterIdTag) && !(t instanceof CharacterTag)) {
|
||||
CharacterIdTag chit = (CharacterIdTag) t;
|
||||
if (swf.getCharacter(chit.getCharacterId()) != null) {
|
||||
parentFound = true;
|
||||
if (!mappedTags.containsKey(chit.getCharacterId())) {
|
||||
mappedTags.put(chit.getCharacterId(), new ArrayList<>());
|
||||
}
|
||||
mappedTags.get(chit.getCharacterId()).add(t);
|
||||
}
|
||||
}
|
||||
if (!parentFound) {
|
||||
others.add(t);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -318,6 +333,7 @@ public class TagTreeModel implements TreeModel {
|
||||
|
||||
TagTreeSwfInfo swfInfo = new TagTreeSwfInfo();
|
||||
swfInfo.folders = nodeList;
|
||||
swfInfo.mappedTags = mappedTags;
|
||||
swfInfo.tagScriptCache = currentTagScriptCache;
|
||||
swfInfos.put(swf, swfInfo);
|
||||
}
|
||||
@@ -461,6 +477,20 @@ public class TagTreeModel implements TreeModel {
|
||||
|
||||
return swfInfo.folders;
|
||||
}
|
||||
|
||||
private List<TreeItem> getMappedCharacters(SWF swf,CharacterTag tag) {
|
||||
TagTreeSwfInfo swfInfo = swfInfos.get(swf);
|
||||
if (swfInfo == null) {
|
||||
createTagList(swf);
|
||||
swfInfo = swfInfos.get(swf);
|
||||
}
|
||||
|
||||
List<TreeItem> mapped = swfInfo.mappedTags.get(tag.getCharacterId());
|
||||
if(mapped == null){
|
||||
mapped = new ArrayList<>();
|
||||
}
|
||||
return mapped;
|
||||
}
|
||||
|
||||
public List<? extends TreeItem> getAllChildren(Object parent) {
|
||||
TreeItem parentNode = (TreeItem) parent;
|
||||
@@ -530,6 +560,8 @@ public class TagTreeModel implements TreeModel {
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
} else if (parentNode instanceof CharacterTag){
|
||||
return getMappedCharacters(((CharacterTag)parentNode).getSwf(),(CharacterTag)parentNode);
|
||||
}
|
||||
|
||||
return new ArrayList<>();
|
||||
@@ -600,6 +632,8 @@ public class TagTreeModel implements TreeModel {
|
||||
return clt.getChild(clt.getRoot(), index);
|
||||
} else if (parentNode instanceof AS3ClassTreeItem) {
|
||||
return ((AS3Package) parentNode).getChild(index);
|
||||
} else if (parentNode instanceof CharacterTag){
|
||||
return getMappedCharacters(((CharacterTag)parentNode).getSwf(),(CharacterTag)parentNode).get(index);
|
||||
}
|
||||
|
||||
throw new Error("Unsupported parent type: " + parentNode.getClass().getName());
|
||||
@@ -636,6 +670,8 @@ public class TagTreeModel implements TreeModel {
|
||||
return clt.getChildCount(clt.getRoot());
|
||||
} else if (parentNode instanceof AS3Package) {
|
||||
return ((AS3Package) parentNode).getChildCount();
|
||||
} else if (parentNode instanceof CharacterTag){
|
||||
return getMappedCharacters(((CharacterTag)parentNode).getSwf(),(CharacterTag)parentNode).size();
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -690,6 +726,8 @@ public class TagTreeModel implements TreeModel {
|
||||
return clt.getIndexOfChild(clt.getRoot(), childNode);
|
||||
} else if (parentNode instanceof AS3ClassTreeItem) {
|
||||
return ((AS3Package) parentNode).getIndexOfChild((AS3ClassTreeItem) childNode);
|
||||
} else if (parentNode instanceof CharacterTag){
|
||||
return getMappedCharacters(((CharacterTag)parentNode).getSwf(),(CharacterTag)parentNode).indexOf(childNode);
|
||||
}
|
||||
|
||||
throw new Error("Unsupported parent type: " + parentNode.getClass().getName());
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.Map;
|
||||
public class TagTreeSwfInfo {
|
||||
|
||||
public List<TreeItem> folders;
|
||||
public Map<Integer,List<TreeItem>> mappedTags;
|
||||
|
||||
public Map<Tag, TagScript> tagScriptCache;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user