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