From ba0ee6fd60db807be8b95844662bd3c0e57947d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 20 Apr 2013 18:51:45 +0200 Subject: [PATCH] gui enhancements --- .../decompiler/flash/abc/gui/DetailPanel.java | 5 +++++ .../decompiler/flash/action/gui/ActionPanel.java | 11 ++++++++++- .../com/jpexs/decompiler/flash/graph/Graph.java | 2 +- .../decompiler/flash/gui/graphics/editing16.png | Bin 0 -> 450 bytes 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/editing16.png diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/gui/DetailPanel.java b/trunk/src/com/jpexs/decompiler/flash/abc/gui/DetailPanel.java index c82dbcc00..575124ba0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/gui/DetailPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/gui/DetailPanel.java @@ -120,6 +120,11 @@ public class DetailPanel extends JPanel implements ActionListener { editButton.setVisible(!val); cancelButton.setVisible(val); editMode = val; + if (val) { + selectedLabel.setIcon(View.getIcon("editing16")); + } else { + selectedLabel.setIcon(null); + } } public void showCard(String name, Trait trait) { 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 449469c95..56746b8af 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java @@ -81,6 +81,7 @@ public class ActionPanel extends JPanel implements ActionListener { public JPanel topButtonsPan; private String srcWithHex; private String srcNoHex; + private String lastDecompiled = ""; public void setText(String text) { int pos = editor.getCaretPosition(); @@ -137,7 +138,8 @@ public class ActionPanel extends JPanel implements ActionListener { } catch (IOException ex) { Logger.getLogger(ActionPanel.class.getName()).log(Level.SEVERE, null, ex); }*/ - decompiledEditor.setText(stripped); + decompiledEditor.setText(lastDecompiled = stripped); + if (debugRecompile) { try { ActionScriptParser ps = new ActionScriptParser(); @@ -360,6 +362,7 @@ public class ActionPanel extends JPanel implements ActionListener { editButton.setVisible(false); cancelButton.setVisible(true); editor.getCaret().setVisible(true); + asmLabel.setIcon(View.getIcon("editing16")); } else { setText(hexButton.isSelected() ? srcWithHex : srcNoHex); editor.setEditable(false); @@ -367,9 +370,11 @@ public class ActionPanel extends JPanel implements ActionListener { editButton.setVisible(true); cancelButton.setVisible(false); editor.getCaret().setVisible(true); + asmLabel.setIcon(null); } topButtonsPan.setVisible(!val); editMode = val; + editor.requestFocusInWindow(); } public void setDecompiledEditMode(boolean val) { @@ -380,6 +385,7 @@ public class ActionPanel extends JPanel implements ActionListener { betaLabel.setVisible(false); cancelDecompiledButton.setVisible(true); decompiledEditor.getCaret().setVisible(true); + decLabel.setIcon(View.getIcon("editing16")); } else { decompiledEditor.setEditable(false); saveDecompiledButton.setVisible(false); @@ -387,8 +393,10 @@ public class ActionPanel extends JPanel implements ActionListener { betaLabel.setVisible(true); cancelDecompiledButton.setVisible(false); decompiledEditor.getCaret().setVisible(true); + decLabel.setIcon(null); } editDecompiledMode = val; + decompiledEditor.requestFocusInWindow(); } @Override @@ -423,6 +431,7 @@ public class ActionPanel extends JPanel implements ActionListener { setDecompiledEditMode(true); } else if (e.getActionCommand().equals("CANCELDECOMPILED")) { setDecompiledEditMode(false); + decompiledEditor.setText(lastDecompiled); } else if (e.getActionCommand().equals("SAVEDECOMPILED")) { try { ActionScriptParser par = new ActionScriptParser(); diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index 03881c239..9eaebb2e7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -1095,7 +1095,7 @@ public class Graph { } else { ex = new NotItem(null, ex); } - if (!finalCommands.isEmpty()) { + if ((finalCommands != null) && (!finalCommands.isEmpty())) { tr.addAll(finalCommands); } tr.add(ex); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/editing16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/editing16.png new file mode 100644 index 0000000000000000000000000000000000000000..0bfecd50ee9f5bc5828f0c0745aa3e0effcbe250 GIT binary patch literal 450 zcmV;z0X_bSP)Rq1}l<=psl5*5Xz9i;M}s*NP=ugs7Q#8Z;Dyx|}!`#}xw_C3!B-yaPC&0j)XcpuX@rNfq|q}N(wJOjA& z>u+z?dfJEuLePrqzy!)73pvLjxk4d6XNZt?hm_iYES{i}J5y3l?}PPNYDBR7oPc~6 zL^d)Bi4Q2L3pnp!nFxN9c2E+=@XAl&+;2m6a~kZj1r3Mz3C=hmUG<{+vWR@t4q?fJ zhFc(ozZD#Mx`^Q~g1v=K6!QnfuqyD4>U4EjF0eamL}Jx| z%&`kR-H+3GBYr*Qx}frLU4`%n9(`uSomzw)t%%NagXkA*R5Mbv9VLDp1wMo$cOMa~ s3Wm%r7^bwK$2$}-<~D8p`#1iScU4^XCLAA~0ssI207*qoM6N<$g3sK(Qvd(} literal 0 HcmV?d00001