mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Update names of properties/variables
This commit is contained in:
@@ -108,10 +108,10 @@ public enum CDeckEditorUI {
|
||||
if (childController != null) {
|
||||
boolean wantElastic = SItemManagerIO.getPref(EditorPreference.elastic_columns);
|
||||
boolean wantUnique = SItemManagerIO.getPref(EditorPreference.display_unique_only);
|
||||
childController.getCatalogListView().setWantElasticColumns(wantElastic);
|
||||
childController.getDeckListView().setWantElasticColumns(wantElastic);
|
||||
childController.getCatalogListView().setWantUnique(wantUnique);
|
||||
childController.getDeckListView().setWantUnique(wantUnique);
|
||||
childController.getCatalogManager().setWantElasticColumns(wantElastic);
|
||||
childController.getDeckManager().setWantElasticColumns(wantElastic);
|
||||
childController.getCatalogManager().setWantUnique(wantUnique);
|
||||
childController.getDeckManager().setWantUnique(wantUnique);
|
||||
CCardCatalog.SINGLETON_INSTANCE.applyCurrentFilter();
|
||||
}
|
||||
}
|
||||
@@ -120,14 +120,14 @@ public enum CDeckEditorUI {
|
||||
void move(InventoryItem item, int qty);
|
||||
}
|
||||
|
||||
private void moveSelectedCards(ItemManager<InventoryItem> listView, _MoveAction moveAction, int maxQty) {
|
||||
List<? extends InventoryItem> items = listView.getSelectedItems();
|
||||
private void moveSelectedCards(ItemManager<InventoryItem> itemManager, _MoveAction moveAction, int maxQty) {
|
||||
List<? extends InventoryItem> items = itemManager.getSelectedItems();
|
||||
if (items.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (InventoryItem item : items) {
|
||||
int toMove = Math.min(maxQty, listView.getItemCount(item));
|
||||
int toMove = Math.min(maxQty, itemManager.getItemCount(item));
|
||||
moveAction.move(item, toMove);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ public enum CDeckEditorUI {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addSelectedCards(final boolean toAlternate, int number) {
|
||||
moveSelectedCards((ItemManager<InventoryItem>)childController.getCatalogListView(),
|
||||
moveSelectedCards((ItemManager<InventoryItem>)childController.getCatalogManager(),
|
||||
new _MoveAction() {
|
||||
@Override
|
||||
public void move(InventoryItem item, int qty) {
|
||||
@@ -148,7 +148,7 @@ public enum CDeckEditorUI {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void removeSelectedCards(final boolean toAlternate, int number) {
|
||||
moveSelectedCards((ItemManager<InventoryItem>)childController.getDeckListView(),
|
||||
moveSelectedCards((ItemManager<InventoryItem>)childController.getDeckManager(),
|
||||
new _MoveAction() {
|
||||
@Override
|
||||
public void move(InventoryItem item, int qty) {
|
||||
@@ -159,7 +159,7 @@ public enum CDeckEditorUI {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void removeAllCards(final boolean toAlternate) {
|
||||
ItemManager<InventoryItem> v = (ItemManager<InventoryItem>)childController.getDeckListView();
|
||||
ItemManager<InventoryItem> v = (ItemManager<InventoryItem>)childController.getDeckManager();
|
||||
v.getTable().selectAll();
|
||||
moveSelectedCards(v, new _MoveAction() {
|
||||
@Override
|
||||
@@ -289,8 +289,8 @@ public enum CDeckEditorUI {
|
||||
* Updates listeners for current controller.
|
||||
*/
|
||||
private void updateController() {
|
||||
ItemManager<? extends InventoryItem> catView = childController.getCatalogListView();
|
||||
ItemManager<? extends InventoryItem> deckView = childController.getDeckListView();
|
||||
ItemManager<? extends InventoryItem> catView = childController.getCatalogManager();
|
||||
ItemManager<? extends InventoryItem> deckView = childController.getDeckManager();
|
||||
final JTable catTable = catView.getTable();
|
||||
final JTable deckTable = deckView.getTable();
|
||||
final _FindAsYouType catFind = new _FindAsYouType(catView);
|
||||
|
||||
@@ -58,8 +58,8 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
|
||||
public void addTextFilterItem ();
|
||||
}
|
||||
|
||||
private ItemManager<TItem> lvCatalog;
|
||||
private ItemManager<TItem> lvDeck;
|
||||
private ItemManager<TItem> catalogManager;
|
||||
private ItemManager<TItem> deckManager;
|
||||
|
||||
/**
|
||||
* Operation to add one of selected card to current deck.
|
||||
@@ -100,39 +100,39 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
|
||||
public abstract void init();
|
||||
|
||||
/**
|
||||
* Gets the ListView holding the cards in the current deck.
|
||||
* Gets the ItemManager holding the cards in the current deck.
|
||||
*
|
||||
* @return {@link forge.gui.toolbox.itemmanager.ItemManager}
|
||||
*/
|
||||
public ItemManager<TItem> getDeckListView() {
|
||||
return this.lvDeck;
|
||||
public ItemManager<TItem> getDeckManager() {
|
||||
return this.deckManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ListView holding the cards in the current deck.
|
||||
* Sets the ItemManager holding the cards in the current deck.
|
||||
*
|
||||
* @param table0   {@link forge.gui.toolbox.itemmanager.ItemManager}
|
||||
* @param itemManager   {@link forge.gui.toolbox.itemmanager.ItemManager}
|
||||
*/
|
||||
public void setDeckListView(final ItemManager<TItem> table0) {
|
||||
this.lvDeck = table0;
|
||||
public void setDeckManager(final ItemManager<TItem> itemManager) {
|
||||
this.deckManager = itemManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ListView holding the cards in the current catalog.
|
||||
* Gets the ItemManager holding the cards in the current catalog.
|
||||
*
|
||||
* @return {@link forge.gui.toolbox.itemmanager.ItemManager}
|
||||
*/
|
||||
public ItemManager<TItem> getCatalogListView() {
|
||||
return this.lvCatalog;
|
||||
public ItemManager<TItem> getCatalogManager() {
|
||||
return this.catalogManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ListView holding the cards in the current catalog.
|
||||
* Sets the ItemManager holding the cards in the current catalog.
|
||||
*
|
||||
* @param table0   {@link forge.gui.toolbox.itemmanager.ItemManager}
|
||||
* @param itemManager   {@link forge.gui.toolbox.itemmanager.ItemManager}
|
||||
*/
|
||||
public void setCatalogListView(final ItemManager<TItem> table0) {
|
||||
this.lvCatalog = table0;
|
||||
public void setCatalogManager(final ItemManager<TItem> itemManager) {
|
||||
this.catalogManager = itemManager;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -271,7 +271,7 @@ public enum CCardCatalog implements ICDoc {
|
||||
public void keyReleased(KeyEvent e) {
|
||||
if (KeyEvent.VK_ENTER == e.getKeyCode() && 0 == e.getModifiers()) {
|
||||
// set focus to table when a plain enter is typed into the text filter box
|
||||
CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getCatalogListView().getTable().requestFocusInWindow();
|
||||
CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getCatalogManager().getTable().requestFocusInWindow();
|
||||
} else if (keypressPending) {
|
||||
// do this in keyReleased instead of keyTyped since the textbox text isn't updated until the key is released
|
||||
// but depend on keypressPending since otherwise we pick up hotkeys and other unwanted stuff
|
||||
@@ -385,7 +385,7 @@ public enum CCardCatalog implements ICDoc {
|
||||
// TODO: is there really no way to make this type safe?
|
||||
ACEditorBase<?, ?> editor = CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController();
|
||||
if (null != editor) {
|
||||
((ACEditorBase<PaperCard, DeckBase>)editor).getCatalogListView().setFilter(cardFilter);
|
||||
((ACEditorBase<PaperCard, DeckBase>)editor).getCatalogManager().setFilter(cardFilter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,14 +94,14 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
|
||||
boolean wantUnique = SItemManagerIO.getPref(EditorPreference.display_unique_only);
|
||||
|
||||
final ItemManager<PaperCard> lvCatalog = new ItemManager<PaperCard>(PaperCard.class, wantUnique);
|
||||
final ItemManager<PaperCard> lvDeck = new ItemManager<PaperCard>(PaperCard.class, wantUnique);
|
||||
final ItemManager<PaperCard> catalogManager = new ItemManager<PaperCard>(PaperCard.class, wantUnique);
|
||||
final ItemManager<PaperCard> deckManager = new ItemManager<PaperCard>(PaperCard.class, wantUnique);
|
||||
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(lvCatalog.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(lvDeck.getTable());
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(catalogManager.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(deckManager.getTable());
|
||||
|
||||
this.setCatalogListView(lvCatalog);
|
||||
this.setDeckListView(lvDeck);
|
||||
this.setCatalogManager(catalogManager);
|
||||
this.setDeckManager(deckManager);
|
||||
|
||||
final Supplier<Deck> newCreator = new Supplier<Deck>() {
|
||||
@Override
|
||||
@@ -125,8 +125,8 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
}
|
||||
|
||||
if (sectionMode == DeckSection.Avatar || sectionMode == DeckSection.Commander) {
|
||||
for(Map.Entry<PaperCard, Integer> cp : getDeckListView().getItems()) {
|
||||
getDeckListView().removeItem(cp.getKey(), cp.getValue());
|
||||
for(Map.Entry<PaperCard, Integer> cp : getDeckManager().getItems()) {
|
||||
getDeckManager().removeItem(cp.getKey(), cp.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,10 +136,10 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
controller.getModel().getOrCreate(DeckSection.Sideboard).add(card, qty);
|
||||
}
|
||||
} else {
|
||||
getDeckListView().addItem(card, qty);
|
||||
getDeckManager().addItem(card, qty);
|
||||
}
|
||||
// if not in sideboard mode, "remove" 0 cards in order to re-show the selected card
|
||||
this.getCatalogListView().removeItem(card, sectionMode == DeckSection.Sideboard ? qty : 0);
|
||||
this.getCatalogManager().removeItem(card, sectionMode == DeckSection.Sideboard ? qty : 0);
|
||||
|
||||
this.controller.notifyModelChanged();
|
||||
}
|
||||
@@ -161,9 +161,9 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
// "added" to library, but library will be recalculated when it is shown again
|
||||
}
|
||||
} else if (sectionMode == DeckSection.Sideboard) {
|
||||
this.getCatalogListView().addItem(card, qty);
|
||||
this.getCatalogManager().addItem(card, qty);
|
||||
}
|
||||
this.getDeckListView().removeItem(card, qty);
|
||||
this.getDeckManager().removeItem(card, qty);
|
||||
this.controller.notifyModelChanged();
|
||||
}
|
||||
|
||||
@@ -188,8 +188,8 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
@Override
|
||||
public void resetTables() {
|
||||
// Constructed mode can use all cards, no limitations.
|
||||
this.getCatalogListView().setPool(ItemPool.createFrom(CardDb.instance().getAllCards(), PaperCard.class), true);
|
||||
this.getDeckListView().setPool(this.controller.getModel().getMain());
|
||||
this.getCatalogManager().setPool(ItemPool.createFrom(CardDb.instance().getAllCards(), PaperCard.class), true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getMain());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -220,17 +220,17 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
{
|
||||
case Main:
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_QUANTITY));
|
||||
this.getCatalogListView().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogListView().setPool(ItemPool.createFrom(CardDb.instance().getAllCards(), PaperCard.class), true);
|
||||
this.getDeckListView().setPool(this.controller.getModel().getMain());
|
||||
this.getCatalogManager().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogManager().setPool(ItemPool.createFrom(CardDb.instance().getAllCards(), PaperCard.class), true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getMain());
|
||||
showOptions = true;
|
||||
title = "Title: ";
|
||||
tabtext = "Main Deck";
|
||||
break;
|
||||
case Sideboard:
|
||||
this.getCatalogListView().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogListView().setPool(this.controller.getModel().getMain());
|
||||
this.getDeckListView().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
||||
this.getCatalogManager().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogManager().setPool(this.controller.getModel().getMain());
|
||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
||||
showOptions = false;
|
||||
title = "Sideboard";
|
||||
tabtext = "Card Catalog";
|
||||
@@ -242,9 +242,9 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_CMC));
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_POWER));
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_TOUGHNESS));
|
||||
this.getCatalogListView().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogListView().setPool(avatarPool, true);
|
||||
this.getDeckListView().setPool(this.controller.getModel().getOrCreate(DeckSection.Avatar));
|
||||
this.getCatalogManager().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogManager().setPool(avatarPool, true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Avatar));
|
||||
showOptions = false;
|
||||
title = "Vanguard";
|
||||
tabtext = "Card Catalog";
|
||||
@@ -256,9 +256,9 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_COLOR));
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_POWER));
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_TOUGHNESS));
|
||||
this.getCatalogListView().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogListView().setPool(planePool,true);
|
||||
this.getDeckListView().setPool(this.controller.getModel().getOrCreate(DeckSection.Planes));
|
||||
this.getCatalogManager().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogManager().setPool(planePool,true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Planes));
|
||||
showOptions = false;
|
||||
title = "Planar";
|
||||
tabtext = "Card Catalog";
|
||||
@@ -270,18 +270,18 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_COLOR));
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_POWER));
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_TOUGHNESS));
|
||||
this.getCatalogListView().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogListView().setPool(schemePool,true);
|
||||
this.getDeckListView().setPool(this.controller.getModel().getOrCreate(DeckSection.Schemes));
|
||||
this.getCatalogManager().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogManager().setPool(schemePool,true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Schemes));
|
||||
showOptions = false;
|
||||
title = "Scheme";
|
||||
tabtext = "Card Catalog";
|
||||
break;
|
||||
case Commander:
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_QUANTITY));
|
||||
this.getCatalogListView().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogListView().setPool(commanderPool, true);
|
||||
this.getDeckListView().setPool(this.controller.getModel().getOrCreate(DeckSection.Commander));
|
||||
this.getCatalogManager().getTable().setAvailableColumns(lstCatalogCols);
|
||||
this.getCatalogManager().setPool(commanderPool, true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Commander));
|
||||
showOptions = false;
|
||||
title = "Commander";
|
||||
tabtext = "Card Catalog";
|
||||
@@ -310,8 +310,8 @@ public final class CEditorConstructed extends ACEditorBase<PaperCard, Deck> {
|
||||
final List<TableColumnInfo<InventoryItem>> lstCatalogCols = SColumnUtil.getCatalogDefaultColumns();
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_QUANTITY));
|
||||
|
||||
this.getCatalogListView().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, lstCatalogCols);
|
||||
this.getDeckListView().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
this.getCatalogManager().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, lstCatalogCols);
|
||||
this.getDeckManager().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
|
||||
SItemManagerUtil.resetUI();
|
||||
|
||||
|
||||
@@ -64,17 +64,17 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
* Updates the deck editor UI as necessary draft selection mode.
|
||||
*/
|
||||
public CEditorDraftingProcess() {
|
||||
final ItemManager<PaperCard> lvCatalog = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> lvDeck = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> catalogManager = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> deckManager = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(lvCatalog.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(lvDeck.getTable());
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(catalogManager.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(deckManager.getTable());
|
||||
|
||||
lvCatalog.setAlwaysNonUnique(true);
|
||||
lvDeck.setAlwaysNonUnique(true);
|
||||
catalogManager.setAlwaysNonUnique(true);
|
||||
deckManager.setAlwaysNonUnique(true);
|
||||
|
||||
this.setCatalogListView(lvCatalog);
|
||||
this.setDeckListView(lvDeck);
|
||||
this.setCatalogManager(catalogManager);
|
||||
this.setDeckManager(deckManager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,8 +93,8 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
* </p>
|
||||
*/
|
||||
private void setup() {
|
||||
this.getCatalogListView().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, SColumnUtil.getCatalogDefaultColumns());
|
||||
this.getDeckListView().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
this.getCatalogManager().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, SColumnUtil.getCatalogDefaultColumns());
|
||||
this.getDeckManager().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
|
||||
ccAddLabel = VCardCatalog.SINGLETON_INSTANCE.getBtnAdd().getText();
|
||||
VCardCatalog.SINGLETON_INSTANCE.getBtnAdd().setText("Choose Card");
|
||||
@@ -112,7 +112,7 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
final PaperCard card = (PaperCard) item;
|
||||
|
||||
// can only draft one at a time, regardless of the requested quantity
|
||||
this.getDeckListView().addItem(card, 1);
|
||||
this.getDeckManager().addItem(card, 1);
|
||||
|
||||
// get next booster pack
|
||||
this.boosterDraft.setChoice(card);
|
||||
@@ -155,8 +155,8 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
VCardCatalog.SINGLETON_INSTANCE.getPnlHeader().setVisible(true);
|
||||
VCardCatalog.SINGLETON_INSTANCE.getLblTitle().setText("Select a card from pack number "
|
||||
+ (((BoosterDraft) boosterDraft).getCurrentBoosterIndex() + 1) + ".");
|
||||
this.getCatalogListView().setPool(list);
|
||||
this.getCatalogListView().getTable().fixSelection(0);
|
||||
this.getCatalogManager().setPool(list);
|
||||
this.getCatalogManager().getTable().fixSelection(0);
|
||||
} // showChoices()
|
||||
|
||||
/**
|
||||
@@ -171,7 +171,7 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
|
||||
// add sideboard to deck
|
||||
CardPool side = deck.getOrCreate(DeckSection.Sideboard);
|
||||
side.addAll(this.getDeckListView().getItems());
|
||||
side.addAll(this.getDeckManager().getItems());
|
||||
|
||||
final CardEdition landSet = IBoosterDraft.LAND_SET_CODE[0];
|
||||
final int landsCount = 20;
|
||||
@@ -263,7 +263,7 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
public void init() {
|
||||
this.setup();
|
||||
this.showChoices(this.boosterDraft.nextChoice());
|
||||
this.getDeckListView().setPool((Iterable<InventoryItem>) null);
|
||||
this.getDeckManager().setPool((Iterable<InventoryItem>) null);
|
||||
|
||||
//Remove buttons
|
||||
VCardCatalog.SINGLETON_INSTANCE.getBtnAdd4().setVisible(false);
|
||||
@@ -278,7 +278,7 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
allDecksParent = removeTab(VAllDecks.SINGLETON_INSTANCE);
|
||||
|
||||
// set catalog table to single-selection only mode
|
||||
getCatalogListView().getTable().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
getCatalogManager().getTable().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -307,7 +307,7 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
}
|
||||
|
||||
// set catalog table back to free-selection mode
|
||||
getCatalogListView().getTable().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
getCatalogManager().getTable().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -59,17 +59,17 @@ public final class CEditorLimited extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
* @param deckMap0   {@link forge.deck.DeckGroup}<{@link forge.util.storage.IStorage}>
|
||||
*/
|
||||
public CEditorLimited(final IStorage<DeckGroup> deckMap0) {
|
||||
final ItemManager<PaperCard> lvCatalog = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> lvDeck = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> catalogManager = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> deckManager = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(lvCatalog.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(lvDeck.getTable());
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(catalogManager.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(deckManager.getTable());
|
||||
|
||||
lvCatalog.setAlwaysNonUnique(true);
|
||||
lvDeck.setAlwaysNonUnique(true);
|
||||
catalogManager.setAlwaysNonUnique(true);
|
||||
deckManager.setAlwaysNonUnique(true);
|
||||
|
||||
this.setCatalogListView(lvCatalog);
|
||||
this.setDeckListView(lvDeck);
|
||||
this.setCatalogManager(catalogManager);
|
||||
this.setDeckManager(deckManager);
|
||||
|
||||
final Supplier<DeckGroup> newCreator = new Supplier<DeckGroup>() {
|
||||
@Override
|
||||
@@ -101,8 +101,8 @@ public final class CEditorLimited extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
|
||||
// update view
|
||||
final PaperCard card = (PaperCard) item;
|
||||
this.getDeckListView().addItem(card, qty);
|
||||
this.getCatalogListView().removeItem(card, qty);
|
||||
this.getDeckManager().addItem(card, qty);
|
||||
this.getCatalogManager().removeItem(card, qty);
|
||||
this.getDeckController().notifyModelChanged();
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ public final class CEditorLimited extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
|
||||
// update view
|
||||
final PaperCard card = (PaperCard) item;
|
||||
this.getCatalogListView().addItem(card, qty);
|
||||
this.getDeckListView().removeItem(card, qty);
|
||||
this.getCatalogManager().addItem(card, qty);
|
||||
this.getDeckManager().removeItem(card, qty);
|
||||
this.getDeckController().notifyModelChanged();
|
||||
}
|
||||
|
||||
@@ -141,8 +141,8 @@ public final class CEditorLimited extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
@Override
|
||||
public void resetTables() {
|
||||
final Deck toEdit = this.getSelectedDeck(this.controller.getModel());
|
||||
this.getCatalogListView().setPool(toEdit.getOrCreate(DeckSection.Sideboard));
|
||||
this.getDeckListView().setPool(toEdit.getMain());
|
||||
this.getCatalogManager().setPool(toEdit.getOrCreate(DeckSection.Sideboard));
|
||||
this.getDeckManager().setPool(toEdit.getMain());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -160,8 +160,8 @@ public final class CEditorLimited extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
*/
|
||||
@Override
|
||||
public void init() {
|
||||
this.getCatalogListView().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, SColumnUtil.getCatalogDefaultColumns());
|
||||
this.getDeckListView().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
this.getCatalogManager().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, SColumnUtil.getCatalogDefaultColumns());
|
||||
this.getDeckManager().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
|
||||
SItemManagerUtil.resetUI();
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ public enum CEditorPreferences implements ICDoc {
|
||||
public void itemStateChanged(ItemEvent arg0) {
|
||||
TableColumnInfo<InventoryItem> col = SColumnUtil.getColumn(name);
|
||||
final JTable table = (col.getEnumValue().substring(0, 4).equals("DECK"))
|
||||
? CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getDeckListView().getTable()
|
||||
: CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getCatalogListView().getTable();
|
||||
? CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getDeckManager().getTable()
|
||||
: CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getCatalogManager().getTable();
|
||||
SColumnUtil.toggleColumn(table, col);
|
||||
SItemManagerIO.savePreferences(table);
|
||||
}
|
||||
@@ -105,12 +105,12 @@ public enum CEditorPreferences implements ICDoc {
|
||||
boolean wantUnique = SItemManagerIO.getPref(EditorPreference.display_unique_only);
|
||||
ACEditorBase<?, ?> curEditor = CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController();
|
||||
if (curEditor != null) {
|
||||
curEditor.getCatalogListView().setWantElasticColumns(wantElastic);
|
||||
curEditor.getDeckListView().setWantElasticColumns(wantElastic);
|
||||
curEditor.getCatalogListView().setWantUnique(wantUnique);
|
||||
curEditor.getCatalogListView().updateView(true);
|
||||
curEditor.getDeckListView().setWantUnique(wantUnique);
|
||||
curEditor.getDeckListView().updateView(true);
|
||||
curEditor.getCatalogManager().setWantElasticColumns(wantElastic);
|
||||
curEditor.getDeckManager().setWantElasticColumns(wantElastic);
|
||||
curEditor.getCatalogManager().setWantUnique(wantUnique);
|
||||
curEditor.getCatalogManager().updateView(true);
|
||||
curEditor.getDeckManager().setWantUnique(wantUnique);
|
||||
curEditor.getDeckManager().updateView(true);
|
||||
}
|
||||
|
||||
VEditorPreferences.SINGLETON_INSTANCE.getChbDeckStats().addItemListener(new ItemListener() {
|
||||
@@ -118,31 +118,31 @@ public enum CEditorPreferences implements ICDoc {
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setStatsVisible(
|
||||
((JCheckBox) e.getSource()).isSelected());
|
||||
SItemManagerIO.setPref(EditorPreference.stats_deck, ((JCheckBox) e.getSource()).isSelected());
|
||||
SItemManagerIO.savePreferences(CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getCatalogListView().getTable()); } });
|
||||
SItemManagerIO.savePreferences(CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController().getCatalogManager().getTable()); } });
|
||||
|
||||
VEditorPreferences.SINGLETON_INSTANCE.getChbElasticColumns().addItemListener(new ItemListener() {
|
||||
@Override public void itemStateChanged(final ItemEvent e) {
|
||||
ACEditorBase<?, ?> curEditor = CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController();
|
||||
boolean wantElastic = ((JCheckBox) e.getSource()).isSelected();
|
||||
if (curEditor != null) {
|
||||
curEditor.getCatalogListView().setWantElasticColumns(wantElastic);
|
||||
curEditor.getDeckListView().setWantElasticColumns(wantElastic);
|
||||
curEditor.getCatalogManager().setWantElasticColumns(wantElastic);
|
||||
curEditor.getDeckManager().setWantElasticColumns(wantElastic);
|
||||
}
|
||||
SItemManagerIO.setPref(EditorPreference.elastic_columns, wantElastic);
|
||||
SItemManagerIO.savePreferences(curEditor.getCatalogListView().getTable()); } });
|
||||
SItemManagerIO.savePreferences(curEditor.getCatalogManager().getTable()); } });
|
||||
|
||||
VEditorPreferences.SINGLETON_INSTANCE.getChbCardDisplayUnique().addItemListener(new ItemListener() {
|
||||
@Override public void itemStateChanged(final ItemEvent e) {
|
||||
ACEditorBase<?, ?> curEditor = CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController();
|
||||
boolean wantUnique = ((JCheckBox) e.getSource()).isSelected();
|
||||
if (curEditor != null) {
|
||||
curEditor.getCatalogListView().setWantUnique(wantUnique);
|
||||
curEditor.getCatalogListView().updateView(true);
|
||||
curEditor.getDeckListView().setWantUnique(wantUnique);
|
||||
curEditor.getDeckListView().updateView(true);
|
||||
curEditor.getCatalogManager().setWantUnique(wantUnique);
|
||||
curEditor.getCatalogManager().updateView(true);
|
||||
curEditor.getDeckManager().setWantUnique(wantUnique);
|
||||
curEditor.getDeckManager().updateView(true);
|
||||
}
|
||||
SItemManagerIO.setPref(EditorPreference.display_unique_only, wantUnique);
|
||||
SItemManagerIO.savePreferences(curEditor.getCatalogListView().getTable()); } });
|
||||
SItemManagerIO.savePreferences(curEditor.getCatalogManager().getTable()); } });
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -95,17 +95,17 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||
public CEditorQuest(final QuestController questData0) {
|
||||
this.questData = questData0;
|
||||
|
||||
final ItemManager<PaperCard> lvCatalog = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> lvDeck = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> catalogManager = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
final ItemManager<PaperCard> deckManager = new ItemManager<PaperCard>(PaperCard.class, false);
|
||||
|
||||
lvCatalog.setAlwaysNonUnique(true);
|
||||
lvDeck.setAlwaysNonUnique(true);
|
||||
catalogManager.setAlwaysNonUnique(true);
|
||||
deckManager.setAlwaysNonUnique(true);
|
||||
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(lvCatalog.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(lvDeck.getTable());
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(catalogManager.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(deckManager.getTable());
|
||||
|
||||
this.setCatalogListView(lvCatalog);
|
||||
this.setDeckListView(lvDeck);
|
||||
this.setCatalogManager(catalogManager);
|
||||
this.setDeckManager(deckManager);
|
||||
|
||||
final Supplier<Deck> newCreator = new Supplier<Deck>() {
|
||||
@Override
|
||||
@@ -123,7 +123,7 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||
* @param card {@link forge.item.PaperCard}
|
||||
*/
|
||||
public void addCheatCard(final PaperCard card, int qty) {
|
||||
this.getCatalogListView().addItem(card, qty);
|
||||
this.getCatalogManager().addItem(card, qty);
|
||||
this.questData.getCards().getCardpool().add(card, qty);
|
||||
}
|
||||
|
||||
@@ -158,9 +158,9 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||
controller.getModel().getOrCreate(DeckSection.Sideboard).add(card, qty);
|
||||
}
|
||||
} else {
|
||||
getDeckListView().addItem(card, qty);
|
||||
getDeckManager().addItem(card, qty);
|
||||
}
|
||||
this.getCatalogListView().removeItem(card, qty);
|
||||
this.getCatalogManager().removeItem(card, qty);
|
||||
this.controller.notifyModelChanged();
|
||||
}
|
||||
|
||||
@@ -180,9 +180,9 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||
controller.getModel().getOrCreate(DeckSection.Sideboard).add(card, qty);
|
||||
}
|
||||
} else {
|
||||
this.getCatalogListView().addItem(card, qty);
|
||||
this.getCatalogManager().addItem(card, qty);
|
||||
}
|
||||
this.getDeckListView().removeItem(card, qty);
|
||||
this.getDeckManager().removeItem(card, qty);
|
||||
this.controller.notifyModelChanged();
|
||||
}
|
||||
|
||||
@@ -215,8 +215,8 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||
// remove sideboard cards from the catalog
|
||||
cardpool.removeAll(deck.getOrCreate(DeckSection.Sideboard));
|
||||
// show cards, makes this user friendly
|
||||
this.getCatalogListView().setPool(cardpool);
|
||||
this.getDeckListView().setPool(deck.getMain());
|
||||
this.getCatalogManager().setPool(cardpool);
|
||||
this.getDeckManager().setPool(deck.getMain());
|
||||
}
|
||||
|
||||
//=========== Overridden from ACEditorBase
|
||||
@@ -236,8 +236,8 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||
*/
|
||||
public void switchEditorMode(boolean isSideboarding) {
|
||||
if (isSideboarding) {
|
||||
this.getCatalogListView().setPool(this.controller.getModel().getMain());
|
||||
this.getDeckListView().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
||||
this.getCatalogManager().setPool(this.controller.getModel().getMain());
|
||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
||||
} else {
|
||||
resetTables();
|
||||
}
|
||||
@@ -278,8 +278,8 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||
columnsDeck.get(columnsDeck.size() - 1).setSortAndDisplayFunctions(
|
||||
this.fnDeckCompare, this.fnDeckGet);
|
||||
|
||||
this.getCatalogListView().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, columnsCatalog);
|
||||
this.getDeckListView().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, columnsDeck);
|
||||
this.getCatalogManager().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, columnsCatalog);
|
||||
this.getDeckManager().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, columnsDeck);
|
||||
|
||||
Deck deck = new Deck();
|
||||
|
||||
|
||||
@@ -127,30 +127,30 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
public CEditorQuestCardShop(final QuestController qd) {
|
||||
this.questData = qd;
|
||||
|
||||
final ItemManager<InventoryItem> lvCatalog = new ItemManager<InventoryItem>(InventoryItem.class, false);
|
||||
final ItemManager<InventoryItem> lvDeck = new ItemManager<InventoryItem>(InventoryItem.class, false);
|
||||
final ItemManager<InventoryItem> catalogManager = new ItemManager<InventoryItem>(InventoryItem.class, false);
|
||||
final ItemManager<InventoryItem> deckManager = new ItemManager<InventoryItem>(InventoryItem.class, false);
|
||||
|
||||
lvCatalog.setAlwaysNonUnique(true);
|
||||
lvDeck.setAlwaysNonUnique(true);
|
||||
catalogManager.setAlwaysNonUnique(true);
|
||||
deckManager.setAlwaysNonUnique(true);
|
||||
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(lvCatalog.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(lvDeck.getTable());
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(catalogManager.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(deckManager.getTable());
|
||||
|
||||
this.setCatalogListView(lvCatalog);
|
||||
this.setDeckListView(lvDeck);
|
||||
this.setCatalogManager(catalogManager);
|
||||
this.setDeckManager(deckManager);
|
||||
}
|
||||
|
||||
private void toggleFullCatalog() {
|
||||
showingFullCatalog = !showingFullCatalog;
|
||||
|
||||
if (showingFullCatalog) {
|
||||
this.getCatalogListView().setPool(fullCatalogCards, true);
|
||||
this.getCatalogManager().setPool(fullCatalogCards, true);
|
||||
VCardCatalog.SINGLETON_INSTANCE.getBtnAdd().setEnabled(false);
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove().setEnabled(false);
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setEnabled(false);
|
||||
fullCatalogToggle.setText("Return to spell shop");
|
||||
} else {
|
||||
this.getCatalogListView().setPool(cardsForSale);
|
||||
this.getCatalogManager().setPool(cardsForSale);
|
||||
VCardCatalog.SINGLETON_INSTANCE.getBtnAdd().setEnabled(true);
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove().setEnabled(true);
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setEnabled(true);
|
||||
@@ -188,8 +188,8 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
columnsDeck.remove(SColumnUtil.getColumn(ColumnName.DECK_AI));
|
||||
|
||||
// Setup with current column set
|
||||
this.getCatalogListView().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, columnsCatalog);
|
||||
this.getDeckListView().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, columnsDeck);
|
||||
this.getCatalogManager().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, columnsCatalog);
|
||||
this.getDeckManager().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, columnsDeck);
|
||||
|
||||
SItemManagerUtil.resetUI();
|
||||
|
||||
@@ -363,8 +363,8 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
|
||||
if (item instanceof PaperCard) {
|
||||
final PaperCard card = (PaperCard) item;
|
||||
this.getDeckListView().addItem(card, qty);
|
||||
this.getCatalogListView().removeItem(item, qty);
|
||||
this.getDeckManager().addItem(card, qty);
|
||||
this.getCatalogManager().removeItem(item, qty);
|
||||
this.questData.getCards().buyCard(card, qty, value);
|
||||
|
||||
} else if (item instanceof OpenablePack) {
|
||||
@@ -380,19 +380,19 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
this.questData.getCards().buyPack(booster, value);
|
||||
final List<PaperCard> newCards = booster.getCards();
|
||||
final List<InventoryItem> newInventory = new LinkedList<InventoryItem>(newCards);
|
||||
getDeckListView().addItems(newInventory);
|
||||
getDeckManager().addItems(newInventory);
|
||||
final CardListViewer c = new CardListViewer(booster.getName(),
|
||||
"You have found the following cards inside:", newCards);
|
||||
c.show();
|
||||
}
|
||||
this.getCatalogListView().removeItem(item, qty);
|
||||
this.getCatalogManager().removeItem(item, qty);
|
||||
} else if (item instanceof PreconDeck) {
|
||||
final PreconDeck deck = (PreconDeck) item;
|
||||
this.questData.getCards().buyPreconDeck(deck, value);
|
||||
final ItemPool<InventoryItem> newInventory =
|
||||
ItemPool.createFrom(deck.getDeck().getMain(), InventoryItem.class);
|
||||
for (int i = 0; qty > i; ++i) {
|
||||
getDeckListView().addItems(newInventory);
|
||||
getDeckManager().addItems(newInventory);
|
||||
}
|
||||
boolean one = 1 == qty;
|
||||
JOptionPane.showMessageDialog(null, String.format(
|
||||
@@ -400,7 +400,7 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
one ? "Deck" : String.format("%d copies of deck", qty),
|
||||
deck.getName(), one ? "was" : "were", one ? "Its" : "Their"),
|
||||
"Thanks for purchasing!", JOptionPane.INFORMATION_MESSAGE);
|
||||
this.getCatalogListView().removeItem(item, qty);
|
||||
this.getCatalogManager().removeItem(item, qty);
|
||||
}
|
||||
|
||||
this.creditsLabel.setText("Credits: " + this.questData.getAssets().getCredits());
|
||||
@@ -416,8 +416,8 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
}
|
||||
|
||||
final PaperCard card = (PaperCard) item;
|
||||
this.getCatalogListView().addItem(card, qty);
|
||||
this.getDeckListView().removeItem(card, qty);
|
||||
this.getCatalogManager().addItem(card, qty);
|
||||
this.getDeckManager().removeItem(card, qty);
|
||||
|
||||
final int price = Math.min((int) (this.multiplier * this.getCardValue(card)), this.questData.getCards()
|
||||
.getSellPriceLimit());
|
||||
@@ -446,8 +446,8 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
return;
|
||||
}
|
||||
|
||||
this.getCatalogListView().addItems(cardsToRemove);
|
||||
this.getDeckListView().removeItems(cardsToRemove);
|
||||
this.getCatalogManager().addItems(cardsToRemove);
|
||||
this.getDeckManager().removeItems(cardsToRemove);
|
||||
|
||||
for (Map.Entry<InventoryItem, Integer> item : cardsToRemove) {
|
||||
if (!(item.getKey() instanceof PaperCard)) {
|
||||
@@ -496,8 +496,8 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
final ItemPool<InventoryItem> ownedItems = new ItemPool<InventoryItem>(InventoryItem.class);
|
||||
ownedItems.addAll(this.questData.getCards().getCardpool().getView());
|
||||
|
||||
this.getCatalogListView().setPool(cardsForSale);
|
||||
this.getDeckListView().setPool(ownedItems);
|
||||
this.getCatalogManager().setPool(cardsForSale);
|
||||
this.getDeckManager().setPool(ownedItems);
|
||||
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setText("Sell all extras");
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setToolTipText("Sell unneeded extra copies of all cards");
|
||||
@@ -505,7 +505,7 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
||||
@Override
|
||||
public void run() {
|
||||
List<Map.Entry<InventoryItem, Integer>> cardsToRemove = new LinkedList<Map.Entry<InventoryItem,Integer>>();
|
||||
for (Map.Entry<InventoryItem, Integer> item : getDeckListView().getItems()) {
|
||||
for (Map.Entry<InventoryItem, Integer> item : getDeckManager().getItems()) {
|
||||
PaperCard card = (PaperCard)item.getKey();
|
||||
int numToKeep = card.getRules().getType().isBasic() ? 50 : 4;
|
||||
if ("Relentless Rats".equals(card.getName())) {
|
||||
|
||||
@@ -74,14 +74,14 @@ public final class CEditorVariant extends ACEditorBase<PaperCard, Deck> {
|
||||
cardPoolCondition = poolCondition;
|
||||
exitToScreen = exitTo;
|
||||
|
||||
final ItemManager<PaperCard> lvCatalog = new ItemManager<PaperCard>(PaperCard.class, true);
|
||||
final ItemManager<PaperCard> lvDeck = new ItemManager<PaperCard>(PaperCard.class, true);
|
||||
final ItemManager<PaperCard> catalogManager = new ItemManager<PaperCard>(PaperCard.class, true);
|
||||
final ItemManager<PaperCard> deckManager = new ItemManager<PaperCard>(PaperCard.class, true);
|
||||
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(lvCatalog.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(lvDeck.getTable());
|
||||
VCardCatalog.SINGLETON_INSTANCE.setTableView(catalogManager.getTable());
|
||||
VCurrentDeck.SINGLETON_INSTANCE.setTableView(deckManager.getTable());
|
||||
|
||||
this.setCatalogListView(lvCatalog);
|
||||
this.setDeckListView(lvDeck);
|
||||
this.setCatalogManager(catalogManager);
|
||||
this.setDeckManager(deckManager);
|
||||
|
||||
final Supplier<Deck> newCreator = new Supplier<Deck>() {
|
||||
@Override
|
||||
@@ -104,7 +104,7 @@ public final class CEditorVariant extends ACEditorBase<PaperCard, Deck> {
|
||||
}
|
||||
|
||||
final PaperCard card = (PaperCard) item;
|
||||
this.getDeckListView().addItem(card, qty);
|
||||
this.getDeckManager().addItem(card, qty);
|
||||
this.controller.notifyModelChanged();
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public final class CEditorVariant extends ACEditorBase<PaperCard, Deck> {
|
||||
}
|
||||
|
||||
final PaperCard card = (PaperCard) item;
|
||||
this.getDeckListView().removeItem(card, qty);
|
||||
this.getDeckManager().removeItem(card, qty);
|
||||
this.controller.notifyModelChanged();
|
||||
}
|
||||
|
||||
@@ -143,8 +143,8 @@ public final class CEditorVariant extends ACEditorBase<PaperCard, Deck> {
|
||||
Iterable<PaperCard> allNT = CardDb.variants().getAllCards();
|
||||
allNT = Iterables.filter(allNT, cardPoolCondition);
|
||||
|
||||
this.getCatalogListView().setPool(ItemPool.createFrom(allNT, PaperCard.class), true);
|
||||
this.getDeckListView().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
||||
this.getCatalogManager().setPool(ItemPool.createFrom(allNT, PaperCard.class), true);
|
||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -165,8 +165,8 @@ public final class CEditorVariant extends ACEditorBase<PaperCard, Deck> {
|
||||
final List<TableColumnInfo<InventoryItem>> lstCatalogCols = SColumnUtil.getCatalogDefaultColumns();
|
||||
lstCatalogCols.remove(SColumnUtil.getColumn(ColumnName.CAT_QUANTITY));
|
||||
|
||||
this.getCatalogListView().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, lstCatalogCols);
|
||||
this.getDeckListView().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
this.getCatalogManager().getTable().setup(VCardCatalog.SINGLETON_INSTANCE, lstCatalogCols);
|
||||
this.getDeckManager().getTable().setup(VCurrentDeck.SINGLETON_INSTANCE, SColumnUtil.getDeckDefaultColumns());
|
||||
|
||||
SItemManagerUtil.resetUI();
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public enum CProbabilities implements ICDoc {
|
||||
|
||||
if (ed == null) { return new ArrayList<String>(); }
|
||||
|
||||
final ItemPoolView<PaperCard> deck = ItemPool.createFrom(ed.getDeckListView().getItems(), PaperCard.class);
|
||||
final ItemPoolView<PaperCard> deck = ItemPool.createFrom(ed.getDeckManager().getItems(), PaperCard.class);
|
||||
|
||||
final List<String> cardProbabilities = new ArrayList<String>();
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public enum CStatistics implements ICDoc {
|
||||
|
||||
if (ed == null) { return; }
|
||||
|
||||
final ItemPoolView<PaperCard> deck = ItemPool.createFrom(ed.getDeckListView().getItems(), PaperCard.class);
|
||||
final ItemPoolView<PaperCard> deck = ItemPool.createFrom(ed.getDeckManager().getItems(), PaperCard.class);
|
||||
|
||||
int total = deck.countAll();
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ public enum VProbabilities implements IVDoc<CProbabilities> {
|
||||
final ACEditorBase<T, TModel> ed = (ACEditorBase<T, TModel>)
|
||||
CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController();
|
||||
|
||||
final List<PaperCard> cards = (List<PaperCard>) ed.getDeckListView().getItems().toFlatList();
|
||||
final List<PaperCard> cards = (List<PaperCard>) ed.getDeckManager().getItems().toFlatList();
|
||||
final String name1 = lbl.getText();
|
||||
String name2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user