From 01f7dfbf8548fcf88b96c331c30b0b0620a221f8 Mon Sep 17 00:00:00 2001 From: melvin Date: Tue, 26 Jul 2011 11:27:31 +0800 Subject: [PATCH] merged updateInfo and update in GamePanel --- src/magic/ui/GameController.java | 18 +++++++++--------- src/magic/ui/GamePanel.java | 5 +---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/magic/ui/GameController.java b/src/magic/ui/GameController.java index a9ffae68ca..62c6053103 100644 --- a/src/magic/ui/GameController.java +++ b/src/magic/ui/GameController.java @@ -291,7 +291,6 @@ public class GameController { //SwingUtilities.invokeLater(new Runnable() { invokeAndWait(new Runnable() { public void run() { - gamePanel.updateInfo(); gamePanel.update(); } }); @@ -300,14 +299,15 @@ public class GameController { public void invokeAndWait(final Runnable task) { if (SwingUtilities.isEventDispatchThread()) { task.run(); - } else { - try { - SwingUtilities.invokeAndWait(task); - } catch (InterruptedException err) { - throw new RuntimeException(err.getMessage()); - } catch (InvocationTargetException err) { - throw new RuntimeException(err.getMessage()); - } + return; + } + + try { + SwingUtilities.invokeAndWait(task); + } catch (InterruptedException err) { + throw new RuntimeException(err.getMessage()); + } catch (InvocationTargetException err) { + throw new RuntimeException(err.getMessage()); } } diff --git a/src/magic/ui/GamePanel.java b/src/magic/ui/GamePanel.java index 1ee137c2d6..4d16f6090b 100644 --- a/src/magic/ui/GamePanel.java +++ b/src/magic/ui/GamePanel.java @@ -306,11 +306,8 @@ public final class GamePanel extends JPanel { } } - public void updateInfo() { - viewerInfo.update(game); - } - public void update() { + viewerInfo.update(game); playerViewer.update(); opponentViewer.update(); gameTournamentViewer.update();