export swf to XML

This commit is contained in:
2015-01-17 14:24:17 +01:00
parent 07eaafdc55
commit 7d09f30ae9
10 changed files with 232 additions and 8 deletions
@@ -95,6 +95,7 @@ public class MainFrameRibbonMenu extends MainFrameMenu implements ActionListener
private static final String ACTION_EXPORT_FLA = "EXPORTFLA";
public static final String ACTION_EXPORT_SEL = "EXPORTSEL";
public static final String ACTION_EXPORT_JAVA_SOURCE = "EXPORTJAVASOURCE";
public static final String ACTION_EXPORT_SWF_XML = "EXPORTSWFXML";
private static final String ACTION_EXPORT = "EXPORT";
private static final String ACTION_IMPORT_TEXT = "IMPORTTEXT";
private static final String ACTION_CHECK_UPDATES = "CHECKUPDATES";
@@ -58,6 +58,7 @@ import com.jpexs.decompiler.flash.exporters.settings.ShapeExportSettings;
import com.jpexs.decompiler.flash.exporters.settings.SoundExportSettings;
import com.jpexs.decompiler.flash.exporters.settings.TextExportSettings;
import com.jpexs.decompiler.flash.exporters.swf.SwfJavaExporter;
import com.jpexs.decompiler.flash.exporters.swf.SwfXmlExporter;
import com.jpexs.decompiler.flash.gui.abc.ABCPanel;
import com.jpexs.decompiler.flash.gui.abc.ClassesListTreeModel;
import com.jpexs.decompiler.flash.gui.abc.DeobfuscationDialog;
@@ -1643,6 +1644,25 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
if (selFile != null) {
try {
new SwfJavaExporter().exportJavaCode(swf, selFile);
Main.stopWork();
} catch (IOException ex) {
logger.log(Level.SEVERE, null, ex);
}
}
}
}
}
public void exportSwfXml() {
List<TreeItem> sel = tagTree.getSelected(tagTree);
for (TreeItem item : sel) {
if (item instanceof SWF) {
SWF swf = (SWF) item;
final String selFile = selectExportDir();
if (selFile != null) {
try {
new SwfXmlExporter().exportXml(swf, selFile);
Main.stopWork();
} catch (IOException ex) {
logger.log(Level.SEVERE, null, ex);
}
@@ -2000,9 +2020,12 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
switch (e.getActionCommand()) {
case MainFrameRibbonMenu.ACTION_EXPORT_JAVA_SOURCE: {
case MainFrameRibbonMenu.ACTION_EXPORT_JAVA_SOURCE:
exportJavaSource();
}
break;
case MainFrameRibbonMenu.ACTION_EXPORT_SWF_XML:
exportSwfXml();
break;
case MainFrameRibbonMenu.ACTION_EXPORT_SEL:
export(true);
break;
@@ -550,3 +550,4 @@ message.confirm.close = There are unsaved changes. Do you really want to close {
message.confirm.closeAll = There are unsaved changes. Do you really want to close all SWFs?
contextmenu.exportJavaSource = Export Java Source
contextmenu.exportSwfXml = Export SWF as XML
@@ -550,3 +550,4 @@ message.confirm.close = Mentetlen v\u00e1ltoz\u00e1sok vannak. Szeretm\u00e9 m\u
message.confirm.closeAll = Mentetlen v\u00e1ltoz\u00e1sok vannak. Szeretn\u00e9 bez\u00e1rni az \u00f6sszes SWF-t ?
contextmenu.exportJavaSource = Java k\u00f3d export\u00e1l\u00e1s
contextmenu.exportSwfXml = SWF export\u00e1l\u00e1sa XML-k\u00e9nt
@@ -77,6 +77,7 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
private JMenuItem rawEditMenuItem;
private JMenuItem jumpToCharacterMenuItem;
private JMenuItem exportJavaSourceMenuItem;
private JMenuItem exportSwfXmlMenuItem;
private JMenuItem closeMenuItem;
private JMenu addTagMenu;
private JMenu moveTagMenu;
@@ -128,6 +129,11 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
exportJavaSourceMenuItem.addActionListener(mainPanel);
add(exportJavaSourceMenuItem);
exportSwfXmlMenuItem = new JMenuItem(mainPanel.translate("contextmenu.exportSwfXml"));
exportSwfXmlMenuItem.setActionCommand(MainFrameRibbonMenu.ACTION_EXPORT_SWF_XML);
exportSwfXmlMenuItem.addActionListener(mainPanel);
add(exportSwfXmlMenuItem);
closeMenuItem = new JMenuItem(mainPanel.translate("contextmenu.closeSwf"));
closeMenuItem.setActionCommand(ACTION_CLOSE_SWF);
closeMenuItem.addActionListener(this);
@@ -469,6 +475,7 @@ public class TagTreeContextMenu extends JPopupMenu implements ActionListener {
}
}
}
break;
}
}
}