diff --git a/CHANGELOG.md b/CHANGELOG.md index 101d44d18..2fc1f4d95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ All notable changes to this project will be documented in this file. - [#2263] Expand one level more (`+` sign) for needed/dependent characters in tag info panel to show full tag name as in tree - [#1290] Export to FlashDevelop project +- [#1290] Export to IntelliJ IDEA project +- Export FLA context menu on SWFs ### Fixed - Debugger - getting children of top level variables diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfFlashDevelopExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfFlashDevelopExporter.java index 1af5a4623..97e97486d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfFlashDevelopExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfFlashDevelopExporter.java @@ -24,16 +24,10 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.exporters.settings.ScriptExportSettings; import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag; -import com.jpexs.decompiler.flash.xfl.XFLXmlWriter; -import com.jpexs.helpers.Helper; -import com.jpexs.helpers.XmlPrettyFormat; import com.jpexs.helpers.utf8.Utf8Helper; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.xml.stream.XMLStreamException; /** * diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfIntelliJIdeaExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfIntelliJIdeaExporter.java new file mode 100644 index 000000000..db9364673 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/swf/SwfIntelliJIdeaExporter.java @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2010-2024 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.exporters.swf; + +import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; +import com.jpexs.decompiler.flash.EventListener; +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; +import com.jpexs.decompiler.flash.exporters.settings.ScriptExportSettings; +import com.jpexs.helpers.utf8.Utf8Helper; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class SwfIntelliJIdeaExporter { + + private static String doubleToString(double d) { + String ds = "" + d; + if (ds.endsWith(".0")) { + ds = ds.substring(0, ds.length() - 2); + } + return ds; + } + + public void exportIntelliJIdeaProject(SWF swf, File outFile, AbortRetryIgnoreHandler handler) throws IOException { + exportIntelliJIdeaProject(swf, outFile, handler, null); + } + + public void exportIntelliJIdeaProject(SWF swf, File outFile, AbortRetryIgnoreHandler handler, EventListener eventListener) throws IOException { + if (!swf.isAS3()) { + throw new IllegalArgumentException("SWF must be AS3"); + } + + String simpleName = outFile.getName(); + if (simpleName.contains(".")) { + simpleName = simpleName.substring(0, simpleName.lastIndexOf(".")); + } + + File baseDir = outFile.getParentFile(); + File ideaDir = new File(baseDir, ".idea"); + + String documentClass = swf.getDocumentClass(); + if (documentClass == null) { + documentClass = ""; + } + + List additionalOptions = new ArrayList<>(); + + additionalOptions.add("-default-size " + Math.round(swf.displayRect.getWidth() / SWF.unitDivisor) + " " + Math.round(swf.displayRect.getHeight() / SWF.unitDivisor)); + additionalOptions.add("-default-frame-rate " + Math.round(swf.frameRate)); + if (swf.getBackgroundColor() != null) { + additionalOptions.add("-default-background-color " + swf.getBackgroundColor().backgroundColor.toHexRGB()); + } + + String imlData = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + try (FileOutputStream fos = new FileOutputStream(outFile)) { + fos.write(Utf8Helper.getBytes(imlData)); + } + + ideaDir.mkdir(); + + String modulesXml = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + try (FileOutputStream fos = new FileOutputStream(new File(ideaDir, "modules.xml"))) { + fos.write(Utf8Helper.getBytes(modulesXml)); + } + + String flexCompilerXml = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + ""; + try (FileOutputStream fos = new FileOutputStream(new File(ideaDir, "flexCompiler.xml"))) { + fos.write(Utf8Helper.getBytes(flexCompilerXml)); + } + + String miscXml = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + ""; + try (FileOutputStream fos = new FileOutputStream(new File(ideaDir, "misc.xml"))) { + fos.write(Utf8Helper.getBytes(miscXml)); + } + + try (FileOutputStream fos = new FileOutputStream(new File(ideaDir, ".name"))) { + fos.write(Utf8Helper.getBytes(outFile.getName())); + } + + String gitIgnore = "# Default ignored files\n" + + "/shelf/\n" + + "/workspace.xml\n" + + "# Editor-based HTTP Client requests\n" + + "/httpRequests/\n" + + "# Datasource local storage ignored files\n" + + "/dataSources/\n" + + "/dataSources.local.xml"; + try (FileOutputStream fos = new FileOutputStream(new File(ideaDir, ".gitignore"))) { + fos.write(Utf8Helper.getBytes(gitIgnore)); + } + + boolean parallel = Configuration.parallelSpeedUp.get(); + ScriptExportSettings scriptExportSettings = new ScriptExportSettings(ScriptExportMode.AS, false, false, true, false, false); + swf.exportActionScript(handler, new File(outFile.getParentFile(), "src").getAbsolutePath(), scriptExportSettings, parallel, eventListener); + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 66d707519..d24490f24 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -461,7 +461,18 @@ public abstract class MainFrameMenu implements MenuBuilder { return; } - mainFrame.getPanel().exportFlashDevelopProject((SWF) openable); + mainFrame.getPanel().exportFlashDevelop((SWF) openable); + } + + protected void exportIdeaActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + if (mainFrame.getPanel().checkEdited()) { + return; + } + + mainFrame.getPanel().exportIdea((SWF) openable); } protected void exportFlaActionPerformed(ActionEvent evt) { @@ -1044,6 +1055,8 @@ public abstract class MainFrameMenu implements MenuBuilder { setMenuEnabled("/file/export/exportFla", allSameSwf && openableSelected && !isWorking); setMenuEnabled("_/exportFlashDevelop", swfSelected && !isWorking); setMenuEnabled("/file/export/exportFlashDevelop", allSameSwf && openableSelected && isAs3 && !isWorking); + setMenuEnabled("_/exportIdea", swfSelected && !isWorking); + setMenuEnabled("/file/export/exportIdea", allSameSwf && openableSelected && isAs3 && !isWorking); setMenuEnabled("_/exportSelected", openableSelected && !isWorking); setMenuEnabled("/file/export/exportSelected", openableSelected && !isWorking); setMenuEnabled("/file/export/exportXml", swfSelected && !isWorking); @@ -1142,6 +1155,7 @@ public abstract class MainFrameMenu implements MenuBuilder { addSeparator("_"); addMenuItem("_/exportFla", translate("menu.file.export.fla"), "exportfla32", this::exportFlaActionPerformed, PRIORITY_TOP, null, true, null, false); addMenuItem("_/exportFlashDevelop", translate("menu.file.export.flashDevelop"), "exportflashdevelop32", this::exportFlashDevelopActionPerformed, PRIORITY_TOP, null, true, null, false); + addMenuItem("_/exportIdea", translate("menu.file.export.idea"), "exportidea32", this::exportIdeaActionPerformed, PRIORITY_TOP, null, true, null, false); addMenuItem("_/exportAll", translate("menu.file.export.all"), "export32", this::exportAllActionPerformed, PRIORITY_TOP, null, true, null, false); addMenuItem("_/exportSelected", translate("menu.file.export.selection"), "exportsel32", this::exportSelectedActionPerformed, PRIORITY_TOP, null, true, null, false); addSeparator("_"); @@ -1175,6 +1189,7 @@ public abstract class MainFrameMenu implements MenuBuilder { addMenuItem("/file/export", translate("menu.export"), null, null, 0, null, false, null, false); addMenuItem("/file/export/exportFla", translate("menu.file.export.fla"), "exportfla32", this::exportFlaActionPerformed, PRIORITY_TOP, null, true, null, false); addMenuItem("/file/export/exportFlashDevelop", translate("menu.file.export.flashDevelop"), "exportflashdevelop32", this::exportFlashDevelopActionPerformed, PRIORITY_TOP, null, true, null, false); + addMenuItem("/file/export/exportIdea", translate("menu.file.export.idea"), "exportidea32", this::exportIdeaActionPerformed, PRIORITY_TOP, null, true, null, false); addMenuItem("/file/export/exportXml", translate("menu.file.export.xml"), "exportxml32", this::exportXmlActionPerformed, PRIORITY_MEDIUM, null, true, null, false); addMenuItem("/file/export/exportAll", translate("menu.file.export.all"), "export16", this::exportAllActionPerformed, PRIORITY_MEDIUM, null, true, new HotKey("CTRL+SHIFT+E"), false); addMenuItem("/file/export/exportSelected", translate("menu.file.export.selection"), "exportsel16", this::exportSelectedActionPerformed, PRIORITY_MEDIUM, null, true, null, false); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 2d3461251..b484cebce 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -89,6 +89,7 @@ import com.jpexs.decompiler.flash.exporters.settings.SpriteExportSettings; import com.jpexs.decompiler.flash.exporters.settings.SymbolClassExportSettings; import com.jpexs.decompiler.flash.exporters.settings.TextExportSettings; import com.jpexs.decompiler.flash.exporters.swf.SwfFlashDevelopExporter; +import com.jpexs.decompiler.flash.exporters.swf.SwfIntelliJIdeaExporter; import com.jpexs.decompiler.flash.exporters.swf.SwfJavaExporter; import com.jpexs.decompiler.flash.exporters.swf.SwfXmlExporter; import com.jpexs.decompiler.flash.flexsdk.MxmlcAs3ScriptReplacer; @@ -3311,7 +3312,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } - public void exportFlashDevelopProject(final SWF swf) { + public void exportFlashDevelop(final SWF swf) { if (swf == null) { return; } @@ -3419,6 +3420,115 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } }.execute(); } + + public void exportIdea(final SWF swf) { + if (swf == null) { + return; + } + + JFileChooser fc = new JFileChooser(); + String selDir = Configuration.lastOpenDir.get(); + fc.setCurrentDirectory(new File(selDir)); + if (!selDir.endsWith(File.separator)) { + selDir += File.separator; + } + String swfShortName = swf.getShortFileName(); + if ("".equals(swfShortName)) { + swfShortName = "untitled.swf"; + } + String fileName; + if (swfShortName.contains(".")) { + fileName = swfShortName.substring(0, swfShortName.lastIndexOf(".")) + ".iml"; + } else { + fileName = swfShortName + ".iml"; + } + + FileFilter f = new FileFilter() { + @Override + public boolean accept(File f) { + return f.isDirectory() || (f.getName().toLowerCase(Locale.ENGLISH).endsWith(".iml")); + } + + @Override + public String getDescription() { + return translate("filter.iml"); + } + }; + fc.setFileFilter(f); + fc.setAcceptAllFileFilterUsed(false); + fc.setSelectedFile(new File(selDir + fileName)); + + if (fc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) { + return; + } + + Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath()); + File sf = Helper.fixDialogFile(fc.getSelectedFile()); + SwfIntelliJIdeaExporter exporter = new SwfIntelliJIdeaExporter(); + + String path = sf.getAbsolutePath(); + if (path.endsWith(".iml")) { + path = path.substring(0, path.length() - ".iml".length()); + } + path += ".iml"; + + final String fpath = path; + + long timeBefore = System.currentTimeMillis(); + new CancellableWorker() { + @Override + protected Void doInBackground() throws Exception { + Helper.freeMem(); + + CancellableWorker w = this; + + ProgressListener prog = new ProgressListener() { + @Override + public void progress(int p) { + } + + @Override + public void status(String status) { + Main.startWork(translate("work.exporting.idea") + "..." + status, w); + } + }; + EventListener evl = swf.getExportEventListener(); + try { + AbortRetryIgnoreHandler errorHandler = new GuiAbortRetryIgnoreHandler(); + exporter.exportIntelliJIdeaProject(swf, new File(fpath), errorHandler, evl); + } catch (Exception ex) { + logger.log(Level.SEVERE, "IDEA export error", ex); + ViewMessages.showMessageDialog(MainPanel.this, translate("error.export") + ": " + ex.getClass().getName() + " " + ex.getLocalizedMessage(), translate("error"), JOptionPane.ERROR_MESSAGE); + } + Helper.freeMem(); + return null; + } + + @Override + protected void onStart() { + Main.startWork(translate("work.exporting.idea") + "...", this); + } + + @Override + protected void done() { + Main.stopWork(); + long timeAfter = System.currentTimeMillis(); + final long timeMs = timeAfter - timeBefore; + + View.execInEventDispatch(() -> { + setStatus(translate("export.finishedin").replace("%time%", Helper.formatTimeSec(timeMs))); + }); + + if (Configuration.openFolderAfterFlaExport.get()) { + try { + Desktop.getDesktop().open(new File(fpath).getAbsoluteFile().getParentFile()); + } catch (IOException ex) { + logger.log(Level.SEVERE, null, ex); + } + } + } + }.execute(); + } public void exportFla(final SWF swf) { if (swf == null) { diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/exportidea16.png b/src/com/jpexs/decompiler/flash/gui/graphics/exportidea16.png new file mode 100644 index 000000000..b68dd2195 Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/exportidea16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/exportidea32.png b/src/com/jpexs/decompiler/flash/gui/graphics/exportidea32.png new file mode 100644 index 000000000..d9da3d173 Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/exportidea32.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index ce108e933..5114e164e 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -1275,10 +1275,20 @@ contextmenu.configurePathResolving = Configure path resolving... contextmenu.setAsLinkage = Set AS linkage -contextmenu.exportFlashDevelopProject = Export FlashDevelop project +contextmenu.exportFlashDevelop = Export FlashDevelop project filter.as3proj = FlashDevelop AS3 projects (*.as3proj) work.exporting.flashDevelop = Exporting FlashDevelop project -menu.file.export.flashDevelop = Export FD project \ No newline at end of file +menu.file.export.flashDevelop = Export FD project + +contextmenu.exportIdea = Export IDEA project + +filter.iml = IntelliJ IDEA projects (*.iml) + +work.exporting.idea = Exporting IntelliJ IDEA project + +menu.file.export.idea = Export IDEA project + +contextmenu.exportFla = Export to FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index 0113a9090..34dde95be 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -1251,10 +1251,20 @@ contextmenu.configurePathResolving = Nastavit resolvov\u00e1n\u00ed cest... contextmenu.setAsLinkage = Nastavit AS vazbu -contextmenu.exportFlashDevelopProject = Exportovat FlashDevelop projekt +contextmenu.exportFlashDevelop = Exportovat FlashDevelop projekt filter.as3proj = FlashDevelop AS3 projekty (*.as3proj) work.exporting.flashDevelop = Exportov\u00e1n\u00ed FlashDevelop projektu -menu.file.export.flashDevelop = Exportovat FD projekt \ No newline at end of file +menu.file.export.flashDevelop = Exportovat FD projekt + +contextmenu.exportIdea = Exportovat IDEA project + +filter.iml = IntelliJ IDEA projekty (*.iml) + +work.exporting.idea = Exportov\u00e1n\u00ed IntelliJ IDEA projektu + +menu.file.export.idea = Exportovat IDEA projekt + +contextmenu.exportFla = Exportovat do FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_de.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_de.properties index bbfcb1d80..f760eee21 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_de.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_de.properties @@ -626,3 +626,5 @@ error.image.alpha.invalid = Ung\u00fcltige Alphakanaldaten. message.confirm.remove.nodep = Wolen Sie wirklich %item% entfernen? message.confirm.removemultiple.nodep = Wollen sie wirklich %count% Elemente entfernen? + +contextmenu.exportFla = Exportiere als *.FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties index 8e9d05d26..6f6856b54 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties @@ -719,3 +719,5 @@ button.remove = Remover message.confirm.remove.nodep = Est\u00e1 seguro que desea remover %item%? message.confirm.removemultiple.nodep = Est\u00e1 seguro que desea eliminar %count% art\u00edculos? + +contextmenu.exportFla = Exportar a FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties index b8d5aaa1a..705ab00c2 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties @@ -738,3 +738,5 @@ contextmenu.showInResources = Afficher dans les resources message.confirm.remove.nodep = \u00cates-vous s\u00fbr de vouloir retirer les objets %item% ? message.confirm.removemultiple.nodep = \u00cates-vous s\u00fbr de vouloir retirer %count% objets ? + +contextmenu.exportFla = Exporter en FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties index de6cae562..44e4e1ce7 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties @@ -716,3 +716,5 @@ export.script.singleFilePallelModeWarning = Az egy f\u00e1jlba t\u00f6rt\u00e9n\ message.confirm.remove.nodep = Biztos benne, hogy t\u00f6r\u00f6lni k\u00edv\u00e1nja a %item%-t ? message.confirm.removemultiple.nodep = Biztos benne, hogy t\u00f6r\u00f6lni k\u00edv\u00e1nja a %count% elemet ? + +contextmenu.exportFla = Export\u00e1l\u00e1s FLA-ba \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_it.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_it.properties index fe8d39a9c..e74473442 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_it.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_it.properties @@ -720,3 +720,5 @@ button.remove = Rimuovi message.confirm.remove.nodep = Sicuro di voler remuovere %item%? message.confirm.removemultiple.nodep = Confermare la rimozione di %count% elementi? + +contextmenu.exportFla = Esporta come FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ja.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ja.properties index 66970a81d..8c7442e7d 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ja.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ja.properties @@ -826,3 +826,5 @@ notavailable.activex.disable = \u8a73\u7d30\u8a2d\u5b9a \uff0f \u305d\u306e\u4ed \u3057\u304b\u3057\u3001\u6b8b\u5ff5\u306a\u304c\u3089\u3001\u3053\u308c\u306f\u52d5\u753b\u30bf\u30b0\u3067\u306f\u6a5f\u80fd\u3057\u307e\u305b\u3093\u3002 button.showin.flashprojector = flash projector \u3067\u8868\u793a + +contextmenu.exportFla = FLA \u3067\u30a8\u30af\u30b9\u30dd\u30fc\u30c8 \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties index ab7cb0aa3..802c4a655 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties @@ -1041,3 +1041,5 @@ contextmenu.copyTagToReplaceByExportName = Tag kopi\u00ebren naar (vervangen doo button.breakpointList = Toon breekpuntlijst node.scenes = sc\u00e8nes contextmenu.showInFramesFolder = Weergeven in framesmap + +contextmenu.exportFla = Naar FLA exporteren \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pl.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pl.properties index 05c3e9150..b2d9f9abe 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pl.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pl.properties @@ -516,3 +516,5 @@ font.name.intag = Nazwa czcionki w etykiecie: message.confirm.remove.nodep = Czy na pewno chcesz usun\u0105\u0107 %item%? message.confirm.removemultiple.nodep = Czy na pewno chcesz usun\u0105\u0107 %count% obiekt\u00f3w(y)? + +contextmenu.exportFla = Eskportuj do pliku FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt.properties index fe402aa91..589b1a0c1 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt.properties @@ -348,3 +348,5 @@ ColorChooser.sampleText = Amostra de Texto Amostra de Texto #... message.confirm.remove.nodep = Tem a certeza que pretende remover %item%? + +contextmenu.exportFla = Exportar para FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt_BR.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt_BR.properties index 95d126b11..3978601c3 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt_BR.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt_BR.properties @@ -1114,3 +1114,5 @@ shaperecords.edge.style.newstyles = Novos estilos - %numfillstyles%x fillstyle + shaperecords.edge.style.fillstyle0 = FillStyle0 = %value% shaperecords.edge.style.fillstyle1 = FillStyle1 = %value% shaperecords.edge.end = Fim da forma + +contextmenu.exportFla = Exportar para FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties index 853c47009..07ac9048b 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties @@ -577,3 +577,5 @@ menu.file.import.symbolClass = \u041a\u043b\u0430\u0441\u0441 \u0441\u0438\u043c message.confirm.remove.nodep = \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 %item%? message.confirm.removemultiple.nodep = \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435: %count%? + +contextmenu.exportFla = \u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties index 5d8319480..413379137 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties @@ -824,3 +824,5 @@ notavailable.activex.disable = Du kan aktivera med intern visning genom att avma Men tyv\u00e4rr fungerar det inte f\u00f6r filmtaggar. button.showin.flashprojector = Visa i flash projector + +contextmenu.exportFla = Exporterar FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_tr.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_tr.properties index 8d25a0308..649a4ac45 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_tr.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_tr.properties @@ -1517,3 +1517,5 @@ contextmenu.addScript.clipactionrecord = \u00d6rnek etkinlik komut dosyas\u0131 contextmenu.addScript.doinitaction = Hareketli ba\u015flang\u0131\u00e7 \u200b\u200bkomut dosyas\u0131 ekle - DoInitAction #after 18.4.1 warning.cannotencrypt = UYARI: %file% dosyas\u0131 HARMAN Air \u015fifrelemesi kullan\u0131larak \u015fifrelendi.\r\nY\u00fcklenmek \u00fczere \u015fifresi ba\u015far\u0131yla \u00e7\u00f6z\u00fcld\u00fc, ancak de\u011fi\u015ftirilen dosyay\u0131 daha sonra kaydetmek isterseniz,\r\n\u015fifreleme kald\u0131r\u0131lacak ( = \u015fifrelenmemi\u015f). + +contextmenu.exportFla = FLA'ya d\u0131\u015fa aktar \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties index a1793f0fa..400ee043b 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties @@ -420,3 +420,5 @@ menu.tools.search = \u041f\u043e\u0448\u0443\u043a \u0442\u0435\u043a\u0441\u044 message.confirm.remove.nodep = \u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 %item%? message.confirm.removemultiple.nodep = \u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0443 \u043a\u0456\u043b\u044c\u043a\u043e\u0441\u0442\u0456: %count%? + +contextmenu.exportFla = \u0415\u043a\u0441\u043f\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u0434\u043e FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_zh.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_zh.properties index d729e6a97..7438d6589 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_zh.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_zh.properties @@ -1029,3 +1029,5 @@ button.morph.start = \u5f00\u59cb button.morph.end = \u7ed3\u675f header.displayrect.unit.pixels = \u50cf\u7d20 header.displayrect.unit.twips = \u7f07 + +contextmenu.exportFla = \u5bfc\u51fa\u5230FLA \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java index 00099606e..bccc6381e 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java @@ -207,7 +207,11 @@ public class TagTreeContextMenu extends JPopupMenu { private JMenuItem exportJavaSourceMenuItem; - private JMenuItem exportFlashDevelopProjectMenuItem; + private JMenuItem exportFlaMenuItem; + + private JMenuItem exportFlashDevelopMenuItem; + + private JMenuItem exportIdeaMenuItem; private JMenuItem exportSwfXmlMenuItem; @@ -485,10 +489,20 @@ public class TagTreeContextMenu extends JPopupMenu { jumpToCharacterMenuItem.setIcon(View.getIcon("jumpto16")); add(jumpToCharacterMenuItem); - exportFlashDevelopProjectMenuItem = new JMenuItem(mainPanel.translate("contextmenu.exportFlashDevelopProject")); - exportFlashDevelopProjectMenuItem.addActionListener(this::exportFlashDevelopProjectActionPerformed); - exportFlashDevelopProjectMenuItem.setIcon(View.getIcon("exportflashdevelop16")); - add(exportFlashDevelopProjectMenuItem); + exportFlaMenuItem = new JMenuItem(mainPanel.translate("contextmenu.exportFla")); + exportFlaMenuItem.addActionListener(this::exportFlaActionPerformed); + exportFlaMenuItem.setIcon(View.getIcon("exportfla16")); + add(exportFlaMenuItem); + + exportFlashDevelopMenuItem = new JMenuItem(mainPanel.translate("contextmenu.exportFlashDevelop")); + exportFlashDevelopMenuItem.addActionListener(this::exportFlashDevelopActionPerformed); + exportFlashDevelopMenuItem.setIcon(View.getIcon("exportflashdevelop16")); + add(exportFlashDevelopMenuItem); + + exportIdeaMenuItem = new JMenuItem(mainPanel.translate("contextmenu.exportIdea")); + exportIdeaMenuItem.addActionListener(this::exportIdeaActionPerformed); + exportIdeaMenuItem.setIcon(View.getIcon("exportidea16")); + add(exportIdeaMenuItem); exportJavaSourceMenuItem = new JMenuItem(mainPanel.translate("contextmenu.exportJavaSource")); exportJavaSourceMenuItem.addActionListener(new ActionListener() { @@ -1165,7 +1179,9 @@ public class TagTreeContextMenu extends JPopupMenu { cleanAbcMenuItem.setVisible(false); rawEditMenuItem.setVisible(false); jumpToCharacterMenuItem.setVisible(false); - exportFlashDevelopProjectMenuItem.setVisible(false); + exportFlaMenuItem.setVisible(false); + exportFlashDevelopMenuItem.setVisible(false); + exportIdeaMenuItem.setVisible(false); exportJavaSourceMenuItem.setVisible(allSelectedIsSwf); exportSwfXmlMenuItem.setVisible(allSelectedIsSwf); @@ -1403,8 +1419,10 @@ public class TagTreeContextMenu extends JPopupMenu { if (firstItem instanceof SWF) { SWF swf = (SWF) firstItem; + exportFlaMenuItem.setVisible(true); if (swf.isAS3()) { - exportFlashDevelopProjectMenuItem.setVisible(true); + exportFlashDevelopMenuItem.setVisible(true); + exportIdeaMenuItem.setVisible(true); } } @@ -5419,10 +5437,19 @@ public class TagTreeContextMenu extends JPopupMenu { } } } - - public void exportFlashDevelopProjectActionPerformed(ActionEvent evt) { + public void exportFlaActionPerformed(ActionEvent evt) { SWF swf = (SWF) getCurrentItem().getOpenable(); - mainPanel.exportFlashDevelopProject(swf); + mainPanel.exportFla(swf); + } + + public void exportFlashDevelopActionPerformed(ActionEvent evt) { + SWF swf = (SWF) getCurrentItem().getOpenable(); + mainPanel.exportFlashDevelop(swf); + } + + public void exportIdeaActionPerformed(ActionEvent evt) { + SWF swf = (SWF) getCurrentItem().getOpenable(); + mainPanel.exportIdea(swf); } public void importScriptsActionPerformed(ActionEvent evt) {