mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Moved control accessors from ViewHome to ControlHome, added view accessors to ViewHome.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
package forge.control;
|
package forge.control;
|
||||||
|
|
||||||
|
import forge.control.home.ControlConstructed;
|
||||||
|
import forge.control.home.ControlDraft;
|
||||||
|
import forge.control.home.ControlSealed;
|
||||||
|
import forge.control.home.ControlUtilities;
|
||||||
import forge.view.ViewHomeUI;
|
import forge.view.ViewHomeUI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,4 +27,24 @@ public class ControlHomeUI {
|
|||||||
public ViewHomeUI getView() {
|
public ViewHomeUI getView() {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return ControlConstructed */
|
||||||
|
public ControlConstructed getControlConstructed() {
|
||||||
|
return view.getViewConstructed().getControl();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return ControlDraft */
|
||||||
|
public ControlDraft getControlDraft() {
|
||||||
|
return view.getViewDraft().getControl();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return ControlSealed */
|
||||||
|
public ControlSealed getControlSealed() {
|
||||||
|
return view.getViewSealed().getControl();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return ControlUtilities */
|
||||||
|
public ControlUtilities getControlUtilities() {
|
||||||
|
return view.getViewUtilities().getControl();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class ControlSealed {
|
|||||||
sealed.addAiDeck(sd.buildAIDeck(sDeck.toForgeCardList()));
|
sealed.addAiDeck(sd.buildAIDeck(sDeck.toForgeCardList()));
|
||||||
AllZone.getDecks().getSealed().add(sealed);
|
AllZone.getDecks().getSealed().add(sealed);
|
||||||
|
|
||||||
view.getParentView().getUtilitiesControl().showDeckEditor(GameType.Sealed, sealed);
|
Singletons.getControl().getHomeControl().getControlUtilities().showDeckEditor(GameType.Sealed, sealed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import forge.GuiDownloadPrices;
|
|||||||
import forge.GuiDownloadQuestImages;
|
import forge.GuiDownloadQuestImages;
|
||||||
import forge.GuiDownloadSetPicturesLQ;
|
import forge.GuiDownloadSetPicturesLQ;
|
||||||
import forge.GuiImportPicture;
|
import forge.GuiImportPicture;
|
||||||
|
import forge.Singletons;
|
||||||
import forge.error.BugzReporter;
|
import forge.error.BugzReporter;
|
||||||
import forge.game.GameType;
|
import forge.game.GameType;
|
||||||
import forge.gui.deckeditor.DeckEditorBase;
|
import forge.gui.deckeditor.DeckEditorBase;
|
||||||
@@ -171,8 +172,8 @@ public class ControlUtilities {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
view.getParentView().getConstructedControl().updateDeckLists();
|
Singletons.getControl().getHomeControl().getControlConstructed().updateDeckLists();
|
||||||
//view.getParentView().getSealedController().updateDeckLists();
|
//view.getParentView().getControlSealed().updateDeckLists();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class DraftingProcess extends DeckEditorBase<CardPrinted, DeckSet> {
|
|||||||
ForgeProps.getLocalized(GuiBoosterDraft.CLOSE_MESSAGE), "", JOptionPane.YES_NO_OPTION);
|
ForgeProps.getLocalized(GuiBoosterDraft.CLOSE_MESSAGE), "", JOptionPane.YES_NO_OPTION);
|
||||||
if (n == JOptionPane.YES_OPTION) {
|
if (n == JOptionPane.YES_OPTION) {
|
||||||
DraftingProcess.this.dispose();
|
DraftingProcess.this.dispose();
|
||||||
Singletons.getView().getHomeView().getDraftControl().updateHumanDecks();
|
Singletons.getControl().getHomeControl().getControlDraft().updateHumanDecks();
|
||||||
}
|
}
|
||||||
} // windowClosing()
|
} // windowClosing()
|
||||||
});
|
});
|
||||||
@@ -337,7 +337,7 @@ public class DraftingProcess extends DeckEditorBase<CardPrinted, DeckSet> {
|
|||||||
// close and open next screen
|
// close and open next screen
|
||||||
this.dispose();
|
this.dispose();
|
||||||
|
|
||||||
Singletons.getView().getHomeView().getDraftControl().updateHumanDecks();
|
Singletons.getControl().getHomeControl().getControlDraft().updateHumanDecks();
|
||||||
|
|
||||||
} /* saveDraft() */
|
} /* saveDraft() */
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,6 @@ import javax.swing.SwingUtilities;
|
|||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.ControlHomeUI;
|
import forge.control.ControlHomeUI;
|
||||||
import forge.control.home.ControlConstructed;
|
|
||||||
import forge.control.home.ControlDraft;
|
|
||||||
import forge.control.home.ControlSealed;
|
|
||||||
import forge.control.home.ControlUtilities;
|
|
||||||
import forge.game.GameType;
|
import forge.game.GameType;
|
||||||
import forge.properties.ForgePreferences;
|
import forge.properties.ForgePreferences;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
@@ -138,7 +134,7 @@ public class ViewHomeUI extends FPanel {
|
|||||||
btnDeckEditor = new FButton();
|
btnDeckEditor = new FButton();
|
||||||
btnDeckEditor.setAction(new AbstractAction() {
|
btnDeckEditor.setAction(new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
ViewHomeUI.this.getUtilitiesControl().showDeckEditor(GameType.Constructed, null);
|
Singletons.getControl().getHomeControl().getControlUtilities().showDeckEditor(GameType.Constructed, null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
btnDeckEditor.setText("Deck Editor");
|
btnDeckEditor.setText("Deck Editor");
|
||||||
@@ -201,7 +197,7 @@ public class ViewHomeUI extends FPanel {
|
|||||||
pnlContent.revalidate();
|
pnlContent.revalidate();
|
||||||
pnlContent.repaint();
|
pnlContent.repaint();
|
||||||
|
|
||||||
this.getConstructedControl().updateDeckSelectionCheckboxes();
|
Singletons.getControl().getHomeControl().getControlConstructed().updateDeckSelectionCheckboxes();
|
||||||
|
|
||||||
Singletons.getModel().getPreferences().setPref(FPref.UI_HOMEMENU,
|
Singletons.getModel().getPreferences().setPref(FPref.UI_HOMEMENU,
|
||||||
ForgePreferences.HomeMenus.constructed.toString());
|
ForgePreferences.HomeMenus.constructed.toString());
|
||||||
@@ -297,26 +293,6 @@ public class ViewHomeUI extends FPanel {
|
|||||||
Singletons.getModel().getPreferences().save();
|
Singletons.getModel().getPreferences().save();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return ControlConstructed */
|
|
||||||
public ControlConstructed getConstructedControl() {
|
|
||||||
return constructed.getControl();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ControlDraft */
|
|
||||||
public ControlDraft getDraftControl() {
|
|
||||||
return draft.getControl();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ControlSealed */
|
|
||||||
public ControlSealed getSealedControl() {
|
|
||||||
return sealed.getControl();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ControlUtilities */
|
|
||||||
public ControlUtilities getUtilitiesControl() {
|
|
||||||
return utilities.getControl();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clearToggles() {
|
private void clearToggles() {
|
||||||
btnConstructed.setToggled(false);
|
btnConstructed.setToggled(false);
|
||||||
btnSealed.setToggled(false);
|
btnSealed.setToggled(false);
|
||||||
@@ -327,6 +303,26 @@ public class ViewHomeUI extends FPanel {
|
|||||||
btnUtilities.setToggled(false);
|
btnUtilities.setToggled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {@link forge.view.home.ViewConstructed} */
|
||||||
|
public ViewConstructed getViewConstructed() {
|
||||||
|
return constructed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return {@link forge.view.home.ViewDraft} */
|
||||||
|
public ViewDraft getViewDraft() {
|
||||||
|
return draft;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return {@link forge.view.home.ViewSealed} */
|
||||||
|
public ViewSealed getViewSealed() {
|
||||||
|
return sealed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return {@link forge.view.home.ViewUtilities} */
|
||||||
|
public ViewUtilities getViewUtilities() {
|
||||||
|
return utilities;
|
||||||
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
public void resetQuest() {
|
public void resetQuest() {
|
||||||
quest = new ViewQuest(this);
|
quest = new ViewQuest(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user