Issue #156 Fixed search freezing

This commit is contained in:
Jindra Pet��k
2013-06-29 19:22:19 +02:00
parent 71491b8d79
commit 0f7d7714f6
3 changed files with 9 additions and 9 deletions
@@ -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);
});
}
@@ -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) {
@@ -68,15 +68,15 @@ public class Graph {
private void fixGraph(GraphPart part) {
//if(true) return;
try{
try {
while (fixGraphOnce(part, new ArrayList<GraphPart>(), false)) {
}
}catch(Exception | Error ex){
}
} catch (Exception | Error ex) {
//ignore
}
}
private boolean fixGraphOnce(GraphPart part, List<GraphPart> visited, boolean doChildren) {
private boolean fixGraphOnce(GraphPart part, List<GraphPart> visited, boolean doChildren) {
if (visited.contains(part)) {
return false;
}