merged updateInfo and update in GamePanel

master
melvin 2011-07-26 11:27:31 +08:00
parent 6eaaac3eb3
commit 01f7dfbf85
2 changed files with 10 additions and 13 deletions

View File

@ -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());
}
}

View File

@ -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();