From 0f7d7714f6ec520a23b7e458d60805e6775ce524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 29 Jun 2013 19:22:19 +0200 Subject: [PATCH] Issue #156 Fixed search freezing --- .../src/com/jpexs/decompiler/flash/abc/gui/ABCPanel.java | 5 ++--- .../jpexs/decompiler/flash/action/gui/ActionPanel.java | 5 +++-- trunk/src/com/jpexs/decompiler/flash/graph/Graph.java | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) 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 0e2310535..7324ee67b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/gui/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/gui/ABCPanel.java @@ -467,15 +467,14 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener { decompiledTextArea.setScript(found.get(foundPos), list); hilightScript(found.get(foundPos)); decompiledTextArea.setCaretPosition(0); - java.util.Timer t = new java.util.Timer(); - t.schedule(new TimerTask() { + SwingUtilities.invokeLater(new Runnable() { @Override public void run() { DocumentSearchData dsd = DocumentSearchData.getFromEditor(decompiledTextArea); dsd.setPattern(searchFor, searchRegexp, searchIgnoreCase); dsd.showQuickFindDialogEx(decompiledTextArea, searchIgnoreCase, searchRegexp); } - }, 1000); + }); } 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 acd3c7c62..dcd3f8677 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/gui/ActionPanel.java @@ -62,6 +62,7 @@ import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JToggleButton; import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; import javax.swing.border.BevelBorder; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; @@ -663,14 +664,14 @@ public class ActionPanel extends JPanel implements ActionListener { Main.mainFrame.tagTree.scrollPathToVisible(tp); decompiledEditor.setCaretPosition(0); java.util.Timer t = new java.util.Timer(); - t.schedule(new TimerTask() { + SwingUtilities.invokeLater(new Runnable() { @Override public void run() { DocumentSearchData dsd = DocumentSearchData.getFromEditor(decompiledEditor); dsd.setPattern(searchFor, searchRegexp, searchIgnoreCase); dsd.showQuickFindDialogEx(decompiledEditor, searchIgnoreCase, searchRegexp); } - }, 1000); + }); } private void uncache(ASMSource pack) { diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index a916a5eab..1ff369bdb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -68,15 +68,15 @@ public class Graph { private void fixGraph(GraphPart part) { //if(true) return; - try{ + try { while (fixGraphOnce(part, new ArrayList(), false)) { - } - }catch(Exception | Error ex){ + } + } catch (Exception | Error ex) { //ignore } } - private boolean fixGraphOnce(GraphPart part, List visited, boolean doChildren) { + private boolean fixGraphOnce(GraphPart part, List visited, boolean doChildren) { if (visited.contains(part)) { return false; }