use of mage.client.tournament.TournamentPane in project mage by magefree.
the class MagePaneMenuItem method showTournament.
public void showTournament(UUID tournamentId) {
for (Component component : desktopPane.getComponents()) {
if (component instanceof TournamentPane && ((TournamentPane) component).getTournamentId().equals(tournamentId)) {
setActive((TournamentPane) component);
return;
}
}
TournamentPane tournamentPane = new TournamentPane();
desktopPane.add(tournamentPane, JLayeredPane.DEFAULT_LAYER);
tournamentPane.setVisible(true);
tournamentPane.showTournament(tournamentId);
setActive(tournamentPane);
}
use of mage.client.tournament.TournamentPane in project mage by magefree.
the class MagePaneMenuItem method hideGames.
public void hideGames() {
Component[] windows = desktopPane.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER);
for (Component window : windows) {
if (window instanceof GamePane) {
GamePane gamePane = (GamePane) window;
gamePane.removeGame();
}
if (window instanceof DraftPane) {
DraftPane draftPane = (DraftPane) window;
draftPane.removeDraft();
}
if (window instanceof TournamentPane) {
TournamentPane tournamentPane = (TournamentPane) window;
tournamentPane.removeTournament();
}
// close & remove sideboarding or construction pane if open
if (window instanceof DeckEditorPane) {
DeckEditorPane deckEditorPane = (DeckEditorPane) window;
if (deckEditorPane.getDeckEditorMode() == DeckEditorMode.LIMITED_BUILDING || deckEditorPane.getDeckEditorMode() == DeckEditorMode.SIDEBOARDING || deckEditorPane.getDeckEditorMode() == DeckEditorMode.VIEW_LIMITED_DECK) {
deckEditorPane.removeFrame();
}
}
}
}
Aggregations