mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 13:28:55 +00:00
loading multiple embedded swfs: progress window fixed, allow to close embedded swf
This commit is contained in:
@@ -2216,6 +2216,10 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
|
||||
public void loadFromBinaryTag(final DefineBinaryDataTag binaryDataTag) {
|
||||
loadFromBinaryTag(Arrays.asList(binaryDataTag));
|
||||
}
|
||||
|
||||
public void loadFromBinaryTag(final List<DefineBinaryDataTag> binaryDataTags) {
|
||||
|
||||
if (Main.loadingDialog == null || Main.loadingDialog.getOwner() == null) {
|
||||
Main.loadingDialog = new LoadingDialog(mainFrame == null ? null : mainFrame.getWindow());
|
||||
@@ -2227,19 +2231,26 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
SWF bswf = new SWF(new ByteArrayInputStream(binaryDataTag.binaryData.getRangeData()), new ProgressListener() {
|
||||
for (DefineBinaryDataTag binaryDataTag : binaryDataTags) {
|
||||
try {
|
||||
SWF bswf = new SWF(new ByteArrayInputStream(binaryDataTag.binaryData.getRangeData()), new ProgressListener() {
|
||||
|
||||
@Override
|
||||
public void progress(int p) {
|
||||
Main.loadingDialog.setPercent(p);
|
||||
@Override
|
||||
public void progress(int p) {
|
||||
Main.loadingDialog.setPercent(p);
|
||||
}
|
||||
}, Configuration.parallelSpeedUp.get());
|
||||
bswf.fileTitle = "(SWF Data)";
|
||||
binaryDataTag.innerSwf = bswf;
|
||||
bswf.binaryData = binaryDataTag;
|
||||
} catch (IOException ex) {
|
||||
//ignore
|
||||
}
|
||||
}, Configuration.parallelSpeedUp.get());
|
||||
bswf.fileTitle = "(SWF Data)";
|
||||
binaryDataTag.innerSwf = bswf;
|
||||
bswf.binaryData = binaryDataTag;
|
||||
} catch (IOException | InterruptedException ex) {
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
//ignore
|
||||
}
|
||||
|
||||
Main.loadingDialog.setVisible(false);
|
||||
Main.stopWork();
|
||||
}
|
||||
|
||||
@@ -194,8 +194,9 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
|
||||
allSelectedIsSwf = false;
|
||||
break;
|
||||
} else if (item instanceof SWF) {
|
||||
SWF swf = (SWF) item;
|
||||
// Do not allow to close SWF in bundle
|
||||
if (((SWF) item).swfList.isBundle) {
|
||||
if (swf.swfList != null &&swf.swfList.isBundle) {
|
||||
allSelectedIsSwf = false;
|
||||
}
|
||||
}
|
||||
@@ -328,11 +329,15 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
|
||||
switch (e.getActionCommand()) {
|
||||
case ACTION_OPEN_SWFINSIDE: {
|
||||
List<TreeItem> sel = tagTree.getSelected(tagTree);
|
||||
List<DefineBinaryDataTag> binaryDatas = new ArrayList<>();
|
||||
for (TreeItem item : sel) {
|
||||
if (item instanceof DefineBinaryDataTag) {
|
||||
mainPanel.loadFromBinaryTag((DefineBinaryDataTag) item);
|
||||
DefineBinaryDataTag binaryData = (DefineBinaryDataTag) item;
|
||||
if (binaryData.isSwfData()) {
|
||||
binaryDatas.add((DefineBinaryDataTag) item);
|
||||
}
|
||||
}
|
||||
|
||||
mainPanel.loadFromBinaryTag(binaryDatas);
|
||||
}
|
||||
break;
|
||||
case ACTION_RAW_EDIT: {
|
||||
@@ -403,7 +408,14 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
|
||||
List<TreeItem> sel = tagTree.getSelected(tagTree);
|
||||
for (TreeItem item : sel) {
|
||||
if (item instanceof SWF) {
|
||||
Main.closeFile(((SWF) item).swfList);
|
||||
SWF swf = (SWF) item;
|
||||
if (swf.binaryData != null) {
|
||||
// embedded swf
|
||||
swf.binaryData.innerSwf = null;
|
||||
mainPanel.refreshTree();
|
||||
} else {
|
||||
Main.closeFile(swf.swfList);
|
||||
}
|
||||
} else if (item instanceof SWFList) {
|
||||
Main.closeFile((SWFList) item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user