diff --git a/.gitattributes b/.gitattributes
index a4ca4b68e5e..b81f82d61de 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -11192,19 +11192,6 @@ src/main/java/forge/quest/data/pet/QuestPetManager.java svneol=native#text/plain
src/main/java/forge/quest/data/pet/QuestPetPlant.java svneol=native#text/plain
src/main/java/forge/quest/data/pet/QuestPetWolf.java svneol=native#text/plain
src/main/java/forge/quest/data/pet/package-info.java svneol=native#text/plain
-src/main/java/forge/quest/gui/QuestAbstractPanel.java svneol=native#text/plain
-src/main/java/forge/quest/gui/QuestFrame.java svneol=native#text/plain
-src/main/java/forge/quest/gui/QuestMainPanel.java -text
-src/main/java/forge/quest/gui/QuestOptions.java svneol=native#text/plain
-src/main/java/forge/quest/gui/QuestWinLoseCardViewer.java -text
-src/main/java/forge/quest/gui/QuestWinLoseHandler.java -text
-src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java svneol=native#text/plain
-src/main/java/forge/quest/gui/bazaar/package-info.java svneol=native#text/plain
-src/main/java/forge/quest/gui/main/QuestChallengePanel.java -text
-src/main/java/forge/quest/gui/main/QuestDuelPanel.java -text
-src/main/java/forge/quest/gui/main/QuestSelectablePanel.java -text
-src/main/java/forge/quest/gui/main/package-info.java svneol=native#text/plain
-src/main/java/forge/quest/gui/package-info.java svneol=native#text/plain
src/main/java/forge/quest/package-info.java svneol=native#text/plain
src/main/java/forge/util/Base64Coder.java svneol=native#text/plain
src/main/java/forge/util/CopyFiles.java svneol=native#text/plain
@@ -11235,6 +11222,8 @@ src/main/java/forge/view/home/ViewSettings.java -text
src/main/java/forge/view/home/ViewUtilities.java -text
src/main/java/forge/view/home/package-info.java svneol=native#text/plain
src/main/java/forge/view/match/MatchTopLevel.java -text
+src/main/java/forge/view/match/QuestWinLoseCardViewer.java -text
+src/main/java/forge/view/match/QuestWinLoseHandler.java -text
src/main/java/forge/view/match/ViewBattlefield.java -text
src/main/java/forge/view/match/ViewDetail.java -text
src/main/java/forge/view/match/ViewDock.java -text
@@ -11309,7 +11298,6 @@ src/test/java/forge/GuiDownloadSetPicturesLQTest.java svneol=native#text/plain
src/test/java/forge/GuiMigrateLocalMWSSetPicturesHQTest.java svneol=native#text/plain
src/test/java/forge/GuiMultipleBlockers4Test.java svneol=native#text/plain
src/test/java/forge/GuiProgressBarWindowTest.java svneol=native#text/plain
-src/test/java/forge/GuiQuestOptionsTest.java svneol=native#text/plain
src/test/java/forge/PanelTest.java svneol=native#text/plain
src/test/java/forge/PhaseHandlerTest.java -text
src/test/java/forge/RunTest.java svneol=native#text/plain
diff --git a/src/main/java/forge/quest/data/QuestPreferences.java b/src/main/java/forge/quest/data/QuestPreferences.java
index 0e3005aaa44..308493c18aa 100644
--- a/src/main/java/forge/quest/data/QuestPreferences.java
+++ b/src/main/java/forge/quest/data/QuestPreferences.java
@@ -27,7 +27,6 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
-import forge.SetUtils;
import forge.properties.ForgeProps;
import forge.properties.NewConstants.Quest;
diff --git a/src/main/java/forge/quest/gui/QuestAbstractPanel.java b/src/main/java/forge/quest/gui/QuestAbstractPanel.java
deleted file mode 100644
index 2fbb9afa2e2..00000000000
--- a/src/main/java/forge/quest/gui/QuestAbstractPanel.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Forge: Play Magic: the Gathering.
- * Copyright (C) 2011 Forge Team
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see
- * Abstract QuestAbstractPanel class. - *
- * - * @author Forge - * @version $Id$ - */ -public abstract class QuestAbstractPanel extends JPanel { - /** ConstantserialVersionUID=-6378675010346615367L. */
- private static final long serialVersionUID = -6378675010346615367L;
-
- /** The main frame. */
- private QuestFrame mainFrame;
-
- /**
- * - * Constructor for QuestAbstractPanel. - *
- * - * @param mainFrame - * a {@link forge.quest.gui.QuestFrame} object. - */ - protected QuestAbstractPanel(final QuestFrame mainFrame) { - this.setMainFrame(mainFrame); - } - - /** - *- * refreshState. - *
- */ - public abstract void refreshState(); - - /** - * Gets the main frame. - * - * @return the mainFrame - */ - public QuestFrame getMainFrame() { - return this.mainFrame; - } - - /** - * Sets the main frame. - * - * @param mainFrame0 - * the mainFrame to set - */ - public void setMainFrame(final QuestFrame mainFrame0) { - this.mainFrame = mainFrame0; - } -} diff --git a/src/main/java/forge/quest/gui/QuestFrame.java b/src/main/java/forge/quest/gui/QuestFrame.java deleted file mode 100644 index 31313ce5eac..00000000000 --- a/src/main/java/forge/quest/gui/QuestFrame.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2011 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see- * QuestFrame class. - *
- * - * @author Forge - * @version $Id$ - */ -public class QuestFrame extends JFrame { - /** ConstantserialVersionUID=-2832625381531838412L. */
- private static final long serialVersionUID = -2832625381531838412L;
-
- /** The visible panel. */
- private final JPanel visiblePanel;
-
- /** The quest layout. */
- private final CardLayout questLayout;
-
- /** Constant MAIN_PANEL="Main". */
- public static final String MAIN_PANEL = "Main";
-
- /** Constant BAZAAR_PANEL="Bazaar". */
- public static final String BAZAAR_PANEL = "Bazaar";
-
- /** The sub panel map. */
- private final Map- * Constructor for QuestFrame. - *
- * - * - * the headless exception - */ - public QuestFrame() { - this.setTitle("Quest Mode"); - - this.visiblePanel = new JPanel(new BorderLayout()); - this.visiblePanel.setBorder(new EmptyBorder(2, 2, 2, 2)); - this.questLayout = new CardLayout(); - this.visiblePanel.setLayout(this.questLayout); - - QuestAbstractPanel newPanel = new QuestMainPanel(this); - this.visiblePanel.add(newPanel, QuestFrame.MAIN_PANEL); - this.subPanelMap.put(QuestFrame.MAIN_PANEL, newPanel); - - newPanel = null; //new QuestBazaarPanel(this); - this.visiblePanel.add(newPanel, QuestFrame.BAZAAR_PANEL); - this.subPanelMap.put(QuestFrame.BAZAAR_PANEL, newPanel); - - this.getContentPane().setLayout(new BorderLayout()); - this.getContentPane().add(this.visiblePanel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(1024, 768)); - this.setMinimumSize(new Dimension(800, 600)); - - this.questLayout.show(this.visiblePanel, QuestFrame.MAIN_PANEL); - - this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); - this.pack(); - this.setVisible(true); - - GuiUtils.centerFrame(this); - - } - - /** - *- * showPane. - *
- * - * @param paneName - * a {@link java.lang.String} object. - */ - private void showPane(final String paneName) { - this.subPanelMap.get(paneName).refreshState(); - this.questLayout.show(this.visiblePanel, paneName); - } - - /** - *- * showMainPane. - *
- */ - public final void showMainPane() { - this.showPane(QuestFrame.MAIN_PANEL); - } - - /** - *- * showBazaarPane. - *
- */ - public final void showBazaarPane() { - this.showPane(QuestFrame.BAZAAR_PANEL); - } - - /** - *- * returnToMainMenu. - *
- */ - public final void returnToMainMenu() { - AllZone.getQuestData().saveData(); - //new OldGuiNewGame(); - - this.dispose(); - } -} diff --git a/src/main/java/forge/quest/gui/QuestMainPanel.java b/src/main/java/forge/quest/gui/QuestMainPanel.java deleted file mode 100644 index 493f79bc873..00000000000 --- a/src/main/java/forge/quest/gui/QuestMainPanel.java +++ /dev/null @@ -1,945 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2011 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see- * QuestMainPanel class. - *
- * VIEW - lays out swing components for duel and challenge events. - * - * @author Forge - * @version $Id: QuestMainPanel.java 10358 2011-09-11 05:20:13Z Doublestrike $ - */ -public class QuestMainPanel extends QuestAbstractPanel { - /** ConstantserialVersionUID=6142934729724012402L. */
- private static final long serialVersionUID = 6142934729724012402L;
-
- private final forge.quest.data.QuestData questData;
- private forge.quest.data.QuestEventManager qem;
-
- /** The credits label. */
- private final JLabel creditsLabel = new JLabel();
-
- /** The life label. */
- private final JLabel lifeLabel = new JLabel();
-
- /** The stats label. */
- private final JLabel statsLabel = new JLabel();
-
- /** The title label. */
- private final JLabel titleLabel = new JLabel();
-
- /** The next quest label. */
- private final JLabel nextQuestLabel = new JLabel();
-
- /** The pet combo box. */
- private final JComboBox petComboBox = new JComboBox();
-
- /** The deck combo box. */
- private final JComboBox deckComboBox = new JComboBox();
-
- /** The event button. */
- private final JButton eventButton = new JButton("Challenges");
-
- /** The play button. */
- private final JButton playButton = new JButton("Play");
-
- private QuestSelectablePanel selectedOpponent;
-
- /** The next match panel. */
- private final JPanel nextMatchPanel = new JPanel();
-
- /** The next match layout. */
- private CardLayout nextMatchLayout;
-
- /** The is showing challenges. */
- private boolean isShowingChallenges = false;
- private final JCheckBox devModeCheckBox = new JCheckBox("Developer Mode");
- // private JCheckBox newGUICheckbox = new JCheckBox("Use new UI", true);
- private final JCheckBox smoothLandCheckBox = new JCheckBox("Adjust AI Land");
- private final JCheckBox petCheckBox = new JCheckBox("Summon Pet");
-
- private final JCheckBox plantBox = new JCheckBox("Summon Plant");
- /** Constant NO_DECKS_AVAILABLE="No decks available". */
- private static final String NO_DECKS_AVAILABLE = "No decks available";
- /** Constant DUELS="Duels". */
- private static final String DUELS = "Duels";
- /** Constant CHALLENGES="Challenges". */
- private static final String CHALLENGES = "Challenges";
-
- // TODO: Make this ordering permanent
- /**
- * Constant lastUsedDeck
- * .
- */
- private static String lastUsedDeck;
- private final JButton zeppelinButton = new JButton("Launch- * Constructor for QuestMainPanel. - *
- * - * @param mainFrame - * a {@link forge.quest.gui.QuestFrame} object. - */ - public QuestMainPanel(final QuestFrame mainFrame) { - super(mainFrame); - this.questData = AllZone.getQuestData(); - this.qem = AllZone.getQuestEventManager(); - - // QuestEventManager is the MODEL for this VIEW. - // All quest events are generated here, the first time the VIEW is made. - if (this.qem == null) { - this.qem = new QuestEventManager(); - this.qem.assembleAllEvents(); - AllZone.setQuestEventManager(this.qem); - } - - this.initUI(); - } - - /** - *- * initUI. - *
- */ - private void initUI() { - this.refresh(); - this.setLayout(new BorderLayout(5, 5)); - final JPanel centerPanel = new JPanel(new BorderLayout()); - this.add(centerPanel, BorderLayout.CENTER); - - final JPanel northPanel = this.createStatusPanel(); - this.add(northPanel, BorderLayout.NORTH); - - final JPanel eastPanel = this.createSidePanel(); - this.add(eastPanel, BorderLayout.EAST); - - final JPanel matchSettingsPanel = this.createMatchSettingsPanel(); - centerPanel.add(matchSettingsPanel, BorderLayout.SOUTH); - - centerPanel.add(this.nextMatchPanel, BorderLayout.CENTER); - this.setBorder(new EmptyBorder(5, 5, 5, 5)); - - } - - /** - *- * createStatusPanel. - *
- * - * @return a {@link javax.swing.JPanel} object. - */ - private JPanel createStatusPanel() { - final JPanel northPanel = new JPanel(); - JLabel modeLabel; - JLabel difficultyLabel; // Create labels at the top - this.titleLabel.setFont(new Font(Font.DIALOG, Font.PLAIN, 28)); - this.titleLabel.setAlignmentX(Component.LEFT_ALIGNMENT); - northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.Y_AXIS)); - northPanel.add(this.titleLabel); - - northPanel.add(Box.createVerticalStrut(5)); - - final JPanel statusPanel = new JPanel(); - statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.X_AXIS)); - statusPanel.setAlignmentX(Component.LEFT_ALIGNMENT); - - modeLabel = new JLabel(this.questData.getMode()); - statusPanel.add(modeLabel); - statusPanel.add(Box.createHorizontalGlue()); - - difficultyLabel = new JLabel(this.questData.getDifficulty()); - statusPanel.add(difficultyLabel); - statusPanel.add(Box.createHorizontalGlue()); - - statusPanel.add(this.statsLabel); - - northPanel.add(statusPanel); - return northPanel; - } - - /** - *- * createSidePanel. - *
- * - * @return a {@link javax.swing.JPanel} object. - */ - private JPanel createSidePanel() { - final JPanel panel = new JPanel(); - JPanel optionsPanel; // Create options checkbox list - optionsPanel = this.createOptionsPanel(); - - final List- * createOptionsPanel. - *
- * - * @return a {@link javax.swing.JPanel} object. - */ - private JPanel createOptionsPanel() { - JPanel optionsPanel; - optionsPanel = new JPanel(); - optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS)); - - // optionsPanel.add(this.newGUICheckbox); - optionsPanel.add(Box.createVerticalStrut(5)); - optionsPanel.add(this.smoothLandCheckBox); - optionsPanel.add(Box.createVerticalStrut(5)); - optionsPanel.add(this.devModeCheckBox); - optionsPanel.setBorder(new TitledBorder(new EtchedBorder(), "Options")); - return optionsPanel; - } - - /** - *- * createMatchSettingsPanel. - *
- * - * @return a {@link javax.swing.JPanel} object. - */ - private JPanel createMatchSettingsPanel() { - - final JPanel matchPanel = new JPanel(); - matchPanel.setLayout(new BoxLayout(matchPanel, BoxLayout.Y_AXIS)); - - final JPanel deckPanel = new JPanel(); - deckPanel.setLayout(new BoxLayout(deckPanel, BoxLayout.X_AXIS)); - - final JLabel deckLabel = new JLabel("Use Deck"); - deckPanel.add(deckLabel); - GuiUtils.addGap(deckPanel); - - this.deckComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(final ActionEvent actionEvent) { - QuestMainPanel.this.playButton.setEnabled(QuestMainPanel.this.canGameBeLaunched()); - QuestMainPanel.lastUsedDeck = (String) QuestMainPanel.this.deckComboBox.getSelectedItem(); - } - }); - - deckPanel.add(this.deckComboBox); - GuiUtils.addGap(deckPanel); - - final JButton editDeckButton = new JButton("Deck Editor"); - editDeckButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(final ActionEvent actionEvent) { - QuestMainPanel.this.showDeckEditor(); - } - }); - deckPanel.add(editDeckButton); - deckPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, deckPanel.getPreferredSize().height)); - deckPanel.setAlignmentX(Component.LEFT_ALIGNMENT); - matchPanel.add(deckPanel); - - GuiUtils.addGap(matchPanel); - - if (this.questData.getMode().equals(forge.quest.data.QuestData.FANTASY)) { - final JPanel fantasyPanel = new JPanel(); - fantasyPanel.setLayout(new BorderLayout()); - - final JPanel petPanel = new JPanel(); - petPanel.setLayout(new BoxLayout(petPanel, BoxLayout.X_AXIS)); - - this.petCheckBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(final ActionEvent actionEvent) { - if (QuestMainPanel.this.petCheckBox.isSelected()) { - QuestMainPanel.this.questData.getPetManager().setSelectedPet( - (String) QuestMainPanel.this.petComboBox.getSelectedItem()); - } else { - QuestMainPanel.this.questData.getPetManager().setSelectedPet(null); - } - - QuestMainPanel.this.petComboBox.setEnabled(QuestMainPanel.this.petCheckBox.isSelected()); - } - }); - - petPanel.add(this.petCheckBox); - GuiUtils.addGap(petPanel); - this.petComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(final ActionEvent actionEvent) { - if (QuestMainPanel.this.petCheckBox.isSelected()) { - QuestMainPanel.this.questData.getPetManager().setSelectedPet( - (String) QuestMainPanel.this.petComboBox.getSelectedItem()); - } else { - QuestMainPanel.this.questData.getPetManager().setSelectedPet(null); - } - } - }); - this.petComboBox.setMaximumSize(new Dimension(Integer.MAX_VALUE, (int) this.petCheckBox.getPreferredSize() - .getHeight())); - petPanel.add(this.petComboBox); - - this.plantBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(final ActionEvent actionEvent) { - QuestMainPanel.this.questData.getPetManager() - .setUsePlant(QuestMainPanel.this.plantBox.isSelected()); - } - }); - - GuiUtils.addGap(petPanel, 10); - petPanel.add(this.plantBox); - petPanel.setMaximumSize(petPanel.getPreferredSize()); - petPanel.setAlignmentX(Component.LEFT_ALIGNMENT); - - fantasyPanel.add(petPanel, BorderLayout.WEST); - - this.zeppelinButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(final ActionEvent actionEvent) { - QuestMainPanel.this.questData.randomizeOpponents(); - QuestMainPanel.this.refreshNextMatchPanel(); - final QuestItemZeppelin zeppelin = (QuestItemZeppelin) QuestMainPanel.this.questData.getInventory() - .getItem("Zeppelin"); - zeppelin.setZeppelinUsed(true); - QuestMainPanel.this.zeppelinButton.setEnabled(false); - } - }); - - this.zeppelinButton.setMaximumSize(this.zeppelinButton.getPreferredSize()); - this.zeppelinPanel.setLayout(new BorderLayout()); - - fantasyPanel.add(this.zeppelinPanel, BorderLayout.EAST); - fantasyPanel.setAlignmentX(Component.LEFT_ALIGNMENT); - matchPanel.add(fantasyPanel); - } - return matchPanel; - } - - /** - *- * createDuelPanel. - *
- * Makes a parent panel, then selectable panel instances for all available - * duels. - * - * @return a {@link javax.swing.JPanel} object. - */ - private JPanel createDuelPanel() { - final JPanel duelPanel = new JPanel(); - QuestDuelPanel duelEvent; - duelPanel.setLayout(new BoxLayout(duelPanel, BoxLayout.Y_AXIS)); - duelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Available Duels")); - - final List- * createChallengePanel. - *
- * Makes a parent panel, then selectable panel instances for all available - * challenges. - * - * @return a {@link javax.swing.JPanel} object. - */ - private JPanel createChallengePanel() { - final JPanel challengePanel = new JPanel(); - - QuestSelectablePanel selpan; - challengePanel.setLayout(new BoxLayout(challengePanel, BoxLayout.Y_AXIS)); - challengePanel.setBorder(new TitledBorder(new EtchedBorder(), "Available Challenges")); - - final List- * refresh. - *
- */ - final void refresh() { - AllZone.getQuestData().saveData(); - - this.devModeCheckBox.setSelected(Constant.Runtime.DEV_MODE[0]); - this.smoothLandCheckBox.setSelected(Constant.Runtime.SMOOTH[0]); - - this.creditsLabel.setText(" " + this.questData.getCredits()); - this.statsLabel.setText(this.questData.getWin() + " wins / " + this.questData.getLost() + " losses"); - this.titleLabel.setText(this.questData.getRank()); - - // copy lastUsedDeck as removal triggers selection change. - final String lastUsedDeck = QuestMainPanel.lastUsedDeck; - this.deckComboBox.removeAllItems(); - - if (this.questData.getDeckNames().size() > 0) { - this.deckComboBox.setEnabled(true); - - final List- * refreshNextMatchPanel. - *
- */ - private void refreshNextMatchPanel() { - this.nextMatchPanel.removeAll(); - this.nextMatchLayout = new CardLayout(); - this.nextMatchPanel.setLayout(this.nextMatchLayout); - this.nextMatchPanel.add(this.createDuelPanel(), QuestMainPanel.DUELS); - this.nextMatchPanel.add(this.createChallengePanel(), QuestMainPanel.CHALLENGES); - if (this.isShowingChallenges) { - this.nextMatchLayout.show(this.nextMatchPanel, QuestMainPanel.CHALLENGES); - } else { - this.nextMatchLayout.show(this.nextMatchPanel, QuestMainPanel.DUELS); - } - } - - /** - *- * nextChallengeInWins. - *
- * - * @return a int. - */ - private int nextChallengeInWins() { - - // Number of wins was 25, lowereing the number to 20 to help short term - // questers. - if (this.questData.getWin() < 20) { - return 20 - this.questData.getWin(); - } - - // The int mul has been lowered by one, should face special opps more - // frequently. - final int challengesPlayed = this.questData.getChallengesPlayed(); - int mul = 5; - - if (this.questData.getInventory().hasItem("Zeppelin")) { - mul = 3; - } else if (this.questData.getInventory().hasItem("Map")) { - mul = 4; - } - - final int delta = (challengesPlayed * mul) - this.questData.getWin(); - - return (delta > 0) ? delta : 0; - } - - /** - *- * showDeckEditor. - *
- */ - final void showDeckEditor() { - final Command exit = new Command() { - private static final long serialVersionUID = -5110231879431074581L; - - @Override - public void execute() { - // saves all deck data - AllZone.getQuestData().saveData(); - - new QuestFrame(); - } - }; - - final DeckEditorQuest g = new DeckEditorQuest(AllZone.getQuestData()); - - g.show(exit); - g.setVisible(true); - this.getMainFrame().dispose(); - } // deck editor button - - /** - *- * showBazaar. - *
- */ - final void showBazaar() { - this.getMainFrame().showBazaarPane(); - } - - /** - *- * showCardShop. - *
- */ - final void showCardShop() { - final Command exit = new Command() { - private static final long serialVersionUID = 8567193482568076362L; - - @Override - public void execute() { - // saves all deck data - AllZone.getQuestData().saveData(); - - new QuestFrame(); - } - }; - - final DeckEditorShop g = new DeckEditorShop(this.questData); - - g.show(exit); - g.setVisible(true); - - this.getMainFrame().dispose(); - - } // card shop button - - /** - *- * launchGame. - *
- */ - private void launchGame() { - // TODO This is a temporary hack to see if the image cache affects the - // heap usage significantly. - ImageCache.clear(); - - final QuestItemZeppelin zeppelin = (QuestItemZeppelin) this.questData.getInventory().getItem("Zeppelin"); - zeppelin.setZeppelinUsed(false); - this.questData.randomizeOpponents(); - - final String humanDeckName = (String) this.deckComboBox.getSelectedItem(); - - final Deck humanDeck = this.questData.getDeck(humanDeckName); - - Constant.Runtime.HUMAN_DECK[0] = humanDeck; - this.moveDeckToTop(humanDeckName); - - Constant.Quest.OPP_ICON_NAME[0] = this.getEventIconFilename(); - - - GuiTopLevel g = (GuiTopLevel) AllZone.getDisplay(); - g.getController().changeState(FControl.MATCH_SCREEN); - g.getController().getMatchController().initMatch(); - - Constant.Runtime.SMOOTH[0] = this.smoothLandCheckBox.isSelected(); - - AllZone.getMatchState().reset(); - if (this.isShowingChallenges) { - this.setupChallenge(humanDeck); - } else { - this.setupDuel(humanDeck); - } - - AllZone.getQuestData().saveData(); - - AllZone.getDisplay().setVisible(true); - this.getMainFrame().dispose(); - } - - /** - *- * setupDuel. - *
- * - * @param humanDeck - * a {@link forge.deck.Deck} object. - */ - final void setupDuel(final Deck humanDeck) { - final Deck computer = this.selectedOpponent.getEvent().getEventDeck(); - Constant.Runtime.COMPUTER_DECK[0] = computer; - - final QuestDuel selectedDuel = (QuestDuel) this.selectedOpponent.getEvent(); - AllZone.setQuestEvent(selectedDuel); - - AllZone.getGameAction().newGame(humanDeck, computer, QuestUtil.getHumanStartingCards(this.questData), - QuestUtil.getComputerStartingCards(this.questData), this.questData.getLife(), 20); - } - - /** - *- * setupChallenge. - *
- * - * @param humanDeck - * a {@link forge.deck.Deck} object. - */ - private void setupChallenge(final Deck humanDeck) { - final QuestChallenge selectedChallenge = (QuestChallenge) this.selectedOpponent.getEvent(); - - final Deck computer = this.selectedOpponent.getEvent().getEventDeck(); - Constant.Runtime.COMPUTER_DECK[0] = computer; - - AllZone.setQuestEvent(selectedChallenge); - - int extraLife = 0; - - if (this.questData.getInventory().getItemLevel("Gear") == 2) { - extraLife = 3; - } - - AllZone.getGameAction().newGame(humanDeck, computer, - QuestUtil.getHumanStartingCards(this.questData, selectedChallenge), - QuestUtil.getComputerStartingCards(this.questData, selectedChallenge), - this.questData.getLife() + extraLife, selectedChallenge.getAILife()); - - } - - /** - *- * getEventIconFilename. - *
- * - * @return a {@link java.lang.String} object. - */ - private String getEventIconFilename() { - return this.selectedOpponent.getIconFilename(); - } - - /** - *- * showChallenges. - *
- */ - final void showChallenges() { - if (this.isShowingChallenges) { - this.isShowingChallenges = false; - this.eventButton.setText("Challenges"); - } else { - this.isShowingChallenges = true; - this.eventButton.setText("Duels"); - } - - if (this.selectedOpponent != null) { - this.selectedOpponent.setSelected(false); - } - - this.selectedOpponent = null; - - this.refresh(); - } - - /** - * The Class SelectionAdapter. - */ - class SelectionAdapter extends MouseAdapter { - - /** The selectable panel. */ - private final QuestSelectablePanel selectablePanel; - - /** - * Instantiates a new selection adapter. - * - * @param selectablePanel - * the selectable panel - */ - SelectionAdapter(final QuestSelectablePanel selectablePanel) { - super(); - this.selectablePanel = selectablePanel; - } - - /* - * (non-Javadoc) - * - * @see - * java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent) - */ - @Override - public void mouseClicked(final MouseEvent mouseEvent) { - - if (QuestMainPanel.this.selectedOpponent != null) { - QuestMainPanel.this.selectedOpponent.setSelected(false); - } - - this.selectablePanel.setSelected(true); - - QuestMainPanel.this.selectedOpponent = this.selectablePanel; - QuestMainPanel.this.playButton.setEnabled(QuestMainPanel.this.canGameBeLaunched()); - } - - } - - /** - *- * moveDeckToTop. - *
- * - * @param humanDeckName - * a {@link java.lang.String} object. - */ - private void moveDeckToTop(final String humanDeckName) { - QuestMainPanel.lastUsedDeck = humanDeckName; - } - - /** - *- * canGameBeLaunched. - *
- * - * @return a boolean. - */ - final boolean canGameBeLaunched() { - return !(QuestMainPanel.NO_DECKS_AVAILABLE.equals(this.deckComboBox.getSelectedItem()) || (this.selectedOpponent == null)); - } - - /** {@inheritDoc} */ - @Override - public final void refreshState() { - this.refresh(); - } - -} diff --git a/src/main/java/forge/quest/gui/QuestOptions.java b/src/main/java/forge/quest/gui/QuestOptions.java deleted file mode 100644 index b565287d08a..00000000000 --- a/src/main/java/forge/quest/gui/QuestOptions.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2011 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see- * Gui_QuestOptions class. - *
- * - * @author Forge - * @version $Id$ - */ -public class QuestOptions extends JFrame { - /** ConstantserialVersionUID=2018518804206822235L. */
- private static final long serialVersionUID = 2018518804206822235L;
-
- private final QuestData questData = new QuestData();
-
- private final JLabel jLabel1 = new JLabel();
- private final JButton continueQuestButton = new JButton();
- private final JPanel jPanel1 = new JPanel();
- private final JPanel jPanel2 = new JPanel();
- private final GridLayout gridLayout1 = new GridLayout();
-
- private final JRadioButton easyRadio = new JRadioButton();
- private final JRadioButton hardRadio = new JRadioButton();
- private final JRadioButton mediumRadio = new JRadioButton();
- private final JRadioButton veryHardRadio = new JRadioButton();
-
- private final JRadioButton fantasyRadio = new JRadioButton();
- private final JRadioButton classicRadio = new JRadioButton();
-
- private final JCheckBox cbStandardStart = new JCheckBox();
-
- private final JButton newQuestButton = new JButton();
- private final JTextArea jTextArea1 = new JTextArea();
- private final ButtonGroup buttonGroup1 = new ButtonGroup();
- private final ButtonGroup buttonGroup2 = new ButtonGroup();
- private final JPanel jPanel3 = new JPanel();
-
- /**
- * - * Constructor for Gui_QuestOptions. - *
- */ - public QuestOptions() { - try { - this.jbInit(); - } catch (final Exception ex) { - ErrorViewer.showError(ex); - } - - this.setup(); - this.setupRadioButtonText(); - - this.setSize(540, 555); - GuiUtils.centerFrame(this); - this.setVisible(true); - } - - /** - *- * setup. - *
- */ - private void setup() { - // make the text look correct on the screen - this.jTextArea1.setBackground(this.getBackground()); - - // if user closes this window, go back to "New Game" screen - this.addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(final WindowEvent ev) { - QuestOptions.this.dispose(); - } - }); - - // is there any saved data? - //if (!this.questData.hasSaveFile()) { - // this.continueQuestButton.setEnabled(false); - //} - } // setup() - - // show total number of games for each difficulty - /** - *- * setupRadioButtonText. - *
- */ - private void setupRadioButtonText() { - /*final String[] diff = QuestPreferences.getDifficulty(); - final JRadioButton[] b = { this.easyRadio, this.mediumRadio, this.hardRadio, this.veryHardRadio }; - - for (int i = 0; i < diff.length; i++) { - // -2 because you start a level 1, and the last level is secret - final int numberLevels = QuestData.RANK_TITLES.length - 2; - final int numGames = numberLevels * QuestPreferences.getWinsForRankIncrease(i); - - b[i].setText(String.format("%s - %d", diff[i], numGames)); - }*/ - - } // setupRadioButtonText() - - /** - *- * jbInit. - *
- * - * @throws java.lang.Exception - * if any. - */ - private void jbInit() throws Exception { - final TitledBorder titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color( - 148, 145, 140)), "Quest Length"); - final Border border2 = BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)); - final TitledBorder titledBorder2 = new TitledBorder(border2, "Continue"); - this.jLabel1.setFont(new java.awt.Font("Dialog", 0, 25)); - this.jLabel1.setHorizontalAlignment(SwingConstants.CENTER); - this.jLabel1.setText("Quest Options"); - this.jLabel1.setBounds(new Rectangle(1, 0, 539, 63)); - this.setTitle("Quest Options"); - this.getContentPane().setLayout(null); - this.continueQuestButton.setBounds(new Rectangle(69, 28, 179, 35)); - this.continueQuestButton.setFont(new java.awt.Font("Dialog", 0, 18)); - this.continueQuestButton.setText("Continue Quest"); - this.continueQuestButton.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final ActionEvent e) { - QuestOptions.this.continueQuestButtonActionPerformed(e); - } - }); - this.jPanel1.setBorder(titledBorder1); - this.jPanel1.setBounds(new Rectangle(20, 63, 500, 353)); - this.jPanel1.setLayout(null); - - this.jPanel2.setBounds(new Rectangle(20, 27, 460, 101)); - this.jPanel2.setLayout(this.gridLayout1); - - this.gridLayout1.setColumns(2); - this.gridLayout1.setRows(4); - - this.easyRadio.setText("Easy - 50 games"); - this.mediumRadio.setText("Medium - 100 games"); - this.hardRadio.setText("Hard - 200 games"); - this.veryHardRadio.setText("Very Hard - 300 games"); - this.classicRadio.setText("Classic"); - this.fantasyRadio.setText("Fantasy"); - - this.easyRadio.setSelected(true); - this.classicRadio.setSelected(true); - - this.cbStandardStart.setText("Standard (Type 2) Starting Pool"); - - this.newQuestButton.setBounds(new Rectangle(179, 292, 140, 38)); - this.newQuestButton.setFont(new java.awt.Font("Dialog", 0, 16)); - this.newQuestButton.setText("New Quest"); - this.newQuestButton.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final ActionEvent e) { - QuestOptions.this.newQuestButtonActionPerformed(e); - } - }); - - final StringBuilder sb = new StringBuilder(); - sb.append("New Quest will delete your current player decks, credits and win loss record. "); - sb.append("Continue Quest will allow you to continue a quest that you started at an earlier time."); - sb.append("\r\n"); - sb.append("\r\n"); - sb.append("Fantasy adds a Bazaar and the occasional fantasy themed opponent for you to battle."); - - this.jTextArea1.setBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140))); - this.jTextArea1.setEnabled(false); - this.jTextArea1.setFont(new java.awt.Font("Dialog", 0, 12)); - this.jTextArea1.setDisabledTextColor(Color.black); - this.jTextArea1.setEditable(false); - // jTextArea1.setText("Note: Starting a new quest will delete your current quest data"); - this.jTextArea1.setText(sb.toString()); - this.jTextArea1.setLineWrap(true); - this.jTextArea1.setWrapStyleWord(true); - this.jTextArea1.setBounds(new Rectangle(86, 145, 327, 128)); - - this.jPanel3.setBorder(titledBorder2); - this.jPanel3.setBounds(new Rectangle(110, 427, 323, 86)); - this.jPanel3.setLayout(null); - - this.jPanel2.add(this.easyRadio, null); - this.jPanel2.add(this.classicRadio, null); - this.jPanel2.add(this.mediumRadio, null); - this.jPanel2.add(this.fantasyRadio, null); - this.jPanel2.add(this.hardRadio, null); - this.jPanel2.add(new JLabel("")); // for empty cell - this.jPanel2.add(this.veryHardRadio, null); - this.jPanel2.add(this.cbStandardStart, null); - - this.jPanel1.add(this.newQuestButton, null); - this.jPanel1.add(this.jTextArea1, null); - this.getContentPane().add(this.jPanel1, null); - this.getContentPane().add(this.jPanel3, null); - this.jPanel3.add(this.continueQuestButton, null); - this.getContentPane().add(this.jLabel1, null); - this.jPanel1.add(this.jPanel2, null); - this.buttonGroup1.add(this.easyRadio); - this.buttonGroup1.add(this.mediumRadio); - this.buttonGroup1.add(this.hardRadio); - this.buttonGroup1.add(this.veryHardRadio); - - this.buttonGroup2.add(this.classicRadio); - this.buttonGroup2.add(this.fantasyRadio); - - } - - /** - *- * continueQuestButton_actionPerformed. - *
- * - * @param e - * a {@link java.awt.event.ActionEvent} object. - */ - final void continueQuestButtonActionPerformed(final ActionEvent e) { - // set global variable - /*AllZone.setQuestData(QuestDataIO.loadData()); - AllZone.getQuestData().guessDifficultyIndex(); - this.dispose(); - - new QuestFrame(); -*/ - } - - /** - *- * newQuestButton_actionPerformed. - *
- * - * @param e - * a {@link java.awt.event.ActionEvent} object. - */ - final void newQuestButtonActionPerformed(final ActionEvent e) { - int difficulty = 0; - - final String mode = this.fantasyRadio.isSelected() ? forge.quest.data.QuestData.FANTASY - : forge.quest.data.QuestData.CLASSIC; - - if (this.easyRadio.isSelected()) { - difficulty = 0; - } else if (this.mediumRadio.isSelected()) { - difficulty = 1; - } else if (this.hardRadio.isSelected()) { - difficulty = 2; - } else if (this.veryHardRadio.isSelected()) { - difficulty = 3; - } else { - // user didn't select a difficulty{ - return; - } - - /* if (this.questData.hasSaveFile()) { - // this will overwrite your save file! - final Object[] possibleValues = { "Yes", "No" }; - final Object choice = JOptionPane.showOptionDialog(null, - "Starting a new quest will overwrite your current quest. Continue?", "Start New Quest?", - JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, possibleValues, possibleValues[1]); - - if (!choice.equals(0)) { - return; - } - }*/ - - // give the user a few cards to build a deck - this.questData.newGame(difficulty, mode, this.cbStandardStart.isSelected()); - - this.questData.saveData(); - - // set global variable - AllZone.setQuestData(this.questData); - - this.dispose(); - new QuestFrame(); - } - -} diff --git a/src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java b/src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java deleted file mode 100644 index b4866534f5c..00000000000 --- a/src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java +++ /dev/null @@ -1,205 +0,0 @@ -package forge.quest.gui.bazaar; - -import forge.quest.gui.QuestAbstractPanel; -import forge.quest.gui.QuestFrame; - -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2011 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see- * QuestBazaarPanel class. - *
- * - * @author Forge - * @version $Id$ - */ -public class QuestBazaarPanel extends QuestAbstractPanel { - /** - * TODO: Write javadoc for Constructor. - * @param mainFrame - */ - protected QuestBazaarPanel(QuestFrame mainFrame) { - super(mainFrame); - // TODO Auto-generated constructor stub - throw new net.slightlymagic.braids.util.NotImplementedError(); - } - - @Override - public void refreshState() { - // TODO Auto-generated method stub - throw new net.slightlymagic.braids.util.NotImplementedError(); - } -/* - /** ConstantserialVersionUID=1418913010051869222L. *
- private static final long serialVersionUID = 1418913010051869222L;
-
- /** Constant stallList. *
- private static List- * showStall. - *
- * - * @param source - * a {@link java.lang.String} object. - * - private void showStall(final String source) { - this.stallLayout.show(this.stallPanel, source); - } - - /** - * Slightly hackish, but should work. - * - static void refreshLastInstance() { - for (final QuestBazaarStall stall : QuestBazaarPanel.stallList) { - stall.updateItems(); - } - } - - /** {@inheritDoc} * - @Override - public final void refreshState() { - QuestBazaarPanel.refreshLastInstance(); - } */ - - /* (non-Javadoc) - * @see forge.quest.gui.QuestAbstractPanel#refreshState() - */ -} diff --git a/src/main/java/forge/quest/gui/bazaar/package-info.java b/src/main/java/forge/quest/gui/bazaar/package-info.java deleted file mode 100644 index 9276ee35f2e..00000000000 --- a/src/main/java/forge/quest/gui/bazaar/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -/** Forge Card Game. */ -package forge.quest.gui.bazaar; - diff --git a/src/main/java/forge/quest/gui/main/QuestChallengePanel.java b/src/main/java/forge/quest/gui/main/QuestChallengePanel.java deleted file mode 100644 index 26478faff07..00000000000 --- a/src/main/java/forge/quest/gui/main/QuestChallengePanel.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2011 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see- * QuestQuestPanel. - *
- * VIEW - Creates a QuestSelectablePanel instance for a "quest" style event. - */ - -@SuppressWarnings("serial") -public class QuestChallengePanel extends QuestSelectablePanel { - - private JLabel repeatabilityLabel; - - /** - *- * QuestChallengePanel. - *
- * Constructor, using challenge data instance. - * - * @param q - * the q - */ - public QuestChallengePanel(final QuestChallenge q) { - super(q); - - GuiUtils.addGap(super.getRootPanel(), 7); - - if (q.getRepeatable()) { - this.repeatabilityLabel = new JLabel("This challenge is repeatable"); - } else { - this.repeatabilityLabel = new JLabel("This challenge is not repeatable"); - } - - super.getRootPanel().add(this.repeatabilityLabel); - - } -} diff --git a/src/main/java/forge/quest/gui/main/QuestDuelPanel.java b/src/main/java/forge/quest/gui/main/QuestDuelPanel.java deleted file mode 100644 index 725d8bf92ba..00000000000 --- a/src/main/java/forge/quest/gui/main/QuestDuelPanel.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2011 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see- * QuestDuelPanel. - *
- * VIEW - Creates a QuestSelectablePanel instance for a "battle" style event. - */ -@SuppressWarnings("serial") -public class QuestDuelPanel extends QuestSelectablePanel { - - /** - *- * QuestDuelPanel. - *
- * Constructor, using duel data instance. - * - * @param d - * the d - */ - public QuestDuelPanel(final QuestDuel d) { - super(d); - } - -} diff --git a/src/main/java/forge/quest/gui/main/QuestSelectablePanel.java b/src/main/java/forge/quest/gui/main/QuestSelectablePanel.java deleted file mode 100644 index 7fb7383bb20..00000000000 --- a/src/main/java/forge/quest/gui/main/QuestSelectablePanel.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2011 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see- * QuestSelectablePanel class. - *
- * VIEW - Creates a selectable panel, used for picking events. - * - * @author Forge - * @version $Id$ - */ -public class QuestSelectablePanel extends JPanel { - /** ConstantserialVersionUID=-1502285997894190742L. */
- private static final long serialVersionUID = -1502285997894190742L;
-
- /** The background color. */
- private final Color backgroundColor;
- private boolean selected;
- private final QuestEvent event;
- private String iconfilename;
-
- /** The root panel. */
- private JPanel rootPanel = new JPanel();
-
- /**
- * - * Constructor for QuestSelectablePanel. - *
- * VIEW - A JPanel for selecting quest events. - * - * @param qe - * the qe - */ - public QuestSelectablePanel(final QuestEvent qe) { - this.event = qe; - this.iconfilename = qe.getIconFilename(); - final File base = ForgeProps.getFile(NewConstants.IMAGE_ICON); - File file = new File(base, this.iconfilename); - - final ImageIcon icon; - if (!file.exists()) { - icon = Singletons.getView().getSkin().getIcon(FSkin.ForgeIcons.ICO_UNKNOWN); - } - else { - icon = new ImageIcon(file.toString()); - } - - this.backgroundColor = this.getBackground(); - this.setLayout(new BorderLayout(5, 5)); - - JLabel iconLabel; - - if (icon.getIconHeight() == -1) { - iconLabel = new JLabel(GuiUtils.getEmptyIcon(40, 40)); - } else { - iconLabel = new JLabel(GuiUtils.getResizedIcon(icon, 40, 40)); - } - - iconLabel.setBorder(new LineBorder(Color.BLACK)); - iconLabel.setAlignmentY(Component.TOP_ALIGNMENT); - - final JPanel iconPanel = new JPanel(new BorderLayout()); - iconPanel.setOpaque(false); - iconPanel.add(iconLabel, BorderLayout.NORTH); - this.add(iconPanel, BorderLayout.WEST); - - this.getRootPanel().setOpaque(false); - this.getRootPanel().setLayout(new BoxLayout(this.getRootPanel(), BoxLayout.Y_AXIS)); - this.add(this.getRootPanel(), BorderLayout.CENTER); - - final JPanel centerTopPanel = new JPanel(); - centerTopPanel.setOpaque(false); - centerTopPanel.setAlignmentX(Component.LEFT_ALIGNMENT); - centerTopPanel.setLayout(new BoxLayout(centerTopPanel, BoxLayout.X_AXIS)); - - final JLabel nameLabel = new JLabel(qe.getTitle()); - GuiUtils.setFontSize(nameLabel, 20); - nameLabel.setAlignmentY(Component.BOTTOM_ALIGNMENT); - centerTopPanel.add(nameLabel); - - GuiUtils.addExpandingHorizontalSpace(centerTopPanel); - - final JLabel difficultyLabel = new JLabel(qe.getDifficulty()); - difficultyLabel.setAlignmentY(Component.BOTTOM_ALIGNMENT); - centerTopPanel.add(difficultyLabel); - this.getRootPanel().add(centerTopPanel); - - GuiUtils.addGap(this.getRootPanel()); - - final JLabel descriptionLabel = new JLabel(qe.getDescription()); - descriptionLabel.setAlignmentX(Component.LEFT_ALIGNMENT); - this.getRootPanel().add(descriptionLabel); - - this.setMaximumSize(new Dimension(Integer.MAX_VALUE, 80)); - this.setBorder(new CompoundBorder(new LineBorder(Color.BLACK), new EmptyBorder(5, 5, 5, 5))); - } - - /** - *- * isSelected. - *
- * - * @return a boolean. - */ - public final boolean isSelected() { - return this.selected; - } - - /** - *
- * Setter for the field selected.
- *
- * getIconFilename. - *
- * - * @return String - */ - public final String getIconFilename() { - return this.iconfilename; - } - - /** - *- * getEvent. - *
- * - * @return QuestEvent - */ - public final QuestEvent getEvent() { - return this.event; - } - - /** - * Gets the root panel. - * - * @return the rootPanel - */ - public JPanel getRootPanel() { - return this.rootPanel; - } - - /** - * Sets the root panel. - * - * @param rootPanel0 - * the rootPanel to set - */ - public void setRootPanel(final JPanel rootPanel0) { - this.rootPanel = rootPanel0; - } -} diff --git a/src/main/java/forge/quest/gui/main/package-info.java b/src/main/java/forge/quest/gui/main/package-info.java deleted file mode 100644 index 2b1c4d710bf..00000000000 --- a/src/main/java/forge/quest/gui/main/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -/** Forge Card Game. */ -package forge.quest.gui.main; - diff --git a/src/main/java/forge/quest/gui/package-info.java b/src/main/java/forge/quest/gui/package-info.java deleted file mode 100644 index 70e242dd95f..00000000000 --- a/src/main/java/forge/quest/gui/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -/** Forge Card Game. */ -package forge.quest.gui; - diff --git a/src/main/java/forge/quest/gui/QuestWinLoseCardViewer.java b/src/main/java/forge/view/match/QuestWinLoseCardViewer.java similarity index 96% rename from src/main/java/forge/quest/gui/QuestWinLoseCardViewer.java rename to src/main/java/forge/view/match/QuestWinLoseCardViewer.java index 7104db8b9e9..79e5702d084 100644 --- a/src/main/java/forge/quest/gui/QuestWinLoseCardViewer.java +++ b/src/main/java/forge/view/match/QuestWinLoseCardViewer.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see