Base class for DefineXTags, getting the images, fonts, text from the characterMap instead of iterating over all tags

This commit is contained in:
honfika@gmail.com
2015-05-14 13:32:49 +02:00
parent 15744df8fd
commit 64c9a7e544
23 changed files with 1174 additions and 1694 deletions

View File

@@ -390,6 +390,32 @@ public final class SWF implements SWFContainerItem, Timelined {
return null;
}
public ImageTag getImage(int imageId) {
CharacterTag characterTag = getCharacters().get(imageId);
if (characterTag instanceof ImageTag) {
return (ImageTag) characterTag;
}
if (characterTag != null) {
logger.log(Level.SEVERE, "CharacterTag should be an ImageTag. characterId: {0}", imageId);
}
return null;
}
public TextTag getText(int textId) {
CharacterTag characterTag = getCharacters().get(textId);
if (characterTag instanceof TextTag) {
return (TextTag) characterTag;
}
if (characterTag != null) {
logger.log(Level.SEVERE, "CharacterTag should be a TextTag. characterId: {0}", textId);
}
return null;
}
public List<ABCContainerTag> getAbcList() {
if (abcList == null) {
synchronized (this) {