Search in sources :

Example 1 with DeckEditorPane

use of mage.client.deckeditor.DeckEditorPane in project mage by magefree.

the class MagePaneMenuItem method showDeckEditor.

public void showDeckEditor(DeckEditorMode mode, Deck deck, UUID tableId, int time) {
    String name;
    if (mode == DeckEditorMode.SIDEBOARDING || mode == DeckEditorMode.LIMITED_BUILDING || mode == DeckEditorMode.VIEW_LIMITED_DECK) {
        name = "Deck Editor - " + tableId.toString();
    } else {
        if (deck != null) {
            name = "Deck Editor - " + deck.getName();
        } else {
            name = "Deck Editor";
        }
        // use already open editor
        Component[] windows = desktopPane.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER);
        for (Component window : windows) {
            if (window instanceof DeckEditorPane && ((MagePane) window).getTitle().equals(name)) {
                setActive((MagePane) window);
                return;
            }
        }
    }
    DeckEditorPane deckEditorPane = new DeckEditorPane();
    desktopPane.add(deckEditorPane, JLayeredPane.DEFAULT_LAYER);
    deckEditorPane.setVisible(false);
    deckEditorPane.show(mode, deck, name, tableId, time);
    setActive(deckEditorPane);
}
Also used : DeckEditorPane(mage.client.deckeditor.DeckEditorPane)

Example 2 with DeckEditorPane

use of mage.client.deckeditor.DeckEditorPane 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

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