diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java index 1fdc333d7..d8b389d45 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java @@ -571,19 +571,25 @@ public class Main { JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get())); FileFilter allSupportedFilter = new FileFilter() { + // todo: honfika: enalbe again after swf bundle imlpmented + //private String[] supportedExtensions = new String[] { ".swf", ".gfx", ".swc", ".zip" }; + private String[] supportedExtensions = new String[] { ".swf", ".gfx" }; + @Override public boolean accept(File f) { String name = f.getName().toLowerCase(); - return (name.endsWith(".swf")) - || (name.endsWith(".gfx")) - || (name.endsWith(".swc")) - || (name.endsWith(".zip")) - || (f.isDirectory()); + for (String ext : supportedExtensions) { + if (name.endsWith(ext)) { + return true; + } + } + return f.isDirectory(); } @Override public String getDescription() { - return AppStrings.translate("filter.supported"); + String exts = Helper.joinStrings(supportedExtensions, "*%s", "; "); + return AppStrings.translate("filter.supported") + " (" + exts + ")"; } }; fc.setFileFilter(allSupportedFilter); @@ -611,7 +617,7 @@ public class Main { return AppStrings.translate("filter.swc"); } }; - fc.addChoosableFileFilter(swcFilter); + // todo: honfika: enalbe again after swf bundle imlpmented fc.addChoosableFileFilter(swcFilter); FileFilter gfxFilter = new FileFilter() { @Override @@ -638,7 +644,7 @@ public class Main { return AppStrings.translate("filter.zip"); } }; - fc.addChoosableFileFilter(zipFilter); + // todo: honfika: enalbe again after swf bundle imlpmented fc.addChoosableFileFilter(zipFilter); FileFilter binaryFilter = new FileFilter() { @Override @@ -651,7 +657,7 @@ public class Main { return AppStrings.translate("filter.binary"); } }; - fc.addChoosableFileFilter(binaryFilter); + // todo: honfika: enalbe again after swf bundle imlpmented fc.addChoosableFileFilter(binaryFilter); fc.setAcceptAllFileFilterUsed(false); JFrame f = new JFrame(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index 061db419a..21c3ec326 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -197,31 +197,30 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene } } - private Map getASMs(String path, List nodes) { - Map ret = new HashMap<>(); + private void getASMs(String path, List nodes, Map result) { for (TreeNode n : nodes) { String subPath = path + "/" + n.toString(); if (n.getItem() instanceof ASMSource) { //cacheScript((ASMSource) n.tag); String npath = subPath; int ppos = 1; - while (ret.containsKey(npath)) { + while (result.containsKey(npath)) { ppos++; npath = subPath + "[" + ppos + "]"; } - ret.put(subPath, (ASMSource) n.getItem()); + result.put(npath, (ASMSource) n.getItem()); } - ret.putAll(getASMs(subPath, n.subNodes)); + getASMs(subPath, n.subNodes, result); } - return ret; } public boolean search(String txt, boolean ignoreCase, boolean regexp) { if ((txt != null) && (!txt.isEmpty())) { searchPanel.setOptions(ignoreCase, regexp); List list = SWF.createASTagList(mainPanel.getCurrentSwf().tags, null); - Map asms = getASMs("", list); + Map asms = new HashMap<>(); + getASMs("", list, asms); List found = new ArrayList<>(); Pattern pat = null; if (regexp) { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 6f230df3e..e301aa0d5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -370,7 +370,7 @@ button.no.all = No to all message.font.add.exists = Character %char% already exists in the font tag.\nDo you want to replace it? filter.gfx = ScaleForm GFx files (*.gfx) -filter.supported = All supported filetypes (*.swf, *.gfx; *.swc; *.zip) +filter.supported = All supported filetypes work.canceled = Canceled work.restoringControlFlow = Restoring control flow menu.advancedsettings.advancedsettings = Advanced Settings diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index cbe0c156c..b8766cb62 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -370,7 +370,7 @@ button.no.all = Ne v\u0161em message.font.add.exists = Znak %char% ji\u017e v tagu p\u00edsma existuje.\nChcete ho nahradit? filter.gfx = ScaleForm GFx soubory (*.gfx) -filter.supported = V\u0161echny podporovan\u00e9 typy (*.swf, *.gfx) +filter.supported = V\u0161echny podporovan\u00e9 typy work.canceled = Stornov\u00e1no work.restoringControlFlow = Obnovuji control flow diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties index cb02d0505..072f2b520 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_es.properties @@ -369,7 +369,7 @@ button.no.all = No a todo message.font.add.exists = El caracter %char% ya existe en la etiqueta de la fuente.\nDesea reemplazarlo? filter.gfx = Archivos ScaleForm GFx (*.gfx) -filter.supported = Todos los tipos de archivo soportados (*.swf, *.gfx) +filter.supported = Todos los tipos de archivo soportados work.canceled = Cancelado work.restoringControlFlow = Restaurando control de flujo menu.advancedsettings.advancedsettings = Opciones Avanzadas diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties index a6208200e..125a96b7d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_fr.properties @@ -370,7 +370,7 @@ button.no.all = Non pour tous message.font.add.exists = Le caract\u00e8re %char% est d\u00e9j\u00e0 pr\u00e9sent dans les \u00e9tiquettes de la police.\nVoulez-vous le remplacer ? filter.gfx = Fichiers vectoriels graphiques (*.gfx) -filter.supported = Tous les types de fichiers support\u00e9s (*.swf, *.gfx) +filter.supported = Tous les types de fichiers support\u00e9s work.canceled = Annul\u00e9 work.restoringControlFlow = Restauration du contr\u00f4le de flux menu.advancedsettings.advancedsettings = Param\u00e8tres avanc\u00e9s diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties index 68b4fb73c..74ab1b47b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_hu.properties @@ -370,7 +370,7 @@ button.no.all = Egyik sem message.font.add.exists = %char% karakter m\u00e1r l\u00e9tezik a bet\u0171t\u00edpus tagben.\nSzeretn\u00e9 lecser\u00e9lni? filter.gfx = ScaleForm GFx f\u00e1jlok (*.gfx) -filter.supported = Minden t\u00e1mogatott f\u00e1jlt\u00edpus (*.swf, *.gfx) +filter.supported = Minden t\u00e1mogatott f\u00e1jlt\u00edpus work.canceled = Megszak\u00edtva work.restoringControlFlow = Vez\u00e9rl\u00e9si-folyam helyre\u00e1ll\u00edt\u00e1s menu.advancedsettings.advancedsettings = Halad\u00f3 be\u00e1ll\u00edt\u00e1sok diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties index cc0d6edce..e2870dae1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_nl.properties @@ -367,7 +367,7 @@ button.no.all = Nee op alles message.font.add.exists = Teken %char% al bestaat in de lettertype-tag. Wilt u het vervangen? filter.gfx = ScaleForm GFx bestanden (*.gfx) -filter.supported = Alle ondersteunde bestandstypen (*.swf, *.gfx) +filter.supported = Alle ondersteunde bestandstypen work.canceled = Geannuleerd work.restoringControlFlow = Aan het herstellen van de control flow... menu.advancedsettings.advancedsettings = Geavanceerde instellingen diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties index a77b0cfe7..62cfe30fd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_ru.properties @@ -371,7 +371,7 @@ button.no.all = \u041d\u0435\u0442 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 message.font.add.exists = \u0421\u0438\u043c\u0432\u043e\u043b %char% \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0442\u044d\u0433\u0435 \u0448\u0440\u0438\u0444\u0442\u0430.\n\u0416\u0435\u043b\u0430\u0435\u0442\u0435 \u043b\u0438 \u0412\u044b \u0435\u0433\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c? filter.gfx = GFx \u0444\u0430\u0439\u043b\u044b ScaleForm (*.gfx) -filter.supported = \u0412\u0441\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b (*.swf, *.gfx) +filter.supported = \u0412\u0441\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b work.canceled = \u041e\u0442\u043c\u0435\u043d\u0435\u043d\u043e work.restoringControlFlow = \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 menu.advancedsettings.advancedsettings = \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties index 10880c9f0..21a076363 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_sv.properties @@ -370,7 +370,7 @@ button.no.all = Nej till alla message.font.add.exists = Tecken %char% finns redan i typsnitts tag:en.\nVill du ers\u00e4tta den? filter.gfx = ScaleForm GFx filer (*.gfx) -filter.supported = Alla filtyper som st\u00f6ds (*.swf, *.gfx) +filter.supported = Alla filtyper som st\u00f6ds work.canceled = Avbruten menu.advancedsettings.advancedsettings = Avancerade Inst\u00e4llningar menu.recentFiles = Senaste Filerna diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties index a3f9bf082..09a99919c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_uk.properties @@ -370,7 +370,7 @@ button.no.all = \u041d\u0456 \u0434\u043b\u044f \u0432\u0441\u0456\u0445 message.font.add.exists = \u0421\u0438\u043c\u0432\u043e\u043b %char% \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454 \u0432 \u0442\u0435\u0433\u0443 \u0448\u0440\u0438\u0444\u0442\u0430.\n \u0412\u0438 \u0431\u0430\u0436\u0430\u0435\u0442\u0435 \u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438 \u0439\u043e\u0433\u043e? filter.gfx = GFx \u0444\u0430\u0439\u043b\u0438 ScaleForm (*.gfx) -filter.supported = \u0412\u0441\u0456 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0442\u0438\u043f\u0438 \u0444\u0430\u0439\u043b\u0456\u0432 (*.swf, *.gfx) +filter.supported = \u0412\u0441\u0456 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0442\u0438\u043f\u0438 \u0444\u0430\u0439\u043b\u0456\u0432 work.canceled = \u0421\u043a\u0430\u0441\u043e\u0432\u0430\u043d\u043e work.restoringControlFlow = \u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043f\u043e\u0442\u043e\u043a\u0443 \u043a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f... menu.advancedsettings.advancedsettings = \u0420\u043e\u0437\u0448\u0438\u0440\u0435\u043d\u0456 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f @@ -408,9 +408,9 @@ decompilationError.error.description = \u0414\u0435\u043a\u043e\u043c\u043f\u045 #example: 1 hour and 2 minutes timeFormat.and = \u0442\u0430 -timeFormat.hour = \u0433\u043E\u0434. -timeFormat.hours = \u0433\u043E\u0434. +timeFormat.hour = \u0433\u043e\u0434. +timeFormat.hours = \u0433\u043e\u0434. timeFormat.minute = \u0445\u0432. timeFormat.minutes = \u0445\u0432. -timeFormat.second = \u0441\u0435\u043A. -timeFormat.seconds = \u0441\u0435\u043A. +timeFormat.second = \u0441\u0435\u043a. +timeFormat.seconds = \u0441\u0435\u043a. diff --git a/trunk/src/com/jpexs/helpers/Helper.java b/trunk/src/com/jpexs/helpers/Helper.java index 4ba9fc50c..49144aa2a 100644 --- a/trunk/src/com/jpexs/helpers/Helper.java +++ b/trunk/src/com/jpexs/helpers/Helper.java @@ -330,6 +330,34 @@ public class Helper { return ret; } + public static String joinStrings(List arr, String formatString, String glue) { + String ret = ""; + boolean first = true; + for (String s : arr) { + if (!first) { + ret += glue; + } else { + first = false; + } + ret += String.format(formatString, s); + } + return ret; + } + + public static String joinStrings(String[] arr, String formatString, String glue) { + String ret = ""; + boolean first = true; + for (String s : arr) { + if (!first) { + ret += glue; + } else { + first = false; + } + ret += String.format(formatString, s); + } + return ret; + } + public static Object deepCopy(Object o) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream();