Use MScreen instead of Object as argument to isScreenReadyToClose().
parent
d221b5aeb9
commit
4bc1693baa
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue