diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java index 4add8c8d8..7804cc882 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java @@ -40,16 +40,18 @@ public class MainFrameClassicMenu extends MainFrameMenu { private final MainFrameClassic mainFrame; + private final Map menuElements = new HashMap<>(); + + private final Map> menuGroups = new HashMap<>(); + + private final Map menuButtonGroups = new HashMap<>(); + public MainFrameClassicMenu(MainFrameClassic mainFrame, boolean externalFlashPlayerUnavailable) { super(mainFrame, externalFlashPlayerUnavailable); this.mainFrame = mainFrame; } - private final Map menuElements = new HashMap<>(); - private final Map> menuGroups = new HashMap<>(); - private final Map menuButtonGroups = new HashMap<>(); - private void addMenu(String path, String title, String icon, final ActionListener subLoader) { path = mapping(path); final String fpath = path; @@ -345,5 +347,4 @@ public class MainFrameClassicMenu extends MainFrameMenu { } return s; } - } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 9565791d1..055b3ba49 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -1,961 +1,973 @@ -/* - * Copyright (C) 2010-2015 JPEXS - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.jpexs.decompiler.flash.gui; - -import com.jpexs.decompiler.flash.ApplicationInfo; -import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFBundle; -import com.jpexs.decompiler.flash.configuration.Configuration; -import com.jpexs.decompiler.flash.console.ContextMenuTools; -import com.jpexs.decompiler.flash.gui.debugger.DebuggerTools; -import com.jpexs.decompiler.flash.gui.helpers.CheckResources; -import com.jpexs.decompiler.flash.tags.ABCContainerTag; -import com.jpexs.helpers.ByteArrayRange; -import com.jpexs.helpers.Cache; -import com.jpexs.helpers.Helper; -import com.jpexs.helpers.utf8.Utf8Helper; -import com.sun.jna.Platform; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.KeyboardFocusManager; -import java.awt.ScrollPane; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.WindowEvent; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.util.List; -import java.util.Timer; -import java.util.TimerTask; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.AbstractButton; -import javax.swing.JDialog; -import javax.swing.JEditorPane; -import javax.swing.JFrame; -import javax.swing.JOptionPane; - -/** - * - * @author JPEXS - */ -public abstract class MainFrameMenu implements MenuBuilder { - - private final MainFrame mainFrame; - - private SWF swf; - - public boolean isInternalFlashViewerSelected() { - return isMenuChecked("/settings/internalViewer"); //miInternalViewer.isSelected(); - } - - private boolean externalFlashPlayerUnavailable; - - public MainFrameMenu(MainFrame mainFrame, boolean externalFlashPlayerUnavailable) { - registerHotKeys(); - this.mainFrame = mainFrame; - this.externalFlashPlayerUnavailable = externalFlashPlayerUnavailable; - } - - protected String translate(String key) { - return mainFrame.translate(key); - } - - protected boolean open(ActionEvent evt) { - if (Main.isWorking()) { - return false; - } - - Main.openFileDialog(); - return true; - } - - protected boolean save(ActionEvent evt) { - if (Main.isWorking()) { - return false; - } - - if (swf != null) { - boolean saved = false; - if (swf.swfList != null && swf.swfList.isBundle()) { - SWFBundle bundle = swf.swfList.bundle; - if (!bundle.isReadOnly()) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try { - swf.saveTo(baos); - saved = bundle.putSWF(swf.getFileTitle(), new ByteArrayInputStream(baos.toByteArray())); - } catch (IOException ex) { - Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex); - } - } - } else if (swf.binaryData != null) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try { - swf.saveTo(baos); - swf.binaryData.binaryData = new ByteArrayRange(baos.toByteArray()); - swf.binaryData.setModified(true); - saved = true; - } catch (IOException ex) { - Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex); - } - } else if (swf.getFile() == null) { - saved = saveAs(swf, SaveFileMode.SAVEAS); - } else { - try { - Main.saveFile(swf, swf.getFile()); - saved = true; - } catch (IOException ex) { - Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, null, ex); - View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE); - } - } - if (saved) { - swf.clearModified(); - mainFrame.getPanel().refreshTree(swf); - } - - return true; - } - - return false; - } - - protected boolean saveAs(ActionEvent evt) { - if (Main.isWorking()) { - return false; - } - - if (swf != null) { - if (saveAs(swf, SaveFileMode.SAVEAS)) { - swf.clearModified(); - } - - return true; - } - - return false; - } - - private boolean saveAs(SWF swf, SaveFileMode mode) { - if (Main.saveFileDialog(swf, mode)) { - mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : "")); - updateComponents(swf); - return true; - } - return false; - } - - protected void saveAsExe(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - if (swf != null) { - saveAs(swf, SaveFileMode.EXE); - } - } - - protected void close(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - if (swf == null) { - return; - } - - Main.closeFile(swf.swfList); - } - - protected boolean closeAll(ActionEvent evt) { - if (Main.isWorking()) { - return false; - } - - if (swf != null) { - Main.closeAll(); - return true; - } - - return false; - } - - protected void importText(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().importText(swf); - } - - protected void importScript(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().importScript(swf); - } - - protected void importSymbolClass(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().importSymbolClass(swf); - } - - protected void exportAll(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - export(false); - } - - protected void exportSelected(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - export(true); - } - - protected boolean export(boolean onlySelected) { - if (swf != null) { - mainFrame.getPanel().export(onlySelected); - return true; - } - - return false; - } - - protected void exportFla(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().exportFla(swf); - } - - protected void importSwfXml(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().importSwfXml(); - } - - protected void exportSwfXml(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().exportSwfXml(); - } - - protected boolean search(ActionEvent evt, Boolean searchInText) { - if (swf != null) { - mainFrame.getPanel().searchInActionScriptOrText(searchInText); - return true; - } - - return false; - } - - protected boolean replace(ActionEvent evt) { - if (swf != null) { - mainFrame.getPanel().replaceText(); - return true; - } - - return false; - } - - protected void restoreControlFlow(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - restoreControlFlow(false); - } - - protected void restoreControlFlowAll(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - restoreControlFlow(true); - } - - protected void restoreControlFlow(boolean all) { - mainFrame.getPanel().restoreControlFlow(all); - } - - protected void showProxy(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - Main.showProxy(); - } - - protected boolean clearLog() { - ErrorLogFrame.getInstance().clearLog(); - return true; - } - - protected void renameOneIdentifier(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().renameOneIdentifier(swf); - } - - protected void renameIdentifiers(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().renameIdentifiers(swf); - } - - protected void deobfuscate(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - mainFrame.getPanel().deobfuscate(); - } - - protected void setSubLimiter(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - Main.setSubLimiter(selected); - } - - protected void switchDebugger() { - DebuggerTools.switchDebugger(swf); - } - - protected void debuggerShowLog(ActionEvent evt) { - DebuggerTools.debuggerShowLog(); - } - - protected void debuggerReplaceTraceCalls(ActionEvent evt) { - ReplaceTraceDialog rtd = new ReplaceTraceDialog(Configuration.lastDebuggerReplaceFunction.get()); - rtd.setVisible(true); - if (rtd.getValue() != null) { - String fname = rtd.getValue(); - DebuggerTools.replaceTraceCalls(swf, fname); - mainFrame.getPanel().refreshDecompiled(); - Configuration.lastDebuggerReplaceFunction.set(rtd.getValue()); - } - } - - protected void clearRecentFiles(ActionEvent evt) { - Configuration.recentFiles.set(null); - } - - protected void removeNonScripts() { - mainFrame.getPanel().removeNonScripts(swf); - } - - protected void refreshDecompiled() { - mainFrame.getPanel().refreshDecompiled(); - } - - protected boolean previousTag() { - return mainFrame.getPanel().previousTag(); - } - - protected boolean nextTag() { - return mainFrame.getPanel().nextTag(); - } - - protected void checkResources() { - ByteArrayOutputStream os = new ByteArrayOutputStream(); - PrintStream stream = new PrintStream(os); - CheckResources.checkResources(stream); - final String str = new String(os.toByteArray(), Utf8Helper.charset); - JDialog dialog = new JDialog() { - - @Override - public void setVisible(boolean bln) { - setSize(new Dimension(800, 600)); - Container cnt = getContentPane(); - cnt.setLayout(new BorderLayout()); - ScrollPane scrollPane = new ScrollPane(); - JEditorPane editor = new JEditorPane(); - editor.setEditable(false); - editor.setText(str); - scrollPane.add(editor); - this.add(scrollPane, BorderLayout.CENTER); - this.setModal(true); - View.centerScreen(this); - super.setVisible(bln); - } - }; - dialog.setVisible(true); - } - - protected void checkUpdates(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - if (!Main.checkForUpdates()) { - View.showMessageDialog(null, translate("update.check.nonewversion"), translate("update.check.title"), JOptionPane.INFORMATION_MESSAGE); - } - } - - protected void helpUs(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - String helpUsURL = ApplicationInfo.PROJECT_PAGE + "/help_us.html?utm_source=app&utm_medium=menu&utm_campaign=app"; - if (!View.navigateUrl(helpUsURL)) { - View.showMessageDialog(null, translate("message.helpus").replace("%url%", helpUsURL)); - } - } - - protected void homePage(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - String homePageURL = ApplicationInfo.PROJECT_PAGE + "?utm_source=app&utm_medium=menu&utm_campaign=app"; - if (!View.navigateUrl(homePageURL)) { - View.showMessageDialog(null, translate("message.homepage").replace("%url%", homePageURL)); - } - } - - protected void about(ActionEvent evt) { - if (Main.isWorking()) { - return; - } - - Main.about(); - } - - protected boolean reload(ActionEvent evt) { - if (swf != null) { - if (View.showConfirmDialog(null, translate("message.confirm.reload"), translate("message.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) { - Main.reloadApp(); - } - - return true; - } - - return false; - } - - protected void advancedSettings(ActionEvent evt) { - Main.advancedSettings(); - } - - protected void loadFromMemory(ActionEvent evt) { - Main.loadFromMemory(); - } - - protected void loadFromCache(ActionEvent evt) { - Main.loadFromCache(); - } - - protected void gotoDucumentClassOnStartup(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - Configuration.gotoMainClassOnStartup.set(selected); - } - - protected void autoRenameIdentifiers(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - Configuration.autoRenameIdentifiers.set(selected); - } - - protected void cacheOnDisk(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - Configuration.cacheOnDisk.set(selected); - if (selected) { - Cache.setStorageType(Cache.STORAGE_FILES); - } else { - Cache.setStorageType(Cache.STORAGE_MEMORY); - } - } - - protected void setLanguage(ActionEvent evt) { - new SelectLanguageDialog().display(); - } - - protected void disableDecompilation(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - Configuration.decompile.set(!selected); - mainFrame.getPanel().disableDecompilationChanged(); - } - - protected void associate(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - if (selected == ContextMenuTools.isAddedToContextMenu()) { - return; - } - ContextMenuTools.addToContextMenu(selected, false); - - // Update checkbox menuitem accordingly (User can cancel rights elevation) - new Timer().schedule(new TimerTask() { - @Override - public void run() { - button.setSelected(ContextMenuTools.isAddedToContextMenu()); - } - }, 1000); // It takes some time registry change to apply - } - - protected void gotoDucumentClass(ActionEvent evt) { - mainFrame.getPanel().gotoDocumentClass(mainFrame.getPanel().getCurrentSwf()); - } - - protected void parallelSpeedUp(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - String confStr = translate("message.confirm.parallel") + "\r\n"; - if (selected) { - confStr += " " + translate("message.confirm.on"); - } else { - confStr += " " + translate("message.confirm.off"); - } - if (View.showConfirmDialog(null, confStr, translate("message.parallel"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { - Configuration.parallelSpeedUp.set(selected); - } else { - button.setSelected(Configuration.parallelSpeedUp.get()); - } - } - - protected void internalViewerSwitch(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - Configuration.internalFlashViewer.set(selected); - mainFrame.getPanel().reload(true); - } - - protected void autoDeobfuscate(ActionEvent evt) { - AbstractButton button = (AbstractButton) evt.getSource(); - boolean selected = button.isSelected(); - - if (View.showConfirmDialog(mainFrame.getPanel(), translate("message.confirm.autodeobfuscate") + "\r\n" + (selected ? translate("message.confirm.on") : translate("message.confirm.off")), translate("message.confirm"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { - Configuration.autoDeobfuscate.set(selected); - mainFrame.getPanel().autoDeobfuscateChanged(); - } else { - button.setSelected(Configuration.autoDeobfuscate.get()); - } - } - - protected void deobfuscationMode(ActionEvent evt, int mode) { - Configuration.deobfuscationMode.set(mode); - mainFrame.getPanel().autoDeobfuscateChanged(); - } - - protected void exit(ActionEvent evt) { - JFrame frame = (JFrame) mainFrame; - frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING)); - } - - public void updateComponents(SWF swf) { - this.swf = swf; - boolean swfLoaded = swf != null; - List abcList = swf != null ? swf.getAbcList() : null; - boolean hasAbc = swfLoaded && abcList != null && !abcList.isEmpty(); - boolean hasDebugger = hasAbc && DebuggerTools.hasDebugger(swf); - - setMenuEnabled("/file/save", swfLoaded); - setMenuEnabled("/file/saveAs", swfLoaded); - setMenuEnabled("/file/saveAsExe", swfLoaded); - setMenuEnabled("/file/close", swfLoaded); - setMenuEnabled("/file/closeAll", swfLoaded); - - setMenuEnabled("/file/export", swfLoaded); - setMenuEnabled("/file/export/exportAll", swfLoaded); - setMenuEnabled("/file/export/exportFla", swfLoaded); - setMenuEnabled("/file/export/exportSel", swfLoaded); - setMenuEnabled("/file/export/exportXml", swfLoaded); - - setMenuEnabled("/file/import", swfLoaded); - setMenuEnabled("/file/import/importText", swfLoaded); - setMenuEnabled("/file/import/importScript", swfLoaded); - setMenuEnabled("/file/import/importSymbolClass", swfLoaded); - setMenuEnabled("/file/import/importXml", swfLoaded); - - setMenuEnabled("/file/reload", swfLoaded); - - setMenuEnabled("/tools/deobfuscation", swfLoaded); - setMenuEnabled("/tools/deobfuscation/renameOneIdentifier", swfLoaded); - setMenuEnabled("/tools/deobfuscation/renameInvalidIdentifiers", swfLoaded); - setMenuEnabled("/tools/deobfuscation/deobfuscation", hasAbc); - - setMenuEnabled("/tools/search", swfLoaded); - setMenuEnabled("/tools/replace", swfLoaded); - setMenuEnabled("/tools/timeline", swfLoaded); - - setMenuEnabled("/tools/gotodocumentclass", hasAbc); - setMenuEnabled("/tools/debugger/debuggerSwitch", hasAbc); - setMenuChecked("/tools/debugger/debuggerSwitch", hasDebugger); - setMenuEnabled("/tools/debugger/debuggerReplaceTrace", hasAbc && hasDebugger); - - } - - private void registerHotKeys() { - - KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); - manager.addKeyEventDispatcher((KeyEvent e) -> { - if (((JFrame) mainFrame).isActive() && e.getID() == KeyEvent.KEY_PRESSED) { - int code = e.getKeyCode(); - if (e.isControlDown() && e.isShiftDown()) { - switch (code) { - case KeyEvent.VK_O: - return open(null); - case KeyEvent.VK_S: - return save(null); - case KeyEvent.VK_A: - return saveAs(null); - case KeyEvent.VK_F: - return search(null, false); - case KeyEvent.VK_T: - return search(null, true); - case KeyEvent.VK_R: - return reload(null); - case KeyEvent.VK_X: - return closeAll(null); - case KeyEvent.VK_D: - return clearLog(); - case KeyEvent.VK_E: - return export(false); - } - } else if (e.isControlDown() && !e.isShiftDown()) { - switch (code) { - case KeyEvent.VK_UP: - return previousTag(); - case KeyEvent.VK_DOWN: - return nextTag(); - } - } - } - - return false; - }); - } - - public void createMenuBar() { - initMenu(); - if (supportsAppMenu()) { - addMenuItem("_", null, null, null, 0, null, false); - addMenuItem("_/open", translate("menu.file.open"), "open32", this::open, PRIORITY_TOP, this::loadRecent, false); - addMenuItem("_/save", translate("menu.file.save"), "save32", this::save, PRIORITY_TOP, null, true); - addMenuItem("_/saveAs", translate("menu.file.saveas"), "saveas32", this::saveAs, PRIORITY_TOP, null, true); - addSeparator("_"); - addMenuItem("_/exportFla", translate("menu.file.export.fla"), "exportfla32", this::exportFla, PRIORITY_TOP, null, true); - addMenuItem("_/exportAll", translate("menu.file.export.all"), "export32", this::exportAll, PRIORITY_TOP, null, true); - addMenuItem("_/exportSel", translate("menu.file.export.selection"), "exportsel32", this::exportSelected, PRIORITY_TOP, null, true); - addSeparator("_"); - addMenuItem("_/checkUpdates", translate("menu.help.checkupdates"), "update32", this::checkUpdates, PRIORITY_TOP, null, true); - addMenuItem("_/about", translate("menu.help.about"), "about32", this::about, PRIORITY_TOP, null, true); - addMenuItem("_/close", translate("menu.file.close"), "close32", this::close, PRIORITY_TOP, null, true); - addMenuItem("_/closeAll", translate("menu.file.closeAll"), "close32", this::closeAll, PRIORITY_TOP, null, true); - addMenuItem("_/$exit", translate("menu.file.exit"), "exit32", this::exit, PRIORITY_TOP, null, true); - finishMenu("_"); - } - - addMenuItem("/file", translate("menu.file"), null, null, 0, null, false); - addMenuItem("/file/open", translate("menu.file.open"), "open32", this::open, PRIORITY_TOP, this::loadRecent, !supportsMenuAction()); - - if (!supportsMenuAction()) { - addMenuItem("/file/recent", translate("menu.recentFiles"), null, null, 0, this::loadRecent, false); - finishMenu("/file/recent"); - } else { - finishMenu("/file/open"); - } - addMenuItem("/file/save", translate("menu.file.save"), "save32", this::save, PRIORITY_TOP, null, true); - addMenuItem("/file/saveAs", translate("menu.file.saveas"), "saveas16", this::saveAs, PRIORITY_MEDIUM, null, true); - addMenuItem("/file/saveAsExe", translate("menu.file.saveasexe"), "saveasexe16", this::saveAsExe, PRIORITY_MEDIUM, null, true); - addMenuItem("/file/reload", translate("menu.file.reload"), "reload16", this::reload, PRIORITY_MEDIUM, null, true); - - addSeparator("/file"); - - addMenuItem("/file/export", translate("menu.export"), null, null, 0, null, false); - addMenuItem("/file/export/exportFla", translate("menu.file.export.fla"), "exportfla32", this::exportFla, PRIORITY_TOP, null, true); - addMenuItem("/file/export/exportXml", translate("menu.file.export.xml"), "exportxml32", this::exportSelected, PRIORITY_MEDIUM, null, true); - - addMenuItem("/file/export/exportAll", translate("menu.file.export.all"), "export16", this::exportAll, PRIORITY_MEDIUM, null, true); - addMenuItem("/file/export/exportSel", translate("menu.file.export.selection"), "exportsel16", this::exportSelected, PRIORITY_MEDIUM, null, true); - finishMenu("/file/export"); - - addMenuItem("/file/import", translate("menu.import"), null, null, 0, null, false); - addMenuItem("/file/import/importXml", translate("menu.file.import.xml"), "importxml32", this::importSwfXml, PRIORITY_TOP, null, true); - addMenuItem("/file/import/importText", translate("menu.file.import.text"), "importtext32", this::importText, PRIORITY_MEDIUM, null, true); - addMenuItem("/file/import/importScript", translate("menu.file.import.script"), "importtext32", this::importScript, PRIORITY_MEDIUM, null, true); - addMenuItem("/file/import/importSymbolClass", translate("menu.file.import.symbolClass"), "importsymbolclass32", this::importSymbolClass, PRIORITY_MEDIUM, null, true); - finishMenu("/file/import"); - - addSeparator("/file"); - - addMenuItem("/file/view", translate("menu.view"), null, null, 0, null, false); - addToggleMenuItem("/file/view/viewResources", translate("menu.file.view.resources"), "view", "viewresources16", this::viewModeResourcesButtonActionPerformed, PRIORITY_MEDIUM); - addToggleMenuItem("/file/view/viewHex", translate("menu.file.view.hex"), "view", "viewhex16", this::viewModeHexDumpButtonActionPerformed, PRIORITY_MEDIUM); - finishMenu("/file/view"); - - addSeparator("/file"); - addMenuItem("/file/close", translate("menu.file.close"), "close32", this::close, PRIORITY_MEDIUM, null, true); - addMenuItem("/file/closeAll", translate("menu.file.closeAll"), "close32", this::closeAll, PRIORITY_MEDIUM, null, true); - - if (!supportsAppMenu()) { - addMenuItem("/file/exit", translate("menu.file.exit"), "exit32", this::exit, PRIORITY_TOP, null, true); - } - finishMenu("/file"); - - if (Configuration.dumpView.get()) { - setGroupSelection("view", "/file/view/viewHex"); - } else { - setGroupSelection("view", "/file/view/viewResources"); - } - - addMenuItem("/tools", translate("menu.tools"), null, null, 0, null, false); - addMenuItem("/tools/search", translate("menu.tools.search"), "search16", (ActionEvent e) -> { - search(e, null); - }, PRIORITY_TOP, null, true); - - addMenuItem("/tools/replace", translate("menu.tools.replace"), "replace32", this::replace, PRIORITY_TOP, null, true); - addToggleMenuItem("/tools/timeline", translate("menu.tools.timeline"), null, "timeline32", this::timelineButtonActionPerformed, PRIORITY_TOP); - - addMenuItem("/tools/proxy", translate("menu.tools.proxy"), "proxy16", this::showProxy, PRIORITY_MEDIUM, null, true); - addMenuItem("/tools/searchmemory", translate("menu.tools.searchmemory"), "loadmemory16", this::loadFromMemory, PRIORITY_MEDIUM, null, true); - addMenuItem("/tools/searchcache", translate("menu.tools.searchcache"), "loadcache16", this::loadFromCache, PRIORITY_MEDIUM, null, true); - - addMenuItem("/tools/deobfuscation", translate("menu.tools.deobfuscation"), "deobfuscate16", null, 0, null, false); - addMenuItem("/tools/deobfuscation/renameOneIdentifier", translate("menu.tools.deobfuscation.globalrename"), "rename16", this::renameOneIdentifier, PRIORITY_MEDIUM, null, true); - addMenuItem("/tools/deobfuscation/renameInvalidIdentifiers", translate("menu.tools.deobfuscation.renameinvalid"), "renameall16", this::renameIdentifiers, PRIORITY_MEDIUM, null, true); - addMenuItem("/tools/deobfuscation/deobfuscation", translate("menu.tools.deobfuscation.pcode"), "deobfuscate32", this::deobfuscate, PRIORITY_TOP, null, true); - finishMenu("/tools/deobfuscation"); - - addMenuItem("/tools/debugger", translate("menu.debugger"), null, null, 0, null, false); - addToggleMenuItem("/tools/debugger/debuggerSwitch", translate("menu.debugger.switch"), null, "debugger32", this::debuggerSwitchButtonActionPerformed, PRIORITY_TOP); - addMenuItem("/tools/debugger/debuggerReplaceTrace", translate("menu.debugger.replacetrace"), "debuggerreplace16", this::debuggerReplaceTraceCalls, PRIORITY_MEDIUM, null, true); - addMenuItem("/tools/debugger/debuggerShowLog", translate("menu.debugger.showlog"), "debuggerlog16", this::debuggerShowLog, PRIORITY_MEDIUM, null, true); - finishMenu("/tools/debugger"); - - addMenuItem("/tools/gotodocumentclass", translate("menu.tools.gotodocumentclass"), "gotomainclass32", this::gotoDucumentClass, PRIORITY_TOP, null, true); - finishMenu("/tools"); - - //Settings - addMenuItem("/settings", translate("menu.settings"), null, null, 0, null, false); - - addToggleMenuItem("/settings/autodeobfuscation", translate("menu.settings.autodeobfuscation"), null, null, this::autoDeobfuscate, 0); - - addToggleMenuItem("/settings/internalViewer", translate("menu.settings.internalflashviewer"), null, null, this::internalViewerSwitch, 0); - - addToggleMenuItem("/settings/parallelspeedup", translate("menu.settings.parallelspeedup"), null, null, this::parallelSpeedUp, 0); - - addToggleMenuItem("/settings/disableDecompilation", translate("menu.settings.disabledecompilation"), null, null, this::disableDecompilation, 0); - - addToggleMenuItem("/settings/cacheOnDisk", translate("menu.settings.cacheOnDisk"), null, null, this::cacheOnDisk, 0); - - addToggleMenuItem("/settings/gotoMainClassOnStartup", translate("menu.settings.gotoMainClassOnStartup"), null, null, this::gotoDucumentClassOnStartup, 0); - - addToggleMenuItem("/settings/autoRenameIdentifiers", translate("menu.settings.autoRenameIdentifiers"), null, null, this::autoRenameIdentifiers, 0); - - if (Platform.isWindows()) { - addToggleMenuItem("/settings/associate", translate("menu.settings.addtocontextmenu"), null, null, this::associate, 0); - } - addMenuItem("/settings/language", translate("menu.language"), null, null, 0, null, false); - addMenuItem("/settings/language/setlanguage", translate("menu.settings.language"), "setlanguage32", this::setLanguage, PRIORITY_TOP, null, true); - finishMenu("/settings/language"); - - addMenuItem("/settings/deobfuscation", translate("menu.deobfuscation"), null, null, 0, null, false); - addToggleMenuItem("/settings/deobfuscation/old", translate("menu.file.deobfuscation.old"), "deobfuscation", "deobfuscateold16", (ActionEvent e) -> { - deobfuscationMode(e, 0); - }, 0); - addToggleMenuItem("/settings/deobfuscation/new", translate("menu.file.deobfuscation.new"), "deobfuscation", "deobfuscatenew16", (ActionEvent e) -> { - deobfuscationMode(e, 1); - }, 0); - - finishMenu("/settings/deobfuscation"); - - addMenuItem("/settings/advancedSettings", translate("menu.advancedsettings.advancedsettings"), null, null, 0, null, false); - addMenuItem("/settings/advancedSettings/advancedSettings", translate("menu.advancedsettings.advancedsettings"), "settings32", this::advancedSettings, PRIORITY_TOP, null, true); - addMenuItem("/settings/advancedSettings/clearRecentFiles", translate("menu.tools.otherTools.clearRecentFiles"), "clearrecent16", this::clearRecentFiles, PRIORITY_MEDIUM, null, true); - - finishMenu("/settings/advancedSettings"); - - finishMenu("/settings"); - - setMenuChecked("/settings/autodeobfuscation", Configuration.autoDeobfuscate.get()); - setMenuChecked("/settings/internalViewer", Configuration.internalFlashViewer.get() || externalFlashPlayerUnavailable); - setMenuChecked("/settings/parallelspeedup", Configuration.parallelSpeedUp.get()); - setMenuChecked("/settings/disableDecompilation", !Configuration.decompile.get()); - setMenuChecked("/settings/cacheOnDisk", !Configuration.cacheOnDisk.get()); - setMenuChecked("/settings/gotoMainClassOnStartup", Configuration.gotoMainClassOnStartup.get()); - setMenuChecked("/settings/autoRenameIdentifiers", Configuration.autoRenameIdentifiers.get()); - - if (externalFlashPlayerUnavailable) { - setMenuEnabled("/settings/internalViewer", false); - } - int deobfuscationMode = Configuration.deobfuscationMode.get(); - switch (deobfuscationMode) { - case 0: - setGroupSelection("deobfuscation", "/settings/deobfuscation/old"); - break; - case 1: - setGroupSelection("deobfuscation", "/settings/deobfuscation/new"); - break; - } - if (Platform.isWindows()) { - setMenuChecked("/settings/associate", ContextMenuTools.isAddedToContextMenu()); - - } - //Help - addMenuItem("/help", translate("menu.help"), null, null, 0, null, false); - addMenuItem("/help/about", translate("menu.help.about"), "about32", this::about, PRIORITY_TOP, null, true); - addMenuItem("/help/helpUs", translate("menu.help.helpus"), "donate32", this::helpUs, PRIORITY_TOP, null, true); - addMenuItem("/help/checkUpdates", translate("menu.help.checkupdates"), "update16", this::checkUpdates, PRIORITY_MEDIUM, null, true); - addMenuItem("/help/homepage", translate("menu.help.homepage"), "homepage16", this::homePage, PRIORITY_MEDIUM, null, true); - finishMenu("/help"); - - if (Configuration.showDebugMenu.get() || Configuration.debugMode.get()) { - - addMenuItem("/debug", "Debug", null, null, 0, null, false); - addMenuItem("/debug/removeNonScripts", "Remove non scripts", "update16", e -> removeNonScripts(), PRIORITY_MEDIUM, null, true); - addMenuItem("/debug/refreshDecompiled", "Refresh decompiled script", "update16", e -> refreshDecompiled(), PRIORITY_MEDIUM, null, true); - addMenuItem("/debug/checkResources", "Check resources", "update16", e -> checkResources(), PRIORITY_MEDIUM, null, true); - addMenuItem("/debug/callGc", "Call System.gc()", "update16", e -> System.gc(), PRIORITY_MEDIUM, null, true); - addMenuItem("/debug/emptyCache", "Empty cache", "update16", e -> { - SWF nswf = mainFrame.getPanel().getCurrentSwf(); - if (nswf != null) { - nswf.clearAllCache(); - } - }, PRIORITY_MEDIUM, null, true); - addMenuItem("/debug/memoryInformation", "Memory information", "update16", e -> { - String architecture = System.getProperty("sun.arch.data.model"); - Runtime runtime = Runtime.getRuntime(); - String info = "Architecture: " + architecture + Helper.newLine - + "Max: " + (runtime.maxMemory() / 1024 / 1024) + "MB" + Helper.newLine - + "Used: " + (runtime.totalMemory() / 1024 / 1024) + "MB" + Helper.newLine - + "Free: " + (runtime.freeMemory() / 1024 / 1024) + "MB"; - View.showMessageDialog(null, info); - SWF nswf = mainFrame.getPanel().getCurrentSwf(); - if (nswf != null) { - nswf.clearAllCache(); - } - }, PRIORITY_MEDIUM, null, true); - addMenuItem("/debug/fixAs3Code", "Fix AS3 code", "update16", e -> { - SWF nswf = mainFrame.getPanel().getCurrentSwf(); - if (nswf != null) { - nswf.fixAS3Code(); - } - }, PRIORITY_MEDIUM, null, true); - finishMenu("/debug"); - } - - finishMenu(""); - } - - private void viewModeResourcesButtonActionPerformed(ActionEvent evt) { - Configuration.dumpView.set(false); - mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES); - setGroupSelection("view", "/file/view/viewResources"); - setMenuChecked("/tools/timeline", false); - - } - - private void viewModeHexDumpButtonActionPerformed(ActionEvent evt) { - Configuration.dumpView.set(true); - mainFrame.getPanel().showView(MainPanel.VIEW_DUMP); - setGroupSelection("view", "/file/view/viewHex"); - setMenuChecked("/tools/timeline", false); - } - - private void debuggerSwitchButtonActionPerformed(ActionEvent evt) { - boolean debuggerOn = isMenuChecked("/tools/debugger/debuggerSwitch"); - if (!debuggerOn || View.showConfirmDialog((Component) mainFrame, translate("message.debugger"), translate("dialog.message.title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, Configuration.displayDebuggerInfo, JOptionPane.OK_OPTION) == JOptionPane.OK_OPTION) { - switchDebugger(); - mainFrame.getPanel().refreshDecompiled(); - } else { - if (debuggerOn) { - setMenuChecked("/tools/debugger/debuggerSwitch", false); - } - } - setMenuEnabled("/tools/debugger/debuggerReplaceTrace", isMenuChecked("/tools/debugger/debuggerSwitch")); - } - - private void timelineButtonActionPerformed(ActionEvent evt) { - if (isMenuChecked("/tools/timeline")) { - if (!mainFrame.getPanel().showView(MainPanel.VIEW_TIMELINE)) { - setMenuChecked("/tools/timeline", false); - } else { - setGroupSelection("view", null); - } - } else { - if (Configuration.dumpView.get()) { - setGroupSelection("view", "/file/view/viewHex"); - mainFrame.getPanel().showView(MainPanel.VIEW_DUMP); - } else { - setGroupSelection("view", "/file/view/viewResources"); - mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES); - } - } - } - - protected void loadRecent(ActionEvent evt) { - List recentFiles = Configuration.getRecentFiles(); - clearMenu("/file/" + (supportsMenuAction() ? "open" : "recent")); - clearMenu("_/open"); - - for (int i = recentFiles.size() - 1; i >= 0; i--) { - final String f = recentFiles.get(i); - ActionListener a = (ActionEvent e) -> { - if (Main.openFile(f, null) == OpenFileResult.NOT_FOUND) { - if (View.showConfirmDialog(null, translate("message.confirm.recentFileNotFound"), translate("message.confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_NO_OPTION) { - Configuration.removeRecentFile(f); - } - } - }; - addMenuItem("/file/" + (supportsMenuAction() ? "open" : "recent") + "/" + i, f, null, a, 0, null, true); - addMenuItem("_/open/" + i, f, null, a, 0, null, true); - } - - finishMenu("/file/" + (supportsMenuAction() ? "open" : "recent")); - finishMenu("_/open"); - - } - -} +/* + * Copyright (C) 2010-2015 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.gui; + +import com.jpexs.decompiler.flash.ApplicationInfo; +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SWFBundle; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.console.ContextMenuTools; +import com.jpexs.decompiler.flash.gui.debugger.DebuggerTools; +import com.jpexs.decompiler.flash.gui.helpers.CheckResources; +import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import com.jpexs.helpers.ByteArrayRange; +import com.jpexs.helpers.Cache; +import com.jpexs.helpers.Helper; +import com.jpexs.helpers.utf8.Utf8Helper; +import com.sun.jna.Platform; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.KeyboardFocusManager; +import java.awt.ScrollPane; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.WindowEvent; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.AbstractButton; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JFrame; +import javax.swing.JOptionPane; + +/** + * + * @author JPEXS + */ +public abstract class MainFrameMenu implements MenuBuilder { + + private final MainFrame mainFrame; + + private SWF swf; + + public boolean isInternalFlashViewerSelected() { + return isMenuChecked("/settings/internalViewer"); //miInternalViewer.isSelected(); + } + + private final boolean externalFlashPlayerUnavailable; + + public MainFrameMenu(MainFrame mainFrame, boolean externalFlashPlayerUnavailable) { + registerHotKeys(); + this.mainFrame = mainFrame; + this.externalFlashPlayerUnavailable = externalFlashPlayerUnavailable; + } + + protected String translate(String key) { + return mainFrame.translate(key); + } + + protected boolean openActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return false; + } + + Main.openFileDialog(); + return true; + } + + protected boolean saveActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return false; + } + + if (swf != null) { + boolean saved = false; + if (swf.swfList != null && swf.swfList.isBundle()) { + SWFBundle bundle = swf.swfList.bundle; + if (!bundle.isReadOnly()) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + swf.saveTo(baos); + saved = bundle.putSWF(swf.getFileTitle(), new ByteArrayInputStream(baos.toByteArray())); + } catch (IOException ex) { + Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex); + } + } + } else if (swf.binaryData != null) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + swf.saveTo(baos); + swf.binaryData.binaryData = new ByteArrayRange(baos.toByteArray()); + swf.binaryData.setModified(true); + saved = true; + } catch (IOException ex) { + Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex); + } + } else if (swf.getFile() == null) { + saved = saveAs(swf, SaveFileMode.SAVEAS); + } else { + try { + Main.saveFile(swf, swf.getFile()); + saved = true; + } catch (IOException ex) { + Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, null, ex); + View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE); + } + } + if (saved) { + swf.clearModified(); + mainFrame.getPanel().refreshTree(swf); + } + + return true; + } + + return false; + } + + protected boolean saveAsActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return false; + } + + if (swf != null) { + if (saveAs(swf, SaveFileMode.SAVEAS)) { + swf.clearModified(); + } + + return true; + } + + return false; + } + + private boolean saveAs(SWF swf, SaveFileMode mode) { + if (Main.saveFileDialog(swf, mode)) { + mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : "")); + updateComponents(swf); + return true; + } + return false; + } + + protected void saveAsExeActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + if (swf != null) { + saveAs(swf, SaveFileMode.EXE); + } + } + + protected void closeActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + if (swf == null) { + return; + } + + Main.closeFile(swf.swfList); + } + + protected boolean closeAllActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return false; + } + + if (swf != null) { + Main.closeAll(); + return true; + } + + return false; + } + + protected void importTextActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().importText(swf); + } + + protected void importScriptActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().importScript(swf); + } + + protected void importSymbolClassActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().importSymbolClass(swf); + } + + protected void exportAllActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + export(false); + } + + protected void exportSelectedActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + export(true); + } + + protected boolean export(boolean onlySelected) { + if (swf != null) { + mainFrame.getPanel().export(onlySelected); + return true; + } + + return false; + } + + protected void exportFlaActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().exportFla(swf); + } + + protected void importXmlActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().importSwfXml(); + } + + protected void exportXmlActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().exportSwfXml(); + } + + protected boolean searchActionPerformed(ActionEvent evt) { + return search(evt, null); + } + + protected boolean search(ActionEvent evt, Boolean searchInText) { + if (swf != null) { + mainFrame.getPanel().searchInActionScriptOrText(searchInText); + return true; + } + + return false; + } + + protected boolean replaceActionPerformed(ActionEvent evt) { + if (swf != null) { + mainFrame.getPanel().replaceText(); + return true; + } + + return false; + } + + protected void restoreControlFlow(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + restoreControlFlow(false); + } + + protected void restoreControlFlowAll(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + restoreControlFlow(true); + } + + protected void restoreControlFlow(boolean all) { + mainFrame.getPanel().restoreControlFlow(all); + } + + protected void showProxyActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + Main.showProxy(); + } + + protected boolean clearLog() { + ErrorLogFrame.getInstance().clearLog(); + return true; + } + + protected void renameOneIdentifier(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().renameOneIdentifier(swf); + } + + protected void renameInvalidIdentifiers(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().renameIdentifiers(swf); + } + + protected void deobfuscationActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + mainFrame.getPanel().deobfuscate(); + } + + protected void setSubLimiter(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + Main.setSubLimiter(selected); + } + + protected void switchDebugger() { + DebuggerTools.switchDebugger(swf); + } + + protected void debuggerShowLogActionPerformed(ActionEvent evt) { + DebuggerTools.debuggerShowLog(); + } + + protected void debuggerReplaceTraceCallsActionPerformed(ActionEvent evt) { + ReplaceTraceDialog rtd = new ReplaceTraceDialog(Configuration.lastDebuggerReplaceFunction.get()); + rtd.setVisible(true); + if (rtd.getValue() != null) { + String fname = rtd.getValue(); + DebuggerTools.replaceTraceCalls(swf, fname); + mainFrame.getPanel().refreshDecompiled(); + Configuration.lastDebuggerReplaceFunction.set(rtd.getValue()); + } + } + + protected void clearRecentFilesActionPerformed(ActionEvent evt) { + Configuration.recentFiles.set(null); + } + + protected void removeNonScripts() { + mainFrame.getPanel().removeNonScripts(swf); + } + + protected void refreshDecompiled() { + mainFrame.getPanel().refreshDecompiled(); + } + + protected boolean previousTag() { + return mainFrame.getPanel().previousTag(); + } + + protected boolean nextTag() { + return mainFrame.getPanel().nextTag(); + } + + protected void checkResources() { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + PrintStream stream = new PrintStream(os); + CheckResources.checkResources(stream); + final String str = new String(os.toByteArray(), Utf8Helper.charset); + JDialog dialog = new JDialog() { + + @Override + public void setVisible(boolean bln) { + setSize(new Dimension(800, 600)); + Container cnt = getContentPane(); + cnt.setLayout(new BorderLayout()); + ScrollPane scrollPane = new ScrollPane(); + JEditorPane editor = new JEditorPane(); + editor.setEditable(false); + editor.setText(str); + scrollPane.add(editor); + this.add(scrollPane, BorderLayout.CENTER); + this.setModal(true); + View.centerScreen(this); + super.setVisible(bln); + } + }; + dialog.setVisible(true); + } + + protected void checkUpdatesActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + if (!Main.checkForUpdates()) { + View.showMessageDialog(null, translate("update.check.nonewversion"), translate("update.check.title"), JOptionPane.INFORMATION_MESSAGE); + } + } + + protected void helpUsActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + String helpUsURL = ApplicationInfo.PROJECT_PAGE + "/help_us.html?utm_source=app&utm_medium=menu&utm_campaign=app"; + if (!View.navigateUrl(helpUsURL)) { + View.showMessageDialog(null, translate("message.helpus").replace("%url%", helpUsURL)); + } + } + + protected void homePageActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + String homePageURL = ApplicationInfo.PROJECT_PAGE + "?utm_source=app&utm_medium=menu&utm_campaign=app"; + if (!View.navigateUrl(homePageURL)) { + View.showMessageDialog(null, translate("message.homepage").replace("%url%", homePageURL)); + } + } + + protected void aboutActionPerformed(ActionEvent evt) { + if (Main.isWorking()) { + return; + } + + Main.about(); + } + + protected boolean reloadActionPerformed(ActionEvent evt) { + if (swf != null) { + if (View.showConfirmDialog(null, translate("message.confirm.reload"), translate("message.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) { + Main.reloadApp(); + } + + return true; + } + + return false; + } + + protected void advancedSettingsActionPerformed(ActionEvent evt) { + Main.advancedSettings(); + } + + protected void searchMemoryActionPerformed(ActionEvent evt) { + Main.loadFromMemory(); + } + + protected void searchCacheActionPerformed(ActionEvent evt) { + Main.loadFromCache(); + } + + protected void gotoDucumentClassOnStartupActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + Configuration.gotoMainClassOnStartup.set(selected); + } + + protected void autoRenameIdentifiersActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + Configuration.autoRenameIdentifiers.set(selected); + } + + protected void cacheOnDiskActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + Configuration.cacheOnDisk.set(selected); + if (selected) { + Cache.setStorageType(Cache.STORAGE_FILES); + } else { + Cache.setStorageType(Cache.STORAGE_MEMORY); + } + } + + protected void setLanguageActionPerformed(ActionEvent evt) { + new SelectLanguageDialog().display(); + } + + protected void disableDecompilationActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + Configuration.decompile.set(!selected); + mainFrame.getPanel().disableDecompilationChanged(); + } + + protected void associateActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + if (selected == ContextMenuTools.isAddedToContextMenu()) { + return; + } + ContextMenuTools.addToContextMenu(selected, false); + + // Update checkbox menuitem accordingly (User can cancel rights elevation) + new Timer().schedule(new TimerTask() { + @Override + public void run() { + button.setSelected(ContextMenuTools.isAddedToContextMenu()); + } + }, 1000); // It takes some time registry change to apply + } + + protected void gotoDucumentClassActionPerformed(ActionEvent evt) { + mainFrame.getPanel().gotoDocumentClass(mainFrame.getPanel().getCurrentSwf()); + } + + protected void parallelSpeedUpActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + String confStr = translate("message.confirm.parallel") + "\r\n"; + if (selected) { + confStr += " " + translate("message.confirm.on"); + } else { + confStr += " " + translate("message.confirm.off"); + } + if (View.showConfirmDialog(null, confStr, translate("message.parallel"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { + Configuration.parallelSpeedUp.set(selected); + } else { + button.setSelected(Configuration.parallelSpeedUp.get()); + } + } + + protected void internalViewerSwitchActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + Configuration.internalFlashViewer.set(selected); + mainFrame.getPanel().reload(true); + } + + protected void autoDeobfuscationActionPerformed(ActionEvent evt) { + AbstractButton button = (AbstractButton) evt.getSource(); + boolean selected = button.isSelected(); + + if (View.showConfirmDialog(mainFrame.getPanel(), translate("message.confirm.autodeobfuscate") + "\r\n" + (selected ? translate("message.confirm.on") : translate("message.confirm.off")), translate("message.confirm"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { + Configuration.autoDeobfuscate.set(selected); + mainFrame.getPanel().autoDeobfuscateChanged(); + } else { + button.setSelected(Configuration.autoDeobfuscate.get()); + } + } + + protected void deobfuscationMode(ActionEvent evt, int mode) { + Configuration.deobfuscationMode.set(mode); + mainFrame.getPanel().autoDeobfuscateChanged(); + } + + protected void exitActionPerformed(ActionEvent evt) { + JFrame frame = (JFrame) mainFrame; + frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING)); + } + + public void updateComponents() { + updateComponents(swf); + } + + public void updateComponents(SWF swf) { + this.swf = swf; + boolean swfLoaded = swf != null; + boolean isWorking = Main.isWorking(); + List abcList = swf != null ? swf.getAbcList() : null; + boolean hasAbc = swfLoaded && abcList != null && !abcList.isEmpty(); + boolean hasDebugger = hasAbc && DebuggerTools.hasDebugger(swf); + + setMenuEnabled("/file/open", !isWorking); + setMenuEnabled("/file/save", swfLoaded && !isWorking); + setMenuEnabled("/file/saveAs", swfLoaded && !isWorking); + setMenuEnabled("/file/saveAsExe", swfLoaded && !isWorking); + setMenuEnabled("/file/close", swfLoaded && !isWorking); + setMenuEnabled("/file/closeAll", swfLoaded && !isWorking); + + setMenuEnabled("/file/export", swfLoaded); + setMenuEnabled("/file/export/exportAll", swfLoaded && !isWorking); + setMenuEnabled("/file/export/exportFla", swfLoaded && !isWorking); + setMenuEnabled("/file/export/exportSelected", swfLoaded && !isWorking); + setMenuEnabled("/file/export/exportXml", swfLoaded && !isWorking); + + setMenuEnabled("/file/import", swfLoaded); + setMenuEnabled("/file/import/importText", swfLoaded && !isWorking); + setMenuEnabled("/file/import/importScript", swfLoaded && !isWorking); + setMenuEnabled("/file/import/importSymbolClass", swfLoaded && !isWorking); + setMenuEnabled("/file/import/importXml", swfLoaded && !isWorking); + + setMenuEnabled("/file/reload", swfLoaded); + + setMenuEnabled("/tools/deobfuscation", swfLoaded); + setMenuEnabled("/tools/deobfuscation/renameOneIdentifier", swfLoaded && !isWorking); + setMenuEnabled("/tools/deobfuscation/renameInvalidIdentifiers", swfLoaded && !isWorking); + setMenuEnabled("/tools/deobfuscation/deobfuscation", hasAbc); + + setMenuEnabled("/tools/search", swfLoaded); + setMenuEnabled("/tools/replace", swfLoaded); + setMenuEnabled("/tools/timeline", swfLoaded); + setMenuEnabled("/tools/showProxy", !isWorking); + + setMenuEnabled("/tools/gotoDocumentClass", hasAbc); + setMenuEnabled("/tools/debugger/debuggerSwitch", hasAbc); + setMenuChecked("/tools/debugger/debuggerSwitch", hasDebugger); + setMenuEnabled("/tools/debugger/debuggerReplaceTrace", hasAbc && hasDebugger); + + setMenuEnabled("/help/checkUpdates", !isWorking); + setMenuEnabled("/help/helpUs", !isWorking); + setMenuEnabled("/help/homePage", !isWorking); + setMenuEnabled("/help/about", !isWorking); + } + + private void registerHotKeys() { + + KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); + manager.addKeyEventDispatcher((KeyEvent e) -> { + if (((JFrame) mainFrame).isActive() && e.getID() == KeyEvent.KEY_PRESSED) { + int code = e.getKeyCode(); + if (e.isControlDown() && e.isShiftDown()) { + switch (code) { + case KeyEvent.VK_O: + return openActionPerformed(null); + case KeyEvent.VK_S: + return saveActionPerformed(null); + case KeyEvent.VK_A: + return saveAsActionPerformed(null); + case KeyEvent.VK_F: + return search(null, false); + case KeyEvent.VK_T: + return search(null, true); + case KeyEvent.VK_R: + return reloadActionPerformed(null); + case KeyEvent.VK_X: + return closeAllActionPerformed(null); + case KeyEvent.VK_D: + return clearLog(); + case KeyEvent.VK_E: + return export(false); + } + } else if (e.isControlDown() && !e.isShiftDown()) { + switch (code) { + case KeyEvent.VK_UP: + return previousTag(); + case KeyEvent.VK_DOWN: + return nextTag(); + } + } + } + + return false; + }); + } + + public void createMenuBar() { + initMenu(); + if (supportsAppMenu()) { + addMenuItem("_", null, null, null, 0, null, false); + addMenuItem("_/open", translate("menu.file.open"), "open32", this::openActionPerformed, PRIORITY_TOP, this::loadRecent, false); + addMenuItem("_/save", translate("menu.file.save"), "save32", this::saveActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("_/saveAs", translate("menu.file.saveas"), "saveas32", this::saveAsActionPerformed, PRIORITY_TOP, null, true); + addSeparator("_"); + addMenuItem("_/exportFla", translate("menu.file.export.fla"), "exportfla32", this::exportFlaActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("_/exportAll", translate("menu.file.export.all"), "export32", this::exportAllActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("_/exportSelected", translate("menu.file.export.selection"), "exportsel32", this::exportSelectedActionPerformed, PRIORITY_TOP, null, true); + addSeparator("_"); + addMenuItem("_/checkUpdates", translate("menu.help.checkupdates"), "update32", this::checkUpdatesActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("_/about", translate("menu.help.about"), "about32", this::aboutActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("_/close", translate("menu.file.close"), "close32", this::closeActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("_/closeAll", translate("menu.file.closeAll"), "close32", this::closeAllActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("_/$exit", translate("menu.file.exit"), "exit32", this::exitActionPerformed, PRIORITY_TOP, null, true); + finishMenu("_"); + } + + addMenuItem("/file", translate("menu.file"), null, null, 0, null, false); + addMenuItem("/file/open", translate("menu.file.open"), "open32", this::openActionPerformed, PRIORITY_TOP, this::loadRecent, !supportsMenuAction()); + + if (!supportsMenuAction()) { + addMenuItem("/file/recent", translate("menu.recentFiles"), null, null, 0, this::loadRecent, false); + finishMenu("/file/recent"); + } else { + finishMenu("/file/open"); + } + addMenuItem("/file/save", translate("menu.file.save"), "save32", this::saveActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("/file/saveAs", translate("menu.file.saveas"), "saveas16", this::saveAsActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/file/saveAsExe", translate("menu.file.saveasexe"), "saveasexe16", this::saveAsExeActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/file/reload", translate("menu.file.reload"), "reload16", this::reloadActionPerformed, PRIORITY_MEDIUM, null, true); + + addSeparator("/file"); + + addMenuItem("/file/export", translate("menu.export"), null, null, 0, null, false); + addMenuItem("/file/export/exportFla", translate("menu.file.export.fla"), "exportfla32", this::exportFlaActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("/file/export/exportXml", translate("menu.file.export.xml"), "exportxml32", this::exportXmlActionPerformed, PRIORITY_MEDIUM, null, true); + + addMenuItem("/file/export/exportAll", translate("menu.file.export.all"), "export16", this::exportAllActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/file/export/exportSelected", translate("menu.file.export.selection"), "exportsel16", this::exportSelectedActionPerformed, PRIORITY_MEDIUM, null, true); + finishMenu("/file/export"); + + addMenuItem("/file/import", translate("menu.import"), null, null, 0, null, false); + addMenuItem("/file/import/importXml", translate("menu.file.import.xml"), "importxml32", this::importXmlActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("/file/import/importText", translate("menu.file.import.text"), "importtext32", this::importTextActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/file/import/importScript", translate("menu.file.import.script"), "importtext32", this::importScriptActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/file/import/importSymbolClass", translate("menu.file.import.symbolClass"), "importsymbolclass32", this::importSymbolClassActionPerformed, PRIORITY_MEDIUM, null, true); + finishMenu("/file/import"); + + addSeparator("/file"); + + addMenuItem("/file/view", translate("menu.view"), null, null, 0, null, false); + addToggleMenuItem("/file/view/viewResources", translate("menu.file.view.resources"), "view", "viewresources16", this::viewResourcesActionPerformed, PRIORITY_MEDIUM); + addToggleMenuItem("/file/view/viewHex", translate("menu.file.view.hex"), "view", "viewhex16", this::viewHexActionPerformed, PRIORITY_MEDIUM); + finishMenu("/file/view"); + + addSeparator("/file"); + addMenuItem("/file/close", translate("menu.file.close"), "close32", this::closeActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/file/closeAll", translate("menu.file.closeAll"), "close32", this::closeAllActionPerformed, PRIORITY_MEDIUM, null, true); + + if (!supportsAppMenu()) { + addMenuItem("/file/exit", translate("menu.file.exit"), "exit32", this::exitActionPerformed, PRIORITY_TOP, null, true); + } + finishMenu("/file"); + + if (Configuration.dumpView.get()) { + setGroupSelection("view", "/file/view/viewHex"); + } else { + setGroupSelection("view", "/file/view/viewResources"); + } + + addMenuItem("/tools", translate("menu.tools"), null, null, 0, null, false); + addMenuItem("/tools/search", translate("menu.tools.search"), "search16", this::searchActionPerformed, PRIORITY_TOP, null, true); + + addMenuItem("/tools/replace", translate("menu.tools.replace"), "replace32", this::replaceActionPerformed, PRIORITY_TOP, null, true); + addToggleMenuItem("/tools/timeline", translate("menu.tools.timeline"), null, "timeline32", this::timelineActionPerformed, PRIORITY_TOP); + + addMenuItem("/tools/showProxy", translate("menu.tools.proxy"), "proxy16", this::showProxyActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/tools/searchMemory", translate("menu.tools.searchMemory"), "loadmemory16", this::searchMemoryActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/tools/searchCache", translate("menu.tools.searchCache"), "loadcache16", this::searchCacheActionPerformed, PRIORITY_MEDIUM, null, true); + + addMenuItem("/tools/deobfuscation", translate("menu.tools.deobfuscation"), "deobfuscate16", null, 0, null, false); + addMenuItem("/tools/deobfuscation/renameOneIdentifier", translate("menu.tools.deobfuscation.globalrename"), "rename16", this::renameOneIdentifier, PRIORITY_MEDIUM, null, true); + addMenuItem("/tools/deobfuscation/renameInvalidIdentifiers", translate("menu.tools.deobfuscation.renameinvalid"), "renameall16", this::renameInvalidIdentifiers, PRIORITY_MEDIUM, null, true); + addMenuItem("/tools/deobfuscation/deobfuscation", translate("menu.tools.deobfuscation.pcode"), "deobfuscate32", this::deobfuscationActionPerformed, PRIORITY_TOP, null, true); + finishMenu("/tools/deobfuscation"); + + addMenuItem("/tools/debugger", translate("menu.debugger"), null, null, 0, null, false); + addToggleMenuItem("/tools/debugger/debuggerSwitch", translate("menu.debugger.switch"), null, "debugger32", this::debuggerSwitchActionPerformed, PRIORITY_TOP); + addMenuItem("/tools/debugger/debuggerReplaceTrace", translate("menu.debugger.replacetrace"), "debuggerreplace16", this::debuggerReplaceTraceCallsActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/tools/debugger/debuggerShowLog", translate("menu.debugger.showlog"), "debuggerlog16", this::debuggerShowLogActionPerformed, PRIORITY_MEDIUM, null, true); + finishMenu("/tools/debugger"); + + addMenuItem("/tools/gotoDocumentClass", translate("menu.tools.gotoDocumentClass"), "gotomainclass32", this::gotoDucumentClassActionPerformed, PRIORITY_TOP, null, true); + finishMenu("/tools"); + + //Settings + addMenuItem("/settings", translate("menu.settings"), null, null, 0, null, false); + + addToggleMenuItem("/settings/autoDeobfuscation", translate("menu.settings.autodeobfuscation"), null, null, this::autoDeobfuscationActionPerformed, 0); + + addToggleMenuItem("/settings/internalViewer", translate("menu.settings.internalflashviewer"), null, null, this::internalViewerSwitchActionPerformed, 0); + + addToggleMenuItem("/settings/parallelSpeedUp", translate("menu.settings.parallelspeedup"), null, null, this::parallelSpeedUpActionPerformed, 0); + + addToggleMenuItem("/settings/disableDecompilation", translate("menu.settings.disabledecompilation"), null, null, this::disableDecompilationActionPerformed, 0); + + addToggleMenuItem("/settings/cacheOnDisk", translate("menu.settings.cacheOnDisk"), null, null, this::cacheOnDiskActionPerformed, 0); + + addToggleMenuItem("/settings/gotoMainClassOnStartup", translate("menu.settings.gotoMainClassOnStartup"), null, null, this::gotoDucumentClassOnStartupActionPerformed, 0); + + addToggleMenuItem("/settings/autoRenameIdentifiers", translate("menu.settings.autoRenameIdentifiers"), null, null, this::autoRenameIdentifiersActionPerformed, 0); + + if (Platform.isWindows()) { + addToggleMenuItem("/settings/associate", translate("menu.settings.addtocontextmenu"), null, null, this::associateActionPerformed, 0); + } + addMenuItem("/settings/language", translate("menu.language"), null, null, 0, null, false); + addMenuItem("/settings/language/setLanguage", translate("menu.settings.language"), "setlanguage32", this::setLanguageActionPerformed, PRIORITY_TOP, null, true); + finishMenu("/settings/language"); + + addMenuItem("/settings/deobfuscation", translate("menu.deobfuscation"), null, null, 0, null, false); + addToggleMenuItem("/settings/deobfuscation/old", translate("menu.file.deobfuscation.old"), "deobfuscation", "deobfuscateold16", (ActionEvent e) -> { + deobfuscationMode(e, 0); + }, 0); + addToggleMenuItem("/settings/deobfuscation/new", translate("menu.file.deobfuscation.new"), "deobfuscation", "deobfuscatenew16", (ActionEvent e) -> { + deobfuscationMode(e, 1); + }, 0); + + finishMenu("/settings/deobfuscation"); + + addMenuItem("/settings/advancedSettings", translate("menu.advancedsettings.advancedsettings"), null, null, 0, null, false); + addMenuItem("/settings/advancedSettings/advancedSettings", translate("menu.advancedsettings.advancedsettings"), "settings32", this::advancedSettingsActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("/settings/advancedSettings/clearRecentFiles", translate("menu.tools.otherTools.clearRecentFiles"), "clearrecent16", this::clearRecentFilesActionPerformed, PRIORITY_MEDIUM, null, true); + + finishMenu("/settings/advancedSettings"); + + finishMenu("/settings"); + + setMenuChecked("/settings/autoDeobfuscation", Configuration.autoDeobfuscate.get()); + setMenuChecked("/settings/internalViewer", Configuration.internalFlashViewer.get() || externalFlashPlayerUnavailable); + setMenuChecked("/settings/parallelSpeedUp", Configuration.parallelSpeedUp.get()); + setMenuChecked("/settings/disableDecompilation", !Configuration.decompile.get()); + setMenuChecked("/settings/cacheOnDisk", !Configuration.cacheOnDisk.get()); + setMenuChecked("/settings/gotoMainClassOnStartup", Configuration.gotoMainClassOnStartup.get()); + setMenuChecked("/settings/autoRenameIdentifiers", Configuration.autoRenameIdentifiers.get()); + + if (externalFlashPlayerUnavailable) { + setMenuEnabled("/settings/internalViewer", false); + } + int deobfuscationMode = Configuration.deobfuscationMode.get(); + switch (deobfuscationMode) { + case 0: + setGroupSelection("deobfuscation", "/settings/deobfuscation/old"); + break; + case 1: + setGroupSelection("deobfuscation", "/settings/deobfuscation/new"); + break; + } + if (Platform.isWindows()) { + setMenuChecked("/settings/associate", ContextMenuTools.isAddedToContextMenu()); + + } + //Help + addMenuItem("/help", translate("menu.help"), null, null, 0, null, false); + addMenuItem("/help/about", translate("menu.help.about"), "about32", this::aboutActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("/help/helpUs", translate("menu.help.helpus"), "donate32", this::helpUsActionPerformed, PRIORITY_TOP, null, true); + addMenuItem("/help/checkUpdates", translate("menu.help.checkupdates"), "update16", this::checkUpdatesActionPerformed, PRIORITY_MEDIUM, null, true); + addMenuItem("/help/homePage", translate("menu.help.homepage"), "homepage16", this::homePageActionPerformed, PRIORITY_MEDIUM, null, true); + finishMenu("/help"); + + if (Configuration.showDebugMenu.get() || Configuration.debugMode.get()) { + + addMenuItem("/debug", "Debug", null, null, 0, null, false); + addMenuItem("/debug/removeNonScripts", "Remove non scripts", "update16", e -> removeNonScripts(), PRIORITY_MEDIUM, null, true); + addMenuItem("/debug/refreshDecompiled", "Refresh decompiled script", "update16", e -> refreshDecompiled(), PRIORITY_MEDIUM, null, true); + addMenuItem("/debug/checkResources", "Check resources", "update16", e -> checkResources(), PRIORITY_MEDIUM, null, true); + addMenuItem("/debug/callGc", "Call System.gc()", "update16", e -> System.gc(), PRIORITY_MEDIUM, null, true); + addMenuItem("/debug/emptyCache", "Empty cache", "update16", e -> { + SWF nswf = mainFrame.getPanel().getCurrentSwf(); + if (nswf != null) { + nswf.clearAllCache(); + } + }, PRIORITY_MEDIUM, null, true); + addMenuItem("/debug/memoryInformation", "Memory information", "update16", e -> { + String architecture = System.getProperty("sun.arch.data.model"); + Runtime runtime = Runtime.getRuntime(); + String info = "Architecture: " + architecture + Helper.newLine + + "Max: " + (runtime.maxMemory() / 1024 / 1024) + "MB" + Helper.newLine + + "Used: " + (runtime.totalMemory() / 1024 / 1024) + "MB" + Helper.newLine + + "Free: " + (runtime.freeMemory() / 1024 / 1024) + "MB"; + View.showMessageDialog(null, info); + SWF nswf = mainFrame.getPanel().getCurrentSwf(); + if (nswf != null) { + nswf.clearAllCache(); + } + }, PRIORITY_MEDIUM, null, true); + addMenuItem("/debug/fixAs3Code", "Fix AS3 code", "update16", e -> { + SWF nswf = mainFrame.getPanel().getCurrentSwf(); + if (nswf != null) { + nswf.fixAS3Code(); + } + }, PRIORITY_MEDIUM, null, true); + finishMenu("/debug"); + } + + finishMenu(""); + } + + private void viewResourcesActionPerformed(ActionEvent evt) { + Configuration.dumpView.set(false); + mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES); + setGroupSelection("view", "/file/view/viewResources"); + setMenuChecked("/tools/timeline", false); + + } + + private void viewHexActionPerformed(ActionEvent evt) { + Configuration.dumpView.set(true); + mainFrame.getPanel().showView(MainPanel.VIEW_DUMP); + setGroupSelection("view", "/file/view/viewHex"); + setMenuChecked("/tools/timeline", false); + } + + private void debuggerSwitchActionPerformed(ActionEvent evt) { + boolean debuggerOn = isMenuChecked("/tools/debugger/debuggerSwitch"); + if (!debuggerOn || View.showConfirmDialog((Component) mainFrame, translate("message.debugger"), translate("dialog.message.title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, Configuration.displayDebuggerInfo, JOptionPane.OK_OPTION) == JOptionPane.OK_OPTION) { + switchDebugger(); + mainFrame.getPanel().refreshDecompiled(); + } else { + if (debuggerOn) { + setMenuChecked("/tools/debugger/debuggerSwitch", false); + } + } + setMenuEnabled("/tools/debugger/debuggerReplaceTrace", isMenuChecked("/tools/debugger/debuggerSwitch")); + } + + private void timelineActionPerformed(ActionEvent evt) { + if (isMenuChecked("/tools/timeline")) { + if (!mainFrame.getPanel().showView(MainPanel.VIEW_TIMELINE)) { + setMenuChecked("/tools/timeline", false); + } else { + setGroupSelection("view", null); + } + } else { + if (Configuration.dumpView.get()) { + setGroupSelection("view", "/file/view/viewHex"); + mainFrame.getPanel().showView(MainPanel.VIEW_DUMP); + } else { + setGroupSelection("view", "/file/view/viewResources"); + mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES); + } + } + } + + protected void loadRecent(ActionEvent evt) { + List recentFiles = Configuration.getRecentFiles(); + clearMenu("/file/" + (supportsMenuAction() ? "open" : "recent")); + clearMenu("_/open"); + + for (int i = recentFiles.size() - 1; i >= 0; i--) { + final String f = recentFiles.get(i); + ActionListener a = (ActionEvent e) -> { + if (Main.openFile(f, null) == OpenFileResult.NOT_FOUND) { + if (View.showConfirmDialog(null, translate("message.confirm.recentFileNotFound"), translate("message.confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_NO_OPTION) { + Configuration.removeRecentFile(f); + } + } + }; + addMenuItem("/file/" + (supportsMenuAction() ? "open" : "recent") + "/" + i, f, null, a, 0, null, true); + addMenuItem("_/open/" + i, f, null, a, 0, null, true); + } + + finishMenu("/file/" + (supportsMenuAction() ? "open" : "recent")); + finishMenu("_/open"); + + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java index f84dccb68..ab858a755 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java @@ -1,547 +1,552 @@ -/* - * Copyright (C) 2010-2015 JPEXS - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.jpexs.decompiler.flash.gui; - -import com.jpexs.decompiler.flash.configuration.Configuration; -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.swing.JCheckBox; -import javax.swing.JComponent; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JToggleButton; -import javax.swing.SwingUtilities; -import org.pushingpixels.flamingo.api.common.AbstractCommandButton; -import org.pushingpixels.flamingo.api.common.CommandButtonDisplayState; -import org.pushingpixels.flamingo.api.common.CommandToggleButtonGroup; -import org.pushingpixels.flamingo.api.common.JCommandButton; -import org.pushingpixels.flamingo.api.common.JCommandButtonPanel; -import org.pushingpixels.flamingo.api.common.JCommandToggleButton; -import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; -import org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback; -import org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand; -import org.pushingpixels.flamingo.api.ribbon.JRibbon; -import org.pushingpixels.flamingo.api.ribbon.JRibbonBand; -import org.pushingpixels.flamingo.api.ribbon.JRibbonComponent; -import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenu; -import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryFooter; -import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary; -import org.pushingpixels.flamingo.api.ribbon.RibbonElementPriority; -import org.pushingpixels.flamingo.api.ribbon.RibbonTask; -import org.pushingpixels.flamingo.api.ribbon.resize.BaseRibbonBandResizePolicy; -import org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies; -import org.pushingpixels.flamingo.api.ribbon.resize.IconRibbonBandResizePolicy; -import org.pushingpixels.flamingo.api.ribbon.resize.RibbonBandResizePolicy; -import org.pushingpixels.flamingo.internal.ui.ribbon.AbstractBandControlPanel; - -/** - * - * @author JPEXS - */ -public class MainFrameRibbonMenu extends MainFrameMenu { - - private JRibbon ribbon; - - public MainFrameRibbonMenu(MainFrameRibbon mainFrame, JRibbon ribbon, boolean externalFlashPlayerUnavailable) { - super(mainFrame, externalFlashPlayerUnavailable); - this.ribbon = ribbon; - } - - private String fixCommandTitle(String title) { - if (title.length() > 2) { - if (title.charAt(1) == ' ') { - title = title.charAt(0) + "\u00A0" + title.substring(2); - } - } - return title; - } - - private RibbonBandResizePolicy titleResizePolicies(final JRibbonBand ribbonBand) { - return new BaseRibbonBandResizePolicy(ribbonBand.getControlPanel()) { - @Override - public int getPreferredWidth(int i, int i1) { - return ribbonBand.getGraphics().getFontMetrics(ribbonBand.getFont()).stringWidth(ribbonBand.getTitle()) + 20; - } - - @Override - public void install(int i, int i1) { - } - }; - } - - private List getResizePolicies(JRibbonBand ribbonBand) { - final List myResizePolicies = new ArrayList<>(); - myResizePolicies.add(new CoreRibbonResizePolicies.Mirror(ribbonBand.getControlPanel())); - myResizePolicies.add(titleResizePolicies(ribbonBand)); - myResizePolicies.add(new IconRibbonBandResizePolicy(ribbonBand.getControlPanel())); - - List resizePolicies = new ArrayList<>(); - - resizePolicies.add(new RibbonBandResizePolicy() { - - @Override - public int getPreferredWidth(int i, int i1) { - int pw = 0; - for (RibbonBandResizePolicy p : myResizePolicies) { - int npw = p.getPreferredWidth(i, i1); - if (npw > pw) { - pw = npw; - } - } - return pw; - } - - @Override - public void install(int i, int i1) { - for (RibbonBandResizePolicy p : myResizePolicies) { - p.install(i, i1); - } - } - }); - return resizePolicies; - } - - private final Map menuItems = new HashMap<>(); - private final Map menuTitles = new HashMap<>(); - private final Map menuIcons = new HashMap<>(); - private final Map menuActions = new HashMap<>(); - private final Map menuLoaders = new HashMap<>(); - private final Map menuPriorities = new HashMap<>(); - - private final Map> menuSubs = new HashMap<>(); - private final Map menuType = new HashMap<>(); - private final Map menuGroup = new HashMap<>(); - - private final Map menuToggleGroups = new HashMap<>(); - private final Map menuToToggleGroup = new HashMap<>(); - - private static final int TYPE_MENU = 1; - private static final int TYPE_MENUITEM = 2; - private static final int TYPE_TOGGLEMENUITEM = 3; - - @Override - protected void loadRecent(ActionEvent evt) { - if (evt.getSource() instanceof JPanel) { - JPanel targetPanel = (JPanel) evt.getSource(); - targetPanel.removeAll(); - JCommandButtonPanel openHistoryPanel = new JCommandButtonPanel(CommandButtonDisplayState.MEDIUM); - String groupName = translate("menu.recentFiles"); - openHistoryPanel.addButtonGroup(groupName); - List recentFiles = Configuration.getRecentFiles(); - int j = 0; - for (int i = recentFiles.size() - 1; i >= 0; i--) { - String path = recentFiles.get(i); - RecentFilesButton historyButton = new RecentFilesButton(j + " " + path, null); - historyButton.fileName = path; - historyButton.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent ae) { - RecentFilesButton source = (RecentFilesButton) ae.getSource(); - if (Main.openFile(source.fileName, null) == OpenFileResult.NOT_FOUND) { - if (View.showConfirmDialog(null, translate("message.confirm.recentFileNotFound"), translate("message.confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_NO_OPTION) { - Configuration.removeRecentFile(source.fileName); - } - } - } - }); - j++; - historyButton.setHorizontalAlignment(SwingUtilities.LEFT); - openHistoryPanel.addButtonToLastGroup(historyButton); - } - openHistoryPanel.setMaxButtonColumns(1); - targetPanel.setLayout(new BorderLayout()); - targetPanel.add(openHistoryPanel, BorderLayout.CENTER); - } - } - - @Override - public void finishMenu(String path) { - if (!menuTitles.containsKey(path)) { - throw new IllegalArgumentException("Menu not started: " + path); - } - boolean isAppMenu = path.equals("_"); - String title = menuTitles.get(path); - String icon = menuIcons.get(path); - ActionListener action = menuActions.get(path); - int priority = menuPriorities.get(path); - int type = menuType.get(path); - if (type != TYPE_MENU) { - throw new IllegalArgumentException("Not a menu: " + path); - } - - String parts[] = path.contains("/") ? path.split("\\/") : new String[]{""}; - List subs = menuSubs.get(path); - - boolean onlyCheckboxes = true; - for (String sub : subs) { - if (sub.equals("-")) { - continue; - } - int subType = menuType.get(sub); - if (subType == TYPE_MENUITEM) { - onlyCheckboxes = false; - break; - } - String subIcon = menuIcons.get(sub); - if (subIcon != null) { - onlyCheckboxes = false; - break; - } - } - if (subs.isEmpty()) { - onlyCheckboxes = false; - } - - if (isAppMenu) { - RibbonApplicationMenu mainMenu = new RibbonApplicationMenu(); - for (String sub : subs) { - if (sub.equals("-")) { - mainMenu.addMenuSeparator(); - continue; - } - - String subTitle = menuTitles.get(sub); - String subIcon = menuIcons.get(sub); - int subType = menuType.get(sub); - ActionListener subAction = menuActions.get(sub); - final ActionListener subLoader = menuLoaders.get(sub); - - if (sub.startsWith("_/$")) //FooterMenu - { - RibbonApplicationMenuEntryFooter footerMenu = new RibbonApplicationMenuEntryFooter(View.getResizableIcon(subIcon), subTitle, subAction); - mainMenu.addFooterEntry(footerMenu); - } else { - RibbonApplicationMenuEntryPrimary menu = new RibbonApplicationMenuEntryPrimary(View.getResizableIcon(subIcon), subTitle, subAction, - subType == TYPE_MENU ? JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION : JCommandButton.CommandButtonKind.ACTION_ONLY); - - if (subLoader != null) { - menu.setRolloverCallback(new RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback() { - @Override - public void menuEntryActivated(JPanel targetPanel) { - subLoader.actionPerformed(new ActionEvent(targetPanel, 0, "load:" + sub)); - } - }); - } - mainMenu.addMenuEntry(menu); - } - - } - - ribbon.setApplicationMenu(mainMenu); - - } - - for (String sub : subs) { - if (sub.equals("-")) { - continue; - } - int subType = menuType.get(sub); - ActionListener subAction = menuActions.get(sub); - String subTitle = menuTitles.get(sub); - String subIcon = menuIcons.get(sub); - String subGroup = menuGroup.get(sub); - final ActionListener subLoader = menuLoaders.get(sub); - AbstractCommandButton but = null; - if (subType == TYPE_MENUITEM || (subType == TYPE_MENU && subAction != null)) { - JCommandButton cbut = null; - if (subIcon != null) { - cbut = new JCommandButton(fixCommandTitle(subTitle), View.getResizableIcon(subIcon)); - } else { - cbut = new JCommandButton(fixCommandTitle(subTitle)); - } - if (subLoader != null) { - cbut.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION); - cbut.setPopupCallback(new PopupPanelCallback() { - - @Override - public JPopupPanel getPopupPanel(JCommandButton jcb) { - JPopupPanel jp = new JPopupPanel() { - }; - - subLoader.actionPerformed(new ActionEvent(jp, 0, "load:" + sub)); - return jp; - } - }); - } - but = cbut; - } else if (subType == TYPE_TOGGLEMENUITEM) { - if (onlyCheckboxes) { - JCheckBox cb = new JCheckBox(subTitle); - if (subAction != null) { - cb.addActionListener(subAction); - } - menuItems.put(sub, cb); - } else { - if (subIcon != null) { - but = new JCommandToggleButton(fixCommandTitle(subTitle), View.getResizableIcon(subIcon)); - } else { - but = new JCommandToggleButton(fixCommandTitle(subTitle)); - } - menuToToggleGroup.get(sub).add((JCommandToggleButton) but); - } - } - if (but != null) { - if (subAction != null) { - but.addActionListener(subAction); - } - menuItems.put(sub, but); - } - } - - //if (parts.length == 3) - { //3rd level - it's a Band! - JRibbonBand band = new JRibbonBand(title, icon != null ? View.getResizableIcon(icon) : null, null); - band.setResizePolicies(getResizePolicies(band)); - int cnt = 0; - for (String sub : subs) { - if (sub.equals("-")) { - continue; - } - - Object o = menuItems.get(sub); - int subPriority = menuPriorities.get(sub); - int subType = menuType.get(sub); - ActionListener subAction = menuActions.get(sub); - if (subType != TYPE_MENU || (subAction != null)) { - if (o instanceof AbstractCommandButton) { - RibbonElementPriority ribbonPriority = RibbonElementPriority.MEDIUM; - switch (subPriority) { - case PRIORITY_LOW: - ribbonPriority = RibbonElementPriority.LOW; - break; - case PRIORITY_MEDIUM: - ribbonPriority = RibbonElementPriority.MEDIUM; - break; - case PRIORITY_TOP: - ribbonPriority = RibbonElementPriority.TOP; - break; - } - - band.addCommandButton((AbstractCommandButton) o, ribbonPriority); - cnt++; - } else if (o instanceof JComponent) { - band.addRibbonComponent(new JRibbonComponent((JComponent) o)); - cnt++; - } - } - } - if (cnt > 0) { - if (parts.length != 3) { - if (!menuSubs.containsKey(path)) { - menuSubs.put(path, new ArrayList<>()); - } - if (!menuSubs.get(path).contains(path + "/_")) { - menuSubs.get(path).add(0, path + "/_"); - } - menuItems.put(path + "/_", band); - - } else { - menuItems.put(path, band); - } - - } - - } - - if (parts.length == 1) { //1st level - it's ribbon - for (String sub : subs) { - if (sub.equals("-")) { - continue; - } - if (menuItems.get(sub) instanceof RibbonTask) { - ribbon.addTask((RibbonTask) menuItems.get(sub)); - } - } - } else if (parts.length == 2) { //2nd level - it's a Task! - int bandCount = 0; - for (String sub : subs) { - if (sub.equals("-")) { - continue; - } - - if (menuItems.get(sub) instanceof AbstractRibbonBand) { - bandCount++; - } - } - AbstractRibbonBand bands[] = new AbstractRibbonBand[bandCount]; - int b = 0; - for (String sub : subs) { - if (sub.equals("-")) { - continue; - } - if (menuItems.get(sub) instanceof AbstractRibbonBand) { - bands[b++] = (AbstractRibbonBand) menuItems.get(sub); - } - } - if (bands.length > 0) { - RibbonTask task = new RibbonTask(title, bands); - menuItems.put(path, task); - } - } - } - - @Override - public void addMenuItem(String path, String title, String icon, ActionListener action, int priority, ActionListener subLoader, boolean isLeaf) { - String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf("/")) : ""; - if (!menuSubs.containsKey(parentPath)) { - throw new IllegalArgumentException("No parent menu exists: " + parentPath); - } - menuSubs.get(parentPath).add(path); - if (!isLeaf) { - menuSubs.put(path, new ArrayList<>()); - } - menuLoaders.put(path, subLoader); - menuTitles.put(path, title); - menuIcons.put(path, icon); - menuActions.put(path, action); - menuPriorities.put(path, priority); - menuType.put(path, isLeaf ? TYPE_MENUITEM : TYPE_MENU); - } - - @Override - public void addToggleMenuItem(String path, String title, String group, String icon, ActionListener action, int priority) { - addMenuItem(path, title, icon, action, priority, action, true); - menuType.put(path, TYPE_TOGGLEMENUITEM); - menuGroup.put(path, group); - if (group == null) { - group = path; - } - if (!menuToggleGroups.containsKey(group)) { - menuToggleGroups.put(group, new CommandToggleButtonGroup()); - } - menuToToggleGroup.put(path, menuToggleGroups.get(group)); - } - - @Override - public boolean isMenuChecked(String path) { - Object o = menuItems.get(path); - if (o instanceof JCommandToggleButton) { - JCommandToggleButton t = (JCommandToggleButton) o; - if (!menuToToggleGroup.containsKey(path)) { - throw new IllegalArgumentException("No toggle group for " + path); - } - return menuToToggleGroup.get(path).getSelected() == t; - } - if (o instanceof JCheckBox) { - return ((JCheckBox) o).isSelected(); - } - throw new IllegalArgumentException("Not a toggle menu"); - } - - @Override - public void setMenuChecked(String path, boolean checked) { - Object o = menuItems.get(path); - if (o instanceof JCommandToggleButton) { - JCommandToggleButton t = (JCommandToggleButton) o; - if (!menuToToggleGroup.containsKey(path)) { - throw new IllegalArgumentException("No toggle group for " + path); - } - menuToToggleGroup.get(path).setSelected(t, checked); - } else if (o instanceof JToggleButton) { - ((JToggleButton) o).setSelected(checked); - } else { - throw new IllegalArgumentException("Not a toggle menu"); - } - } - - @Override - public void setGroupSelection(String group, String selected) { - if (!menuToggleGroups.containsKey(group)) { - throw new IllegalArgumentException("Group " + group + " does not exist"); - } - menuToggleGroups.get(group).clearSelection(); - if (selected == null) { - return; - } - if (!menuItems.containsKey(selected)) { - throw new IllegalArgumentException("Selection " + selected + " not found"); - } - JCommandToggleButton c = (JCommandToggleButton) menuItems.get(selected); - menuToggleGroups.get(group).setSelected(c, true); - } - - @Override - public String getGroupSelection(String group) { - if (!menuToggleGroups.containsKey(group)) { - throw new IllegalArgumentException("Group " + group + " does not exist"); - } - JCommandToggleButton c = menuToggleGroups.get(group).getSelected(); - for (String path : menuItems.keySet()) { - if (menuItems.get(path) == c) { - return path; - } - } - return null; - } - - @Override - public void clearMenu(String path) { - - } - - @Override - public void setMenuEnabled(String path, boolean enabled) { - if (!menuItems.containsKey(path)) { - throw new IllegalArgumentException("Menu not found: " + path); - } - Object o = menuItems.get(path); - if (o instanceof JRibbonBand) { - ((JRibbonBand) o).setEnabled(enabled); - } else if (o instanceof AbstractCommandButton) { - ((AbstractCommandButton) o).setEnabled(enabled); - } else if (o instanceof JComponent) { - ((JComponent) o).setEnabled(enabled); - } else { - throw new IllegalArgumentException("Cannot set enabled to: " + path); - } - } - - @Override - public void initMenu() { - menuSubs.put("", new ArrayList<>()); - menuPriorities.put("", 0); - menuActions.put("", null); - menuTitles.put("", null); - menuIcons.put("", null); - menuType.put("", TYPE_MENU); - } - - @Override - public void addSeparator(String parentPath) { - if (!menuSubs.containsKey(parentPath)) { - throw new IllegalArgumentException("Menu does not exist: " + parentPath); - } - menuSubs.get(parentPath).add("-"); - } - - @Override - public boolean supportsMenuAction() { - return true; - } - - @Override - public boolean supportsAppMenu() { - return true; - } - -} +/* + * Copyright (C) 2010-2015 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.gui; + +import com.jpexs.decompiler.flash.configuration.Configuration; +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JToggleButton; +import javax.swing.SwingUtilities; +import org.pushingpixels.flamingo.api.common.AbstractCommandButton; +import org.pushingpixels.flamingo.api.common.CommandButtonDisplayState; +import org.pushingpixels.flamingo.api.common.CommandToggleButtonGroup; +import org.pushingpixels.flamingo.api.common.JCommandButton; +import org.pushingpixels.flamingo.api.common.JCommandButtonPanel; +import org.pushingpixels.flamingo.api.common.JCommandToggleButton; +import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; +import org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback; +import org.pushingpixels.flamingo.api.ribbon.AbstractRibbonBand; +import org.pushingpixels.flamingo.api.ribbon.JRibbon; +import org.pushingpixels.flamingo.api.ribbon.JRibbonBand; +import org.pushingpixels.flamingo.api.ribbon.JRibbonComponent; +import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenu; +import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryFooter; +import org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary; +import org.pushingpixels.flamingo.api.ribbon.RibbonElementPriority; +import org.pushingpixels.flamingo.api.ribbon.RibbonTask; +import org.pushingpixels.flamingo.api.ribbon.resize.BaseRibbonBandResizePolicy; +import org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies; +import org.pushingpixels.flamingo.api.ribbon.resize.IconRibbonBandResizePolicy; +import org.pushingpixels.flamingo.api.ribbon.resize.RibbonBandResizePolicy; +import org.pushingpixels.flamingo.internal.ui.ribbon.AbstractBandControlPanel; + +/** + * + * @author JPEXS + */ +public class MainFrameRibbonMenu extends MainFrameMenu { + + private final JRibbon ribbon; + + private final Map menuItems = new HashMap<>(); + + private final Map menuTitles = new HashMap<>(); + + private final Map menuIcons = new HashMap<>(); + + private final Map menuActions = new HashMap<>(); + + private final Map menuLoaders = new HashMap<>(); + + private final Map menuPriorities = new HashMap<>(); + + private final Map> menuSubs = new HashMap<>(); + + private final Map menuType = new HashMap<>(); + + private final Map menuGroup = new HashMap<>(); + + private final Map menuToggleGroups = new HashMap<>(); + + private final Map menuToToggleGroup = new HashMap<>(); + + private static final int TYPE_MENU = 1; + + private static final int TYPE_MENUITEM = 2; + + private static final int TYPE_TOGGLEMENUITEM = 3; + + public MainFrameRibbonMenu(MainFrameRibbon mainFrame, JRibbon ribbon, boolean externalFlashPlayerUnavailable) { + super(mainFrame, externalFlashPlayerUnavailable); + this.ribbon = ribbon; + } + + private String fixCommandTitle(String title) { + if (title.length() > 2) { + if (title.charAt(1) == ' ') { + title = title.charAt(0) + "\u00A0" + title.substring(2); + } + } + return title; + } + + private RibbonBandResizePolicy titleResizePolicies(final JRibbonBand ribbonBand) { + return new BaseRibbonBandResizePolicy(ribbonBand.getControlPanel()) { + @Override + public int getPreferredWidth(int i, int i1) { + return ribbonBand.getGraphics().getFontMetrics(ribbonBand.getFont()).stringWidth(ribbonBand.getTitle()) + 20; + } + + @Override + public void install(int i, int i1) { + } + }; + } + + private List getResizePolicies(JRibbonBand ribbonBand) { + final List myResizePolicies = new ArrayList<>(); + myResizePolicies.add(new CoreRibbonResizePolicies.Mirror(ribbonBand.getControlPanel())); + myResizePolicies.add(titleResizePolicies(ribbonBand)); + myResizePolicies.add(new IconRibbonBandResizePolicy(ribbonBand.getControlPanel())); + + List resizePolicies = new ArrayList<>(); + + resizePolicies.add(new RibbonBandResizePolicy() { + + @Override + public int getPreferredWidth(int i, int i1) { + int pw = 0; + for (RibbonBandResizePolicy p : myResizePolicies) { + int npw = p.getPreferredWidth(i, i1); + if (npw > pw) { + pw = npw; + } + } + return pw; + } + + @Override + public void install(int i, int i1) { + for (RibbonBandResizePolicy p : myResizePolicies) { + p.install(i, i1); + } + } + }); + return resizePolicies; + } + + @Override + protected void loadRecent(ActionEvent evt) { + if (evt.getSource() instanceof JPanel) { + JPanel targetPanel = (JPanel) evt.getSource(); + targetPanel.removeAll(); + JCommandButtonPanel openHistoryPanel = new JCommandButtonPanel(CommandButtonDisplayState.MEDIUM); + String groupName = translate("menu.recentFiles"); + openHistoryPanel.addButtonGroup(groupName); + List recentFiles = Configuration.getRecentFiles(); + int j = 0; + for (int i = recentFiles.size() - 1; i >= 0; i--) { + String path = recentFiles.get(i); + RecentFilesButton historyButton = new RecentFilesButton(j + " " + path, null); + historyButton.fileName = path; + historyButton.addActionListener((ActionEvent ae) -> { + RecentFilesButton source = (RecentFilesButton) ae.getSource(); + if (Main.openFile(source.fileName, null) == OpenFileResult.NOT_FOUND) { + if (View.showConfirmDialog(null, translate("message.confirm.recentFileNotFound"), translate("message.confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_NO_OPTION) { + Configuration.removeRecentFile(source.fileName); + } + } + }); + j++; + historyButton.setHorizontalAlignment(SwingUtilities.LEFT); + openHistoryPanel.addButtonToLastGroup(historyButton); + } + openHistoryPanel.setMaxButtonColumns(1); + targetPanel.setLayout(new BorderLayout()); + targetPanel.add(openHistoryPanel, BorderLayout.CENTER); + } + } + + @Override + public void finishMenu(String path) { + if (!menuTitles.containsKey(path)) { + throw new IllegalArgumentException("Menu not started: " + path); + } + boolean isAppMenu = path.equals("_"); + String title = menuTitles.get(path); + String icon = menuIcons.get(path); + ActionListener action = menuActions.get(path); + int priority = menuPriorities.get(path); + int type = menuType.get(path); + if (type != TYPE_MENU) { + throw new IllegalArgumentException("Not a menu: " + path); + } + + String parts[] = path.contains("/") ? path.split("\\/") : new String[]{""}; + List subs = menuSubs.get(path); + + boolean onlyCheckboxes = true; + for (String sub : subs) { + if (sub.equals("-")) { + continue; + } + int subType = menuType.get(sub); + if (subType == TYPE_MENUITEM) { + onlyCheckboxes = false; + break; + } + String subIcon = menuIcons.get(sub); + if (subIcon != null) { + onlyCheckboxes = false; + break; + } + } + if (subs.isEmpty()) { + onlyCheckboxes = false; + } + + if (isAppMenu) { + RibbonApplicationMenu mainMenu = new RibbonApplicationMenu(); + for (String sub : subs) { + if (sub.equals("-")) { + mainMenu.addMenuSeparator(); + continue; + } + + String subTitle = menuTitles.get(sub); + String subIcon = menuIcons.get(sub); + int subType = menuType.get(sub); + ActionListener subAction = menuActions.get(sub); + final ActionListener subLoader = menuLoaders.get(sub); + + if (sub.startsWith("_/$")) //FooterMenu + { + RibbonApplicationMenuEntryFooter footerMenu = new RibbonApplicationMenuEntryFooter(View.getResizableIcon(subIcon), subTitle, subAction); + mainMenu.addFooterEntry(footerMenu); + } else { + RibbonApplicationMenuEntryPrimary menu = new RibbonApplicationMenuEntryPrimary(View.getResizableIcon(subIcon), subTitle, subAction, + subType == TYPE_MENU ? JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION : JCommandButton.CommandButtonKind.ACTION_ONLY); + + if (subLoader != null) { + menu.setRolloverCallback(new RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback() { + @Override + public void menuEntryActivated(JPanel targetPanel) { + subLoader.actionPerformed(new ActionEvent(targetPanel, 0, "load:" + sub)); + } + }); + } + mainMenu.addMenuEntry(menu); + } + + } + + ribbon.setApplicationMenu(mainMenu); + + } + + for (String sub : subs) { + if (sub.equals("-")) { + continue; + } + int subType = menuType.get(sub); + ActionListener subAction = menuActions.get(sub); + String subTitle = menuTitles.get(sub); + String subIcon = menuIcons.get(sub); + String subGroup = menuGroup.get(sub); + final ActionListener subLoader = menuLoaders.get(sub); + AbstractCommandButton but = null; + if (subType == TYPE_MENUITEM || (subType == TYPE_MENU && subAction != null)) { + JCommandButton cbut = null; + if (subIcon != null) { + cbut = new JCommandButton(fixCommandTitle(subTitle), View.getResizableIcon(subIcon)); + } else { + cbut = new JCommandButton(fixCommandTitle(subTitle)); + } + if (subLoader != null) { + cbut.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION); + cbut.setPopupCallback(new PopupPanelCallback() { + + @Override + public JPopupPanel getPopupPanel(JCommandButton jcb) { + JPopupPanel jp = new JPopupPanel() { + }; + + subLoader.actionPerformed(new ActionEvent(jp, 0, "load:" + sub)); + return jp; + } + }); + } + but = cbut; + } else if (subType == TYPE_TOGGLEMENUITEM) { + if (onlyCheckboxes) { + JCheckBox cb = new JCheckBox(subTitle); + if (subAction != null) { + cb.addActionListener(subAction); + } + menuItems.put(sub, cb); + } else { + if (subIcon != null) { + but = new JCommandToggleButton(fixCommandTitle(subTitle), View.getResizableIcon(subIcon)); + } else { + but = new JCommandToggleButton(fixCommandTitle(subTitle)); + } + menuToToggleGroup.get(sub).add((JCommandToggleButton) but); + } + } + if (but != null) { + if (subAction != null) { + but.addActionListener(subAction); + } + menuItems.put(sub, but); + } + } + + //if (parts.length == 3) + { //3rd level - it's a Band! + JRibbonBand band = new JRibbonBand(title, icon != null ? View.getResizableIcon(icon) : null, null); + band.setResizePolicies(getResizePolicies(band)); + int cnt = 0; + for (String sub : subs) { + if (sub.equals("-")) { + continue; + } + + Object o = menuItems.get(sub); + int subPriority = menuPriorities.get(sub); + int subType = menuType.get(sub); + ActionListener subAction = menuActions.get(sub); + if (subType != TYPE_MENU || (subAction != null)) { + if (o instanceof AbstractCommandButton) { + RibbonElementPriority ribbonPriority = RibbonElementPriority.MEDIUM; + switch (subPriority) { + case PRIORITY_LOW: + ribbonPriority = RibbonElementPriority.LOW; + break; + case PRIORITY_MEDIUM: + ribbonPriority = RibbonElementPriority.MEDIUM; + break; + case PRIORITY_TOP: + ribbonPriority = RibbonElementPriority.TOP; + break; + } + + band.addCommandButton((AbstractCommandButton) o, ribbonPriority); + cnt++; + } else if (o instanceof JComponent) { + band.addRibbonComponent(new JRibbonComponent((JComponent) o)); + cnt++; + } + } + } + if (cnt > 0) { + if (parts.length != 3) { + if (!menuSubs.containsKey(path)) { + menuSubs.put(path, new ArrayList<>()); + } + if (!menuSubs.get(path).contains(path + "/_")) { + menuSubs.get(path).add(0, path + "/_"); + } + menuItems.put(path + "/_", band); + + } else { + menuItems.put(path, band); + } + + } + + } + + if (parts.length == 1) { //1st level - it's ribbon + for (String sub : subs) { + if (sub.equals("-")) { + continue; + } + if (menuItems.get(sub) instanceof RibbonTask) { + ribbon.addTask((RibbonTask) menuItems.get(sub)); + } + } + } else if (parts.length == 2) { //2nd level - it's a Task! + int bandCount = 0; + for (String sub : subs) { + if (sub.equals("-")) { + continue; + } + + if (menuItems.get(sub) instanceof AbstractRibbonBand) { + bandCount++; + } + } + AbstractRibbonBand bands[] = new AbstractRibbonBand[bandCount]; + int b = 0; + for (String sub : subs) { + if (sub.equals("-")) { + continue; + } + if (menuItems.get(sub) instanceof AbstractRibbonBand) { + bands[b++] = (AbstractRibbonBand) menuItems.get(sub); + } + } + if (bands.length > 0) { + RibbonTask task = new RibbonTask(title, bands); + menuItems.put(path, task); + } + } + } + + @Override + public void addMenuItem(String path, String title, String icon, ActionListener action, int priority, ActionListener subLoader, boolean isLeaf) { + String parentPath = path.contains("/") ? path.substring(0, path.lastIndexOf("/")) : ""; + if (!menuSubs.containsKey(parentPath)) { + throw new IllegalArgumentException("No parent menu exists: " + parentPath); + } + menuSubs.get(parentPath).add(path); + if (!isLeaf) { + menuSubs.put(path, new ArrayList<>()); + } + menuLoaders.put(path, subLoader); + menuTitles.put(path, title); + menuIcons.put(path, icon); + menuActions.put(path, action); + menuPriorities.put(path, priority); + menuType.put(path, isLeaf ? TYPE_MENUITEM : TYPE_MENU); + } + + @Override + public void addToggleMenuItem(String path, String title, String group, String icon, ActionListener action, int priority) { + addMenuItem(path, title, icon, action, priority, action, true); + menuType.put(path, TYPE_TOGGLEMENUITEM); + menuGroup.put(path, group); + if (group == null) { + group = path; + } + if (!menuToggleGroups.containsKey(group)) { + menuToggleGroups.put(group, new CommandToggleButtonGroup()); + } + menuToToggleGroup.put(path, menuToggleGroups.get(group)); + } + + @Override + public boolean isMenuChecked(String path) { + Object o = menuItems.get(path); + if (o instanceof JCommandToggleButton) { + JCommandToggleButton t = (JCommandToggleButton) o; + if (!menuToToggleGroup.containsKey(path)) { + throw new IllegalArgumentException("No toggle group for " + path); + } + return menuToToggleGroup.get(path).getSelected() == t; + } + if (o instanceof JCheckBox) { + return ((JCheckBox) o).isSelected(); + } + throw new IllegalArgumentException("Not a toggle menu"); + } + + @Override + public void setMenuChecked(String path, boolean checked) { + Object o = menuItems.get(path); + if (o instanceof JCommandToggleButton) { + JCommandToggleButton t = (JCommandToggleButton) o; + if (!menuToToggleGroup.containsKey(path)) { + throw new IllegalArgumentException("No toggle group for " + path); + } + menuToToggleGroup.get(path).setSelected(t, checked); + } else if (o instanceof JToggleButton) { + ((JToggleButton) o).setSelected(checked); + } else { + throw new IllegalArgumentException("Not a toggle menu"); + } + } + + @Override + public void setGroupSelection(String group, String selected) { + if (!menuToggleGroups.containsKey(group)) { + throw new IllegalArgumentException("Group " + group + " does not exist"); + } + menuToggleGroups.get(group).clearSelection(); + if (selected == null) { + return; + } + if (!menuItems.containsKey(selected)) { + throw new IllegalArgumentException("Selection " + selected + " not found"); + } + JCommandToggleButton c = (JCommandToggleButton) menuItems.get(selected); + menuToggleGroups.get(group).setSelected(c, true); + } + + @Override + public String getGroupSelection(String group) { + if (!menuToggleGroups.containsKey(group)) { + throw new IllegalArgumentException("Group " + group + " does not exist"); + } + JCommandToggleButton c = menuToggleGroups.get(group).getSelected(); + for (String path : menuItems.keySet()) { + if (menuItems.get(path) == c) { + return path; + } + } + return null; + } + + @Override + public void clearMenu(String path) { + + } + + @Override + public void setMenuEnabled(String path, boolean enabled) { + if (!menuItems.containsKey(path)) { + throw new IllegalArgumentException("Menu not found: " + path); + } + Object o = menuItems.get(path); + if (o instanceof JRibbonBand) { + ((JRibbonBand) o).setEnabled(enabled); + } else if (o instanceof AbstractCommandButton) { + ((AbstractCommandButton) o).setEnabled(enabled); + } else if (o instanceof JComponent) { + ((JComponent) o).setEnabled(enabled); + } else { + throw new IllegalArgumentException("Cannot set enabled to: " + path); + } + } + + @Override + public void initMenu() { + menuSubs.put("", new ArrayList<>()); + menuPriorities.put("", 0); + menuActions.put("", null); + menuTitles.put("", null); + menuIcons.put("", null); + menuType.put("", TYPE_MENU); + } + + @Override + public void addSeparator(String parentPath) { + if (!menuSubs.containsKey(parentPath)) { + throw new IllegalArgumentException("Menu does not exist: " + parentPath); + } + menuSubs.get(parentPath).add("-"); + } + + @Override + public boolean supportsMenuAction() { + return true; + } + + @Override + public boolean supportsAppMenu() { + return true; + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 0a1acd402..7e874c1ef 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -347,6 +347,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se public void setWorkStatus(String s, CancellableWorker worker) { statusPanel.setWorkStatus(s, worker); + mainMenu.updateComponents(); } private JPanel createWelcomePanel() { diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 5f5179d9e..cc0fe2d6a 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Deobfuscation menu.tools.deobfuscation.pcode = P-code deobfuscation... menu.tools.deobfuscation.globalrename = Globally rename identifier menu.tools.deobfuscation.renameinvalid = Rename invalid identifiers -menu.tools.gotodocumentclass = Go to document class +menu.tools.gotoDocumentClass = Go to document class menu.settings = Settings menu.settings.autodeobfuscation = Automatic deobfuscation @@ -335,7 +335,7 @@ warning.initializers = Static fields and consts are often initialized in initial #after version 1.7.0u1: -menu.tools.searchmemory = Search SWFs in memory +menu.tools.searchMemory = Search SWFs in memory menu.file.reload = Reload message.confirm.reload = This action cancels all unsaved changes and reloads the SWF file again.\nDo you want to continue? @@ -358,7 +358,7 @@ preview.stop = Stop message.confirm.removemultiple = Are you sure you want to remove %count% items\n and all objects which depend on it? -menu.tools.searchcache = Search browsers cache +menu.tools.searchCache = Search browsers cache #after version 1.7.2u2 diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ca.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ca.properties index c2e760198..86879963b 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ca.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ca.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Desofuscaci\u00f3 menu.tools.deobfuscation.pcode = Desofuscaci\u00f3 de codi P... menu.tools.deobfuscation.globalrename = Renomena globalment l'identificador menu.tools.deobfuscation.renameinvalid = Renomena els identificadors inv\u00e0lids -menu.tools.gotodocumentclass = Ves a la classe de document +menu.tools.gotoDocumentClass = Ves a la classe de document menu.settings = Par\u00e0metres menu.settings.autodeobfuscation = Desofuscaci\u00f3 autom\u00e0tica @@ -335,7 +335,7 @@ warning.initializers = Els camps est\u00e0tics i les constants sovint s'iniciali #after version 1.7.0u1: -menu.tools.searchmemory = Busca SWFs a la mem\u00f2ria +menu.tools.searchMemory = Busca SWFs a la mem\u00f2ria menu.file.reload = Recarrega message.confirm.reload = Aquesta acci\u00f3 cancel\u00b7la tots els canvis no desats i recarrega altre cop el fitxer SWF.\nVols continuar? @@ -358,7 +358,7 @@ preview.stop = Atura message.confirm.removemultiple = Segur que vols eliminar %count% elements\n i tots els objectes que en depenen? -menu.tools.searchcache = Cau dels explorardors de cerca +menu.tools.searchCache = Cau dels explorardors de cerca #after version 1.7.2u2 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 5f8bb38f9..c73005244 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Deobfuskace menu.tools.deobfuscation.pcode = Deobfuskace P-k\u00f3du... menu.tools.deobfuscation.globalrename = Glob\u00e1ln\u011b p\u0159ejmenovat identifik\u00e1tor menu.tools.deobfuscation.renameinvalid = P\u0159ejmenovat neplatn\u00e9 identifik\u00e1tory -menu.tools.gotodocumentclass = P\u0159ej\u00edt na hlavn\u00ed t\u0159\u00eddu dokumentu +menu.tools.gotoDocumentClass = P\u0159ej\u00edt na hlavn\u00ed t\u0159\u00eddu dokumentu menu.settings = Nastaven\u00ed menu.settings.autodeobfuscation = Automatick\u00e1 deobfuskace @@ -335,7 +335,7 @@ warning.initializers = Statick\u00e9 atributy a konstanty jsou \u010dasto inicia #after version 1.7.0u1: -menu.tools.searchmemory = Hledat SWF v pam\u011bti +menu.tools.searchMemory = Hledat SWF v pam\u011bti menu.file.reload = Znovu na\u010d\u00edst message.confirm.reload = Tato akce zru\u0161\u00ed v\u0161echny neulo\u017een\u00e9 zm\u011bny a znovu na\u010dte SWF soubor.\nChcete pokra\u010dovat? @@ -358,7 +358,7 @@ preview.stop = Zastavit message.confirm.removemultiple = Opravdu chcete odebrat %count% polo\u017eek\n a v\u0161echny objekty kter\u00e9 na nich z\u00e1vis\u00ed? -menu.tools.searchcache = Prohledat cache prohl\u00ed\u017ee\u010d\u016f +menu.tools.searchCache = Prohledat cache prohl\u00ed\u017ee\u010d\u016f #after version 1.7.2u2 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 b148817e3..4262fbc85 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_de.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_de.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Deobfuskation menu.tools.deobfuscation.pcode = PCode-Deobfuskation... menu.tools.deobfuscation.globalrename = Globale Bezeichnung \u00e4ndern menu.tools.deobfuscation.renameinvalid = Ung\u00fcltige Bezeichnungen umbenennen -menu.tools.gotodocumentclass = Zur Dokumentklasse gehen +menu.tools.gotoDocumentClass = Zur Dokumentklasse gehen menu.settings = Einstellungen menu.settings.autodeobfuscation = Automatische Deobfuskation @@ -335,7 +335,7 @@ warning.initializers = Statische Felder und Konstanten sind h\u00e4uftig in Init #after version 1.7.0u1: -menu.tools.searchmemory = SWFs Dateien im Speicher suchen +menu.tools.searchMemory = SWFs Dateien im Speicher suchen menu.file.reload = Erneut laden message.confirm.reload = Diese Aktion bricht alle nicht gespeicherten \u00c4nderungen ab und l\u00e4dt die Datei erneut.\nWollen Sie fortfahren? @@ -358,7 +358,7 @@ preview.stop = Stopp message.confirm.removemultiple = Wollen sie wirklich %count% Elemente entfernen\n und alle Objekte, die davon anh\u00e4ngig sind? -menu.tools.searchcache = Browsercache suchen +menu.tools.searchCache = Browsercache suchen #after version 1.7.2u2 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 f15ec0441..870096e1e 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Desofuscaci\u00f3n menu.tools.deobfuscation.pcode = Desofuscaci\u00f3n de PCode... menu.tools.deobfuscation.globalrename = Renombrar identificador globalmente menu.tools.deobfuscation.renameinvalid = Renombrar identificadores inv\u00e1lidos -menu.tools.gotodocumentclass = Ir al document class +menu.tools.gotoDocumentClass = Ir al document class menu.settings = Ajustes menu.settings.autodeobfuscation = Desofuscaci\u00f3n autom\u00e1tica @@ -335,7 +335,7 @@ warning.initializers = Los campos est\u00e1ticos y constantes son a menudo inici #after version 1.7.0u1: -menu.tools.searchmemory = Buscar SWFs en memoria +menu.tools.searchMemory = Buscar SWFs en memoria menu.file.reload = Recargar message.confirm.reload = Esta acci\u00f3n eliminar\u00e1 todos lo cambios no guardados y recargar\u00e1 el archivo SWF otra vez.\nDesea continuar? @@ -358,7 +358,7 @@ preview.stop = Detener message.confirm.removemultiple = Est\u00e1 seguro que desea eliminar %count% art\u00edculos\n y todos los objetos que dependen de el? -menu.tools.searchcache = Buscar cache del navegador +menu.tools.searchCache = Buscar cache del navegador #after version 1.7.2u2 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 eefbaa454..b33b1be20 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = D\u00e9sobfuscation menu.tools.deobfuscation.pcode = D\u00e9sobfuscation en assembleur ... menu.tools.deobfuscation.globalrename = Renommer int\u00e9gralement les identificateurs menu.tools.deobfuscation.renameinvalid = Renommer les identificateurs invalides -menu.tools.gotodocumentclass = Aller \u00e0 la classe du document +menu.tools.gotoDocumentClass = Aller \u00e0 la classe du document menu.settings = Param\u00e8tres menu.settings.autodeobfuscation = D\u00e9sobfuscation automatique @@ -335,7 +335,7 @@ warning.initializers = Les champs statiques et les constantes variables sont ini #after version 1.7.0u1: -menu.tools.searchmemory = Recherche de fichiers SWF en m\u00e9moire +menu.tools.searchMemory = Recherche de fichiers SWF en m\u00e9moire menu.file.reload = Recharger message.confirm.reload = Cette action annule tous les changements et recharge \u00e0 nouveau le fichier SWF.\nVoulez-vous continuer ? @@ -358,7 +358,7 @@ preview.stop = Stop message.confirm.removemultiple = \u00cates-vous s\u00fbr de vouloir retirer %count% objets\n et tout ceux dont ils d\u00e9pendent ? -menu.tools.searchcache = Rechercher dans la m\u00e9moire cache des navigateurs +menu.tools.searchCache = Rechercher dans la m\u00e9moire cache des navigateurs #after version 1.7.2u2 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 4513eaabe..71a6b8c80 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Deobfuszk\u00e1l\u00e1s menu.tools.deobfuscation.pcode = PCode deobfuszk\u00e1l\u00e1s... menu.tools.deobfuscation.globalrename = Azonos\u00edt\u00f3k glob\u00e1lis \u00e1tnevez\u00e9se menu.tools.deobfuscation.renameinvalid = \u00c9rv\u00e9nytelen azonos\u00edt\u00f3k \u00e1tnevez\u00e9se -menu.tools.gotodocumentclass = Dokumentum oszt\u00e1lyhoz ugr\u00e1s +menu.tools.gotoDocumentClass = Dokumentum oszt\u00e1lyhoz ugr\u00e1s menu.settings = Be\u00e1ll\u00edt\u00e1sok menu.settings.autodeobfuscation = Automatikus deobfuszk\u00e1l\u00e1s @@ -335,7 +335,7 @@ warning.initializers = A statikus mez\u0151k \u00e9s konstansok gyakran az initi #after version 1.7.0u1: -menu.tools.searchmemory = SWF-ek keres\u00e9se a mem\u00f3ri\u00e1ban +menu.tools.searchMemory = SWF-ek keres\u00e9se a mem\u00f3ri\u00e1ban menu.file.reload = \u00dajrat\u00f6lt\u00e9s message.confirm.reload = Ez a m\u0171velet visszavonja az \u00f6sszes nem mentett v\u00e1ltoz\u00e1st, \u00e9s \u00fajrat\u00f6lti az SWF f\u00e1jlt.\nSzeretn\u00e9 folytatni? @@ -358,7 +358,7 @@ preview.stop = Meg\u00e1ll\u00edt\u00e1s message.confirm.removemultiple = Biztos benne, hogy t\u00f6r\u00f6lni k\u00edv\u00e1nja a %count% elemet\n \u00e9s az \u00f6sszes t\u0151le f\u00fcgg\u0151 objektumot ? -menu.tools.searchcache = Keres\u00e9s a b\u00f6ng\u00e9sz\u0151 gyors\u00edt\u00f3t\u00e1r\u00e1ban +menu.tools.searchCache = Keres\u00e9s a b\u00f6ng\u00e9sz\u0151 gyors\u00edt\u00f3t\u00e1r\u00e1ban #after version 1.7.2u2 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 cf25b15fe..60a6845c3 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Deobfuscatie menu.tools.deobfuscation.pcode = P-code deobfuscatie... menu.tools.deobfuscation.globalrename = Globale identifier hernoemen menu.tools.deobfuscation.renameinvalid = Ongeldig identifiers hernoemen -menu.tools.gotodocumentclass = Naar document klasse gaan +menu.tools.gotoDocumentClass = Naar document klasse gaan menu.settings = Instellingen menu.settings.autodeobfuscation = Automatische deobfuscatie @@ -335,7 +335,7 @@ warning.initializers = Statische velden en constanten worden vaak in de initiali #after version 1.7.0u1: -menu.tools.searchmemory = Naar SWFs in het geheugen zoeken +menu.tools.searchMemory = Naar SWFs in het geheugen zoeken menu.file.reload = Herladen message.confirm.reload = Hiermee annuleert U alle niet-opgeslagen veranderingen en laadt het SWF-bestand opnieuw.\nWilt U doorgaan? @@ -358,7 +358,7 @@ preview.stop = Stoppen message.confirm.removemultiple = Weet U zeker dat U %count% items\n en alle objecten die afhankelijk zijn van hen wilt verwijderen? -menu.tools.searchcache = In de browser-cache zoeken +menu.tools.searchCache = In de browser-cache zoeken #after version 1.7.2u2 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 504943547..63ec9aa4e 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pl.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pl.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Odkodowanie menu.tools.deobfuscation.pcode = Odkodowanie P-kodu... menu.tools.deobfuscation.globalrename = Globalnie zmie\u0144 nazw\u0119 identyfikatora menu.tools.deobfuscation.renameinvalid = Zmie\u0144 nazw\u0119 nieprawid\u0142owych identyfikator\u00f3w -menu.tools.gotodocumentclass = Id\u017a do klasy dokumentu +menu.tools.gotoDocumentClass = Id\u017a do klasy dokumentu menu.settings = Ustawienia menu.settings.autodeobfuscation = Automatyczne odkodowanie @@ -335,7 +335,7 @@ warning.initializers = Statyczne pola i sta\u0142e cz\u0119sto s\u0105 inicjowan #after version 1.7.0u1: -menu.tools.searchmemory = Wyszukaj SWF w pami\u0119ci +menu.tools.searchMemory = Wyszukaj SWF w pami\u0119ci menu.file.reload = Za\u0142aduj ponownie message.confirm.reload = Ta akcja anuluje wszystkie niezapisane zmiany i \u0142aduje ponownie plik SWF. \nCzy chcesz kontynuowa\u0107? @@ -358,7 +358,7 @@ preview.stop = Zatrzymaj message.confirm.removemultiple = Czy na pewno chcesz usun\u0105\u0107 %count% obiekt\u00f3w(y)\n i wszystkie obiekty, kt\u00f3re od nich zale\u017c\u0105? -menu.tools.searchcache = Wyszukaj w pami\u0119ci podr\u0119cznej przegl\u0105darek +menu.tools.searchCache = Wyszukaj w pami\u0119ci podr\u0119cznej przegl\u0105darek #after version 1.7.2u2 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 e0b0f6622..51051d796 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_pt.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Deobfuscar menu.tools.deobfuscation.pcode = Deobfus\u00e7\u00e3o P-code... menu.tools.deobfuscation.globalrename = Globalmente Renomear identificador. menu.tools.deobfuscation.renameinvalid = Renomear identificadores invalidos -menu.tools.gotodocumentclass = Ir para document class. +menu.tools.gotoDocumentClass = Ir para document class. menu.settings = Defini\u00e7\u00f5es menu.settings.autodeobfuscation = Deobfusca\u00e7\u00e3o Autom\u00e1tica @@ -335,7 +335,7 @@ warning.initializers = Campos est\u00e1ticos e constantes regularmente sao inici #after version 1.7.0u1: -menu.tools.searchmemory = Procurar SWFs em mem\u00f3ria +menu.tools.searchMemory = Procurar SWFs em mem\u00f3ria menu.file.reload = Carregar de novo message.confirm.reload = Esta acc\u00e7\u00e3o cancela todas as altera\u00e7\u00f5es N\u00c3O salvas e carrega de novo o ficheiro swf.\nDeseja continuar? 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 79c15365d..fd1e0814e 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 @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Deobfuscar menu.tools.deobfuscation.pcode = Deobfus\u00e7\u00e3o P-code... menu.tools.deobfuscation.globalrename = Globalmente Renomear identificador. menu.tools.deobfuscation.renameinvalid = Renomear identificadores invalidos -menu.tools.gotodocumentclass = Ir para document class. +menu.tools.gotoDocumentClass = Ir para document class. menu.settings = Defini\u00e7\u00f5es menu.settings.autodeobfuscation = Deobfusca\u00e7\u00e3o Autom\u00e1tica @@ -335,7 +335,7 @@ warning.initializers = Campos est\u00e1ticos e constantes regularmente sao inici #after version 1.7.0u1: -menu.tools.searchmemory = Procurar SWFs em mem\u00f3ria +menu.tools.searchMemory = Procurar SWFs em mem\u00f3ria menu.file.reload = Carregar de novo message.confirm.reload = Esta acc\u00e7\u00e3o cancela todas as altera\u00e7\u00f5es N\u00c3O salvas e carrega de novo o ficheiro swf.\nDeseja continuar? 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 2fe341252..1dc7de3dd 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = \u0414\u0435\u043e\u0431\u0444\u0443\u0441\u043a\u043 menu.tools.deobfuscation.pcode = \u0414\u0435\u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044f P-code... menu.tools.deobfuscation.globalrename = \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 menu.tools.deobfuscation.renameinvalid = \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b -menu.tools.gotodocumentclass = \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 +menu.tools.gotoDocumentClass = \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 menu.settings = \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 menu.settings.autodeobfuscation = \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0435\u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044f @@ -335,7 +335,7 @@ warning.initializers = \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0 #after version 1.7.0u1: -menu.tools.searchmemory = \u0418\u0441\u043a\u0430\u0442\u044c SWF \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 +menu.tools.searchMemory = \u0418\u0441\u043a\u0430\u0442\u044c SWF \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 menu.file.reload = \u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c message.confirm.reload = \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u043d\u0435\u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043d\u043e\u0432\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 SWF \u0444\u0430\u0439\u043b.\n \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c? @@ -358,7 +358,7 @@ preview.stop = \u0421\u0442\u043e\u043f message.confirm.removemultiple = \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%\n \u0438 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u043d\u0438\u0445? -menu.tools.searchcache = \u041f\u043e\u0438\u0441\u043a \u0432 \u043a\u044d\u0448\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 +menu.tools.searchCache = \u041f\u043e\u0438\u0441\u043a \u0432 \u043a\u044d\u0448\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 #after version 1.7.2u2 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 92395b5f2..9487c038e 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = Avl\u00e4gsna obfuskering menu.tools.deobfuscation.pcode = Avl\u00e4gsna obfuskerad Bytekod... menu.tools.deobfuscation.globalrename = Byt namn p\u00e5 global identifierare menu.tools.deobfuscation.renameinvalid = Byt namn p\u00e5 felaktiga identifierare -menu.tools.gotodocumentclass = G\u00e5 till dokumentklass +menu.tools.gotoDocumentClass = G\u00e5 till dokumentklass menu.settings = Inst\u00e4llningar menu.settings.autodeobfuscation = Automatiskt avl\u00e4gsning av obfuskering @@ -335,7 +335,7 @@ warning.initializers = Statiska f\u00e4lt och consts initieras i initierare ofta #after version 1.7.0u1: -menu.tools.searchmemory = S\u00f6k efter SWFs i minnet +menu.tools.searchMemory = S\u00f6k efter SWFs i minnet menu.file.reload = Ladda om message.confirm.reload = Denna \u00e5tg\u00e4rd avbryter alla \u00e4ndringar som inte sparats och laddar om SWF filen igen.\nVill du forts\u00e4tta? @@ -358,7 +358,7 @@ preview.stop = Stoppa message.confirm.removemultiple = \u00c4r du s\u00e4ker p\u00e5 att du vill ta bort %count% objekt\noch alla andra objekt som \u00e4r beroende av objektet? -menu.tools.searchcache = S\u00f6k i webbl\u00e4sarens cache +menu.tools.searchCache = S\u00f6k i webbl\u00e4sarens cache #after version 1.7.2u2 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 396dda8e1..ba822e2a2 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = \u0414\u0435\u043e\u0431\u0444\u0443\u0441\u043a\u043 menu.tools.deobfuscation.pcode = \u0414\u0435\u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0456\u044f P-\u043a\u043e\u0434\u0443... menu.tools.deobfuscation.globalrename = \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440 menu.tools.deobfuscation.renameinvalid = \u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0445\u0438\u0431\u043d\u0456 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u0438 -menu.tools.gotodocumentclass = \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0434\u043e \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0443 +menu.tools.gotoDocumentClass = \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0434\u043e \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0443 menu.settings = \u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f menu.settings.autodeobfuscation = \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u0430 \u0434\u0435\u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0456\u044f @@ -335,7 +335,7 @@ warning.initializers = \u0421\u0442\u0430\u0442\u0438\u0447\u043d\u0456 \u043f\u #after version 1.7.0u1: -menu.tools.searchmemory = \u041f\u043e\u0448\u0443\u043a SWF \u0432 \u043f\u0430\u043c'\u044f\u0442\u0456 +menu.tools.searchMemory = \u041f\u043e\u0448\u0443\u043a SWF \u0432 \u043f\u0430\u043c'\u044f\u0442\u0456 menu.file.reload = \u041f\u0435\u0440\u0435\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 message.confirm.reload = \u0426\u044f \u0434\u0456\u044f \u0441\u043a\u0430\u0441\u043e\u0432\u0443\u0454 \u0432\u0441\u0456 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0456 \u0437\u043c\u0456\u043d\u0438 \u0456 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0454 \u0444\u0430\u0439\u043b SWF \u0437\u043d\u043e\u0432\u0443. \u0412\u0438 \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0438\u0442\u0438? @@ -358,7 +358,7 @@ preview.stop = \u0421\u0442\u043e\u043f message.confirm.removemultiple = \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%, \u0456 \u0432\u0441\u0456 \u043e\u0431'\u0454\u043a\u0442\u0438, \u044f\u043a\u0456 \u0437\u0430\u043b\u0435\u0436\u0430\u0442\u044c \u0432\u0456\u0434 \u043d\u0438\u0445? -menu.tools.searchcache = \u041f\u043e\u0448\u0443\u043a \u0443 \u043a\u0435\u0448\u0456 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456\u0432 +menu.tools.searchCache = \u041f\u043e\u0448\u0443\u043a \u0443 \u043a\u0435\u0448\u0456 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456\u0432 #after version 1.7.2u2 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 9ebf45c1d..62d4741d2 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_zh.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_zh.properties @@ -29,7 +29,7 @@ menu.tools.deobfuscation = \u53cd\u6df7\u6dc6 menu.tools.deobfuscation.pcode = P\u4ee3\u7801\u53cd\u6df7\u6dc6... menu.tools.deobfuscation.globalrename = \u5168\u5c40\u91cd\u547d\u540d\u6807\u8bc6\u7b26 menu.tools.deobfuscation.renameinvalid = \u91cd\u547d\u540d\u65e0\u6548\u6807\u8bc6\u7b26 -menu.tools.gotodocumentclass = \u8df3\u8f6c\u5230\u4e3b\u7c7b +menu.tools.gotoDocumentClass = \u8df3\u8f6c\u5230\u4e3b\u7c7b menu.settings = \u8bbe\u7f6e menu.settings.autodeobfuscation = \u81ea\u52a8\u53cd\u6df7\u6dc6 @@ -335,7 +335,7 @@ warning.initializers = \u9759\u6001\u5b57\u6bb5\u548c\u5e38\u91cf\u901a\u5e38\u5 #after version 1.7.0u1: -menu.tools.searchmemory = \u641c\u7d22\u5185\u5b58\u4e2d\u7684SWF +menu.tools.searchMemory = \u641c\u7d22\u5185\u5b58\u4e2d\u7684SWF menu.file.reload = \u91cd\u8f7d message.confirm.reload = \u8be5\u52a8\u4f5c\u5c06\u4f1a\u4e22\u5931\u6240\u6709\u672a\u4fdd\u5b58\u7684\u6539\u52a8\uff0c\u5e76\u91cd\u65b0\u52a0\u8f7d\u5f53\u524dSWF\u6587\u4ef6\u3002\n\u662f\u5426\u7ee7\u7eed\uff1f @@ -358,7 +358,7 @@ preview.stop = \u505c\u6b62 message.confirm.removemultiple = \u60a8\u786e\u5b9a\u8981\u79fb\u9664 %count% \u4e2a\u9879\u76ee\uff0c\n\u4ee5\u53ca\u5176\u6240\u6709\u7684\u4f9d\u8d56\u5bf9\u8c61\u5417\uff1f -menu.tools.searchcache = \u641c\u7d22\u6d4f\u89c8\u5668\u7f13\u5b58 +menu.tools.searchCache = \u641c\u7d22\u6d4f\u89c8\u5668\u7f13\u5b58 #after version 1.7.2u2