Added Tag list view - WIP - does not have context menu yet,

and other things can be not working yet
This commit is contained in:
Jindra Petřík
2022-10-29 20:25:12 +02:00
parent ddde47498a
commit 7d1f6e684a
12 changed files with 645 additions and 68 deletions

View File

@@ -58,6 +58,8 @@ public class Frame implements TreeItem, Exportable {
public List<ASMSourceContainer> actionContainers = new ArrayList<>();
public List<Tag> innerTags = new ArrayList<>();
public List<Tag> allInnerTags = new ArrayList<>();
public ShowFrameTag showFrameTag = null; // can be null for the last frame
@@ -113,6 +115,15 @@ public class Frame implements TreeItem, Exportable {
return timeline.hashCode() ^ Integer.hashCode(frame);
}
public boolean isAllInnerTagsModified() {
for (Tag t : allInnerTags) {
if (t.isModified()) {
return true;
}
}
return false;
}
@Override
public boolean isModified() {
for (Tag t : innerTags) {

View File

@@ -74,6 +74,7 @@ import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -110,7 +111,7 @@ public class Timeline {
private final Map<ASMSource, Integer> actionFrames = new HashMap<>();
private final Map<SoundStreamHeadTypeTag, List<SoundStreamBlockTag>> soundStramBlocks = new HashMap<>();
private final Map<Integer, List<SoundStreamBlockTag>> soundStramBlocks = new LinkedHashMap<>();
private AS2Package as2RootPackage;
@@ -163,7 +164,7 @@ public class Timeline {
public List<SoundStreamBlockTag> getSoundStreamBlocks(SoundStreamHeadTypeTag head) {
ensureInitialized();
return soundStramBlocks.get(head);
return soundStramBlocks.get(head.getCharacterId());
}
public Tag getParentTag() {
@@ -274,6 +275,7 @@ public class Timeline {
newFrameNeeded = true;
frame.innerTags.add(t);
}
frame.allInnerTags.add(t);
if (t instanceof ASMSourceContainer) {
ASMSourceContainer asmSourceContainer = (ASMSourceContainer) t;
@@ -504,7 +506,7 @@ public class Timeline {
SoundStreamHeadTypeTag head = (SoundStreamHeadTypeTag) t;
head.setVirtualCharacterId(containerId);
blocks = new ArrayList<>();
soundStramBlocks.put(head, blocks);
soundStramBlocks.put(containerId, blocks);
continue;
}