From 366b96a59a5cd0ab9055ab6da536e8edd60b0a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 2 Mar 2013 21:00:07 +0100 Subject: [PATCH] New icons (Silk icons) All tags merged into one tree including AS3 classes --- .../src/com/jpexs/decompiler/flash/Main.java | 2 +- trunk/src/com/jpexs/decompiler/flash/SWF.java | 10 +- .../flash/abc/avm2/graph/AVM2Graph.java | 18 +- .../instructions/other/GetScopeObjectIns.java | 3 - .../decompiler/flash/abc/gui/ABCPanel.java | 36 +- .../flash/abc/gui/ClassesListTree.java | 6 +- .../flash/abc/gui/ClassesListTreeModel.java | 5 + .../decompiler/flash/abc/gui/GraphFrame.java | 6 +- .../flash/abc/gui/IconListRenderer.java | 7 +- .../flash/abc/gui/graphics/constant.png | Bin 543 -> 0 bytes .../flash/abc/gui/graphics/function.png | Bin 410 -> 0 bytes .../flash/abc/gui/graphics/variable.png | Bin 562 -> 0 bytes .../decompiler/flash/action/TagNode.java | 182 --- .../flash/action/gui/ActionPanel.java | 122 +- .../flash/action/gui/TagTreeModel.java | 93 -- .../jpexs/decompiler/flash/graph/Graph.java | 18 +- .../decompiler/flash/gui/AboutDialog.java | 2 +- .../decompiler/flash/gui/ExportDialog.java | 89 ++ .../jpexs/decompiler/flash/gui/FrameNode.java | 35 + .../decompiler/flash/gui/LoadingPanel.java | 2 +- .../jpexs/decompiler/flash/gui/MainFrame.java | 1096 ++++++++++++----- .../jpexs/decompiler/flash/gui/ModeFrame.java | 9 +- .../jpexs/decompiler/flash/gui/TagNode.java | 79 ++ .../jpexs/decompiler/flash/gui/TagPanel.java | 300 ----- .../decompiler/flash/gui/TagTreeModel.java | 54 +- .../com/jpexs/decompiler/flash/gui/View.java | 18 +- .../decompiler/flash/gui/graphics/about16.png | Bin 0 -> 778 bytes .../decompiler/flash/gui/graphics/as16.png | Bin 575 -> 603 bytes .../flash/gui/graphics/button16.png | Bin 395 -> 211 bytes .../flash/gui/graphics/constant.png | Bin 0 -> 343 bytes .../flash/gui/graphics/deobfuscate16.png | Bin 0 -> 774 bytes .../flash/gui/graphics/donate16.png | Bin 0 -> 749 bytes .../decompiler/flash/gui/graphics/exit16.png | Bin 509 -> 688 bytes .../flash/gui/graphics/export16.png | Bin 0 -> 612 bytes .../flash/gui/graphics/exportsel16.png | Bin 0 -> 679 bytes .../decompiler/flash/gui/graphics/flash16.png | Bin 0 -> 582 bytes .../flash/gui/graphics/folder16.png | Bin 0 -> 537 bytes .../flash/gui/graphics/folderopen16.png | Bin 0 -> 536 bytes .../decompiler/flash/gui/graphics/font16.png | Bin 401 -> 567 bytes .../decompiler/flash/gui/graphics/frame16.png | Bin 0 -> 653 bytes .../flash/gui/graphics/function.png | Bin 0 -> 483 bytes .../decompiler/flash/gui/graphics/image16.png | Bin 535 -> 606 bytes .../flash/gui/graphics/morphshape16.png | Bin 527 -> 435 bytes .../decompiler/flash/gui/graphics/open16.png | Bin 787 -> 639 bytes .../flash/gui/graphics/package16.png | Bin 0 -> 853 bytes .../decompiler/flash/gui/graphics/save16.png | Bin 504 -> 620 bytes .../flash/gui/graphics/saveas16.png | Bin 481 -> 857 bytes .../gui/graphics/{search.png => search16.png} | Bin .../decompiler/flash/gui/graphics/shape16.png | Bin 542 -> 353 bytes .../flash/gui/graphics/sprite16.png | Bin 727 -> 452 bytes .../decompiler/flash/gui/graphics/text16.png | Bin 418 -> 153 bytes .../flash/gui/graphics/update16.png | Bin 0 -> 789 bytes .../flash/gui/graphics/variable.png | Bin 0 -> 356 bytes .../flash/gui/proxy/ProxyFrame.java | 8 +- 54 files changed, 1191 insertions(+), 1009 deletions(-) delete mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/gui/graphics/constant.png delete mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/gui/graphics/function.png delete mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/gui/graphics/variable.png delete mode 100644 trunk/src/com/jpexs/decompiler/flash/action/TagNode.java delete mode 100644 trunk/src/com/jpexs/decompiler/flash/action/gui/TagTreeModel.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/ExportDialog.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/FrameNode.java delete mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/TagPanel.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/about16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/constant.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/deobfuscate16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/donate16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/export16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/exportsel16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/flash16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/folder16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/folderopen16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/frame16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/function.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/package16.png rename trunk/src/com/jpexs/decompiler/flash/gui/graphics/{search.png => search16.png} (100%) create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/update16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/variable.png diff --git a/trunk/src/com/jpexs/decompiler/flash/Main.java b/trunk/src/com/jpexs/decompiler/flash/Main.java index 88dcb36e3..abaeca90c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/Main.java @@ -645,7 +645,7 @@ public class Main { } if (SystemTray.isSupported()) { SystemTray tray = SystemTray.getSystemTray(); - trayIcon = new TrayIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/proxy16.png"), "JP ASDec Proxy"); + trayIcon = new TrayIcon(View.loadImage("proxy16"), "JP ASDec Proxy"); trayIcon.setImageAutoSize(true); PopupMenu trayPopup = new PopupMenu(); diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 7f468e6f5..ed596c60d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -17,7 +17,7 @@ package com.jpexs.decompiler.flash; import SevenZip.Compression.LZMA.Encoder; -import com.jpexs.decompiler.flash.action.TagNode; +import com.jpexs.decompiler.flash.gui.TagNode; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG4Tag; @@ -381,7 +381,7 @@ public class SWF { list2.addAll(tags); List list = TagNode.createTagList(list2); TagNode.setExport(list, true); - return TagNode.exportNode(list, outdir, isPcode); + return TagNode.exportNodeAS(list, outdir, isPcode); } return asV3Found; } @@ -435,6 +435,9 @@ public class SWF { } public static void exportShapes(String outdir, List tags) throws IOException { + if (!(new File(outdir)).exists()) { + (new File(outdir)).mkdirs(); + } for (Tag t : tags) { if (t instanceof ShapeTag) { int characterID = 0; @@ -459,6 +462,9 @@ public class SWF { } public static void exportImages(String outdir, List tags, JPEGTablesTag jtt) throws IOException { + if (!(new File(outdir)).exists()) { + (new File(outdir)).mkdirs(); + } for (Tag t : tags) { if ((t instanceof DefineBitsJPEG2Tag) || (t instanceof DefineBitsJPEG3Tag) || (t instanceof DefineBitsJPEG4Tag)) { byte imageData[] = null; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index fc58b19a3..fa14dc521 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -1312,7 +1312,7 @@ public class AVM2Graph extends Graph { if (part.getHeight() >= 3) { if (code.code.get(part.getPosAt(part.getHeight() - 2)).definition instanceof KillIns) { if (code.code.get(part.getPosAt(part.getHeight() - 3)).definition instanceof GetLocalTypeIns) { - if (!output.isEmpty()) { + if (output.size() >= 2) { if (output.get(output.size() - 2) instanceof SetLocalTreeItem) { ret = new ArrayList(); ret.addAll(output); @@ -1539,4 +1539,20 @@ public class AVM2Graph extends Graph { } } } + + @Override + protected boolean isEmpty(List output) { + if (super.isEmpty(output)) { + return true; + } + for (GraphTargetItem i : output) { + if (i instanceof SetLocalTreeItem) { + if (code.isKilled(((SetLocalTreeItem) i).regIndex, 0, code.code.size() - 1)) { + continue; + } + } + return false; + } + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java index 185253750..06b200e7d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java @@ -36,9 +36,6 @@ public class GetScopeObjectIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int index = ins.operands[0]; - if (scopeStack.size() <= index) { - System.out.println("uuu"); - } stack.push(scopeStack.get(index)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/ABCPanel.java b/trunk/src/com/jpexs/decompiler/flash/abc/gui/ABCPanel.java index 38b452e1e..9ad44abd8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/gui/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/gui/ABCPanel.java @@ -55,6 +55,8 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { public JLabel decLabel = new JLabel("ActionScript source"); public DetailPanel detailPanel; public JTextField filterField = new JTextField(""); + public JPanel navPanel; + public JTabbedPane tabbedPane; private JTable autoResizeColWidth(JTable table, TableModel model) { table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); @@ -153,13 +155,13 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { } public void initSplits() { - splitPaneTreeVSNavigator.setDividerLocation(splitPaneTreeVSNavigator.getHeight() / 2); + //splitPaneTreeVSNavigator.setDividerLocation(splitPaneTreeVSNavigator.getHeight() / 2); try { Thread.sleep(100); } catch (InterruptedException ex) { Logger.getLogger(ABCPanel.class.getName()).log(Level.SEVERE, null, ex); } - splitPaneTreeNavVSDecompiledDetail.setDividerLocation(splitPaneTreeNavVSDecompiledDetail.getWidth() * 1 / 3); + //splitPaneTreeNavVSDecompiledDetail.setDividerLocation(splitPaneTreeNavVSDecompiledDetail.getWidth() * 1 / 3); try { Thread.sleep(100); } catch (InterruptedException ex) { @@ -210,12 +212,12 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { navigator.setABC(list, abc); - JPanel navPanel = new JPanel(new BorderLayout()); + navPanel = new JPanel(new BorderLayout()); JLabel traitsLabel = new JLabel("Traits"); navPanel.add(traitsLabel, BorderLayout.NORTH); traitsLabel.setBorder(new BevelBorder(BevelBorder.RAISED)); - navPanel.add(new JScrollPane(navigator), BorderLayout.CENTER); + //navPanel.add(new JScrollPane(navigator), BorderLayout.CENTER); Main.startWork("Building script tree..."); @@ -250,7 +252,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { JPanel searchPanel = new JPanel(); searchPanel.setLayout(new BorderLayout()); searchPanel.add(filterField, BorderLayout.CENTER); - JLabel picLabel = new JLabel(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/search.png"))); + JLabel picLabel = new JLabel(View.getIcon("search16")); searchPanel.add(picLabel, BorderLayout.EAST); treePanel.add(searchPanel, BorderLayout.NORTH); @@ -259,27 +261,27 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { navPanel); splitPaneTreeVSNavigator.setResizeWeight(0.5); splitPaneTreeVSNavigator.setContinuousLayout(true); - JTabbedPane tabbedPane = new JTabbedPane(); - tabbedPane.addTab("Scripts", splitPaneTreeVSNavigator); + tabbedPane = new JTabbedPane(); + tabbedPane.addTab("Traits", new JScrollPane(navigator)); //tabbedPane.setTabPlacement(JTabbedPane.BOTTOM); - pan2.add(tabbedPane, BorderLayout.CENTER); + //pan2.add(tabbedPane, BorderLayout.CENTER); abcComboBox.addItemListener(this); + /* - - splitPaneTreeNavVSDecompiledDetail = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, - pan2, - splitPaneDecompiledVSDetail); - splitPaneTreeNavVSDecompiledDetail.setResizeWeight(0); - splitPaneTreeNavVSDecompiledDetail.setContinuousLayout(true); - //pan2.setPreferredSize(new Dimension(300, 200)); + splitPaneTreeNavVSDecompiledDetail = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, + pan2, + splitPaneDecompiledVSDetail); + splitPaneTreeNavVSDecompiledDetail.setResizeWeight(0); + splitPaneTreeNavVSDecompiledDetail.setContinuousLayout(true); + //pan2.setPreferredSize(new Dimension(300, 200)); - add(splitPaneTreeNavVSDecompiledDetail, BorderLayout.CENTER); - + add(splitPaneTreeNavVSDecompiledDetail, BorderLayout.CENTER);*/ + add(splitPaneDecompiledVSDetail, BorderLayout.CENTER); JPanel panConstants = new JPanel(); panConstants.setLayout(new BorderLayout()); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTree.java b/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTree.java index 7c66d998b..8f625da38 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTree.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTree.java @@ -19,11 +19,11 @@ package com.jpexs.decompiler.flash.abc.gui; import com.jpexs.decompiler.flash.Main; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitClass; +import com.jpexs.decompiler.flash.gui.View; import com.jpexs.decompiler.flash.tags.DoABCTag; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import javax.swing.ImageIcon; import javax.swing.JTree; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; @@ -53,9 +53,7 @@ public class ClassesListTree extends JTree implements TreeSelectionListener { addTreeSelectionListener(this); DefaultTreeCellRenderer treeRenderer = new DefaultTreeCellRenderer(); ClassLoader cldr = this.getClass().getClassLoader(); - java.net.URL imageURL = cldr.getResource("com/jpexs/decompiler/flash/gui/graphics/as16.png"); - ImageIcon leafIcon = new ImageIcon(imageURL); - treeRenderer.setLeafIcon(leafIcon); + treeRenderer.setLeafIcon(View.getIcon("as16")); setCellRenderer(treeRenderer); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTreeModel.java b/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTreeModel.java index d8ace2912..02c7bc971 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTreeModel.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/gui/ClassesListTreeModel.java @@ -141,4 +141,9 @@ public class ClassesListTreeModel implements TreeModel { public void removeTreeModelListener(TreeModelListener l) { } + + @Override + public String toString() { + return "scripts"; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/GraphFrame.java b/trunk/src/com/jpexs/decompiler/flash/abc/gui/GraphFrame.java index a8b18a050..5fab88f89 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/gui/GraphFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/gui/GraphFrame.java @@ -51,7 +51,11 @@ public class GraphFrame extends JFrame { protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.black); - paintPart(g, graph.heads.get(0), 0, getPartWidth(graph.heads.get(0), new HashSet()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2, new HashMap()); + GraphPart h = graph.heads.get(0); + if (graph.heads.size() > 3) { + h = graph.heads.get(3); + } + paintPart(g, h, 0, getPartWidth(graph.heads.get(0), new HashSet()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2, new HashMap()); } private void paintPart(Graphics g, GraphPart part, int y, int x, HashMap used) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/IconListRenderer.java b/trunk/src/com/jpexs/decompiler/flash/abc/gui/IconListRenderer.java index b39a7c9fa..cd8445efb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/gui/IconListRenderer.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/gui/IconListRenderer.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.gui; +import com.jpexs.decompiler.flash.gui.View; import java.awt.Component; import javax.swing.*; @@ -33,9 +34,9 @@ public class IconListRenderer } public IconListRenderer() { - constIcon = loadIcon("com/jpexs/decompiler/flash/abc/gui/graphics/constant.png"); - functionIcon = loadIcon("com/jpexs/decompiler/flash/abc/gui/graphics/function.png"); - variableIcon = loadIcon("com/jpexs/decompiler/flash/abc/gui/graphics/variable.png"); + constIcon = View.getIcon("constant"); + functionIcon = View.getIcon("function"); + variableIcon = View.getIcon("variable"); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/graphics/constant.png b/trunk/src/com/jpexs/decompiler/flash/abc/gui/graphics/constant.png deleted file mode 100644 index c6ddca761385476b83453ce2f40b7d9a9f37917c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 543 zcmV+)0^t3LP)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igY? z4_CX>@2HM@dakSAh-}0004cNkl|+Wh(Zb>g=m{X(035_2^0c?c6o+0c>)u$$O9y; zV&iVJ!D3f2MIv_=L0RYg7I*I5HQvgd<_yC>-+br5z<|res^{J>XS>_oU2qN*S=rtJ za^RFcq2^E~aqtEMCrqd#ha3)Lr+U+R+i;8g;7U<9yxN;C*$fFVh2+ z9vw!_&%b`MIycLo?H%^k*4R2cjE2!fDgY=dJI6u2&id;&ycjC6x$u^gS}o4u|JnDq z;6M^4JUlTr#_xZB z87`MG)CUm3()t9@PCRBJ$XKjQ@}t@0U8Tb5)fL|x4L+@`^dLnBZJ(q7#8P#VgR?qc zj*odcI?BiSS6q0X_aCg#pwkOTe3+SGd3u^42qDn&9+O4O0zj*iAWQoVB3D(c*?fY8 h^%)HOnFjsMJOJMx{tBH8III8w002ovPDHLkV1i6}pBS8wuEzW)2nq^9ye zooS`7GGoK__v$SUN~X4xS{aHP*S*}k!^*F8$%?1VlgQu&X%Q~loCIESkpIZO` diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/graphics/variable.png b/trunk/src/com/jpexs/decompiler/flash/abc/gui/graphics/variable.png deleted file mode 100644 index 0fe224d56c113dafc748dac1085bfa2922087d92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 562 zcmV-20?qx2P)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igY? z4<-T&0-OH;000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0004vNkl|qEZXL4q!$EhyR}G>6fTR12wJ4c zCs2Y04EQAy*UX>w&Fro>#e3_HyIZ*f!`vC}IdjgPxzOQ=(p8>{&(x#%dMo9VU~Rsq zvF(}M2B52bl0X!-2RG^M3Quot%M35>qOF5_K>!g!8^`Q=9`CDEYxmS@wN?USJ>A{U z_^>cSe*YY09m+Vgjma0zSbaB6*;UXcId37*)}xH$Q*MU6!a09R7HvF#OLu%Z_{rwV zB-%K%O=b&$G7fD#F9!R_4)swyxkB5R!|%TtdD+kN-X4_kD4XQ9Q4lBctY_on6km@n zD5;olN0+Ras;1J#Z$h0g}Fu z2up8ADV|=DTY81Pt02;V1z|v7{6mrmym_7F@~ diff --git a/trunk/src/com/jpexs/decompiler/flash/action/TagNode.java b/trunk/src/com/jpexs/decompiler/flash/action/TagNode.java deleted file mode 100644 index df9f6a0b8..000000000 --- a/trunk/src/com/jpexs/decompiler/flash/action/TagNode.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (C) 2010-2013 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.action; - -import com.jpexs.decompiler.flash.EventListener; -import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.helpers.Highlighting; -import com.jpexs.decompiler.flash.tags.DefineButton2Tag; -import com.jpexs.decompiler.flash.tags.DefineButtonTag; -import com.jpexs.decompiler.flash.tags.DefineSpriteTag; -import com.jpexs.decompiler.flash.tags.DoInitActionTag; -import com.jpexs.decompiler.flash.tags.ExportAssetsTag; -import com.jpexs.decompiler.flash.tags.ShowFrameTag; -import com.jpexs.decompiler.flash.tags.Tag; -import com.jpexs.decompiler.flash.tags.base.ASMSource; -import com.jpexs.decompiler.flash.tags.base.Container; -import java.io.File; -import java.io.FileOutputStream; -import java.util.ArrayList; -import java.util.List; - -public class TagNode { - - public List subItems; - public Object tag; - public boolean export = false; - - public TagNode(Object tag) { - this.tag = tag; - this.subItems = new ArrayList(); - } - - @Override - public String toString() { - return tag.toString(); - } - - public static List createTagList(List list) { - List ret = new ArrayList(); - int frame = 1; - List frames = new ArrayList(); - - List exportAssetsTags = new ArrayList(); - for (Object t : list) { - if (t instanceof ExportAssetsTag) { - exportAssetsTags.add((ExportAssetsTag) t); - } - if (t instanceof ShowFrameTag) { - TagNode tti = new TagNode("frame" + frame); - - for (int r = ret.size() - 1; r >= 0; r--) { - if (!(ret.get(r).tag instanceof DefineSpriteTag)) { - if (!(ret.get(r).tag instanceof DefineButtonTag)) { - if (!(ret.get(r).tag instanceof DefineButton2Tag)) { - if (!(ret.get(r).tag instanceof DoInitActionTag)) { - tti.subItems.add(ret.get(r)); - ret.remove(r); - } - } - } - } - } - frame++; - frames.add(tti); - } else if (t instanceof ASMSource) { - TagNode tti = new TagNode(t); - ret.add(tti); - } else if (t instanceof Container) { - if (((Container) t).getItemCount() > 0) { - - TagNode tti = new TagNode(t); - List subItems = ((Container) t).getSubItems(); - - tti.subItems = createTagList(subItems); - ret.add(tti); - } - } - - } - ret.addAll(frames); - for (int i = ret.size() - 1; i >= 0; i--) { - if (ret.get(i).tag instanceof DefineSpriteTag) { - ((DefineSpriteTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof DefineButtonTag) { - ((DefineButtonTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof DefineButton2Tag) { - ((DefineButton2Tag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof DoInitActionTag) { - ((DoInitActionTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof ASMSource) { - ASMSource ass = (ASMSource) ret.get(i).tag; - if (ass.containsSource()) { - continue; - } - } - if (ret.get(i).subItems.isEmpty()) { - ret.remove(i); - } - } - return ret; - } - - public static void setExport(List nodeList, boolean export) { - for (TagNode node : nodeList) { - node.export = export; - setExport(node.subItems, export); - } - } - - public static boolean exportNode(List nodeList, String outdir, boolean isPcode) { - return exportNode(nodeList, outdir, isPcode, null); - } - - public static boolean exportNode(List nodeList, String outdir, boolean isPcode, EventListener ev) { - File dir = new File(outdir); - List existingNames = new ArrayList(); - for (TagNode node : nodeList) { - String name = ""; - if (node.tag instanceof Tag) { - name = ((Tag) node.tag).getExportName(); - } else { - name = node.tag.toString(); - } - int i = 1; - String baseName = name; - while (existingNames.contains(name)) { - i++; - name = baseName + "_" + i; - } - existingNames.add(name); - if (node.subItems.isEmpty()) { - if ((node.tag instanceof ASMSource) && (node.export)) { - if (!dir.exists()) { - dir.mkdirs(); - } - try { - String f = outdir + File.separatorChar + name + ".as"; - if (ev != null) { - ev.handleEvent("export", "Exporting " + f + " ..."); - } - String ret; - if (isPcode) { - ret = Highlighting.stripHilights(((ASMSource) node.tag).getASMSource(SWF.DEFAULT_VERSION)); - } else { - List as = ((ASMSource) node.tag).getActions(SWF.DEFAULT_VERSION); - com.jpexs.decompiler.flash.action.Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION); - ret = (Highlighting.stripHilights(com.jpexs.decompiler.flash.action.Action.actionsToSource(as, SWF.DEFAULT_VERSION))); - } - - - FileOutputStream fos = new FileOutputStream(f); - fos.write(ret.getBytes()); - fos.close(); - } catch (Exception ex) { - } - } - } else { - exportNode(node.subItems, outdir + File.separatorChar + name, isPcode, ev); - } - - } - return true; - } -} diff --git a/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java b/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java index 9ea8766e4..e8327f929 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.gui.GraphFrame; import com.jpexs.decompiler.flash.abc.gui.LineMarkedEditorPane; import com.jpexs.decompiler.flash.action.ActionGraph; -import com.jpexs.decompiler.flash.action.TagNode; import com.jpexs.decompiler.flash.action.parser.ASMParser; import com.jpexs.decompiler.flash.action.parser.ParseException; import com.jpexs.decompiler.flash.helpers.Highlighting; @@ -41,15 +40,10 @@ import javax.swing.*; import javax.swing.border.BevelBorder; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; -import javax.swing.event.TreeSelectionEvent; -import javax.swing.event.TreeSelectionListener; -import javax.swing.tree.DefaultTreeCellRenderer; -import javax.swing.tree.TreePath; import jsyntaxpane.DefaultSyntaxKit; -public class ActionPanel extends JPanel implements TreeSelectionListener, ActionListener { +public class ActionPanel extends JPanel implements ActionListener { - public JTree tagTree; public LineMarkedEditorPane editor; public LineMarkedEditorPane decompiledEditor; public List list; @@ -65,26 +59,47 @@ public class ActionPanel extends JPanel implements TreeSelectionListener, Action public JLabel decLabel = new JLabel("ActionScript source"); public List decompiledHilights = new ArrayList(); public List disassembledHilights = new ArrayList(); - private String lastDisasm = ""; + public String lastDisasm = ""; private boolean ignoreCarret = false; private boolean editMode = false; private List lastCode; + private ASMSource src; - public ActionPanel(List list) { + public void setSource(ASMSource src) { + this.src = src; + Main.startWork("Decompiling..."); + final ASMSource asm = (ASMSource) src; + (new Thread() { + @Override + public void run() { + lastDisasm = asm.getASMSource(SWF.DEFAULT_VERSION); + disassembledHilights = Highlighting.getInstrHighlights(lastDisasm); + lastDisasm = Highlighting.stripHilights(lastDisasm); + editor.setText(lastDisasm); + if (Main.DO_DECOMPILE) { + List as = asm.getActions(SWF.DEFAULT_VERSION); + lastCode = as; + com.jpexs.decompiler.flash.action.Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION); + decompiledEditor.setText("//Decompiling..."); + String s = com.jpexs.decompiler.flash.action.Action.actionsToSource(as, SWF.DEFAULT_VERSION); + decompiledHilights = Highlighting.getInstrHighlights(s); + decompiledEditor.setText(Highlighting.stripHilights(s)); + } + setEditMode(false); + Main.stopWork(); + } + }).start(); + } + + public ActionPanel() { this.list = list; DefaultSyntaxKit.initKit(); editor = new LineMarkedEditorPane(); editor.setEditable(false); decompiledEditor = new LineMarkedEditorPane(); decompiledEditor.setEditable(false); - tagTree = new JTree(new TagTreeModel(list)); - DefaultTreeCellRenderer treeRenderer = new DefaultTreeCellRenderer(); - ClassLoader cldr = this.getClass().getClassLoader(); - java.net.URL imageURL = cldr.getResource("com/jpexs/decompiler/flash/gui/graphics/as16.png"); - ImageIcon leafIcon = new ImageIcon(imageURL); - treeRenderer.setLeafIcon(leafIcon); - tagTree.setCellRenderer(treeRenderer); + JPanel panB = new JPanel(); panB.setLayout(new BorderLayout()); @@ -131,15 +146,16 @@ public class ActionPanel extends JPanel implements TreeSelectionListener, Action setLayout(new BorderLayout()); - add(splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(tagTree), splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panA, panB)), BorderLayout.CENTER); - splitPane.setResizeWeight(0.5); + //add(splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(tagTree), splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panA, panB)), BorderLayout.CENTER); + add(splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panA, panB), BorderLayout.CENTER); +// splitPane.setResizeWeight(0.5); splitPane2.setResizeWeight(0.5); editor.setContentType("text/flasm"); editor.setFont(new Font("Monospaced", Font.PLAIN, editor.getFont().getSize())); decompiledEditor.setContentType("text/actionscript"); decompiledEditor.setFont(new Font("Monospaced", Font.PLAIN, decompiledEditor.getFont().getSize())); - tagTree.addTreeSelectionListener(this); + //tagTree.addTreeSelectionListener(this); editor.addCaretListener(new CaretListener() { @Override public void caretUpdate(CaretEvent e) { @@ -196,42 +212,8 @@ public class ActionPanel extends JPanel implements TreeSelectionListener, Action } public void initSplits() { - splitPane.setDividerLocation(getWidth() / 3); - splitPane2.setDividerLocation(getWidth() / 3); - } - - public void valueChanged(TreeSelectionEvent e) { - if (Main.isWorking()) { - return; - } - Object obj = tagTree.getLastSelectedPathComponent(); - if (obj instanceof TagNode) { - obj = ((TagNode) obj).tag; - if (obj instanceof ASMSource) { - Main.startWork("Decompiling..."); - final ASMSource asm = (ASMSource) obj; - (new Thread() { - @Override - public void run() { - lastDisasm = asm.getASMSource(SWF.DEFAULT_VERSION); - disassembledHilights = Highlighting.getInstrHighlights(lastDisasm); - lastDisasm = Highlighting.stripHilights(lastDisasm); - editor.setText(lastDisasm); - if (Main.DO_DECOMPILE) { - List as = asm.getActions(SWF.DEFAULT_VERSION); - lastCode = as; - com.jpexs.decompiler.flash.action.Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION); - decompiledEditor.setText("//Decompiling..."); - String s = com.jpexs.decompiler.flash.action.Action.actionsToSource(as, SWF.DEFAULT_VERSION); - decompiledHilights = Highlighting.getInstrHighlights(s); - decompiledEditor.setText(Highlighting.stripHilights(s)); - } - setEditMode(false); - Main.stopWork(); - } - }).start(); - } - } + //splitPane.setDividerLocation(getWidth() / 3); + splitPane2.setDividerLocation(getWidth() / 2); } public void display() { @@ -240,19 +222,6 @@ public class ActionPanel extends JPanel implements TreeSelectionListener, Action splitPane2.setDividerLocation(0.5); } - public List getSelectedNodes() { - List ret = new ArrayList(); - TreePath tps[] = tagTree.getSelectionPaths(); - if (tps == null) { - return ret; - } - for (TreePath tp : tps) { - TagNode te = (TagNode) tp.getLastPathComponent(); - ret.add(te); - } - return ret; - } - public void setEditMode(boolean val) { if (val) { editor.setEditable(true); @@ -282,17 +251,12 @@ public class ActionPanel extends JPanel implements TreeSelectionListener, Action setEditMode(false); editor.setText(lastDisasm); } else if (e.getActionCommand().equals("SAVEACTION")) { - TagNode ti = (TagNode) tagTree.getLastSelectedPathComponent(); - if (ti.tag instanceof ASMSource) { - ASMSource dat = (ASMSource) ti.tag; - try { - dat.setActions(ASMParser.parse(new ByteArrayInputStream(editor.getText().getBytes()), SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION); - valueChanged(null); - JOptionPane.showMessageDialog(this, "Code successfully saved"); - } catch (IOException ex) { - } catch (ParseException ex) { - JOptionPane.showMessageDialog(this, "" + ex.text + " on line " + ex.line, "Error", JOptionPane.ERROR_MESSAGE); - } + try { + src.setActions(ASMParser.parse(new ByteArrayInputStream(editor.getText().getBytes()), SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION); + JOptionPane.showMessageDialog(this, "Code successfully saved"); + } catch (IOException ex) { + } catch (ParseException ex) { + JOptionPane.showMessageDialog(this, "" + ex.text + " on line " + ex.line, "Error", JOptionPane.ERROR_MESSAGE); } saveButton.setVisible(false); editButton.setVisible(true); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/gui/TagTreeModel.java b/trunk/src/com/jpexs/decompiler/flash/action/gui/TagTreeModel.java deleted file mode 100644 index 86d3fddd1..000000000 --- a/trunk/src/com/jpexs/decompiler/flash/action/gui/TagTreeModel.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2010-2013 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.action.gui; - -import com.jpexs.decompiler.flash.action.TagNode; -import com.jpexs.decompiler.flash.tags.*; -import java.util.ArrayList; -import java.util.List; -import javax.swing.event.TreeModelListener; -import javax.swing.tree.TreeModel; -import javax.swing.tree.TreePath; - -public class TagTreeModel implements TreeModel { - - private String root = ""; - private List list = new ArrayList(); - - public TagTreeModel(List list) { - List list2 = new ArrayList(); - list2.addAll(list); - this.list = TagNode.createTagList(list2); - } - - public List getNodeList() { - return list; - } - - public Object getRoot() { - return root; - } - - public Object getChild(Object parent, int index) { - if (parent == root) { - return list.get(index); - } else { - return ((TagNode) parent).subItems.get(index); - } - } - - public int getChildCount(Object parent) { - if (parent == root) { - return list.size(); - } else { - return ((TagNode) parent).subItems.size(); - } - } - - public boolean isLeaf(Object node) { - return (getChildCount(node) == 0); - } - - public void valueForPathChanged(TreePath path, Object newValue) { - } - - public int getIndexOfChild(Object parent, Object child) { - if (parent == root) { - for (int t = 0; t < list.size(); t++) { - if (list.get(t) == child) { - return t; - } - } - return -1; - } else { - List subTags = ((TagNode) parent).subItems; - for (int t = 0; t < subTags.size(); t++) { - if (subTags.get(t) == child) { - return t; - } - } - return -1; - } - } - - public void addTreeModelListener(TreeModelListener l) { - } - - public void removeTreeModelListener(TreeModelListener l) { - } -} diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index 753b07102..3246e8b54 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -81,7 +81,7 @@ public class Graph { int pos = -1; for (GraphPart r : uniqueRefs) { pos++; - if (r.path.startsWith("e")) { + if (r.path.startsWith("e") && !part.path.startsWith("e")) { continue; } if (part.leadsTo(r, new ArrayList())) { @@ -345,6 +345,13 @@ public class Graph { } } + protected boolean isEmpty(List output) { + if (output.isEmpty()) { + return true; + } + return false; + } + protected List check(List localData, List allParts, Stack stack, GraphPart parent, GraphPart part, GraphPart stopPart, List loops, List output, HashMap> forFinalCommands) { return null; } @@ -458,14 +465,14 @@ public class Graph { a.firstPart = ((AndItem) second).firstPart; } if (second instanceof OrItem) { - a.firstPart = ((AndItem) second).firstPart; + a.firstPart = ((OrItem) second).firstPart; } } else { OrItem o = new OrItem(null, first, second); stack.push(o); o.firstPart = part; - if (second instanceof OrItem) { - o.firstPart = ((OrItem) second).firstPart; + if (second instanceof AndItem) { + o.firstPart = ((AndItem) second).firstPart; } if (second instanceof OrItem) { o.firstPart = ((OrItem) second).firstPart; @@ -939,8 +946,7 @@ public class Graph { System.err.println("/ONFALSE (inside " + part + ")"); } } - - if (onTrue.isEmpty() && onFalse.isEmpty() && (trueStack.size() > stackSizeBefore) && (falseStack.size() > stackSizeBefore)) { + if (isEmpty(onTrue) && isEmpty(onFalse) && (trueStack.size() > stackSizeBefore) && (falseStack.size() > stackSizeBefore)) { stack.push(new TernarOpItem(null, expr, trueStack.pop(), falseStack.pop())); } else { List retw = retx; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/AboutDialog.java b/trunk/src/com/jpexs/decompiler/flash/gui/AboutDialog.java index 507a87fab..1829d725c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/AboutDialog.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/AboutDialog.java @@ -94,7 +94,7 @@ public class AboutDialog extends JDialog { setVisible(false); } }); - + getRootPane().setDefaultButton(okButton); setModal(true); View.centerScreen(this); View.setWindowIcon(this); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/ExportDialog.java b/trunk/src/com/jpexs/decompiler/flash/gui/ExportDialog.java new file mode 100644 index 000000000..188801efb --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/gui/ExportDialog.java @@ -0,0 +1,89 @@ +package com.jpexs.decompiler.flash.gui; + +import java.awt.Container; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; + +/** + * + * @author JPEXS + */ +public class ExportDialog extends JDialog { + + JComboBox images; + JComboBox shapes; + JComboBox actionScript; + boolean cancelled = false; + + public ExportDialog() { + setTitle("Export..."); + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + cancelled = true; + } + }); + setSize(200, 175); + setLayout(null); + JLabel shapesLabel = new JLabel("Shapes"); + shapesLabel.setBounds(10, 10, 60, 25); + shapes = new JComboBox(new String[]{"SVG"}); + shapes.setBounds(75, 10, 95, 25); + + JLabel imagesLabel = new JLabel("Images"); + imagesLabel.setBounds(10, 35, 60, 25); + images = new JComboBox(new String[]{"PNG/JPEG"}); + images.setBounds(75, 35, 95, 25); + + JLabel actionScriptLabel = new JLabel("ActionScript"); + actionScriptLabel.setBounds(10, 60, 60, 25); + actionScript = new JComboBox(new String[]{"AS", "PCODE"}); + actionScript.setBounds(75, 60, 95, 25); + + JButton okButton = new JButton("OK"); + okButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + setVisible(false); + } + }); + okButton.setBounds(20, 95, 75, 25); + + JButton cancelButton = new JButton("Cancel"); + cancelButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + cancelled = true; + setVisible(false); + } + }); + cancelButton.setBounds(95, 95, 75, 25); + Container cnt = getContentPane(); + cnt.add(shapes); + cnt.add(shapesLabel); + cnt.add(images); + cnt.add(imagesLabel); + cnt.add(actionScript); + cnt.add(actionScriptLabel); + cnt.add(okButton); + cnt.add(cancelButton); + View.centerScreen(this); + View.setWindowIcon(this); + getRootPane().setDefaultButton(okButton); + setModal(true); + } + + @Override + public void setVisible(boolean b) { + if (b) { + cancelled = false; + } + super.setVisible(b); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/FrameNode.java b/trunk/src/com/jpexs/decompiler/flash/gui/FrameNode.java new file mode 100644 index 000000000..ba3e00bb3 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/gui/FrameNode.java @@ -0,0 +1,35 @@ +package com.jpexs.decompiler.flash.gui; + +/** + * + * @author JPEXS + */ +public class FrameNode { + + private int frame; + private Object parent; + private boolean display; + + public FrameNode(int frame, Object parent, boolean display) { + this.frame = frame; + this.parent = parent; + this.display = display; + } + + public boolean isDisplayed() { + return display; + } + + @Override + public String toString() { + return "frame " + frame; + } + + public int getFrame() { + return frame; + } + + public Object getParent() { + return parent; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/LoadingPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/LoadingPanel.java index 458bf11df..af529c3c4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/LoadingPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/LoadingPanel.java @@ -42,7 +42,7 @@ public class LoadingPanel extends JPanel { public LoadingPanel(int iconWidth, int iconHeight) { this.iconWidth = iconWidth; this.iconHeight = iconHeight; - ImageIcon icon = (new ImageIcon(this.getClass().getResource("/com/jpexs/decompiler/flash/gui/graphics/loading.png"))); + ImageIcon icon = View.getIcon("loading"); animationImage = icon.getImage(); java.util.Timer timer = new java.util.Timer(); timer.schedule(new java.util.TimerTask() { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 92edc069b..bdfc762d1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -19,10 +19,15 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.Main; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.gui.ABCPanel; import com.jpexs.decompiler.flash.abc.gui.DeobfuscationDialog; +import com.jpexs.decompiler.flash.abc.gui.TreeElement; import com.jpexs.decompiler.flash.abc.gui.TreeLeafScript; +import com.jpexs.decompiler.flash.abc.types.traits.Trait; +import com.jpexs.decompiler.flash.abc.types.traits.TraitClass; import com.jpexs.decompiler.flash.action.gui.ActionPanel; +import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag; @@ -48,28 +53,44 @@ import com.jpexs.decompiler.flash.tags.DefineText2Tag; import com.jpexs.decompiler.flash.tags.DefineTextTag; import com.jpexs.decompiler.flash.tags.DoABCTag; import com.jpexs.decompiler.flash.tags.DoInitActionTag; +import com.jpexs.decompiler.flash.tags.EndTag; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.JPEGTablesTag; +import com.jpexs.decompiler.flash.tags.PlaceObject2Tag; +import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag; import com.jpexs.decompiler.flash.tags.ShowFrameTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSource; +import com.jpexs.decompiler.flash.tags.base.AloneTag; +import com.jpexs.decompiler.flash.tags.base.BoundedTag; +import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.Container; -import com.jpexs.decompiler.flash.tags.base.ShapeTag; +import com.jpexs.decompiler.flash.tags.base.FontTag; +import com.jpexs.decompiler.flash.types.GLYPHENTRY; +import com.jpexs.decompiler.flash.types.MATRIX; +import com.jpexs.decompiler.flash.types.RECT; +import com.jpexs.decompiler.flash.types.RGB; +import com.jpexs.decompiler.flash.types.TEXTRECORD; import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Icon; -import javax.swing.ImageIcon; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFileChooser; import javax.swing.JFrame; @@ -80,16 +101,26 @@ import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JProgressBar; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; import javax.swing.JTabbedPane; +import javax.swing.JTree; import javax.swing.SwingConstants; import javax.swing.SwingWorker; import javax.swing.border.BevelBorder; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.TreeCellRenderer; +import javax.swing.tree.TreeModel; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; /** * * @author Jindra */ -public class MainFrame extends JFrame implements ActionListener { +public class MainFrame extends JFrame implements ActionListener, TreeSelectionListener { private SWF swf; public ABCPanel abcPanel; @@ -100,6 +131,22 @@ public class MainFrame extends JFrame implements ActionListener { public JPanel statusPanel = new JPanel(); public JProgressBar progressBar = new JProgressBar(0, 100); private DeobfuscationDialog deobfuscationDialog; + public JTree tagTree; + public FlashPlayerPanel flashPanel; + public JPanel displayPanel; + public ImagePanel imagePanel; + final static String CARDFLASHPANEL = "Flash card"; + final static String CARDIMAGEPANEL = "Image card"; + final static String CARDEMPTYPANEL = "Empty card"; + final static String CARDACTIONSCRIPTPANEL = "ActionScript card"; + final static String DETAILCARDAS3NAVIGATOR = "Traits list"; + final static String DETAILCARDEMPTYPANEL = "Empty card"; + private JPEGTablesTag jtt; + private HashMap characters; + private List abcList; + JSplitPane splitPane1; + JSplitPane splitPane2; + private JPanel detailPanel; public void setPercent(int percent) { progressBar.setValue(percent); @@ -112,6 +159,14 @@ public class MainFrame extends JFrame implements ActionListener { } } + static { + try { + File.createTempFile("temp", ".swf").delete(); //First call to this is slow, so make it first + } catch (IOException ex) { + Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); + } + } + private static void addTab(JTabbedPane tabbedPane, Component tab, String title, Icon icon) { tabbedPane.add(tab); @@ -135,13 +190,6 @@ public class MainFrame extends JFrame implements ActionListener { } statusLabel.setText(s); } - private TagPanel imagesTagPanel; - private TagPanel shapesTagPanel; - private TagPanel morphshapesTagPanel; - private TagPanel spritesTagPanel; - private TagPanel textsTagPanel; - private TagPanel buttonsTagPanel; - private TagPanel fontsTagPanel; public MainFrame(SWF swf) { setSize(1000, 700); @@ -163,68 +211,27 @@ public class MainFrame extends JFrame implements ActionListener { JMenu menuFile = new JMenu("File"); JMenuItem miOpen = new JMenuItem("Open..."); - miOpen.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/open16.png"))); + miOpen.setIcon(View.getIcon("open16")); miOpen.setActionCommand("OPEN"); miOpen.addActionListener(this); JMenuItem miSave = new JMenuItem("Save"); - miSave.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/save16.png"))); + miSave.setIcon(View.getIcon("save16")); miSave.setActionCommand("SAVE"); miSave.addActionListener(this); JMenuItem miSaveAs = new JMenuItem("Save as..."); - miSaveAs.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/saveas16.png"))); + miSaveAs.setIcon(View.getIcon("saveas16")); miSaveAs.setActionCommand("SAVEAS"); miSaveAs.addActionListener(this); - JMenu menuExportAll = new JMenu("Export all"); - JMenuItem miExportAllAS = new JMenuItem("ActionScript..."); - miExportAllAS.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/as16.png"))); - miExportAllAS.setActionCommand("EXPORT"); - miExportAllAS.addActionListener(this); + JMenuItem menuExportAll = new JMenuItem("Export all"); + menuExportAll.setActionCommand("EXPORT"); + menuExportAll.addActionListener(this); + JMenuItem menuExportSel = new JMenuItem("Export selection"); + menuExportSel.setActionCommand("EXPORTSEL"); + menuExportSel.addActionListener(this); + menuExportAll.setIcon(View.getIcon("export16")); + menuExportSel.setIcon(View.getIcon("exportsel16")); - JMenuItem miExportAllPCode = new JMenuItem("PCode..."); - miExportAllPCode.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/pcode16.png"))); - miExportAllPCode.setActionCommand("EXPORTPCODE"); - miExportAllPCode.addActionListener(this); - JMenuItem miExportImages = new JMenuItem("Images..."); - miExportImages.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/image16.png"))); - miExportImages.setActionCommand("EXPORTIMAGES"); - miExportImages.addActionListener(this); - - JMenuItem miExportShapes = new JMenuItem("Shapes..."); - miExportShapes.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/shape16.png"))); - miExportShapes.setActionCommand("EXPORTSHAPES"); - miExportShapes.addActionListener(this); - - menuExportAll.add(miExportAllAS); - menuExportAll.add(miExportAllPCode); - menuExportAll.add(miExportImages); - menuExportAll.add(miExportShapes); - - JMenu menuExportSel = new JMenu("Export selection"); - JMenuItem miExportSelAS = new JMenuItem("ActionScript..."); - miExportSelAS.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/as16.png"))); - miExportSelAS.setActionCommand("EXPORTSEL"); - miExportSelAS.addActionListener(this); - - JMenuItem miExportSelPCode = new JMenuItem("PCode..."); - miExportSelPCode.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/pcode16.png"))); - miExportSelPCode.setActionCommand("EXPORTPCODESEL"); - miExportSelPCode.addActionListener(this); - - JMenuItem miExportSelImages = new JMenuItem("Images..."); - miExportSelImages.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/image16.png"))); - miExportSelImages.setActionCommand("EXPORTIMAGESSEL"); - miExportSelImages.addActionListener(this); - - JMenuItem miExportSelShapes = new JMenuItem("Shapes..."); - miExportSelShapes.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/shape16.png"))); - miExportSelShapes.setActionCommand("EXPORTSHAPESSEL"); - miExportSelShapes.addActionListener(this); - - menuExportSel.add(miExportSelAS); - menuExportSel.add(miExportSelPCode); - menuExportSel.add(miExportSelImages); - menuExportSel.add(miExportSelShapes); menuFile.add(miOpen); menuFile.add(miSave); @@ -233,12 +240,13 @@ public class MainFrame extends JFrame implements ActionListener { menuFile.add(menuExportSel); menuFile.addSeparator(); JMenuItem miClose = new JMenuItem("Exit"); - miClose.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/exit16.png"))); + miClose.setIcon(View.getIcon("exit16")); miClose.setActionCommand("EXIT"); miClose.addActionListener(this); menuFile.add(miClose); menuBar.add(menuFile); JMenu menuDeobfuscation = new JMenu("Deobfuscation"); + menuDeobfuscation.setIcon(View.getIcon("deobfuscate16")); JMenuItem miDeobfuscation = new JMenuItem("PCode deobfuscation..."); miDeobfuscation.setActionCommand("DEOBFUSCATE"); @@ -276,6 +284,7 @@ public class MainFrame extends JFrame implements ActionListener { miControlFlowAll.setActionCommand("RESTORECONTROLFLOWALL"); miControlFlowAll.addActionListener(this); + menuDeobfuscation.add(miRenameIdentifiers); //menuDeobfuscation.add(miSubLimiter); menuDeobfuscation.add(miDeobfuscation); @@ -291,7 +300,7 @@ public class MainFrame extends JFrame implements ActionListener { JMenu menuTools = new JMenu("Tools"); JMenuItem miProxy = new JMenuItem("Proxy"); miProxy.setActionCommand("SHOWPROXY"); - miProxy.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/proxy16.png"))); + miProxy.setIcon(View.getIcon("proxy16")); miProxy.addActionListener(this); menuTools.add(miProxy); @@ -301,72 +310,97 @@ public class MainFrame extends JFrame implements ActionListener { JMenu menuHelp = new JMenu("Help"); JMenuItem miAbout = new JMenuItem("About..."); + miAbout.setIcon(View.getIcon("about16")); + miAbout.setActionCommand("ABOUT"); miAbout.addActionListener(this); JMenuItem miCheckUpdates = new JMenuItem("Check for updates..."); miCheckUpdates.setActionCommand("CHECKUPDATES"); + miCheckUpdates.setIcon(View.getIcon("update16")); miCheckUpdates.addActionListener(this); - menuHelp.add(miAbout); + + JMenuItem miDonate = new JMenuItem("Donate..."); + miDonate.setActionCommand("DONATE"); + miDonate.setIcon(View.getIcon("donate16")); + miDonate.addActionListener(this); + + menuHelp.add(miCheckUpdates); + menuHelp.add(miDonate); + menuHelp.add(miAbout); menuBar.add(menuHelp); setJMenuBar(menuBar); List objs = new ArrayList(); objs.addAll(swf.tags); + + this.swf = swf; - getContentPane().setLayout(new BorderLayout()); - List shapes = new ArrayList(); - List images = new ArrayList(); - List morphShapes = new ArrayList(); - List sprites = new ArrayList(); - List fonts = new ArrayList(); - List texts = new ArrayList(); - List buttons = new ArrayList(); - List abcList = new ArrayList(); - getShapes(objs, shapes); - getImages(objs, images); - getMorphShapes(objs, morphShapes); - getSprites(objs, sprites); - getFonts(objs, fonts); - getTexts(objs, texts); - getButtons(objs, buttons); + java.awt.Container cnt = getContentPane(); + cnt.setLayout(new BorderLayout()); + + + detailPanel = new JPanel(); + detailPanel.setLayout(new CardLayout()); + JPanel whitePanel = new JPanel(); + whitePanel.setBackground(Color.white); + detailPanel.add(whitePanel, DETAILCARDEMPTYPANEL); + CardLayout cl2 = (CardLayout) (detailPanel.getLayout()); + cl2.show(detailPanel, DETAILCARDEMPTYPANEL); + + + abcList = new ArrayList(); getActionScript3(objs, abcList); - - getContentPane().add(tabPane, BorderLayout.CENTER); - if (!abcList.isEmpty()) { - addTab(tabPane, abcPanel = new ABCPanel(abcList), "ActionScript3", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/as16.png"))); + addTab(tabPane, abcPanel = new ABCPanel(abcList), "ActionScript3", View.getIcon("as16")); + detailPanel.add(abcPanel.tabbedPane, DETAILCARDAS3NAVIGATOR); } else { - actionPanel = new ActionPanel(swf.tags); - if (actionPanel.tagTree.getRowCount() > 1) { - addTab(tabPane, actionPanel, "ActionScript", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/as16.png"))); - } + actionPanel = new ActionPanel(); + addTab(tabPane, actionPanel, "ActionScript", View.getIcon("as16")); + menuDeobfuscation.setEnabled(false); } - if (!shapes.isEmpty()) { - addTab(tabPane, shapesTagPanel = new TagPanel(this, shapes, swf), "Shapes", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/shape16.png"))); - } - if (!morphShapes.isEmpty()) { - addTab(tabPane, morphshapesTagPanel = new TagPanel(this, morphShapes, swf), "MorphShapes", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/morphshape16.png"))); - } - if (!images.isEmpty()) { - addTab(tabPane, imagesTagPanel = new TagPanel(this, images, swf), "Images", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/image16.png"))); - } - if (!sprites.isEmpty()) { - addTab(tabPane, spritesTagPanel = new TagPanel(this, sprites, swf), "Sprites", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/sprite16.png"))); - } - if (!fonts.isEmpty()) { - addTab(tabPane, fontsTagPanel = new TagPanel(this, fonts, swf), "Fonts", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/font16.png"))); - } - if (!texts.isEmpty()) { - addTab(tabPane, textsTagPanel = new TagPanel(this, texts, swf), "Texts", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/text16.png"))); - } - if (!buttons.isEmpty()) { - addTab(tabPane, buttonsTagPanel = new TagPanel(this, buttons, swf), "Buttons", new ImageIcon(this.getClass().getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/button16.png"))); - } + tagTree = new JTree(new TagTreeModel(createTagList(objs, null), (new File(Main.file)).getName())); + tagTree.addTreeSelectionListener(this); + TreeCellRenderer tcr = new DefaultTreeCellRenderer() { + @Override + public Component getTreeCellRendererComponent( + JTree tree, + Object value, + boolean sel, + boolean expanded, + boolean leaf, + int row, + boolean hasFocus) { + + super.getTreeCellRendererComponent( + tree, value, sel, + expanded, leaf, row, + hasFocus); + Object val = value; + if (val instanceof TagNode) { + val = ((TagNode) val).tag; + } + String type = getTagType(val); + if (row == 0) { + setIcon(View.getIcon("flash16")); + } else if (type != null) { + if (type.equals("folder") && expanded) { + type = "folderopen"; + } + setIcon(View.getIcon(type + "16")); + //setToolTipText("This book is in the Tutorial series."); + } else { + //setToolTipText(null); //no tool tip + } + return this; + } + }; + + tagTree.setCellRenderer(tcr); loadingPanel.setPreferredSize(new Dimension(30, 30)); statusPanel = new JPanel(); statusPanel.setPreferredSize(new Dimension(1, 30)); @@ -375,7 +409,48 @@ public class MainFrame extends JFrame implements ActionListener { statusPanel.add(loadingPanel, BorderLayout.WEST); statusPanel.add(statusLabel, BorderLayout.CENTER); loadingPanel.setVisible(false); - add(statusPanel, BorderLayout.SOUTH); + cnt.add(statusPanel, BorderLayout.SOUTH); + + for (Tag t : swf.tags) { + if (t instanceof JPEGTablesTag) { + jtt = (JPEGTablesTag) t; + } + } + characters = new HashMap(); + List list2 = new ArrayList(); + list2.addAll(swf.tags); + parseCharacters(list2); + + //setLayout(new BorderLayout()); + try { + flashPanel = new FlashPlayerPanel(this); + } catch (FlashUnsupportedException fue) { + } + displayPanel = new JPanel(new CardLayout()); + if (flashPanel != null) { + displayPanel.add(flashPanel, CARDFLASHPANEL); + } else { + JPanel swtPanel = new JPanel(new BorderLayout()); + swtPanel.add(new JLabel("
Preview of this object is not available on this platform. (Windows only)
", JLabel.CENTER), BorderLayout.CENTER); + swtPanel.setBackground(Color.white); + displayPanel.add(swtPanel, CARDFLASHPANEL); + } + imagePanel = new ImagePanel(); + displayPanel.add(imagePanel, CARDIMAGEPANEL); + displayPanel.add(new JPanel(), CARDEMPTYPANEL); + if (actionPanel != null) { + displayPanel.add(actionPanel, CARDACTIONSCRIPTPANEL); + } + if (abcPanel != null) { + displayPanel.add(abcPanel, CARDACTIONSCRIPTPANEL); + } + CardLayout cl = (CardLayout) (displayPanel.getLayout()); + cl.show(displayPanel, CARDEMPTYPANEL); + //displayPanel.setBorder(BorderFactory.createLineBorder(Color.black)); + splitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(tagTree), detailPanel); + splitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, splitPane2, displayPanel); + cnt.add(splitPane1, BorderLayout.CENTER); + splitPane1.setDividerLocation(0.5); View.centerScreen(this); @@ -391,6 +466,19 @@ public class MainFrame extends JFrame implements ActionListener { if (actionPanel != null) { actionPanel.initSplits(); } + splitPane1.setDividerLocation(getWidth() / 3); + splitPane2.setDividerLocation(splitPane2.getHeight() * 3 / 5); + } + } + + private void parseCharacters(List list) { + for (Object t : list) { + if (t instanceof CharacterTag) { + characters.put(((CharacterTag) t).getCharacterID(), (CharacterTag) t); + } + if (t instanceof Container) { + parseCharacters(((Container) t).getSubItems()); + } } } @@ -495,79 +583,238 @@ public class MainFrame extends JFrame implements ActionListener { } } - public static List createTagList(List list) { + public static List createASTagList(List list, Object parent) { List ret = new ArrayList(); int frame = 1; List frames = new ArrayList(); - List shapes = new ArrayList(); - List morphShapes = new ArrayList(); - List sprites = new ArrayList(); - List buttons = new ArrayList(); - List images = new ArrayList(); - List fonts = new ArrayList(); - List texts = new ArrayList(); - List exportAssetsTags = new ArrayList(); for (Object t : list) { if (t instanceof ExportAssetsTag) { exportAssetsTags.add((ExportAssetsTag) t); } - if ((t instanceof DefineFontTag) - || (t instanceof DefineFont2Tag) - || (t instanceof DefineFont3Tag) - || (t instanceof DefineFont4Tag)) { - fonts.add(new TagNode(t)); - } - if ((t instanceof DefineTextTag) - || (t instanceof DefineText2Tag) - || (t instanceof DefineEditTextTag)) { - texts.add(new TagNode(t)); - } - - if ((t instanceof DefineBitsTag) - || (t instanceof DefineBitsJPEG2Tag) - || (t instanceof DefineBitsJPEG3Tag) - || (t instanceof DefineBitsJPEG4Tag) - || (t instanceof DefineBitsLosslessTag) - || (t instanceof DefineBitsLossless2Tag)) { - images.add(new TagNode(t)); - } - if ((t instanceof DefineShapeTag) - || (t instanceof DefineShape2Tag) - || (t instanceof DefineShape3Tag) - || (t instanceof DefineShape4Tag)) { - shapes.add(new TagNode(t)); - } - - if ((t instanceof DefineMorphShapeTag) || (t instanceof DefineMorphShape2Tag)) { - morphShapes.add(new TagNode(t)); - } - - if (t instanceof DefineSpriteTag) { - sprites.add(new TagNode(t)); - } - if ((t instanceof DefineButtonTag) || (t instanceof DefineButton2Tag)) { - buttons.add(new TagNode(t)); - } if (t instanceof ShowFrameTag) { - TagNode tti = new TagNode("frame" + frame); + TagNode tti = new TagNode(new FrameNode(frame, parent, false)); - /* for (int r = ret.size() - 1; r >= 0; r--) { - if (!(ret.get(r).tag instanceof DefineSpriteTag)) { - if (!(ret.get(r).tag instanceof DefineButtonTag)) { - if (!(ret.get(r).tag instanceof DefineButton2Tag)) { - if (!(ret.get(r).tag instanceof DoInitActionTag)) { - tti.subItems.add(ret.get(r)); - ret.remove(r); - } - } - } - } - }*/ + for (int r = ret.size() - 1; r >= 0; r--) { + if (!(ret.get(r).tag instanceof DefineSpriteTag)) { + if (!(ret.get(r).tag instanceof DefineButtonTag)) { + if (!(ret.get(r).tag instanceof DefineButton2Tag)) { + if (!(ret.get(r).tag instanceof DoInitActionTag)) { + tti.subItems.add(ret.get(r)); + ret.remove(r); + } + } + } + } + } frame++; frames.add(tti); - } /*if (t instanceof ASMSource) { + } else if (t instanceof ASMSource) { + TagNode tti = new TagNode(t); + ret.add(tti); + } else if (t instanceof Container) { + if (((Container) t).getItemCount() > 0) { + + TagNode tti = new TagNode(t); + List subItems = ((Container) t).getSubItems(); + + tti.subItems = createASTagList(subItems, t); + ret.add(tti); + } + } + + } + ret.addAll(frames); + for (int i = ret.size() - 1; i >= 0; i--) { + if (ret.get(i).tag instanceof DefineSpriteTag) { + ((DefineSpriteTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof DefineButtonTag) { + ((DefineButtonTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof DefineButton2Tag) { + ((DefineButton2Tag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof DoInitActionTag) { + ((DoInitActionTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof ASMSource) { + ASMSource ass = (ASMSource) ret.get(i).tag; + if (ass.containsSource()) { + continue; + } + } + if (ret.get(i).subItems.isEmpty()) { + ret.remove(i); + } + } + return ret; + } + + public List getSelectedNodes() { + List ret = new ArrayList(); + TreePath tps[] = tagTree.getSelectionPaths(); + if (tps == null) { + return ret; + } + for (TreePath tp : tps) { + TagNode te = (TagNode) tp.getLastPathComponent(); + ret.add(te); + } + return ret; + } + + public String getTagType(Object t) { + if ((t instanceof DefineFontTag) + || (t instanceof DefineFont2Tag) + || (t instanceof DefineFont3Tag) + || (t instanceof DefineFont4Tag)) { + return "font"; + } + if ((t instanceof DefineTextTag) + || (t instanceof DefineText2Tag) + || (t instanceof DefineEditTextTag)) { + return "text"; + } + + if ((t instanceof DefineBitsTag) + || (t instanceof DefineBitsJPEG2Tag) + || (t instanceof DefineBitsJPEG3Tag) + || (t instanceof DefineBitsJPEG4Tag) + || (t instanceof DefineBitsLosslessTag) + || (t instanceof DefineBitsLossless2Tag)) { + return "image"; + } + if ((t instanceof DefineShapeTag) + || (t instanceof DefineShape2Tag) + || (t instanceof DefineShape3Tag) + || (t instanceof DefineShape4Tag)) { + return "shape"; + } + + if ((t instanceof DefineMorphShapeTag) || (t instanceof DefineMorphShape2Tag)) { + return "morphshape"; + } + + if (t instanceof DefineSpriteTag) { + return "sprite"; + } + if ((t instanceof DefineButtonTag) || (t instanceof DefineButton2Tag)) { + return "button"; + } + if (t instanceof ASMSource) { + return "as"; + } + if (t instanceof TreeElement) { + TreeElement te = (TreeElement) t; + if (te.getItem() instanceof TreeLeafScript) { + return "as"; + } else { + return "package"; + } + } + if (t instanceof FrameNode) { + return "frame"; + } + if (t instanceof ShowFrameTag) { + return "showframe"; + } + return "folder"; + } + + public List getTagsWithType(List list, String type) { + List ret = new ArrayList(); + for (Object o : list) { + String ttype = getTagType(o); + if (type.equals(ttype)) { + ret.add(o); + } + } + return ret; + } + + public List getTagNodesWithType(List list, String type, Object parent, boolean display) { + List ret = new ArrayList(); + int frameCnt = 0; + for (Object o : list) { + String ttype = getTagType(o); + if ("showframe".equals(ttype) && "frame".equals(type)) { + frameCnt++; + ret.add(new TagNode(new FrameNode(frameCnt, parent, display))); + } else if (type.equals(ttype)) { + ret.add(new TagNode(o)); + } + } + return ret; + } + + public List getAllSubs(JTree tree, Object o) { + TreeModel tm = tree.getModel(); + List ret = new ArrayList(); + for (int i = 0; i < tm.getChildCount(o); i++) { + Object c = tm.getChild(o, i); + ret.add(c); + ret.addAll(getAllSubs(tree, c)); + } + return ret; + } + + public List getAllSelected(JTree tree) { + TreeSelectionModel tsm = tree.getSelectionModel(); + TreePath tps[] = tsm.getSelectionPaths(); + List ret = new ArrayList(); + if (tps == null) { + return ret; + } + + for (TreePath tp : tps) { + Object o = tp.getLastPathComponent(); + ret.add(o); + ret.addAll(getAllSubs(tree, o)); + } + return ret; + } + + public TagNode getASTagNode(JTree tree) { + TreeModel tm = tree.getModel(); + Object root = tm.getRoot(); + for (int i = 0; i < tm.getChildCount(root); i++) { + Object node = tm.getChild(root, i); + if (node instanceof TagNode) { + Object tag = ((TagNode) tm.getChild(root, i)).tag; + if (tag != null) { + if (tag.equals("scripts")) { + return (TagNode) node; + } + } + } + } + return null; + } + + public List createTagList(List list, Object parent) { + List ret = new ArrayList(); + List frames = getTagNodesWithType(list, "frame", parent, true); + List shapes = getTagNodesWithType(list, "shape", parent, true); + List morphShapes = getTagNodesWithType(list, "morphshape", parent, true); + List sprites = getTagNodesWithType(list, "sprite", parent, true); + List buttons = getTagNodesWithType(list, "button", parent, true); + List images = getTagNodesWithType(list, "image", parent, true); + List fonts = getTagNodesWithType(list, "font", parent, true); + List texts = getTagNodesWithType(list, "text", parent, true); + List actionScript = new ArrayList(); + + for (TagNode n : sprites) { + n.subItems = getTagNodesWithType(new ArrayList(((DefineSpriteTag) n.tag).subTags), "frame", n.tag, true); + } + + List exportAssetsTags = new ArrayList(); + for (Object t : list) { + if (t instanceof ExportAssetsTag) { + exportAssetsTags.add((ExportAssetsTag) t); + } + /*if (t instanceof ASMSource) { TagNode tti = new TagNode(t); ret.add(tti); } else */ @@ -575,12 +822,13 @@ public class MainFrame extends JFrame implements ActionListener { TagNode tti = new TagNode(t); if (((Container) t).getItemCount() > 0) { List subItems = ((Container) t).getSubItems(); - tti.subItems = createTagList(subItems); + tti.subItems = createTagList(subItems, parent); } //ret.add(tti); } } + actionScript = createASTagList(list, null); TagNode textsNode = new TagNode("texts"); textsNode.subItems.addAll(texts); @@ -605,37 +853,44 @@ public class MainFrame extends JFrame implements ActionListener { TagNode framesNode = new TagNode("frames"); framesNode.subItems.addAll(frames); - ret.add(shapesNode); - ret.add(morphShapesNode);; - ret.add(spritesNode); - ret.add(textsNode); - ret.add(imagesNode); - ret.add(buttonsNode); - ret.add(fontsNode); - ret.add(framesNode); - for (int i = ret.size() - 1; i >= 0; i--) { - if (ret.get(i).tag instanceof DefineSpriteTag) { - ((DefineSpriteTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof DefineButtonTag) { - ((DefineButtonTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof DefineButton2Tag) { - ((DefineButton2Tag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof DoInitActionTag) { - ((DoInitActionTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; - } - if (ret.get(i).tag instanceof ASMSource) { - ASMSource ass = (ASMSource) ret.get(i).tag; - if (ass.containsSource()) { - continue; - } - } - if (ret.get(i).subItems.isEmpty()) { - //ret.remove(i); - } + + TagNode actionScriptNode = new TagNode("scripts"); + actionScriptNode.subItems.addAll(actionScript); + + if (!shapesNode.subItems.isEmpty()) { + ret.add(shapesNode); } + if (!morphShapesNode.subItems.isEmpty()) { + ret.add(morphShapesNode); + } + if (!spritesNode.subItems.isEmpty()) { + ret.add(spritesNode); + } + if (!textsNode.subItems.isEmpty()) { + ret.add(textsNode); + } + if (!imagesNode.subItems.isEmpty()) { + ret.add(imagesNode); + } + if (!buttonsNode.subItems.isEmpty()) { + ret.add(buttonsNode); + } + if (!fontsNode.subItems.isEmpty()) { + ret.add(fontsNode); + } + if (!framesNode.subItems.isEmpty()) { + ret.add(framesNode); + } + + + if (abcPanel != null) { + actionScriptNode.subItems.clear(); + actionScriptNode.tag = abcPanel.classTree.getModel(); + } + if ((!actionScriptNode.subItems.isEmpty()) || (abcPanel != null)) { + ret.add(actionScriptNode); + } + return ret; } @@ -692,108 +947,108 @@ public class MainFrame extends JFrame implements ActionListener { } if (e.getActionCommand().startsWith("EXPORT")) { - JFileChooser chooser = new JFileChooser(); - chooser.setCurrentDirectory(new java.io.File((String) Configuration.getConfig("lastExportDir", "."))); - chooser.setDialogTitle("Select directory to export"); - chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - chooser.setAcceptAllFileFilterUsed(false); - if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { - final long timeBefore = System.currentTimeMillis(); - Main.startWork("Exporting..."); - final String selFile = chooser.getSelectedFile().getAbsolutePath(); - Configuration.setConfig("lastExportDir", chooser.getSelectedFile().getParentFile().getAbsolutePath()); - final boolean isPcode = e.getActionCommand().startsWith("EXPORTPCODE"); - final boolean onlySel = e.getActionCommand().endsWith("SEL"); - final boolean images = e.getActionCommand().startsWith("EXPORTIMAGES"); - final boolean shapes = e.getActionCommand().startsWith("EXPORTSHAPES"); - (new Thread() { - @Override - public void run() { - try { - if (onlySel) { - if (images) { - if (imagesTagPanel != null) { - List list = new ArrayList(); + ExportDialog export = new ExportDialog(); + export.setVisible(true); + if (!export.cancelled) { + JFileChooser chooser = new JFileChooser(); + chooser.setCurrentDirectory(new java.io.File((String) Configuration.getConfig("lastExportDir", "."))); + chooser.setDialogTitle("Select directory to export"); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + chooser.setAcceptAllFileFilterUsed(false); + if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { + final long timeBefore = System.currentTimeMillis(); + Main.startWork("Exporting..."); + final String selFile = chooser.getSelectedFile().getAbsolutePath(); + Configuration.setConfig("lastExportDir", chooser.getSelectedFile().getParentFile().getAbsolutePath()); + final boolean isPcode = export.actionScript.getSelectedIndex() == 1; //e.getActionCommand().startsWith("EXPORTPCODE"); + final boolean onlySel = e.getActionCommand().endsWith("SEL"); + //final boolean images = e.getActionCommand().startsWith("EXPORTIMAGES"); + //final boolean shapes = e.getActionCommand().startsWith("EXPORTSHAPES"); + (new Thread() { + @Override + public void run() { + try { + if (onlySel) { + List sel = getAllSelected(tagTree); - Object lob[] = imagesTagPanel.tagList.getSelectedValues(); - for (Object o : lob) { - if (o instanceof Tag) { - list.add((Tag) o); + List tlsList = new ArrayList(); + JPEGTablesTag jtt = null; + for (Tag t : swf.tags) { + if (t instanceof JPEGTablesTag) { + jtt = (JPEGTablesTag) t; + break; + } + } + List images = new ArrayList(); + List shapes = new ArrayList(); + List actionNodes = new ArrayList(); + for (Object d : sel) { + if (d instanceof TagNode) { + TagNode n = (TagNode) d; + if ("image".equals(getTagType(n.tag))) { + images.add((Tag) n.tag); + } + if ("shape".equals(getTagType(n.tag))) { + shapes.add((Tag) n.tag); + } + if ("as".equals(getTagType(n.tag))) { + actionNodes.add(n); } } - JPEGTablesTag jtt = null; - for (Tag t : swf.tags) { - if (t instanceof JPEGTablesTag) { - jtt = (JPEGTablesTag) t; - break; + if (d instanceof TreeElement) { + if (((TreeElement) d).isLeaf()) { + tlsList.add((TreeLeafScript) ((TreeElement) d).getItem()); } } - SWF.exportImages(selFile, list, jtt); } - } else if (shapes) { - List list = new ArrayList(); - Object lob[] = shapesTagPanel.tagList.getSelectedValues(); - for (Object o : lob) { - if (o instanceof ShapeTag) { - list.add((Tag) o); + SWF.exportImages(selFile + File.separator + "images", images, jtt); + SWF.exportShapes(selFile + File.separator + "shapes", shapes); + if (abcPanel != null) { + for (int i = 0; i < tlsList.size(); i++) { + TreeLeafScript tls = tlsList.get(i); + Main.startWork("Exporting " + (i + 1) + "/" + tlsList.size() + " " + tls.abc.script_info[tls.scriptIndex].getPath(tls.abc) + " ..."); + tls.abc.script_info[tls.scriptIndex].export(tls.abc, abcPanel.list, selFile, isPcode); + } + } else { + List allNodes = new ArrayList(); + TagNode asn = getASTagNode(tagTree); + if (asn != null) { + allNodes.add(asn); + TagNode.setExport(allNodes, false); + TagNode.setExport(actionNodes, true); + TagNode.exportNodeAS(allNodes, selFile, isPcode); } } - SWF.exportShapes(selFile, list); - } else if (abcPanel != null) { - List tlsList = abcPanel.classTree.getSelectedScripts(); - if (tlsList.isEmpty()) { - JOptionPane.showMessageDialog(null, "No script selected!"); - } - for (int i = 0; i < tlsList.size(); i++) { - TreeLeafScript tls = tlsList.get(i); - Main.startWork("Exporting " + (i + 1) + "/" + tlsList.size() + " " + tls.abc.script_info[tls.scriptIndex].getPath(tls.abc) + " ..."); - tls.abc.script_info[tls.scriptIndex].export(tls.abc, abcPanel.list, selFile, isPcode); - } - } else if (actionPanel != null) { - List nodes = actionPanel.getSelectedNodes(); - if (nodes.isEmpty()) { - JOptionPane.showMessageDialog(null, "No nodes selected!"); - } - com.jpexs.decompiler.flash.action.gui.TagTreeModel ttm = (com.jpexs.decompiler.flash.action.gui.TagTreeModel) actionPanel.tagTree.getModel(); - List allnodes = ttm.getNodeList(); - com.jpexs.decompiler.flash.action.TagNode.setExport(allnodes, false); - com.jpexs.decompiler.flash.action.TagNode.setExport(nodes, true); - com.jpexs.decompiler.flash.action.TagNode.exportNode(allnodes, selFile, isPcode); - } - } else { - if (images) { - Main.swf.exportImages(selFile); - } else if (shapes) { - Main.swf.exportShapes(selFile); } else { + Main.swf.exportImages(selFile + File.separator + "images"); + Main.swf.exportShapes(selFile + File.separator + "shapes"); Main.swf.exportActionScript(selFile, isPcode); } + } catch (Exception ignored) { + ignored.printStackTrace(); + JOptionPane.showMessageDialog(null, "Cannot write to the file"); } - } catch (Exception ignored) { - ignored.printStackTrace(); - JOptionPane.showMessageDialog(null, "Cannot write to the file"); + Main.stopWork(); + long timeAfter = System.currentTimeMillis(); + long timeMs = timeAfter - timeBefore; + long timeS = timeMs / 1000; + timeMs = timeMs % 1000; + long timeM = timeS / 60; + timeS = timeS % 60; + long timeH = timeM / 60; + timeM = timeM % 60; + String timeStr = ""; + if (timeH > 0) { + timeStr += Helper.padZeros(timeH, 2) + ":"; + } + timeStr += Helper.padZeros(timeM, 2) + ":"; + timeStr += Helper.padZeros(timeS, 2) + "." + Helper.padZeros(timeMs, 3); + setStatus("Exported in " + timeStr); } - Main.stopWork(); - long timeAfter = System.currentTimeMillis(); - long timeMs = timeAfter - timeBefore; - long timeS = timeMs / 1000; - timeMs = timeMs % 1000; - long timeM = timeS / 60; - timeS = timeS % 60; - long timeH = timeM / 60; - timeM = timeM % 60; - String timeStr = ""; - if (timeH > 0) { - timeStr += Helper.padZeros(timeH, 2) + ":"; - } - timeStr += Helper.padZeros(timeM, 2) + ":"; - timeStr += Helper.padZeros(timeS, 2) + "." + Helper.padZeros(timeMs, 3); - setStatus("Exported in " + timeStr); - } - }).start(); + }).start(); + } } - } if (e.getActionCommand().equals("CHECKUPDATES")) { @@ -802,6 +1057,20 @@ public class MainFrame extends JFrame implements ActionListener { } } + if (e.getActionCommand().equals("DONATE")) { + String donateURL = Main.projectPage + "/donate.html"; + if (java.awt.Desktop.isDesktopSupported()) { + java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); + try { + java.net.URI uri = new java.net.URI(donateURL); + desktop.browse(uri); + } catch (Exception ex) { + } + } else { + JOptionPane.showMessageDialog(null, "Please visit\r\n" + donateURL + "\r\nfor details."); + } + } + if (e.getActionCommand().startsWith("RESTORECONTROLFLOW")) { Main.startWork("Restoring control flow..."); final boolean all = e.getActionCommand().endsWith("ALL"); @@ -953,4 +1222,253 @@ public class MainFrame extends JFrame implements ActionListener { } } } + + public void showDetail(String card) { + CardLayout cl = (CardLayout) (detailPanel.getLayout()); + cl.show(detailPanel, card); + } + + public void showCard(String card) { + CardLayout cl = (CardLayout) (displayPanel.getLayout()); + cl.show(displayPanel, card); + } + private Object oldValue; + private File tempFile; + + @Override + public void valueChanged(TreeSelectionEvent e) { + Object tagObj = tagTree.getLastSelectedPathComponent(); + if (tagObj == null) { + return; + } + + if (tagObj instanceof TagNode) { + tagObj = ((TagNode) tagObj).tag; + } + if (tagObj instanceof TreeElement) { + tagObj = ((TreeElement) tagObj).getItem(); + } + + if (tagObj == oldValue) { + return; + } + oldValue = tagObj; + + if (tagObj instanceof TreeLeafScript) { + final TreeLeafScript scriptLeaf = (TreeLeafScript) tagObj; + if (!Main.isWorking()) { + Main.startWork("Decompiling..."); + (new Thread() { + @Override + public void run() { + int classIndex = -1; + for (Trait t : scriptLeaf.abc.script_info[scriptLeaf.scriptIndex].traits.traits) { + if (t instanceof TraitClass) { + classIndex = ((TraitClass) t).class_info; + break; + } + } + abcPanel.navigator.setABC(abcList, scriptLeaf.abc); + abcPanel.navigator.setClassIndex(classIndex); + abcPanel.setAbc(scriptLeaf.abc); + abcPanel.decompiledTextArea.setScript(scriptLeaf.abc.script_info[scriptLeaf.scriptIndex], scriptLeaf.abc, abcList); + abcPanel.decompiledTextArea.setClassIndex(classIndex); + abcPanel.decompiledTextArea.setNoTrait(); + abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setCode(""); + Main.stopWork(); + } + }).start(); + } + showDetail(DETAILCARDAS3NAVIGATOR); + showCard(CARDACTIONSCRIPTPANEL); + return; + } else { + showDetail(DETAILCARDEMPTYPANEL); + } + if (tagObj instanceof ASMSource) { + showCard(CARDACTIONSCRIPTPANEL); + actionPanel.setSource((ASMSource) tagObj); + } else if (tagObj instanceof DefineBitsTag) { + showCard(CARDIMAGEPANEL); + imagePanel.setImage(((DefineBitsTag) tagObj).getFullImageData(jtt)); + } else if (tagObj instanceof DefineBitsJPEG2Tag) { + showCard(CARDIMAGEPANEL); + imagePanel.setImage(((DefineBitsJPEG2Tag) tagObj).imageData); + } else if (tagObj instanceof DefineBitsJPEG3Tag) { + showCard(CARDIMAGEPANEL); + imagePanel.setImage(((DefineBitsJPEG3Tag) tagObj).imageData); + } else if (tagObj instanceof DefineBitsJPEG4Tag) { + showCard(CARDIMAGEPANEL); + imagePanel.setImage(((DefineBitsJPEG4Tag) tagObj).imageData); + } else if (tagObj instanceof DefineBitsLosslessTag) { + showCard(CARDIMAGEPANEL); + imagePanel.setImage(((DefineBitsLosslessTag) tagObj).getImage()); + } else if (tagObj instanceof DefineBitsLossless2Tag) { + showCard(CARDIMAGEPANEL); + imagePanel.setImage(((DefineBitsLossless2Tag) tagObj).getImage()); + } else if ((tagObj instanceof FrameNode && ((FrameNode) tagObj).isDisplayed()) || (((tagObj instanceof CharacterTag) || (tagObj instanceof FontTag)) && (tagObj instanceof Tag))) { + try { + + if (tempFile != null) { + tempFile.delete(); + } + tempFile = File.createTempFile("temp", ".swf"); + tempFile.deleteOnExit(); + + FileOutputStream fos = new FileOutputStream(tempFile); + SWFOutputStream sos = new SWFOutputStream(fos, 10); + sos.write("FWS".getBytes()); + sos.write(13); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + SWFOutputStream sos2 = new SWFOutputStream(baos, 10); + int width = swf.displayRect.Xmax - swf.displayRect.Xmin; + int height = swf.displayRect.Ymax - swf.displayRect.Ymin; + sos2.writeRECT(swf.displayRect); + sos2.writeUI8(0); + sos2.writeUI8(swf.frameRate); + sos2.writeUI16(100); //framecnt + sos2.writeTag(new SetBackgroundColorTag(new RGB(255, 255, 255))); + + if (tagObj instanceof FrameNode) { + FrameNode fn = (FrameNode) tagObj; + Object parent = fn.getParent(); + List subs = new ArrayList(); + if (parent == null) { + subs.addAll(swf.tags); + } else { + if (parent instanceof Container) { + subs = ((Container) parent).getSubItems(); + } + } + List doneCharacters = new ArrayList(); + int frameCnt = 1; + for (Object o : subs) { + if (o instanceof ShowFrameTag) { + frameCnt++; + continue; + } + if (frameCnt > fn.getFrame()) { + break; + } + Tag t = (Tag) o; + if (frameCnt == fn.getFrame()) { + Set needed = t.getNeededCharacters(); + for (int n : needed) { + if (!doneCharacters.contains(n)) { + sos2.writeTag(characters.get(n)); + doneCharacters.add(n); + } + } + if (t instanceof CharacterTag) { + doneCharacters.add(((CharacterTag) t).getCharacterID()); + } + } + sos2.writeTag(t); + } + sos2.writeTag(new ShowFrameTag()); + } else { + + if (tagObj instanceof DefineBitsTag) { + if (jtt != null) { + sos2.writeTag(jtt); + } + } else if (tagObj instanceof AloneTag) { + } else { + Set needed = ((Tag) tagObj).getNeededCharacters(); + for (int n : needed) { + sos2.writeTag(characters.get(n)); + } + } + + sos2.writeTag(((Tag) tagObj)); + + int chtId = 0; + if (tagObj instanceof CharacterTag) { + chtId = ((CharacterTag) tagObj).getCharacterID(); + } + + MATRIX mat = new MATRIX(); + mat.hasRotate = false; + mat.hasScale = false; + mat.translateX = 0; + mat.translateY = 0; + if (tagObj instanceof BoundedTag) { + RECT r = ((BoundedTag) tagObj).getRect(characters); + mat.translateX = -r.Xmin; + mat.translateY = -r.Ymin; + mat.translateX = mat.translateX + width / 2 - r.getWidth() / 2; + mat.translateY = mat.translateY + height / 2 - r.getHeight() / 2; + } else { + mat.translateX = width / 4; + mat.translateY = height / 4; + } + if (tagObj instanceof FontTag) { + + int countGlyphs = ((FontTag) tagObj).getGlyphShapeTable().length; + int fontId = ((FontTag) tagObj).getFontId(); + int sloupcu = (int) Math.ceil(Math.sqrt(countGlyphs)); + int radku = (int) Math.ceil(((float) countGlyphs) / ((float) sloupcu)); + int x = 0; + int y = 1; + for (int f = 0; f < countGlyphs; f++) { + if (x >= sloupcu) { + x = 0; + y++; + } + List rec = new ArrayList(); + TEXTRECORD tr = new TEXTRECORD(); + int textHeight = height / radku; + tr.fontId = fontId; + tr.styleFlagsHasFont = true; + tr.textHeight = textHeight; + tr.glyphEntries = new GLYPHENTRY[1]; + tr.styleFlagsHasColor = true; + tr.textColor = new RGB(0, 0, 0); + tr.glyphEntries[0] = new GLYPHENTRY(); + tr.glyphEntries[0].glyphAdvance = 0; + tr.glyphEntries[0].glyphIndex = f; + rec.add(tr); + mat.translateX = x * width / sloupcu; + mat.translateY = y * height / radku; + sos2.writeTag(new DefineTextTag(999 + f, new RECT(0, width, 0, height), new MATRIX(), SWFOutputStream.getNeededBitsU(countGlyphs - 1), SWFOutputStream.getNeededBitsU(0), rec)); + sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1 + f, 999 + f, mat, null, 0, null, 0, null)); + x++; + } + sos2.writeTag(new ShowFrameTag()); + } else if ((tagObj instanceof DefineMorphShapeTag) || (tagObj instanceof DefineMorphShape2Tag)) { + sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); + sos2.writeTag(new ShowFrameTag()); + int numFrames = 100; + for (int ratio = 0; ratio < 65536; ratio += 65536 / numFrames) { + sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, false, true, 1, chtId, mat, null, ratio, null, 0, null)); + sos2.writeTag(new ShowFrameTag()); + } + } else { + sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); + sos2.writeTag(new ShowFrameTag()); + } + }//not showframe + + sos2.writeTag(new EndTag()); + byte data[] = baos.toByteArray(); + + sos.writeUI32(sos.getPos() + data.length + 4); + sos.write(data); + fos.close(); + showCard(CARDFLASHPANEL); + if (flashPanel != null) { + if (flashPanel instanceof FlashPlayerPanel) { + flashPanel.displaySWF(tempFile.getAbsolutePath()); + } + } + + } catch (Exception ex) { + Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); + } + + } else { + showCard(CARDEMPTYPANEL); + } + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/ModeFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/ModeFrame.java index 2bc0749a9..ea94a01ff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/ModeFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/ModeFrame.java @@ -23,7 +23,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; @@ -46,18 +45,18 @@ public class ModeFrame extends JFrame implements ActionListener { setSize(350, 200); openButton.addActionListener(this); openButton.setActionCommand("OPEN"); - openButton.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/open24.png"))); + openButton.setIcon(View.getIcon("open24")); proxyButton.addActionListener(this); proxyButton.setActionCommand("PROXY"); - proxyButton.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/proxy24.png"))); + proxyButton.setIcon(View.getIcon("proxy24")); exitButton.addActionListener(this); exitButton.setActionCommand("EXIT"); - exitButton.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/exit24.png"))); + exitButton.setIcon(View.getIcon("exit24")); setResizable(false); Container cont = getContentPane(); cont.setLayout(new GridLayout(4, 1)); JLabel logoLabel = new JLabel(); - logoLabel.setIcon(new ImageIcon(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/logo.png"))); + logoLabel.setIcon(View.getIcon("logo")); cont.add(logoLabel); cont.add(openButton); cont.add(proxyButton); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/TagNode.java b/trunk/src/com/jpexs/decompiler/flash/gui/TagNode.java index f5c44a6d2..3ba80e11d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/TagNode.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/TagNode.java @@ -16,6 +16,10 @@ */ package com.jpexs.decompiler.flash.gui; +import com.jpexs.decompiler.flash.EventListener; +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.helpers.Highlighting; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG4Tag; @@ -41,8 +45,11 @@ import com.jpexs.decompiler.flash.tags.DefineTextTag; import com.jpexs.decompiler.flash.tags.DoInitActionTag; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.ShowFrameTag; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.Container; +import java.io.File; +import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; @@ -50,6 +57,16 @@ public class TagNode { public List subItems; public Object tag; + public boolean export = false; + + public List getAllSubs() { + List ret = new ArrayList(); + ret.addAll(subItems); + for (TagNode n : subItems) { + ret.addAll(n.getAllSubs()); + } + return ret; + } public TagNode(Object tag) { this.tag = tag; @@ -204,4 +221,66 @@ public class TagNode { } return ret; } + + public static void setExport(List nodeList, boolean export) { + for (TagNode node : nodeList) { + node.export = export; + setExport(node.subItems, export); + } + } + + public static boolean exportNodeAS(List nodeList, String outdir, boolean isPcode) { + return exportNodeAS(nodeList, outdir, isPcode, null); + } + + public static boolean exportNodeAS(List nodeList, String outdir, boolean isPcode, EventListener ev) { + File dir = new File(outdir); + List existingNames = new ArrayList(); + for (TagNode node : nodeList) { + String name = ""; + if (node.tag instanceof Tag) { + name = ((Tag) node.tag).getExportName(); + } else { + name = node.tag.toString(); + } + int i = 1; + String baseName = name; + while (existingNames.contains(name)) { + i++; + name = baseName + "_" + i; + } + existingNames.add(name); + if (node.subItems.isEmpty()) { + if ((node.tag instanceof ASMSource) && (node.export)) { + if (!dir.exists()) { + dir.mkdirs(); + } + try { + String f = outdir + File.separatorChar + name + ".as"; + if (ev != null) { + ev.handleEvent("export", "Exporting " + f + " ..."); + } + String ret; + if (isPcode) { + ret = Highlighting.stripHilights(((ASMSource) node.tag).getASMSource(SWF.DEFAULT_VERSION)); + } else { + List as = ((ASMSource) node.tag).getActions(SWF.DEFAULT_VERSION); + Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION); + ret = (Highlighting.stripHilights(Action.actionsToSource(as, SWF.DEFAULT_VERSION))); + } + + + FileOutputStream fos = new FileOutputStream(f); + fos.write(ret.getBytes()); + fos.close(); + } catch (Exception ex) { + } + } + } else { + exportNodeAS(node.subItems, outdir + File.separatorChar + name, isPcode, ev); + } + + } + return true; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/TagPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/TagPanel.java deleted file mode 100644 index 9143f6374..000000000 --- a/trunk/src/com/jpexs/decompiler/flash/gui/TagPanel.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (C) 2010-2013 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.SWF; -import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; -import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag; -import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag; -import com.jpexs.decompiler.flash.tags.DefineBitsJPEG4Tag; -import com.jpexs.decompiler.flash.tags.DefineBitsLossless2Tag; -import com.jpexs.decompiler.flash.tags.DefineBitsLosslessTag; -import com.jpexs.decompiler.flash.tags.DefineBitsTag; -import com.jpexs.decompiler.flash.tags.DefineMorphShape2Tag; -import com.jpexs.decompiler.flash.tags.DefineMorphShapeTag; -import com.jpexs.decompiler.flash.tags.DefineTextTag; -import com.jpexs.decompiler.flash.tags.EndTag; -import com.jpexs.decompiler.flash.tags.JPEGTablesTag; -import com.jpexs.decompiler.flash.tags.PlaceObject2Tag; -import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag; -import com.jpexs.decompiler.flash.tags.ShowFrameTag; -import com.jpexs.decompiler.flash.tags.Tag; -import com.jpexs.decompiler.flash.tags.base.AloneTag; -import com.jpexs.decompiler.flash.tags.base.BoundedTag; -import com.jpexs.decompiler.flash.tags.base.CharacterTag; -import com.jpexs.decompiler.flash.tags.base.Container; -import com.jpexs.decompiler.flash.tags.base.FontTag; -import com.jpexs.decompiler.flash.types.GLYPHENTRY; -import com.jpexs.decompiler.flash.types.MATRIX; -import com.jpexs.decompiler.flash.types.RECT; -import com.jpexs.decompiler.flash.types.RGB; -import com.jpexs.decompiler.flash.types.TEXTRECORD; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Color; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.BorderFactory; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -/** - * - * @author JPEXS - */ -public class TagPanel extends JPanel implements ListSelectionListener { - - public JList tagList; - public FlashPlayerPanel flashPanel; - public JPanel displayPanel; - public ImagePanel imagePanel; - private SWF swf; - final static String CARDFLASHPANEL = "Flash card"; - final static String CARDIMAGEPANEL = "Image card"; - final static String CARDEMPTYPANEL = "Empty card"; - private JPEGTablesTag jtt; - private HashMap characters; - - static { - try { - File.createTempFile("temp", ".swf").delete(); //First call to this is slow, so make it first - } catch (IOException ex) { - Logger.getLogger(TagPanel.class.getName()).log(Level.SEVERE, null, ex); - } - } - - private void parseCharacters(List list) { - for (Object t : list) { - if (t instanceof CharacterTag) { - characters.put(((CharacterTag) t).getCharacterID(), (CharacterTag) t); - } - if (t instanceof Container) { - parseCharacters(((Container) t).getSubItems()); - } - } - } - private JFrame frame; - - public TagPanel(JFrame frame, List list, SWF swf) { - this.frame = frame; - this.swf = swf; - for (Tag t : swf.tags) { - if (t instanceof JPEGTablesTag) { - jtt = (JPEGTablesTag) t; - } - } - characters = new HashMap(); - List list2 = new ArrayList(); - list2.addAll(swf.tags); - parseCharacters(list2); - tagList = new JList(list.toArray(new Tag[list.size()])); - tagList.addListSelectionListener(this); - - setLayout(new BorderLayout()); - try { - flashPanel = new FlashPlayerPanel(frame); - } catch (FlashUnsupportedException fue) { - } - displayPanel = new JPanel(new CardLayout()); - if (flashPanel != null) { - displayPanel.add(flashPanel, CARDFLASHPANEL); - } else { - JPanel swtPanel = new JPanel(new BorderLayout()); - swtPanel.add(new JLabel("
Preview of this object is not available on this platform. (Windows only)
", JLabel.CENTER), BorderLayout.CENTER); - swtPanel.setBackground(Color.white); - displayPanel.add(swtPanel, CARDFLASHPANEL); - } - imagePanel = new ImagePanel(); - displayPanel.add(imagePanel, CARDIMAGEPANEL); - displayPanel.add(new JPanel(), CARDEMPTYPANEL); - CardLayout cl = (CardLayout) (displayPanel.getLayout()); - cl.show(displayPanel, CARDEMPTYPANEL); - tagList.setBorder(BorderFactory.createLoweredBevelBorder()); - displayPanel.setBorder(BorderFactory.createLineBorder(Color.black)); - add(new JScrollPane(tagList), BorderLayout.WEST); - add(displayPanel, BorderLayout.CENTER); - } - private File tempFile; - - public void showCard(String card) { - CardLayout cl = (CardLayout) (displayPanel.getLayout()); - cl.show(displayPanel, card); - } - private Object oldValue; - - @Override - public void valueChanged(ListSelectionEvent e) { - Tag tagObj = (Tag) tagList.getSelectedValue(); - if (tagObj == oldValue) { - return; - } - oldValue = tagObj; - if (tagObj instanceof DefineBitsTag) { - showCard(CARDIMAGEPANEL); - imagePanel.setImage(((DefineBitsTag) tagObj).getFullImageData(jtt)); - } else if (tagObj instanceof DefineBitsJPEG2Tag) { - showCard(CARDIMAGEPANEL); - imagePanel.setImage(((DefineBitsJPEG2Tag) tagObj).imageData); - } else if (tagObj instanceof DefineBitsJPEG3Tag) { - showCard(CARDIMAGEPANEL); - imagePanel.setImage(((DefineBitsJPEG3Tag) tagObj).imageData); - } else if (tagObj instanceof DefineBitsJPEG4Tag) { - showCard(CARDIMAGEPANEL); - imagePanel.setImage(((DefineBitsJPEG4Tag) tagObj).imageData); - } else if (tagObj instanceof DefineBitsLosslessTag) { - showCard(CARDIMAGEPANEL); - imagePanel.setImage(((DefineBitsLosslessTag) tagObj).getImage()); - } else if (tagObj instanceof DefineBitsLossless2Tag) { - showCard(CARDIMAGEPANEL); - imagePanel.setImage(((DefineBitsLossless2Tag) tagObj).getImage()); - } else if (((tagObj instanceof CharacterTag) || (tagObj instanceof FontTag)) && (tagObj instanceof Tag)) { - try { - - if (tempFile != null) { - tempFile.delete(); - } - tempFile = File.createTempFile("temp", ".swf"); - tempFile.deleteOnExit(); - - FileOutputStream fos = new FileOutputStream(tempFile); - SWFOutputStream sos = new SWFOutputStream(fos, 10); - sos.write("FWS".getBytes()); - sos.write(13); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos2 = new SWFOutputStream(baos, 10); - int width = swf.displayRect.Xmax - swf.displayRect.Xmin; - int height = swf.displayRect.Ymax - swf.displayRect.Ymin; - sos2.writeRECT(swf.displayRect); - sos2.writeUI8(0); - sos2.writeUI8(swf.frameRate); - sos2.writeUI16(100); //framecnt - sos2.writeTag(new SetBackgroundColorTag(new RGB(255, 255, 255))); - if (tagObj instanceof DefineBitsTag) { - if (jtt != null) { - sos2.writeTag(jtt); - } - } else if (tagObj instanceof AloneTag) { - } else { - Set needed = tagObj.getNeededCharacters(); - for (int n : needed) { - sos2.writeTag(characters.get(n)); - } - } - - sos2.writeTag(tagObj); - - int chtId = 0; - if (tagObj instanceof CharacterTag) { - chtId = ((CharacterTag) tagObj).getCharacterID(); - } - - MATRIX mat = new MATRIX(); - mat.hasRotate = false; - mat.hasScale = false; - mat.translateX = 0; - mat.translateY = 0; - if (tagObj instanceof BoundedTag) { - RECT r = ((BoundedTag) tagObj).getRect(characters); - mat.translateX = -r.Xmin; - mat.translateY = -r.Ymin; - mat.translateX = mat.translateX + width / 2 - r.getWidth() / 2; - mat.translateY = mat.translateY + height / 2 - r.getHeight() / 2; - } else { - mat.translateX = width / 4; - mat.translateY = height / 4; - } - if (tagObj instanceof FontTag) { - - int countGlyphs = ((FontTag) tagObj).getGlyphShapeTable().length; - int fontId = ((FontTag) tagObj).getFontId(); - int sloupcu = (int) Math.ceil(Math.sqrt(countGlyphs)); - int radku = (int) Math.ceil(((float) countGlyphs) / ((float) sloupcu)); - int x = 0; - int y = 1; - for (int f = 0; f < countGlyphs; f++) { - if (x >= sloupcu) { - x = 0; - y++; - } - List rec = new ArrayList(); - TEXTRECORD tr = new TEXTRECORD(); - int textHeight = height / radku; - tr.fontId = fontId; - tr.styleFlagsHasFont = true; - tr.textHeight = textHeight; - tr.glyphEntries = new GLYPHENTRY[1]; - tr.styleFlagsHasColor = true; - tr.textColor = new RGB(0, 0, 0); - tr.glyphEntries[0] = new GLYPHENTRY(); - tr.glyphEntries[0].glyphAdvance = 0; - tr.glyphEntries[0].glyphIndex = f; - rec.add(tr); - mat.translateX = x * width / sloupcu; - mat.translateY = y * height / radku; - sos2.writeTag(new DefineTextTag(999 + f, new RECT(0, width, 0, height), new MATRIX(), SWFOutputStream.getNeededBitsU(countGlyphs - 1), SWFOutputStream.getNeededBitsU(0), rec)); - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1 + f, 999 + f, mat, null, 0, null, 0, null)); - x++; - } - sos2.writeTag(new ShowFrameTag()); - } else if ((tagObj instanceof DefineMorphShapeTag) || (tagObj instanceof DefineMorphShape2Tag)) { - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); - sos2.writeTag(new ShowFrameTag()); - int numFrames = 100; - for (int ratio = 0; ratio < 65536; ratio += 65536 / numFrames) { - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, false, true, 1, chtId, mat, null, ratio, null, 0, null)); - sos2.writeTag(new ShowFrameTag()); - } - } else { - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); - sos2.writeTag(new ShowFrameTag()); - } - - sos2.writeTag(new EndTag()); - byte data[] = baos.toByteArray(); - - sos.writeUI32(sos.getPos() + data.length + 4); - sos.write(data); - fos.close(); - showCard(CARDFLASHPANEL); - if (flashPanel != null) { - if (flashPanel instanceof FlashPlayerPanel) { - flashPanel.displaySWF(tempFile.getAbsolutePath()); - } - } - - } catch (Exception ex) { - Logger.getLogger(TagPanel.class.getName()).log(Level.SEVERE, null, ex); - } - - } - } -} diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/TagTreeModel.java b/trunk/src/com/jpexs/decompiler/flash/gui/TagTreeModel.java index 5bae9c716..3f2b95513 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/TagTreeModel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/TagTreeModel.java @@ -16,7 +16,8 @@ */ package com.jpexs.decompiler.flash.gui; -import com.jpexs.decompiler.flash.tags.*; +import com.jpexs.decompiler.flash.abc.gui.ClassesListTreeModel; +import com.jpexs.decompiler.flash.abc.gui.TreeElement; import java.util.ArrayList; import java.util.List; import javax.swing.event.TreeModelListener; @@ -28,10 +29,13 @@ public class TagTreeModel implements TreeModel { private String root = ""; private List list = new ArrayList(); - public TagTreeModel(List list) { - List list2 = new ArrayList(); - list2.addAll(list); - this.list = TagNode.createTagList(list2); + public TagTreeModel(List list, String rootName) { + this.root = rootName; + this.list = list; + } + + public List getNodeList() { + return list; } public Object getRoot() { @@ -39,6 +43,14 @@ public class TagTreeModel implements TreeModel { } public Object getChild(Object parent, int index) { + if (parent instanceof TagNode) { + if (((TagNode) parent).tag instanceof ClassesListTreeModel) { + ClassesListTreeModel clt = (ClassesListTreeModel) ((TagNode) parent).tag; + return clt.getChild(clt.getRoot(), index); + } + } else if (parent instanceof TreeElement) { + return ((TreeElement) parent).getChild(index); + } if (parent == root) { return list.get(index); } else { @@ -50,7 +62,17 @@ public class TagTreeModel implements TreeModel { if (parent == root) { return list.size(); } else { - return ((TagNode) parent).subItems.size(); + if (parent instanceof TagNode) { + if (((TagNode) parent).tag instanceof ClassesListTreeModel) { + ClassesListTreeModel clt = (ClassesListTreeModel) ((TagNode) parent).tag; + return clt.getChildCount(clt.getRoot()); + } + return ((TagNode) parent).subItems.size(); + } else if (parent instanceof TreeElement) { + return ((TreeElement) parent).getChildCount(); + } + return 0; + } } @@ -62,6 +84,12 @@ public class TagTreeModel implements TreeModel { } public int getIndexOfChild(Object parent, Object child) { + if (parent instanceof TagNode) { + if (((TagNode) parent).tag instanceof ClassesListTreeModel) { + ClassesListTreeModel clt = (ClassesListTreeModel) ((TagNode) parent).tag; + return clt.getIndexOfChild(clt.getRoot(), child); + } + } if (parent == root) { for (int t = 0; t < list.size(); t++) { if (list.get(t) == child) { @@ -70,12 +98,18 @@ public class TagTreeModel implements TreeModel { } return -1; } else { - List subTags = ((TagNode) parent).subItems; - for (int t = 0; t < subTags.size(); t++) { - if (subTags.get(t) == child) { - return t; + if (parent instanceof TagNode) { + List subTags = ((TagNode) parent).subItems; + for (int t = 0; t < subTags.size(); t++) { + if (subTags.get(t) == child) { + return t; + } } } + if (parent instanceof TreeElement) { + return ((TreeElement) parent).getIndexOfChild((TreeElement) child); + } + return -1; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/View.java b/trunk/src/com/jpexs/decompiler/flash/gui/View.java index 888f3058e..d9d7fb4e0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/View.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/View.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.gui; import java.awt.*; import java.util.ArrayList; +import javax.swing.ImageIcon; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.UIManager; @@ -52,12 +53,11 @@ public class View { /** * Loads image from resources * - * @param path Path to image without starting slash + * @param name Name of the image * @return loaded Image */ - public static Image loadImage(String path) { - ClassLoader cldr = (new Object()).getClass().getClassLoader(); - java.net.URL imageURL = (new Object()).getClass().getResource("/" + path); + public static Image loadImage(String name) { + java.net.URL imageURL = View.class.getResource("/com/jpexs/decompiler/flash/gui/graphics/" + name + ".png"); return Toolkit.getDefaultToolkit().createImage(imageURL); } @@ -68,9 +68,9 @@ public class View { */ public static void setWindowIcon(Window f) { java.util.List images = new ArrayList(); - images.add(loadImage("com/jpexs/decompiler/flash/gui/graphics/icon16.png")); - images.add(loadImage("com/jpexs/decompiler/flash/gui/graphics/icon32.png")); - images.add(loadImage("com/jpexs/decompiler/flash/gui/graphics/icon48.png")); + images.add(loadImage("icon16")); + images.add(loadImage("icon32")); + images.add(loadImage("icon48")); f.setIconImages(images); } @@ -85,4 +85,8 @@ public class View { f.setLocation((dim.width - abounds.width) / 2, (dim.height - abounds.height) / 2); } + + public static ImageIcon getIcon(String name) { + return new ImageIcon(View.class.getClassLoader().getResource("com/jpexs/decompiler/flash/gui/graphics/" + name + ".png")); + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/about16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/about16.png new file mode 100644 index 0000000000000000000000000000000000000000..12cd1aef900803abba99b26920337ec01ad5c267 GIT binary patch literal 778 zcmV+l1NHogP)BVme|mWaqy4$_pJm?y9KM{-*hp?1+Ey3e-CEDooTa!B;e(Q>TSF?bj>5At13y1p zriN3w3x~5SfZj{@J4M{kp{?=M_Lh2bV+5LH)Q)5W!-ePA$RgE1@5f1cyHki0Y}JyVEYZF(LD$xXlt$7A5CgE@ zpV-&l%vf;=5kZ2-2gi@Y6J&=cuwt>!vJ^#(&n|LcZyUzi6Duj$$hJ1s*HD-#;k-w@ zpdrwAuoDG_N2bvb07G$Zk*?Hc)JLtW4yqOnic_$zO7NZ#l>Fm){;fE?b$IbOaX2fe z0la4g0Dfw2xk7Wi7NapVD8YMPCZu?A1QCK*67dgsvRKBLFtrM>?$%&_lD1882mzdO zWPdw5KWw6IT`m1b_8=lS5jt8D3=RDa=&jWzR-)S@56WMslZ~mKu1)-wpXB>rNBQ>N zU#K`#1B&v|_AQK;7I~B}OdGiUT9LX>f0xm6<;LeP!=vFjPsUQF*wCJ*dO)4YBypgdiuF!=i@6Zyi7F|q#K zz?tlSZULa@t1D?$e;f@b36&N!V2mjOHw|*1sf1lt6VC4Xl@O+f$vugEtAis=9V02y>eSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM00HeuL_t(I%Z-ygPuoxwhABgrjxZ9XTc?&G2&rqtUqGZFgg^?Z zm_GxbD1VhokY%~8B{maJ@F*OK&VH9LwOeGt#DRjj0~v~8`>iO7!Ybi;zE$va z`A^T#yW`y44;k^#O~K5*jD=qcUhPScvUVIHxZ*BE?`;? zlMue($?KEY@H%JDd?{jL?E;+Ktbi(+`ow|ON7f41{jK`LrSs4-gYZPQ=lSAcF22EG zJeg;~$&VafW&|Ww3y^gOwOWlq$!!Aq3lDqyqw!Q8!*9-6@WuNA66pf|8aK&7+63M~ zx{Z4}J34Zg;Oee>(1A-|a4i{d2V_y;KFRLhGP}J2L5L*xxXvDQ^+W#v2hGZuyrMtm P00000NkvXXu0mjfMzCV_|S*E^l&Yo9;Xs0005JNklZ=5?vJkN_SbzAVR!|VEyhSW5LKJdF zOkC$(l@QHlVIK_4n|bdu-+A-qg^2KM&1Ulz0630gJkK*h5ZLi}BmfKmtJmwyiG6tn zv|6oSk|b4PvDiN%0%HvK`yE6C$KUOCAC*ew2LQMmM1*#`{o6FnkLh$ux7&?u+a}Ah z=z6`<<#Hj@G=J%QKGR?@`0L~d&dHrl=Z~T&Z?{Jh58d@BeIx*LGB<3Gak+i z2?h$Xq&xaLGB9lH=l+w(3gjnwx;TbZ+)7T6s5tQBk$oMj4iAq~#gh9CA`KdBZRdHW zOO{AhNcI^=yctRi3^gL6EKK@mUI49Q@O1TaS?83{1OTZhJWc=r delta 379 zcmV->0fhe30gD5W8Gi-<001BJ|6u?C00eVFNmK|32nc)#WQYI&010qNS#tmY4c7nw z4c7reD4Tcy000?uMObuGZ)S9NVRB^vcXxL#X>MzCV_|S*E^l&Yo9;Xs00039NklfF7Fl~(=>hZ zJkJ_y?79vqrQvTjn?WfhEr4MdI2;b6lax}dRx86V%km4rnA$WAS(ahjHbD>oP*oNC z{hsA=X@Cqso^#m%6U0>l!H~j^hx=F}vOFZ-DuH z&iQ=ics#OLEbx7w*=)viI^}x38UO*jg<-gE+t#f9qM|4!r_<>}0MEe7E#V*f6#xI3 Zz5xw5T#NClz5D2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4(Hn@Kjn`Gv6Zo$+}#>l%zHySE< zZ{K|8_W3s)o?B-6X@A#exZ7nkbIm@hNh#m!rg*VM%@=HIw$lIpJ6gl2Z;{6H(-C(a zR%(lNC(1r3vN(`>(=B^1TLGg~T7qZ1%d>Mk>lT_a2?#LkEr0v}{*T{s2B-aAmUT~& z+4!Yl^E8#-=aqjrW=x8D_g%6<^< zlgUq0Q544c8(ae&UR$8ps&snq6^bPY3v3xAmMW74Di$h~GCH6E3TaYs2#6A<7K*gC z777H71_Wa;(dfp+g-drPCSWu)#PInZi72LJ;o?i~$-U=y&UbQ89Dul3%3P+Axkzc* zbH-y;QF=hR{qLItf%ci2_&e5wNo0gnVatG?ul6Zw=o$I9Ljfn*ic3`U?>IfEim3g{ zujU&$-hy6wn;w(xme|zJm;lWJxtTFfM)q0`kX!Vu0+d${$}LCddK1<^htTe-fUYL3 zB`SdNsZD>RgvLj1<^@h6_+cDRK2Brcr2~>%$*5S)hyV33PV^teac3%|4lz@8p4?)5 z?t5o^?q+%^%)Yygo~I^U4VR!bTnWuE35hcWrfCDR3q+sxJ79e7Fg`&)RCqLA^2^y^ z0laVfadW90_Fz8Brm|r47sB^u1VgI>kanj)Z4`zMSfHlm8>CwXa$JVM`$2RrmZB-3 zN10m-!;BvH*Br3V8t`DH7m`jf#2upVDXl{5ff18_pzCPK1Zu$$CKKvd8FGeFf)+K<|x33pc7P&S#3GZT4mEw;nr(Ze*F z3&*?-4U-lm*#tber5 z%S_ceqB`b3ko6r~BbvDwdohTvP(3a(pq{x#T$yQsu#OKwEe}KuH^Mh@nxg_(Nw136 zq#a^3xNBke)In+!?qk3%4wB69{pF`Tzg`07*qoM6N<$ Eg55P&8UO$Q literal 0 HcmV?d00001 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/donate16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/donate16.png new file mode 100644 index 0000000000000000000000000000000000000000..d9ee53e590a68a95a9fa9483f0ebd14f3f25bb72 GIT binary patch literal 749 zcmV{UrO36YoGex>*KgTU04Sb0lNGJEiq?mmQbVHD$?08PR{#RY@(Jtf90i82`&dI!dW7jO<!P=IT3`*tHLxxjwl=}>+*)uJ zQXzyPPN^^yrLNn-L6|)gDrKnEAdbPP1a+KXt(F*+N-)2L{Eb_PQs+ab)QQT6Pw(ST zBha=K(orHRSCfHi4O9%(3e<(Lb`^!uF>+VB$3*L{zr`0-_;)Y*n?E-k7dr!rf-5ve?cY>d<{Q2T>(phfG`V$89Qfr0$5PaI$GcI;T;lseVaJa_ff4eP;K@^|hsa{cCz zXuY%j{{3s?^}(OQ^lJ0wCa2U<(RxpI&Wzye%Qu%q>x1omeM7&Az4w3Z$LrQ@df3^y f|6iKmf8+cE7K65BSFA1B00000NkvXXu0mjfxAtvo literal 0 HcmV?d00001 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/exit16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/exit16.png index dfd42e6f3ff1a3dc397804aa3bfcf8fad8ddee70..2541d2bcbc218b194f79fd99f67d33de1873c6c4 100644 GIT binary patch delta 663 zcmV;I0%-mH1F!{eSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM00KfuL_t(I%axP6Yt%s$g}?djX0u5QnBbd4qK0T7K~O6#w9`Mq zP86{e6hQ==l!BHPk%)-3SXl@bu@Vu)S2R8ojD;xC4UuGL?tfz}R^lGi;?H?ZA~`!EO0gP{$xPPot(gCe znc-&CYoC#&1%F%;+3oKa++V)SLaGrun`QvjgqvWRa7{oUyOUDA37GDE%9f3r>9Muk z`Z$59p<W>iYj7vxikNWw_8sK+%_fno zbvCa5%KNOO6e%CReDLPLmVwdHp%H5J8cVW-n2=oPDu1s*)euRTDwZPMT|ekuJ5O6_ znMJ8n+&lN+*qe`Uryf0fOc6@7m#S3D9aKvlL`$d`B6VCNCXw3r60@`Gh^eg^;^f7L zBL~m#&&%~?RFw}OW-xV34L2vHh^ycdF%jlt8Qc*`%@DVL-N{UNOOZ>Q+k2s<3;OC> zBLfvoBYz>3ad%Wxvj?im@!?Zs%Pk!UA&?|C%o1@)jUMC%pu8GT6a^=CpK9qq2mz7C z3Y|UuxC$DVAb-J33FG7Ad3t)9xw*NP{;$@f+h^(O?xwxkMWxzFTcw@FpEW+cdGam% x%XgkQxpjk??l6;KGaYibzM@MzCV_|S*E^l&Yo9;Xs0004cNklf^t>q}U~Bm^JvD9??fg*4B7*x4}&!6KGoPYI~8Iu|b$OhYin^8P+J>2^&+ zP>D5jv8S{!OU%O=qbnX?;wSE9nKaLxbi1X6364W>>09@+o-rx`V~$Qy#ltMqjGm_< zfC-ur@;L;jv8MzK**)ONbJ`27miKXBl_>K#1QRT@TF!C6;gDT!VUcccmCM8|pXq<% Y7ofzdU5#DY{xaiib^#X=YT4@yE_&2#eBulEdzjE`u&@G%2(&u{J-<}d(^uY4W_kMfEX z@!X)AR9F&FL?RJyJRUzvBoeqN{5kY`z3wcM0+du73~_0|*lac! z42Dw(Eg1o{Ash}P8jXrqN+1w`*XxDD;ShmPCZC7#4;wWbHoMvBl$=zF-`?*9j*Nbjd=v@OWt_BgKxP-3wd zy37?ATx&$b+&zRM!K;BD%Okw`Sb@&Pak8$KRX19jWZmC0&n*Ggv%j8nvSPDFw zEkV65AGOoBQ8kf`R|}Px*&INNS%osq9b{Fq2I(x6@xM>tg=vRLF?I`0rWzr2le8`i+HPlfb=NXi$c+ZzYZP*4?P(yq75D@R;k30Y*%ZgH3Yc-^(XFCRc_=j*MH+-Q{ym#M59r}<8l9XUqgUVqAYH`IFFmpPk9mj z<^}pM0F`3c7A8|uxb}DsCe!^BK=9Ws+NfOgn#5o_3~yH%vbzppDkGw+Yq+pf#De&U z-x~s4KDgWWfa~u}oSB}7?K-d>8xCB^za$);Jb^!E4>w+&!^(_2x&)n>Jh-lWK~332 z^~VM}Jq2~OikaLTikV|Lemk`jKnJrK_D6Nw7 zJ?Jq5%WoFF9+*6vLh3MP3um!be~oo{9SgH}aU@%UKz|u^Ihcn)Pp)qIUSHy35~1)I zK7Id;2bWf$eKYtzA7@FD_&5gxvYqB%p2T0v!kyF4kR8wQ(az;^_y?Wc7>2+&(VzeT N002ovPDHLkV1hNN9Mk{+ literal 0 HcmV?d00001 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/flash16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/flash16.png new file mode 100644 index 0000000000000000000000000000000000000000..5769120b1b6d38019b505c9167498ea199212cc1 GIT binary patch literal 582 zcmV-M0=fN(P)OL3{+!MJa`3kv~Q#QfQ%c z)1s}QE<_XaYBG;IuRF=td#+}fi4h(6HgoUyJLi0t(*dA^B)%@8kkG&bdM5P5^Z5WF z%d%>m^SbN0XeV)wbUOXn5Ag#A$gJx+7-OCkMM1S%MWIlTkbFLmOeW(&n&wUd&;`>p zVcRy$Z{K0=?SpNnP^;BYEEXleFbq(UY&LrXX$6qkJ~)8+b{=jj3HEXds;Z(?D%}}L zX3`39&dy=Zyar!ehA}e>w)(*vrCct{PI9^2Jpj&OZS8<3-@{0(gNv%1{)zAiLY+_^ zl}e>Ofd4&#Irj#7>=o=Uhv5IJ@?sN0^J|(WL2Uun$4}si6}TG-s3T#p&6GE<<2W)O zf{^Y2HlO#*QDvTp3v&d@;8*}aUC4lisG9(w7@d5Y8y)}U#FwCkqp*Mcgme4{&gGRf zlBfd`nF9cQBKB2_L{F8G2)7pAf$i)Ds`|}-c>pc^LRW{w4SQ)3N^BbZx)6BlCZts! zKph%`(m#xg-q3I7=(us;9<)*2%iuQ1J`oV3gU6V~T}^JU5714JN33&GwEEru0d}Uo U{MPL+lmGw#07*qoM6N<$f^vibe*gdg literal 0 HcmV?d00001 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/folder16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/folder16.png new file mode 100644 index 0000000000000000000000000000000000000000..784e8fa48234f4f64b6922a6758f254ee0ca08ec GIT binary patch literal 537 zcmV+!0_OdRP)x(K@^6+>g^d@v4;gkbWsEoXE%32*i1tcpTNXd5CcIl)ECgqz|2rE6EW}s7R?kl za1q`0GCkMruC6-2LANtwVlsgzsp4?{@7$`KBv!G66>Vie3h?3OmEEkjwdLG0PgLVi z`!N((f$A@n17Ldj#`};0I3@iHJ5M{#IZz|UIYRm4(!uV7eYIYIwQf&}_2J~}>pQ^n z6o8--^T(=hkBNQ_k{-_GWE;FMW7!p}f{NG3nHZ{D5<3d8&tLh%a4AqqnjMkr3m&fkMdECD3N5}Unig5wy40;>lo4j~k+e}v)` zR6)J8Mk*u=SpB`p6o)7j?S0T@9?bz#m@l>gc*zk__|*!FMcHwP!gwLJvS~9c0px8E zWbt?jW7TJ0i{Vq zK~y-)#go5l6hRnPg_Twk zu#;e6nIaG?gFy_U2}`jp)cdGk8i;klvmkpnUEd3x!2_HpIvYy~J#a^NV_b2olo6p`pY<6Ey$Xd~Z7 zzJo#!fb8U52sWtzPEy&X++9Y#RjpAdw2|+k&_SV(;-H$6*o9iG=0Gm)`n~T5%U+rj zb1T&$=Aa`e6o5mv+KmlNow%mWCpSB1Z>>&OfI;za^YN7h#AOWmALR)!Zyiz3ss{e= a-}nQnjpB1L0G3Ap0000eSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM00GHKL_t(I%VYTe|33pIn1N;nIJDnzaPGd*>e+W|igV}9eutJD z6C7J^%(5!J++~z>hF358BqLq}?3%9!=PZA8Z{nVp|ND16|9{`T{rUgGC69hP)m_`B zA9I?EpbM;PugQc>ySuA+<>ODqD;|C=T=MX{UHRo12Jxpki1LC><(2Y+WsknQcidX* zTz73j)4C`Bt#Z%LBq|In3NI=p&%XC4ZrYvurkUqMfViP%<)i;rITx1_G{7|L0<%-Y z^;KE(?|(N*JAa#|AA6F^IPpwJ<+6wWU8=5LQujKb`Z+F#fck zUgU8t^YpU|s(=Orx83-p>b9R3rvXOEXGG&B-+ooO{Lz1}<{Ou-vd(X^%s98zwd(4P z#ubnMhqc}OsqDB<8mj>Yv8NgBOD@j_`PDq_3`$^`Cx4&WSia!?|ESJe|CQ`^D`6O* zA9IQe7(FhfOCJ7@=(+VqC+L_hOo58)eqnWw!}ZzI?)*>azx`j)es74J#Wp4s11vJm zt&8oy^)F$#qIxt-1Q&F!b17S<7vP fw9gB4GZp{&1d#)fC4X~5NmK|32nc)#WQYI&010qNS#tmY4c7nw4c7reD4Tcy000?u zMObuGZ)S9NVRB^vcXxL#X>MzCV_|S*E^l&Yo9;Xs0003FNklafUZCQ#(;>OZ_PYB4R5d)<0Y!GoOJ0T;c}ZRqicB)x?Nc#UT3e zH#7GtTrZ~4gOkj>cx{4nOkobkmHaTS@Dtm(!$fAPipOw`z!%(Nv~ZJHs=VFDN@nV) z*ipwr=>qpy#%>RsVkjbZF^&;5C|8Jx8Wu|Bvw{OGMnosRV-0`s4M$CFbEH``UieWf zE6rmE8zuj>blEEen-R%y6~?U+j_?LA|m=S^QI;D|9_?@aQT_B T734Ut00000NkvXXu0mjfJsqCm diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/frame16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/frame16.png new file mode 100644 index 0000000000000000000000000000000000000000..b0ce7bb198a3b268bd634d2b26e9b710f3797d37 GIT binary patch literal 653 zcmV;80&@L{P)WO3(`_cf+b25@DJ#zdQm}8GzWtq2-QnZ8W6mB^kfeK5f%S{ zUW%tGMCwrwic~ZrQcG=4f?5bkV+3dRk8hw6bk~y$KX#b!y*J4EJ~>;dRASqrSu;ZpM>?P}K~6AT zWv6Dmq?v&9LdXC(m%WCO6ma_di$R(v$@ad_>@R41N3N5lSJq9@6CGhX84-$%Xrd_6 z;){?{E|Ytt5$S-&Au>t4wDlIxdkfe-a22LMj``McG};r8@{GsRPm*+8fFey6C)@ifDBXVyTw(N@Xd41b45OFg6x_QA zpwLiigyy~cVoPxW^r~C7ZQpr%>1$*HKmv~AY-qJw4;gUecS--wnqslISSS=^KA&Ic n@BK|Onfz#3R%n{$a)0j^sqv5F(1NTL00000NkvXXu0mjf3S}fX literal 0 HcmV?d00001 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/function.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/function.png new file mode 100644 index 0000000000000000000000000000000000000000..f8ced8c3b9faaf523e353b0db18ab85efa98f8cf GIT binary patch literal 483 zcmV<90UZ8`P)2*QcBDc zJk#`l0Mx7vIwTFta1@~^rJK@SztQ((+IyvxiNqzg@q#u2NCc4Va#ugo4{Y1c1E7iC z#Bc+34Dbaxxwy-svR^r_R;$I|kfa8y*u?@0)8)vFc(^{?BBHuwS=zXs08ozBvUCZ{ zVUC$MOw*jp1Ym^sEPy&t0bt4Vyjc7MKz&uOFhZ09M)9F20CaR+|IP%2o8gIet)26L zV+emT%132sJQ{CN6kYUsJwHBh8X%<eSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM00HnxL_t(I%cYY&Yg9oLhMzO{-o5uG3%ihwVIxtJfM5~CR7U@R zg@uh(Qdmg(fQ>)G-yo*5(8@wAO#VSYun2?|LCqKW*laf0xqmxz#v*3PZh{CIrkk1P zocEpgNC<)JtQcVVX(rfHhV^6CK{_GrmElVdyNNfQ^8{iB?38x@AaU1COf`D_xeB0UL( z17jkLKw-9+tbgs0mVVH*Eu446Y0A_@o$rlds-+sL10DbMzCV_|S*E^l&Yo9;Xs0004$Nklne?V~K$KGFMss0E-LAojkR)4`lFrrbB7Iml*LuZ<~ zbB~K^P?K!z!n3-Z^S;l^IdDZ)*-x2$xdBw?z?M}WA86mBF3ZHBqbLJ%Qg){s zT)VVFYxWDBtv+V`E{F1WgtE&{*dX{gi>eo^cyst*MROqnqMzLFc;DvD!|QbBTGWbX zEYuAm0tCP(j=Xw{Ru|)o!M|D#nrYyV>)vb#08%fPRx|nPK?{D00@6?2n^)E|HdB%;+m8MD?J(j0000C4Xl@O+f$vugEtAis=9V02y>eSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM00BiwL_t(I%YBngYQr!PMxPz`0PV^YvM2qP-+qSJ+%W?;A=SLTe|QjtU_3oO6tfD7 zB7VESy}=zMkQ|doZ_&Shg?S52)5O#EJ51nmBrpjxkO}KW&fU1>YP;PI<-D}to-)aN z*klqiFgac4V}F5s5+p1L6Ih=$2_@f6E668ZC%VvQbD`h_r556Cgy6Jo>j|*2z{Lom z8f6?>>PIkVv)K%QjRejY(R}`*(6?jp+G0hH3!I310<6fv$?bSN`g*+{AesWUTCLdc z_mtNN%K=-W6PTYtZaH8HvZa6i6&L{PpY=4B#2-g@aS^9}jZq2!0000MzCV_|S*E^l&Yo9;Xs0004uNklKaB`B$Y$d5N_dK5Jq8BgV5j5-lF{h5e>Qog?~g)xHOiPp%rA2Ls1tb zj4lp|b{f2vd4JRc?{d!je9w8$dm=M!RYbI8=4wr%jtYNFIwFikc)`fGh|$@IwR8U@ ztap$-Jjvr;K3t@KnKu)esnJ1hBcG6$YmL4@IxPm%G zeSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM00I$7L_t(I%Y~CWYm`A0hM$@5Tfb!E#zedz-cnd-3cJK6g@uJ} z{)4qYBvyfdDFi_a!QRH&#zGLm#)zm$l$Gpe-OcWIIWw=tUVpM`hzDMVIUJsO&zTt~ ziKD_fcLg{PxN!;?7dL^gk|L6h6tGg3WnpHTR-WhD+S=L#mH>YoVAaet7!1_ycGYgT z)oeCpX6pC*+TPyY1eV+}Ev%Z^YcnIph?!9o1&fP|lbSS5Z+ZR`Ns{2bCrJ{rEThxu z&}y{~As=3>ynmgUUtV@@nkAk+xY-;zAxV<4E1Ywf*&)EmU%$NexaOQ2%~;?ZS9y7H zsvVLf!8teCPXL&5Vwn{`9ump~{5;Mz@X5m8Gx-NJ1XRw)P+&z3MNzfi)BpaF#%_}@ zJ99_@SqVgZeE}3mPMzk`-KQgf(~Lq+HE^grpz4XUYkwOorWdHson-o!#wUM%zCP{1 zlg^%F;l@26f`o_^JNN0QHBk6txU<(DA&C$|4+trhq>vN)?@;KV&_%XSVRfoOj>m>z z0x<^4)-JuhZ_2XlHqcBdkfIT*pU65xi0xCKb&$ECBN?bdv7+9nF_U?d^k LDeN z7P9@JLS6^rUMzCV_|S*E^l&Yo9;Xs0007zNkl_OPVh1DW@AOu2WEyA)zP^*fdWq(i*Eh;b!dO@|wASj8j zf+)(+$S6y)uySy6e4%4^X70WJe~TzI>~WR{exGv=9HF)5ZzW__Ei$JDp-Mr+&LOzuaoPTs_Bmy5q7CVzs$2l7G0iW@XuA;M|oC z%y4DOjx5724q_E#P`e_VjS-vUcZRTwLa4>Z3X`u6G?|$hmX{aKp0a-1%L!!RTHDA8 zV1@$(ii50QnnmxpN8B%V15|AZQzeW|&|K zkOD-&oEE5BorgF47UlRX2nx=x%H-z96o*bVT_1pkx+Rp%>t)~3J*1<>B#j6n9c483YDoId znN8*Pi9IWXH3ewC^^AZqF$Fwzr~qH3@x0e4tx`_@U z<)@~rFhI+LXus>ZyCs0}1#b5d;DuKnoCP s1cDzefd+hEiBElFcN(wuKK%)P2mH|q&7v|#SO5S307*qoM6N<$f^L*&IRF3v diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/package16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/package16.png new file mode 100644 index 0000000000000000000000000000000000000000..da3c2a2d74bab159ba0f65d7db601768258afcb2 GIT binary patch literal 853 zcmV-b1FHOqP)5TQ^(M5v$(QKVE?W+9X! z*o}&~6c?_FreF)9NJB7b5Nbn{G0n4+%uJhR9(V5R|NFTpb|HgjefT!tIhLx@DR+N) zV+fHiR5Yt19}k|KnCsND{tH-`IMJ)3AE?OtyZ4>Un|6(d%h#JK`i&a7^xW9>`yBy` zS4SOHeOpC7$?hH5-#7Rswiue_8Ju*2N@$58=a#2OTA3png`w3v->gWif7t%e$ z$NLVS!tFT#8WL|Wa&K~+{%4P2cRfwesYV1_!F=3OaRVHl(>=`%&{x*s30c}#CNE@&;ItrAv!f!)Oy$Q9t$uS=(sD$-J{T*^(8Eez1E-l3}} zPrfHZ1`qsIFe&gipuL8-IZbo2Yg{lFGKs?ZZWcOaOdk*3`5T;$?AjbG1#`B510Er^h2)2r3Y{!8_2Gj=$KzuN5 zaErtW8W_Y2iJJjY)5pmTVJoPJYpanPOEuYHclM^C1F>${hFRpdi8a<2H|Xudf78bm(zwJ9`K%6I?q*Ua~ fW9JvIbn5*B+_J)rUMBs>00000NkvXXu0mjfH&TkY literal 0 HcmV?d00001 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/save16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/save16.png index 97f5a5b84fa080eb18598a3a0adbcf9056e0ad35..99d532e8b1750115952f97302a92d713c0486f97 100644 GIT binary patch delta 594 zcmV-Y0eSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM00I6^nn(lBi&WL_`A$Rsm%o@uL-g zf`w?2DnigAr8ZVpBBBUmq1Xy`f?{EnA{G|GPQ^mB62%POnSXosejnFrhi`oM79PX% zcmns4jwZm~(kx4plq&!1Z~VMHUEjO&@ylO!JbiTQ+I5o<=1qRN{}nPDolOeI^o4N5I>!U$NpDp3FeeGn5};8< z5=4STOC)7oo1}CYvk(x`G!jXqN<

Q!1jIt|6rpvqE_1l}i8s007|D(ND&Rr1YgV zvxrFe;P!O@0040F>XA8z-3W=UQ56kv?b53N0001LmbnI{C&{cd0&f5Q1poj5c=pj3 z%{i?zl1rpl{I(nQ_%oN!YK=Fa`xF2G0KkR&%bbC~+u@CG-%s)+xhi>pl7y6`NJ)wm gi6ltKJ#D%BKOuZ>i)|3Fq5uE@07*qoM6N<$f+MzCV_|S*E^l&Yo9;Xs0004XNklZZTZyXcprI+o{QoKiCSN2Wt(cOOmy$? zXmNRMAIr*+I-M4PpO(=Hs{F`m6`!XppJzK{a&lua91wK+bu4#>hd^5wm%Dew7Ul&2 zssL37Md3#&>VK zxQaDee6C+X2ZLUb8%o)l4SX?c$H!>#II_S0eO5ab#?0LvKT(UtC?6R?y|^go zaSSNh*gzTv=Frd|12#9&!(sGDq@YK9H&mpgWNr>@n^wD>9T4Bz3OCS0Ar#Z(J{WX_ zKN_U3UQbTaFp!2(m`Ww!@md2=fHF$l175GEsJExv=eRDXmDTmLXX`1;D+r9>D>_X;f1H z000DMK}|sb0I`n?{9y$E00QVqL_t(|+C5WSNK`=>{?6GOZmS1Pb5l#U4R2v;k(9a8 zTSX7`5JXrQBt-^64?!>W(vwdS(gp0nh`=BUp+uu1(Tohr+<(l_G|O~_)m<;Edpk4J zKeOt8&YauKclrN+j#hp7%~b$}G-_$=py2|9mF^k@R9JKkIt?K>ILCtBhF{TmvU%X% z(PwgDS?jf$M!CK?-=Q#q3nWY$Nv^w&;Es~*2ze0k^Ivp`mj>ZK!6w0N%&&>zW}P*oIzQ;)%KOrrku5P zbwIi^DK)Qa2n|K!NGm@B!&8NY-^D2Dd_n}ul57vdmfU>Vj8y-WnUv)`y&v_vr?4sW zAVT9KuxkmVXSk7_ldBwnF=ar7w(%efOBF^R>MKTIc#j|+XouaY;m_btEJT3j;r)N&O9EsV7 zu-FA+i-nl&`-HrcZ3wgnk!PC9rJl-FsEW(j6@T82I%g%A*oJ_=1spM~gz_=_(U19> zOR#2a1t&$8lxcJ5v~>kr+ek8^qrE7ry#U8lA4WSqV6Z!cFI_!&TVS9!{0ga}Guj_a zZhK)R>}0~^p1oeD`eDWEwVZ!LU}{^!hdt z(L1a-K$Mw3=ULZ%^qQI)e$ZI&0Y3{Cg{2b`~kL8WlD8UO$Q M07*qoM6N<$f)c8Kj{pDw delta 455 zcmV;&0XY8I2H^vcB!2{RLP=Bz2nYy#2xN!=000SaNLh0L01ejw01ejxLMWSf0000P zbVXQnQ*UN;cVTj60C#tHE@^ISb7Ns}WiD@WXPfRk8UO$RUP(kjR5*>rk-JMmVHn1L z=XlIZ8fAFHE|j>KLWDyUI7BTjHMBIiv^BLxQ_!UUKt;H;M1O*W9ZEb)xYj{ zCjlTzAZkGn=zl3eZ1!qe(cX#f`ZGZ4EE)>ripr;kl^KabMPbAukSi(_t6c!;oI?1p z{JRMZIt^~8K~?BBmFHv5HehP3pR?V7Du63|Nu~Aw|0{e0h}kU0NCW_VEQThTM9gF` zMx#Fhq_2izHd76S0H_6n$W|-p^=+>=K&PYb_XE)IctF~I-RJAFLh+^f)GD8XQbq$H x04DUdWrxGwx3~~=s>vUpoIW+=a-Gs^{2k*PXA9zh`$zx)002ovPDHLkV1ii_$1(r_ diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/search.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/search16.png similarity index 100% rename from trunk/src/com/jpexs/decompiler/flash/gui/graphics/search.png rename to trunk/src/com/jpexs/decompiler/flash/gui/graphics/search16.png diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/shape16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/shape16.png index c1d9b7a607f3d12212c90228811bc6174f39c584..33af046098e0c48e5dce566fd6c134b066a496e2 100644 GIT binary patch delta 325 zcmV-L0lNO41mOaZC4Xl@O+f$vugEtAis=9V02y>eSaefwW^{L9a%BKPWN%_+AW3au zXJt}lVPtu6$z?nM008qzL_t(I%f*v1PQ*YE1k30|PD;ST_zp3@;WH#81c(n@aywlF zUfXNg*#&Gg(oVOkXLcu*d(H!Qp373afBdW{Q3R?0!Gs8vxqq&}+w04;GXQvgdPKy4 zfRP9eCJB7~UXKK&Xcq)jw9|B>L=vgnNrb8y5hdxurOw{uRyi72nHz;97`h;ehS delta 515 zcmV+e0{s2q0-gkrC4X~5NmK|32nc)#WQYI&010qNS#tmY4c7nw4c7reD4Tcy000?u zMObuGZ)S9NVRB^vcXxL#X>MzCV_|S*E^l&Yo9;Xs0004-Nkl9tfCbPX{h9a^o; zEFX1y+%Tg~L$}NIdM^$h_~3BP|NHpP;rvrXSW9F|SxU`P>Xp)jl-^6}v6N1&CXgb6 zl-lqNcQJ^W!_QrB{OZ`3%|7K08Lz>Anu07w(I?_oNm*KKD7esjSHFr zttB962|fhdO7_HU4d272Zx@4};AX86{uQ_yj07!28!=;~bE!TR@}D(*47RQ&kPWT{ zb4LwNU()-s?x#Pevv(GDc{@-^UMWz-N%y-pD$FlvzI>ATZ87_9$AHHC54nSbLSF@j zgwa%f$|-q-hY|Xd)P>#73>-1m(Qc~sMwJzgD_h)tVv1P5%&N!|Z;0+{qm&$^WEj)9 zhhG)w#5uG_SSq)$u1MaFIn?89v0jOJbYp1Q&8+o1{{?;}6Zs0Qya)gQ002ovPDHLk FV1m78>1hA} diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/sprite16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/sprite16.png index bbcaa5fb0eac3ef8292bb1a60b5056853878fa6f..7851cf34c946e5667221e3478668503eb1cd733f 100644 GIT binary patch delta 437 zcmV;m0ZRVY1;hi88Gi%-006c6H|hWY00d`2O+f$vugEtAis=9V02y>eSaefwW^{L9 za%BKPWN%_+AW3auXJt}lVPtu6$z?nM00CA>L_t&-83n;VNK^p;2jK7Bou-mr5*XQ^ z%?t_}YIO~wvB{;e!J^i1PiSc`h@zo5)TzB8hj1#vh%n<46Murxj=Zuv-~07_MF6ZU zbZ+iVGQQJ%F*6S!B4T->)k~5jY4u)CMnn{`ve22`JFC_-Wm*(8cU;q(~AS%Po_@naEU!xidrBXD? z;hN|x^%W|Ij)0y*r5vi|?W&Fub(NqJ@z0o=OMzCV_|S*E^l&Yo9;Xs00071NklMM3RyAAnTGO#6$u_wp74pO~@vlq5V&G0D864jf zz!`0KcekIr+<$uNwt-#b)wjs;e7)#U(c zCBWx^RM3<24PS8xk-z`|;4eUBJbeC3_aM>7c_JdBg(T6%A)>yQL{XloTp=2rCh8s} zYU$|t20%+hkN|*6Z|OO3#%VF@fTJyd-EPOPSO6U+;D2~4kWGeg?P@Ph>@S03frFj* z&DP0}MR4A@xd-N9I*nh&zZ=in! zP%D+-tA83>DVK_32{|DWqe@x)te(JXqp{8m0Qq$MhX^R76Yo+XPu)$c7n%56xgbQn zA|RVucri12Z-OeNt=&YJ8o551j?F$10YpSXG;nG9wPSHB|LmAE!ACy#6Hy7+u*$5~ zcw~pM{h95;Q>#MV%v2kTxfM(f_s;O&eK&-}+(VnS_nKp37>4DHZ4X%OUW-CwFi0d) wqKNwOwUeo6kL)4AjQp>FVdQ&MASh2>??{Fg5@H delta 403 zcmV;E0c`%60ipwt8Gi-<001BJ|6u?C00eVFNmK|32nc)#WQYI&010qNS#tmY4c7nw z4c7reD4Tcy000?uMObuGZ)S9NVRB^vcXxL#X>MzCV_|S*E^l&Yo9;Xs0003WNkldYsckhTz|Y*ArBm0&UrcK{XV?sq^jJ;hW$j6H(148j4^{(Rkhb@Fw@8#<1-fU z3A^|{6``t{jy)_)yT9}n!KIB`68knxvW&MFVGiH$5$7263z7`+qN?6sk$}h8oQSuu zjQg1Ha!;^=eSa)f)wPJ@j^GUMlI-9Pw($qQ-JtOtgR1(HCHC|pv x_59H^g7mjB$vrG~1l65itLn5#d)sxs0Pf1rF}h?v(+mIr002ovPDHLkV1n2Gyw3Y+732PG_{dW-vWnGW?ek+eegcN?|t9z2?7xGKN@MGRD*J^ z&rlky@ZUE!D5>oxB^64H+e}Jso>dhAcXJ|I^4Pu&0hSi(IWgLX71SJg^}9{IANt4a z6@3vO@*Gyvx&UJ2j;g6eXHOcITv{wUTQS>}4p&n=2Fk;r%w^@S*8a(S*4l9Z?xB2q zbEz@ceIA}S32-WSa5Toip*ae*h-LZ>K#V(y+NX@kSg_V%$^H^^#w5(VjmNa^Al#Zr zxKskTv?tM3%<%;PqbiC^j8kOR6?gv~_-2jxYPk=$UI?e|FeaO0Fjl)4b{QYeM$$#= z33NONUJd|;c@3 zEdc1N;!Mt4u3_FH!uuLNdh0_mSQm{kBBv%A#u5&?pX`FYmIHU&F-*wfPx9%`;Lgug8DbunAt zBaI+kWJ7UF0I#(WUwSj4$>*c9h=G}AiU3$-A0$Ax*`Bq(7C5v$WSb3D;V`_ofN@<0 zyyGH_s4k);Wh-=dcVI!ug{|Qbq&Jv@e+2kN0@9!>-iNlrSST`i(3d5k^wJhQO4^KW zF%1@J6soS$C)Ne{CC_FFV2Y&a z4Co4YFjq&xTp5X`tPqr@&_w?P@T)qFu}N};o>QJmcZySJ(R-Md ToJi+(00000NkvXXu0mjf*@atu literal 0 HcmV?d00001 diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/variable.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/variable.png new file mode 100644 index 0000000000000000000000000000000000000000..a3b44b5cf5c47f62cd0990f900e5e6601fed8273 GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4>p!L4QVojGzH#nN6Ry1TxW?8$pbNdH@rsEs7ZRQl4#C;>;21nSx1h#2s zZ_GHP!e!XBzGm}h-aR)J1sx?ry-NQx1^7yv9Q_g8th3=CN5+f@zFm>>4BM(N&U;?o zq_E?p@t!k>m$m+0(OxE(P`<zMdx&z_V5IFb#`n>l=vie;XV($iwTQ?prCeWAEV67nZnJV`c4+g wOrH6ATW;{KV`r>*4r~1M*x8_@CHsi^9& images = new ArrayList(); - images.add(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/proxy16.png")); - images.add(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/proxy24.png")); - images.add(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/proxy32.png")); - images.add(View.loadImage("com/jpexs/decompiler/flash/gui/graphics/proxy48.png")); + images.add(View.loadImage("proxy16")); + images.add(View.loadImage("proxy24")); + images.add(View.loadImage("proxy32")); + images.add(View.loadImage("proxy48")); setIconImages(images); }