|
@@ -1,6 +1,7 @@
|
|
|
package animation;
|
|
|
|
|
|
import javax.swing.JTree;
|
|
|
+import javax.swing.SwingUtilities;
|
|
|
import javax.swing.tree.DefaultMutableTreeNode;
|
|
|
import javax.swing.tree.MutableTreeNode;
|
|
|
import javax.swing.tree.TreePath;
|
|
@@ -162,18 +163,24 @@ public class PseudoCodeNode extends DefaultMutableTreeNode {
|
|
|
{
|
|
|
if( controller == null || controller.getStepOption() != 1 || breakPoint )
|
|
|
{
|
|
|
- synchronized( tree ) {
|
|
|
- expandToRoot();
|
|
|
- }
|
|
|
+ SwingUtilities.invokeLater( new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ expandToRoot();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if( controller == null || controller.getStepOption() != 1 )
|
|
|
{
|
|
|
- synchronized( tree ) {
|
|
|
- tree.collapsePath( new TreePath( this.getPath() ) );
|
|
|
- }
|
|
|
+ SwingUtilities.invokeLater( new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ tree.collapsePath( new TreePath( getPath() ) );
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
if( breakPoint && selected )
|