Issues #319: AS3 - Improved try..catch..finally decompilation

This commit is contained in:
Jindra Pet��k
2013-08-11 17:21:29 +02:00
parent 1cc46522e7
commit 5d092a0954
10 changed files with 297 additions and 179 deletions
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.graph.GraphPart;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -47,7 +48,7 @@ public class GraphFrame extends AppFrame {
private GraphPart head;
public GraphPanel(Graph graph) {
graph.init();
graph.init(new ArrayList<>());
size = getPartPositions(head = graph.heads.get(0), SPACE_VERTICAL + SPACE_VERTICAL + BLOCK_HEIGHT / 2, getPartWidth(graph.heads.get(0), new HashSet<GraphPart>()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2 - SPACE_HORIZONTAL, partPos, true);
backLinksLeft = 1;
backLinksRight = 1;
@@ -22,10 +22,8 @@ import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashSet;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Set;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
@@ -96,8 +94,8 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
View.centerScreen(this);
setTitle(translate("dialog.title"));
pack();
if(getWidth()<350){
setSize(350, getHeight());
if (getWidth() < 350) {
setSize(350, getHeight());
}
}
@@ -37,7 +37,6 @@ import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.basic.BasicProgressBarUI;
import org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon;
import org.pushingpixels.substance.api.SubstanceConstants;
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
@@ -33,10 +33,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.SwingUtilities;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.Document;
import jsyntaxpane.SyntaxDocument;
public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretListener {
@@ -99,6 +98,11 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
if (bi == -1) {
return false;
}
View.execInEventDispatch(new Runnable() {
@Override
public void run() {
}
});
abcPanel.detailPanel.showCard(DetailPanel.METHOD_TRAIT_CARD, trait);
if (reset || (abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex() != bi)) {
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, abc, name);
@@ -163,7 +167,16 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
}
@Override
public void caretUpdate(CaretEvent e) {
public void caretUpdate(final CaretEvent e) {
if (!SwingUtilities.isEventDispatchThread()) {
View.execInEventDispatch(new Runnable() {
@Override
public void run() {
caretUpdate(e);
}
});
return;
}
if (abc == null) {
return;
}