Fixed: AS2 Class names not showing in Folder list view

This commit is contained in:
Jindra Petřík
2025-05-25 18:22:48 +02:00
parent 1768395a9b
commit ceee0afb12
2 changed files with 24 additions and 12 deletions

View File

@@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file.
- Proper freeing memory after SWF close
- AS1/2 improper selection of search result
- [#2459] AS1/2 StoreRegister improper declaration position
- AS2 Class names not showing in Folder list view
## [23.0.1] - 2025-05-16
### Fixed

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.gui.tagtree.AbstractTagTree;
import com.jpexs.decompiler.flash.tags.DoInitActionTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.helpers.SerializableImage;
@@ -161,7 +162,7 @@ public class FolderListPanel extends JPanel {
});
setFocusable(true);
}
public void goToSelection() {
if (selectedIndex > -1) {
TreeItem selectedItem = FolderListPanel.this.items.get(selectedIndex);
@@ -178,8 +179,8 @@ public class FolderListPanel extends JPanel {
selectedItems.clear();
selectedIndex = -1;
((JScrollPane) getParent().getParent()).getVerticalScrollBar().setValue(0);
}
}
public void clear() {
items = new ArrayList<>();
selectedItems.clear();
@@ -243,16 +244,26 @@ public class FolderListPanel extends JPanel {
TreeNodeType type = AbstractTagTree.getTreeNodeType(treeItem);
Icon icon = ICONS.get(type);
icon.paintIcon(l, g, x * CELL_WIDTH + BORDER_SIZE + PREVIEW_SIZE / 2 - icon.getIconWidth() / 2, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE / 2 - icon.getIconHeight() / 2);
String s;
if (treeItem instanceof Tag) {
Tag t = (Tag) treeItem;
String uniqueId = t.getUniqueId();
s = ((Tag) treeItem).getTagName();
if (uniqueId != null) {
s = s + " (" + uniqueId + ")";
String s = null;
if (treeItem instanceof DoInitActionTag) {
DoInitActionTag tag = (DoInitActionTag) treeItem;
String expName = tag.getSwf().getExportName(tag.getCharacterId());
if (expName != null && !expName.isEmpty()) {
String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName};
s = pathParts[pathParts.length - 1];
}
}
if (s == null) {
if (treeItem instanceof Tag) {
Tag t = (Tag) treeItem;
String uniqueId = t.getUniqueId();
s = ((Tag) treeItem).getTagName();
if (uniqueId != null) {
s = s + " (" + uniqueId + ")";
}
} else {
s = treeItem.toString();
}
} else {
s = treeItem.toString();
}
int itemIndex = mainPanel.getCurrentTree().getFullModel().getItemIndex(treeItem);