From dc8c4e5d56e396c29afc7cedd5855b071416ef93 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sat, 29 Sep 2012 04:30:33 +0000 Subject: [PATCH] reverting to previous version that didn't cause freezes --- .../forge/gui/match/controllers/CMessage.java | 38 +++++-------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/src/main/java/forge/gui/match/controllers/CMessage.java b/src/main/java/forge/gui/match/controllers/CMessage.java index 61a06c509b7..ce7ec05534a 100644 --- a/src/main/java/forge/gui/match/controllers/CMessage.java +++ b/src/main/java/forge/gui/match/controllers/CMessage.java @@ -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 worker = new SwingWorker() { - @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 worker = new SwingWorker() { - @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(); } };