Search in sources :

Example 1 with DeckFileFilter

use of mage.cards.decks.DeckFileFilter in project mage by magefree.

the class NewTournamentDialog method playerLoadDeck.

protected String playerLoadDeck() {
    if (fcSelectDeck == null) {
        fcSelectDeck = new JFileChooser();
        fcSelectDeck.setAcceptAllFileFilterUsed(false);
        fcSelectDeck.addChoosableFileFilter(new DeckFileFilter("dck", "XMage's deck files (*.dck)"));
    }
    String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", "");
    if (!lastFolder.isEmpty()) {
        fcSelectDeck.setCurrentDirectory(new File(lastFolder));
    }
    int ret = fcSelectDeck.showDialog(this, "Select Deck");
    if (ret == JFileChooser.APPROVE_OPTION) {
        File file = fcSelectDeck.getSelectedFile();
        return (file.getPath());
    }
    return "";
}
Also used : DeckFileFilter(mage.cards.decks.DeckFileFilter) File(java.io.File)

Example 2 with DeckFileFilter

use of mage.cards.decks.DeckFileFilter in project mage by magefree.

the class NewTournamentDialog method playerLoadJumpstartPacks.

protected String playerLoadJumpstartPacks() {
    if (fcJumpstartSelectDeck == null) {
        fcJumpstartSelectDeck = new JFileChooser();
        fcJumpstartSelectDeck.setAcceptAllFileFilterUsed(false);
        fcJumpstartSelectDeck.addChoosableFileFilter(new DeckFileFilter("txt", "Jumpstart Packs (*.txt)"));
    }
    String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", "");
    if (!lastFolder.isEmpty()) {
        fcJumpstartSelectDeck.setCurrentDirectory(new File(lastFolder));
    }
    int ret = fcJumpstartSelectDeck.showDialog(this, "Select Jumpstart Packs file");
    if (ret == JFileChooser.APPROVE_OPTION) {
        File file = fcJumpstartSelectDeck.getSelectedFile();
        return (file.getPath());
    }
    return "";
}
Also used : DeckFileFilter(mage.cards.decks.DeckFileFilter) File(java.io.File)

Aggregations

File (java.io.File)2 DeckFileFilter (mage.cards.decks.DeckFileFilter)2