reverting to previous version that didn't cause freezes

This commit is contained in:
ArsenalNut
2012-09-29 04:30:33 +00:00
parent 95f4fe4c48
commit dc8c4e5d56

View File

@@ -20,8 +20,6 @@ package forge.gui.match.controllers;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.SwingWorker;
import forge.Command; import forge.Command;
import forge.Constant; import forge.Constant;
import forge.Singletons; import forge.Singletons;
@@ -43,40 +41,22 @@ public enum CMessage implements ICDoc {
private final ActionListener actCancel = new ActionListener() { private final ActionListener actCancel = new ActionListener() {
@Override @Override
public void actionPerformed(final ActionEvent evt) { public void actionPerformed(final ActionEvent evt) {
// Pull all non-UI actions off off the EDT. inputControl.selectButtonCancel();
final SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { VMessage.SINGLETON_INSTANCE.getBtnOK().requestFocusInWindow();
@Override
public Void doInBackground() {
inputControl.selectButtonCancel();
VMessage.SINGLETON_INSTANCE.getBtnOK().requestFocusInWindow();
return null;
}
};
worker.execute();
} }
}; };
private final ActionListener actOK = new ActionListener() { private final ActionListener actOK = new ActionListener() {
@Override @Override
public void actionPerformed(final ActionEvent evt) { public void actionPerformed(final ActionEvent evt) {
// Pull all non-UI actions off off the EDT. inputControl.selectButtonOK();
final SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
@Override
public Void doInBackground() {
inputControl.selectButtonOK();
if (Singletons.getModel().getGameState().getPhaseHandler().isNeedToNextPhase()) { if (Singletons.getModel().getGameState().getPhaseHandler().isNeedToNextPhase()) {
// moves to next turn // moves to next turn
Singletons.getModel().getGameState().getPhaseHandler().setNeedToNextPhase(false); Singletons.getModel().getGameState().getPhaseHandler().setNeedToNextPhase(false);
Singletons.getModel().getGameState().getPhaseHandler().nextPhase(); Singletons.getModel().getGameState().getPhaseHandler().nextPhase();
} }
VMessage.SINGLETON_INSTANCE.getBtnOK().requestFocusInWindow(); VMessage.SINGLETON_INSTANCE.getBtnOK().requestFocusInWindow();
return null;
}
};
worker.execute();
} }
}; };