mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
client registration is now a blocking call on the client side + added server messages handlers
This commit is contained in:
parent
d2ae55fff6
commit
b68cd765b7
11 changed files with 194 additions and 31 deletions
|
|
@ -1002,20 +1002,25 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
this.tablesPane.hideTables();
|
||||
}
|
||||
|
||||
public void showGames(boolean setActive) {
|
||||
MagePane topPanebefore = getTopMost(tablesPane);
|
||||
if (!tablesPane.isVisible()) {
|
||||
this.tablesPane.setVisible(true);
|
||||
this.tablesPane.showTables();
|
||||
}
|
||||
if (setActive) {
|
||||
setActive(tablesPane);
|
||||
} else {
|
||||
// if other panel was already shown, mamke sure it's topmost again
|
||||
if (topPanebefore != null) {
|
||||
setActive(topPanebefore);
|
||||
public void showGames(final boolean setActive) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MagePane topPanebefore = getTopMost(tablesPane);
|
||||
if (!tablesPane.isVisible()) {
|
||||
tablesPane.setVisible(true);
|
||||
tablesPane.showTables();
|
||||
}
|
||||
if (setActive) {
|
||||
setActive(tablesPane);
|
||||
} else {
|
||||
// if other panel was already shown, mamke sure it's topmost again
|
||||
if (topPanebefore != null) {
|
||||
setActive(topPanebefore);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void hideGames() {
|
||||
|
|
@ -1372,13 +1377,13 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
@Override
|
||||
public void clientRegistered(ServerState state) {
|
||||
this.serverState = state;
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setWindowTitle();
|
||||
showGames(false);
|
||||
}
|
||||
});
|
||||
// SwingUtilities.invokeLater(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// setWindowTitle();
|
||||
// showGames(false);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ public class ConnectDialog extends MageDialog {
|
|||
if (result) {
|
||||
lblStatus.setText("");
|
||||
connected();
|
||||
// MageFrame.getInstance().showGames(false);
|
||||
MageFrame.getInstance().showGames(false);
|
||||
} else {
|
||||
lblStatus.setText("Could not connect");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue