Search in sources :

Example 1 with TournamentPane

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);
}
Also used : TournamentPane(mage.client.tournament.TournamentPane)

Example 2 with 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();
            }
        }
    }
}
Also used : TournamentPane(mage.client.tournament.TournamentPane) DeckEditorPane(mage.client.deckeditor.DeckEditorPane) GamePane(mage.client.game.GamePane) DraftPane(mage.client.draft.DraftPane)

Aggregations

TournamentPane (mage.client.tournament.TournamentPane)2 DeckEditorPane (mage.client.deckeditor.DeckEditorPane)1 DraftPane (mage.client.draft.DraftPane)1 GamePane (mage.client.game.GamePane)1