UI: added deck editor sets update on server connection (on new release);

This commit is contained in:
Oleg Agafonov 2019-02-09 19:13:18 +04:00
parent 264d81305e
commit ff00d3c482

View file

@ -5,29 +5,17 @@
*/ */
package mage.client.deckeditor; package mage.client.deckeditor;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.util.Map.Entry;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import mage.MageObject; import mage.MageObject;
import mage.ObjectColor; import mage.ObjectColor;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
import mage.cards.Sets; import mage.cards.Sets;
import mage.cards.repository.CardCriteria; import mage.cards.repository.*;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.client.MageFrame; import mage.client.MageFrame;
import mage.client.cards.*; import mage.client.cards.*;
import mage.client.constants.Constants.SortBy; import mage.client.constants.Constants.SortBy;
import mage.client.deckeditor.table.TableModel; import mage.client.deckeditor.table.TableModel;
import mage.client.dialog.CheckBoxList; import mage.client.dialog.CheckBoxList;
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_NAMES;
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_RULES;
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_TYPES;
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_UNIQUE;
import mage.client.util.GUISizeHelper; import mage.client.util.GUISizeHelper;
import mage.client.util.gui.FastSearchUtil; import mage.client.util.gui.FastSearchUtil;
import mage.client.util.sets.ConstructedFormats; import mage.client.util.sets.ConstructedFormats;
@ -41,12 +29,21 @@ import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.ColorlessPredicate; import mage.filter.predicate.mageobject.ColorlessPredicate;
import mage.filter.predicate.other.CardTextPredicate; import mage.filter.predicate.other.CardTextPredicate;
import mage.filter.predicate.other.ExpansionSetPredicate; import mage.filter.predicate.other.ExpansionSetPredicate;
import mage.game.events.Listener;
import mage.view.CardView; import mage.view.CardView;
import mage.view.CardsView; import mage.view.CardsView;
import org.mage.card.arcane.ManaSymbolsCellRenderer; import org.mage.card.arcane.ManaSymbolsCellRenderer;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.util.Map.Entry;
import static mage.client.dialog.PreferencesDialog.*;
/** /**
*
* @author BetaSteward_at_googlemail.com, nantuko * @author BetaSteward_at_googlemail.com, nantuko
*/ */
public class CardSelector extends javax.swing.JPanel implements ComponentListener, DragCardTarget { public class CardSelector extends javax.swing.JPanel implements ComponentListener, DragCardTarget {
@ -56,6 +53,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
private boolean limited = false; private boolean limited = false;
private final SortSetting sortSetting; private final SortSetting sortSetting;
private static final Map<String, Integer> pdAllowed = new HashMap<>(); private static final Map<String, Integer> pdAllowed = new HashMap<>();
private static Listener<RepositoryEvent> setsDbListener = null;
private final String TEST_MULTI_SET = "Multiple Sets selected"; private final String TEST_MULTI_SET = "Multiple Sets selected";
@ -163,7 +161,6 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
/** /**
* Free all references * Free all references
*
*/ */
public void cleanUp() { public void cleanUp() {
this.cardGrid.clear(); this.cardGrid.clear();
@ -503,6 +500,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
} }
} }
private void reloadSetsCombobox() {
DefaultComboBoxModel model = new DefaultComboBoxModel<>(ConstructedFormats.getTypes());
cbExpansionSet.setModel(model);
}
/** /**
* This method is called from within the constructor to initialize the form. * This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always * WARNING: Do NOT modify this code. The content of this method is always
@ -573,8 +575,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbRed.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_red_off.png"))); // NOI18N tbRed.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_red_off.png"))); // NOI18N
tbRed.setSelected(true); tbRed.setSelected(true);
tbRed.setToolTipText("<html><font color='red'><strong>Red</strong></font><br/>" tbRed.setToolTipText("<html><font color='red'><strong>Red</strong></font><br/>"
+ tbColor.getToolTipText()); + tbColor.getToolTipText());
tbRed.setActionCommand("Red"); tbRed.setActionCommand("Red");
tbRed.setFocusable(false); tbRed.setFocusable(false);
tbRed.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbRed.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -664,7 +666,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbColor.add(tbColorless); tbColor.add(tbColorless);
tbColor.add(jSeparator1); tbColor.add(jSeparator1);
cbExpansionSet.setModel(new DefaultComboBoxModel<>(ConstructedFormats.getTypes())); reloadSetsCombobox();
cbExpansionSet.setMaximumSize(new java.awt.Dimension(250, 25)); cbExpansionSet.setMaximumSize(new java.awt.Dimension(250, 25));
cbExpansionSet.setMinimumSize(new java.awt.Dimension(250, 25)); cbExpansionSet.setMinimumSize(new java.awt.Dimension(250, 25));
cbExpansionSet.setName("cbExpansionSet"); // NOI18N cbExpansionSet.setName("cbExpansionSet"); // NOI18N
@ -674,6 +676,17 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
cbExpansionSetActionPerformed(evt); cbExpansionSetActionPerformed(evt);
} }
}); });
// auto-update sets list on changes
setsDbListener = new Listener<RepositoryEvent>() {
@Override
public void event(RepositoryEvent event) {
if (event.getEventType().equals(RepositoryEvent.RepositoryEventType.DB_UPDATED)) {
reloadSetsCombobox();
// TODO: auto-refresh cards list
}
}
};
ExpansionRepository.instance.subscribe(setsDbListener);
tbColor.add(cbExpansionSet); tbColor.add(cbExpansionSet);
btnExpansionSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_32.png"))); // NOI18N btnExpansionSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_32.png"))); // NOI18N
@ -733,8 +746,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbLand.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_land.png"))); // NOI18N tbLand.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_land.png"))); // NOI18N
tbLand.setSelected(true); tbLand.setSelected(true);
tbLand.setToolTipText("<html><strong>Land</strong><br/>" tbLand.setToolTipText("<html><strong>Land</strong><br/>"
+ tbTypes.getToolTipText()); + tbTypes.getToolTipText());
tbLand.setActionCommand("Lands"); tbLand.setActionCommand("Lands");
tbLand.setFocusable(false); tbLand.setFocusable(false);
tbLand.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbLand.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -748,8 +761,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbCreatures.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_creatures.png"))); // NOI18N tbCreatures.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_creatures.png"))); // NOI18N
tbCreatures.setSelected(true); tbCreatures.setSelected(true);
tbCreatures.setToolTipText("<html><strong>Creatures</strong><br/>" tbCreatures.setToolTipText("<html><strong>Creatures</strong><br/>"
+ tbTypes.getToolTipText()); + tbTypes.getToolTipText());
tbCreatures.setActionCommand("Creatures"); tbCreatures.setActionCommand("Creatures");
tbCreatures.setFocusable(false); tbCreatures.setFocusable(false);
tbCreatures.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbCreatures.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -763,8 +776,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbArifiacts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_artifact.png"))); // NOI18N tbArifiacts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_artifact.png"))); // NOI18N
tbArifiacts.setSelected(true); tbArifiacts.setSelected(true);
tbArifiacts.setToolTipText("<html><strong>Artifacts</strong><br/>" tbArifiacts.setToolTipText("<html><strong>Artifacts</strong><br/>"
+ tbTypes.getToolTipText()); + tbTypes.getToolTipText());
tbArifiacts.setActionCommand("Artifacts"); tbArifiacts.setActionCommand("Artifacts");
tbArifiacts.setFocusable(false); tbArifiacts.setFocusable(false);
tbArifiacts.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbArifiacts.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -778,8 +791,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbSorceries.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_sorcery.png"))); // NOI18N tbSorceries.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_sorcery.png"))); // NOI18N
tbSorceries.setSelected(true); tbSorceries.setSelected(true);
tbSorceries.setToolTipText("<html><strong>Sorceries</strong><br/>" tbSorceries.setToolTipText("<html><strong>Sorceries</strong><br/>"
+ tbTypes.getToolTipText()); + tbTypes.getToolTipText());
tbSorceries.setActionCommand("Soceries"); tbSorceries.setActionCommand("Soceries");
tbSorceries.setFocusable(false); tbSorceries.setFocusable(false);
tbSorceries.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbSorceries.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -793,8 +806,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbInstants.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_instant.png"))); // NOI18N tbInstants.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_instant.png"))); // NOI18N
tbInstants.setSelected(true); tbInstants.setSelected(true);
tbInstants.setToolTipText("<html><strong>Instants</strong><br/>" tbInstants.setToolTipText("<html><strong>Instants</strong><br/>"
+ tbTypes.getToolTipText()); + tbTypes.getToolTipText());
tbInstants.setActionCommand("Instants"); tbInstants.setActionCommand("Instants");
tbInstants.setFocusable(false); tbInstants.setFocusable(false);
tbInstants.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbInstants.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -808,8 +821,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbEnchantments.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_enchantment.png"))); // NOI18N tbEnchantments.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_enchantment.png"))); // NOI18N
tbEnchantments.setSelected(true); tbEnchantments.setSelected(true);
tbEnchantments.setToolTipText("<html><strong>Enchantments</strong><br/>" tbEnchantments.setToolTipText("<html><strong>Enchantments</strong><br/>"
+ tbTypes.getToolTipText()); + tbTypes.getToolTipText());
tbEnchantments.setActionCommand("Enchantments"); tbEnchantments.setActionCommand("Enchantments");
tbEnchantments.setFocusable(false); tbEnchantments.setFocusable(false);
tbEnchantments.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbEnchantments.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -823,8 +836,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbPlaneswalkers.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_planeswalker.png"))); // NOI18N tbPlaneswalkers.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_planeswalker.png"))); // NOI18N
tbPlaneswalkers.setSelected(true); tbPlaneswalkers.setSelected(true);
tbPlaneswalkers.setToolTipText("<html><strong>Planeswalker</strong><br/>" tbPlaneswalkers.setToolTipText("<html><strong>Planeswalker</strong><br/>"
+ tbTypes.getToolTipText()); + tbTypes.getToolTipText());
tbPlaneswalkers.setActionCommand("Planeswalkers"); tbPlaneswalkers.setActionCommand("Planeswalkers");
tbPlaneswalkers.setFocusable(false); tbPlaneswalkers.setFocusable(false);
tbPlaneswalkers.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbPlaneswalkers.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -905,8 +918,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbCommon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_common_20.png"))); // NOI18N tbCommon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_common_20.png"))); // NOI18N
tbCommon.setSelected(true); tbCommon.setSelected(true);
tbCommon.setToolTipText("<html><strong>Common</strong><br/>" tbCommon.setToolTipText("<html><strong>Common</strong><br/>"
+ tbRarities.getToolTipText()); + tbRarities.getToolTipText());
tbCommon.setActionCommand("Common"); tbCommon.setActionCommand("Common");
tbCommon.setFocusable(false); tbCommon.setFocusable(false);
tbCommon.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbCommon.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -920,8 +933,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbUncommon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_uncommon_20.png"))); // NOI18N tbUncommon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_uncommon_20.png"))); // NOI18N
tbUncommon.setSelected(true); tbUncommon.setSelected(true);
tbUncommon.setToolTipText("<html><strong>Uncommon</strong><br/>" tbUncommon.setToolTipText("<html><strong>Uncommon</strong><br/>"
+ tbRarities.getToolTipText()); + tbRarities.getToolTipText());
tbUncommon.setActionCommand("Uncommon"); tbUncommon.setActionCommand("Uncommon");
tbUncommon.setFocusable(false); tbUncommon.setFocusable(false);
tbUncommon.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbUncommon.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -935,8 +948,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbRare.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_rare_20.png"))); // NOI18N tbRare.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_rare_20.png"))); // NOI18N
tbRare.setSelected(true); tbRare.setSelected(true);
tbRare.setToolTipText("<html><strong>Rare</strong><br/>" tbRare.setToolTipText("<html><strong>Rare</strong><br/>"
+ tbRarities.getToolTipText()); + tbRarities.getToolTipText());
tbRare.setActionCommand("Rare"); tbRare.setActionCommand("Rare");
tbRare.setFocusable(false); tbRare.setFocusable(false);
tbRare.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbRare.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -950,8 +963,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbMythic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_mythic_20.png"))); // NOI18N tbMythic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_mythic_20.png"))); // NOI18N
tbMythic.setSelected(true); tbMythic.setSelected(true);
tbMythic.setToolTipText("<html><strong>Mythic</strong><br/>" tbMythic.setToolTipText("<html><strong>Mythic</strong><br/>"
+ tbRarities.getToolTipText()); + tbRarities.getToolTipText());
tbMythic.setActionCommand("Mythic"); tbMythic.setActionCommand("Mythic");
tbMythic.setFocusable(false); tbMythic.setFocusable(false);
tbMythic.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbMythic.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -965,8 +978,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbSpecial.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_special_20.png"))); // NOI18N tbSpecial.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/rarity_special_20.png"))); // NOI18N
tbSpecial.setSelected(true); tbSpecial.setSelected(true);
tbSpecial.setToolTipText("<html><strong>Special</strong><br/>" tbSpecial.setToolTipText("<html><strong>Special</strong><br/>"
+ tbRarities.getToolTipText()); + tbRarities.getToolTipText());
tbSpecial.setActionCommand("Special"); tbSpecial.setActionCommand("Special");
tbSpecial.setFocusable(false); tbSpecial.setFocusable(false);
tbSpecial.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tbSpecial.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -1119,59 +1132,59 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
javax.swing.GroupLayout cardSelectorBottomPanelLayout = new javax.swing.GroupLayout(cardSelectorBottomPanel); javax.swing.GroupLayout cardSelectorBottomPanelLayout = new javax.swing.GroupLayout(cardSelectorBottomPanel);
cardSelectorBottomPanel.setLayout(cardSelectorBottomPanelLayout); cardSelectorBottomPanel.setLayout(cardSelectorBottomPanelLayout);
cardSelectorBottomPanelLayout.setHorizontalGroup( cardSelectorBottomPanelLayout.setHorizontalGroup(
cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(cardSelectorBottomPanelLayout.createSequentialGroup() .addGroup(cardSelectorBottomPanelLayout.createSequentialGroup()
.addGap(6, 6, 6) .addGap(6, 6, 6)
.addComponent(jButtonAddToMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonAddToMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(2, 2, 2) .addGap(2, 2, 2)
.addComponent(jButtonRemoveFromMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonRemoveFromMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1) .addGap(1, 1, 1)
.addComponent(jButtonAddToSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonAddToSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(2, 2, 2) .addGap(2, 2, 2)
.addComponent(jButtonRemoveFromSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonRemoveFromSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonSearch) .addComponent(jButtonSearch)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonClean) .addComponent(jButtonClean)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkNames, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(chkNames, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkTypes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(chkTypes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkRules, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(chkRules, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5) .addGap(5, 5, 5)
.addComponent(chkUnique, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(chkUnique, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5) .addGap(5, 5, 5)
.addComponent(cardCountLabel) .addComponent(cardCountLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cardCount, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cardCount, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
cardSelectorBottomPanelLayout.setVerticalGroup( cardSelectorBottomPanelLayout.setVerticalGroup(
cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(cardSelectorBottomPanelLayout.createSequentialGroup() .addGroup(cardSelectorBottomPanelLayout.createSequentialGroup()
.addGap(4, 4, 4) .addGap(4, 4, 4)
.addGroup(cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(chkTypes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(chkTypes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(chkRules, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(chkRules, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(chkUnique, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(chkUnique, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(chkNames, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(chkNames, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(cardSelectorBottomPanelLayout.createSequentialGroup() .addGroup(cardSelectorBottomPanelLayout.createSequentialGroup()
.addGroup(cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButtonRemoveFromMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonRemoveFromMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButtonAddToSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonAddToSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButtonRemoveFromSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonRemoveFromSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(cardSelectorBottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButtonSearch) .addComponent(jButtonSearch)
.addComponent(jButtonClean) .addComponent(jButtonClean)
.addComponent(cardCount) .addComponent(cardCount)
.addComponent(jButtonAddToMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonAddToMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cardCountLabel))) .addComponent(cardCountLabel)))
.addGap(0, 0, Short.MAX_VALUE))) .addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap()) .addContainerGap())
); );
cardCountLabel.getAccessibleContext().setAccessibleName("cardCountLabel"); cardCountLabel.getAccessibleContext().setAccessibleName("cardCountLabel");
@ -1180,22 +1193,22 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tbColor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(tbColor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tbTypes, javax.swing.GroupLayout.DEFAULT_SIZE, 1057, Short.MAX_VALUE) .addComponent(tbTypes, javax.swing.GroupLayout.DEFAULT_SIZE, 1057, Short.MAX_VALUE)
.addComponent(cardSelectorScrollPane) .addComponent(cardSelectorScrollPane)
.addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1057, Short.MAX_VALUE) .addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1057, Short.MAX_VALUE)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(tbColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tbColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0) .addGap(0, 0, 0)
.addComponent(tbTypes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tbTypes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0) .addGap(0, 0, 0)
.addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE) .addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
.addGap(0, 0, 0) .addGap(0, 0, 0)
.addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents