Use MScreen instead of Object as argument to isScreenReadyToClose().

master
lodici 2017-02-23 13:59:00 +00:00
parent d221b5aeb9
commit 4bc1693baa
8 changed files with 14 additions and 8 deletions

View File

@ -78,7 +78,7 @@ public abstract class MScreen {
UrlHelper.openURL(wikiPage.getUrl());
}
public boolean isScreenReadyToClose(final Object aScreen) {
public boolean isScreenReadyToClose(MScreen aScreen) {
if (loadingWorker != null && !loadingWorker.isDone()) {
loadingWorker.cancel(true);
}

View File

@ -7,6 +7,7 @@ import magic.translate.MText;
import magic.ui.MagicLogs;
import magic.ui.WikiPage;
import magic.ui.screen.HeaderFooterScreen;
import magic.ui.screen.MScreen;
import magic.ui.screen.widget.MenuButton;
import magic.ui.widget.cards.table.CardsTableStyle;
@ -76,7 +77,7 @@ public class ExplorerScreen extends HeaderFooterScreen {
}
@Override
public boolean isScreenReadyToClose(final Object nextScreen) {
public boolean isScreenReadyToClose(MScreen nextScreen) {
if (super.isScreenReadyToClose(nextScreen)) {
MagicSetDefinitions.clearLoadedSets();
MagicLogs.clearLoadedLogs();

View File

@ -17,6 +17,7 @@ import magic.ui.MagicLogs;
import magic.ui.ScreenController;
import magic.ui.WikiPage;
import magic.ui.screen.HeaderFooterScreen;
import magic.ui.screen.MScreen;
import magic.ui.screen.interfaces.IDeckConsumer;
import magic.ui.screen.widget.MenuButton;
import magic.ui.widget.deck.DeckStatusPanel;
@ -267,7 +268,7 @@ public class DeckEditorScreen extends HeaderFooterScreen
}
@Override
public boolean isScreenReadyToClose(final Object nextScreen) {
public boolean isScreenReadyToClose(MScreen nextScreen) {
if (super.isScreenReadyToClose(nextScreen)) {
if (contentPanel == null) {
return true;

View File

@ -18,6 +18,7 @@ import magic.ui.MagicLogs;
import magic.ui.ScreenController;
import magic.ui.WikiPage;
import magic.ui.screen.HeaderFooterScreen;
import magic.ui.screen.MScreen;
import magic.ui.screen.duel.decks.DuelDecksScreen;
import magic.ui.screen.interfaces.IDeckConsumer;
import magic.ui.screen.widget.MenuButton;
@ -201,7 +202,7 @@ public class DeckEditorSplitScreen extends HeaderFooterScreen
* @see magic.ui.MagScreen#canScreenClose()
*/
@Override
public boolean isScreenReadyToClose(final Object nextScreen) {
public boolean isScreenReadyToClose(MScreen nextScreen) {
if (screenContent.isDeckEditor() && !screenContent.isStandaloneDeckEditor() && nextScreen instanceof DuelDecksScreen) {
((DuelDecksScreen)nextScreen).updateDecksAfterEdit();
}

View File

@ -5,6 +5,7 @@ import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.dialog.DecksFilterDialog;
import magic.ui.screen.HeaderFooterScreen;
import magic.ui.screen.MScreen;
import magic.ui.screen.interfaces.IDeckConsumer;
import magic.ui.screen.widget.MenuButton;
import magic.ui.widget.deck.DeckStatusPanel;
@ -84,7 +85,7 @@ public class DecksScreen extends HeaderFooterScreen {
}
@Override
public boolean isScreenReadyToClose(final Object nextScreen) {
public boolean isScreenReadyToClose(MScreen nextScreen) {
DecksFilterDialog.resetFilterHistory();
return true;
}

View File

@ -6,6 +6,7 @@ import magic.translate.MText;
import magic.ui.ScreenController;
import magic.ui.WikiPage;
import magic.ui.screen.HeaderFooterScreen;
import magic.ui.screen.MScreen;
import magic.ui.screen.widget.MenuButton;
@SuppressWarnings("serial")
@ -76,7 +77,7 @@ public class NewDuelSettingsScreen extends HeaderFooterScreen {
}
@Override
public boolean isScreenReadyToClose(final Object nextScreen) {
public boolean isScreenReadyToClose(MScreen nextScreen) {
if (isEachPlayerDeckValid(false)) {
updateDuelConfig();
}

View File

@ -25,7 +25,7 @@ public class DownloadImagesScreen extends MScreen {
}
@Override
public boolean isScreenReadyToClose(final Object nextScreen) {
public boolean isScreenReadyToClose(MScreen nextScreen) {
final boolean isBusy = dialogPanel.isBusy();
ToolTipManager.sharedInstance().setEnabled(isBusy == false);
return isBusy == false;

View File

@ -3,6 +3,7 @@ package magic.ui.screen.stats;
import java.sql.SQLException;
import magic.data.stats.MagicStats;
import magic.ui.screen.HeaderFooterScreen;
import magic.ui.screen.MScreen;
import magic.ui.screen.widget.MenuButton;
@SuppressWarnings("serial")
@ -39,7 +40,7 @@ public class StatsScreen extends HeaderFooterScreen {
}
@Override
public boolean isScreenReadyToClose(Object aScreen) {
public boolean isScreenReadyToClose(MScreen aScreen) {
return super.isScreenReadyToClose(aScreen)
&& contentPanel.isReadyToClose();
}