* Some more changes to the deck editor.

This commit is contained in:
LevelX2 2014-05-10 11:35:07 +02:00
parent 5a9ccecd90
commit 0e34720611
18 changed files with 632 additions and 337 deletions

View file

@ -57,7 +57,7 @@ public class CardEventSource implements EventSource<Event>, Serializable {
dispatcher.fireEvent(new Event(card, message));
}
public void shiftDoubleClick(SimpleCardView card, String message) {
public void altDoubleClick(SimpleCardView card, String message) {
dispatcher.fireEvent(new Event(card, message));
}

View file

@ -306,14 +306,14 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
e.consume();
Object obj = e.getSource();
if (obj instanceof Card) {
if (e.isShiftDown()) {
cardEventSource.shiftDoubleClick(((Card) obj).getOriginal(), "shift-double-click");
if (e.isAltDown()) {
cardEventSource.altDoubleClick(((Card) obj).getOriginal(), "alt-double-click");
} else {
cardEventSource.doubleClick(((Card) obj).getOriginal(), "double-click");
}
} else if (obj instanceof MageCard) {
if (e.isShiftDown()) {
cardEventSource.shiftDoubleClick(((MageCard) obj).getOriginal(), "shift-double-click");
if (e.isAltDown()) {
cardEventSource.altDoubleClick(((MageCard) obj).getOriginal(), "alt-double-click");
} else {
cardEventSource.doubleClick(((MageCard) obj).getOriginal(), "double-click");
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="bgView">
</Component>
@ -34,16 +34,21 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelCardArea" alignment="0" max="32767" attributes="0"/>
<Component id="panelControl" pref="818" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelControl" pref="654" max="32767" attributes="0"/>
<Component id="panelCardArea" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="panelControl" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="panelCardArea" pref="69" max="32767" attributes="0"/>
<Component id="panelControl" min="-2" pref="25" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="panelCardArea" pref="266" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -67,22 +72,27 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="lblCount" min="-2" pref="75" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="lblCreatureCount" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="lblLandCount" min="-2" pref="75" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="lblCount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblLandCount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblCreatureCount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblSorceryCount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblInstantCount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblEnchantmentCount" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="chkPiles" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="cbSortBy" min="-2" pref="120" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cbSortBy" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jToggleListView" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jToggleCardView" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="287" max="-2" attributes="0"/>
<EmptySpace min="0" pref="55" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -90,17 +100,20 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="cbSortBy" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="lblCount" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblCreatureCount" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblLandCount" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblCreatureCount" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblSorceryCount" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblInstantCount" alignment="3" min="-2" pref="-17" max="-2" attributes="0"/>
<Component id="lblEnchantmentCount" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="chkPiles" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jToggleListView" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="cbSortBy" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jToggleListView" min="-2" max="-2" attributes="0"/>
<Component id="jToggleCardView" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -108,22 +121,117 @@
<SubComponents>
<Component class="javax.swing.JLabel" name="lblCount">
<Properties>
<Property name="text" type="java.lang.String" value="Card Count"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblCreatureCount">
<Properties>
<Property name="text" type="java.lang.String" value="Creature Count"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/deck_pack.png"/>
</Property>
<Property name="text" type="java.lang.String" value="999"/>
<Property name="toolTipText" type="java.lang.String" value="Number of all cards in this area."/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Standardcursor"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblLandCount">
<Properties>
<Property name="text" type="java.lang.String" value="Land Count"/>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_land.png"/>
</Property>
<Property name="text" type="java.lang.String" value="999"/>
<Property name="toolTipText" type="java.lang.String" value="Number of lands."/>
<Property name="verticalAlignment" type="int" value="1"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Standardcursor"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblCreatureCount">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_creatures.png"/>
</Property>
<Property name="text" type="java.lang.String" value="999"/>
<Property name="toolTipText" type="java.lang.String" value="Number of creatures."/>
<Property name="verticalAlignment" type="int" value="1"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Standardcursor"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblSorceryCount">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_sorcery.png"/>
</Property>
<Property name="text" type="java.lang.String" value="999"/>
<Property name="toolTipText" type="java.lang.String" value="Number of sorceries."/>
<Property name="verticalAlignment" type="int" value="1"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Standardcursor"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblInstantCount">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_instant.png"/>
</Property>
<Property name="text" type="java.lang.String" value="999"/>
<Property name="toolTipText" type="java.lang.String" value="Number of instants."/>
<Property name="verticalAlignment" type="int" value="1"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Standardcursor"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblEnchantmentCount">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_enchantment.png"/>
</Property>
<Property name="text" type="java.lang.String" value="999"/>
<Property name="toolTipText" type="java.lang.String" value="Number of enchantments."/>
<Property name="verticalAlignment" type="int" value="1"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Standardcursor"/>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="chkPiles">
<Properties>
<Property name="text" type="java.lang.String" value="Piles"/>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[3, 2, 2, 2]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkPilesActionPerformed"/>
@ -138,14 +246,15 @@
</Property>
<Property name="toolTipText" type="java.lang.String" value="Sort the cards if card view is active."/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 20]"/>
<Dimension value="[120, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 20]"/>
<Dimension value="[120, 20]"/>
</Property>
<Property name="name" type="java.lang.String" value="SortBy" noResource="true"/>
<Property name="opaque" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 20]"/>
<Dimension value="[120, 20]"/>
</Property>
</Properties>
<Events>
@ -164,6 +273,10 @@
<Image iconType="3" name="/buttons/list_panel.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Shows the cards as a list."/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="horizontalTextPosition" type="int" value="10"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[2, 6, 2, 6]"/>
</Property>
@ -174,7 +287,7 @@
<Dimension value="[37, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[37, 22]"/>
<Dimension value="[44, 22]"/>
</Property>
</Properties>
<AccessibilityProperties>
@ -193,11 +306,12 @@
<Image iconType="3" name="/buttons/card_panel.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Shows the card as images."/>
<Property name="horizontalTextPosition" type="int" value="10"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[2, 6, 2, 6]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[33, 22]"/>
<Dimension value="[40, 22]"/>
</Property>
</Properties>
<Events>

View file

@ -34,9 +34,10 @@
package mage.client.cards;
import java.awt.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@ -45,22 +46,33 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import javax.swing.*;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import mage.constants.CardType;
import mage.cards.MageCard;
import mage.client.constants.Constants.DeckEditorMode;
import mage.client.constants.Constants.SortBy;
import static mage.client.constants.Constants.SortBy.CASTING_COST;
import static mage.client.constants.Constants.SortBy.COLOR;
import static mage.client.constants.Constants.SortBy.COLOR_DETAILED;
import static mage.client.constants.Constants.SortBy.RARITY;
import mage.client.deckeditor.SortSetting;
import mage.client.deckeditor.table.TableModel;
import mage.client.deckeditor.table.UpdateCountsCallback;
import mage.client.dialog.PreferencesDialog;
import mage.client.plugins.impl.Plugins;
import mage.client.util.*;
import mage.client.util.CardViewColorComparator;
import mage.client.util.CardViewColorDetailedComparator;
import mage.client.util.CardViewCostComparator;
import mage.client.util.CardViewNameComparator;
import mage.client.util.CardViewRarityComparator;
import mage.client.util.Config;
import mage.client.util.Event;
import mage.client.util.Listener;
import mage.client.util.gui.TableSpinnerEditor;
import mage.constants.CardType;
import mage.view.CardView;
import mage.view.CardsView;
import org.mage.card.arcane.CardPanel;
@ -164,8 +176,8 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
public void mousePressed(MouseEvent e) {
if (e.getClickCount() == 2 && !e.isConsumed()) {
e.consume();
if (e.isShiftDown()) {
handleShiftDoubleClick();
if (e.isAltDown()) {
handleAltDoubleClick();
} else {
handleDoubleClick();
}
@ -173,7 +185,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
}
});
mainModel.setUpdateCountsCallback(new UpdateCountsCallback(lblCount, lblCreatureCount, lblLandCount));
mainModel.setUpdateCountsCallback(new UpdateCountsCallback(lblCount, lblCreatureCount, lblLandCount, lblSorceryCount, lblInstantCount, lblEnchantmentCount));
}
// if you use the deck ediot to build a free deck, numbers can be set directly in deck and sideboard
@ -192,11 +204,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
public void handleSetNumber(int number) {
if (mainTable.getSelectedRowCount() == 1) {
int[] n = mainTable.getSelectedRows();
List<Integer> indexes = asList(n);
for (Integer index : indexes) {
mainModel.setNumber(index, number);
}
mainModel.setNumber(mainTable.getSelectedRow(), number);
}
}
@ -211,13 +219,13 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
}
}
public void handleShiftDoubleClick() {
public void handleAltDoubleClick() {
if (mainTable.getSelectedRowCount() > 0) {
int[] n = mainTable.getSelectedRows();
List<Integer> indexes = asList(n);
Collections.reverse(indexes);
for (Integer index : indexes) {
mainModel.shiftDoubleClick(index);
mainModel.altDoubleClick(index);
}
}
}
@ -236,6 +244,10 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId) {
int selectedRow = -1;
if (currentView.equals(mainModel)) {
selectedRow = mainTable.getSelectedRow();
}
this.cards = showCards;
this.bigCard = bigCard;
this.gameId = gameId;
@ -243,6 +255,12 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
cbSortBy.setSelectedItem(sortSetting.getSortBy());
chkPiles.setSelected(sortSetting.isPilesToggle());
currentView.loadCards(showCards, sortSetting, bigCard, gameId);
if (selectedRow >= 0) {
selectedRow = Math.min(selectedRow, mainTable.getRowCount()-1);
if (selectedRow >= 0) {
mainTable.setRowSelectionInterval(selectedRow, selectedRow);
}
}
}
private void redrawCards() {
@ -260,6 +278,9 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
int curRow = 0;
int landCount = 0;
int creatureCount = 0;
int sorceryCount = 0;
int instantCount = 0;
int enchantmentCount = 0;
//FIXME: why we remove all cards? for performance it's better to merge changes
// as it is already done in ListView
cardArea.removeAll();
@ -323,36 +344,41 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
}
rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20);
addCard(card, bigCard, gameId, rectangle);
if (card.getCardTypes().contains(CardType.LAND)) {
landCount++;
}
if (card.getCardTypes().contains(CardType.CREATURE)) {
creatureCount++;
}
curRow++;
lastCard = card;
}
else {
} else {
rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20);
addCard(card, bigCard, gameId, rectangle);
if (card.getCardTypes().contains(CardType.LAND)) {
landCount++;
}
if (card.getCardTypes().contains(CardType.CREATURE)) {
creatureCount++;
}
curColumn++;
if (curColumn == numColumns) {
curColumn = 0;
curRow++;
}
}
if (card.getCardTypes().contains(CardType.LAND)) {
landCount++;
}
if (card.getCardTypes().contains(CardType.CREATURE)) {
creatureCount++;
}
if (card.getCardTypes().contains(CardType.SORCERY)) {
sorceryCount++;
}
if (card.getCardTypes().contains(CardType.INSTANT)) {
instantCount++;
}
if (card.getCardTypes().contains(CardType.ENCHANTMENT)) {
enchantmentCount++;
}
}
}
int count = cards != null ? cards.size() : 0;
this.lblCount.setText("Count: " + Integer.toString(count));
this.lblCreatureCount.setText("Creatures: " + Integer.toString(creatureCount));
this.lblLandCount.setText("Lands: " + Integer.toString(landCount));
this.lblCount.setText(Integer.toString(count));
this.lblCreatureCount.setText(Integer.toString(creatureCount));
this.lblLandCount.setText(Integer.toString(landCount));
this.lblSorceryCount.setText(Integer.toString(sorceryCount));
this.lblInstantCount.setText(Integer.toString(instantCount));
this.lblEnchantmentCount.setText(Integer.toString(enchantmentCount));
cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight + 200));
cardArea.revalidate();
this.revalidate();
@ -411,12 +437,16 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
bgView = new javax.swing.ButtonGroup();
panelControl = new javax.swing.JPanel();
lblCount = new javax.swing.JLabel();
lblCreatureCount = new javax.swing.JLabel();
lblLandCount = new javax.swing.JLabel();
lblCreatureCount = new javax.swing.JLabel();
lblSorceryCount = new javax.swing.JLabel();
lblInstantCount = new javax.swing.JLabel();
lblEnchantmentCount = new javax.swing.JLabel();
chkPiles = new javax.swing.JCheckBox();
cbSortBy = new javax.swing.JComboBox<SortBy>();
jToggleListView = new javax.swing.JToggleButton();
@ -437,13 +467,73 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
panelControl.setPreferredSize(new java.awt.Dimension(616, 23));
panelControl.setRequestFocusEnabled(false);
lblCount.setText("Card Count");
lblCount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/deck_pack.png"))); // NOI18N
lblCount.setText("999");
lblCount.setToolTipText("Number of all cards in this area.");
lblCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblCount.setFocusable(false);
lblCount.setInheritsPopupMenu(false);
lblCount.setRequestFocusEnabled(false);
lblCount.setVerifyInputWhenFocusTarget(false);
lblCreatureCount.setText("Creature Count");
lblLandCount.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
lblLandCount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_land.png"))); // NOI18N
lblLandCount.setText("999");
lblLandCount.setToolTipText("Number of lands.");
lblLandCount.setVerticalAlignment(javax.swing.SwingConstants.TOP);
lblLandCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblLandCount.setFocusable(false);
lblLandCount.setInheritsPopupMenu(false);
lblLandCount.setRequestFocusEnabled(false);
lblLandCount.setVerifyInputWhenFocusTarget(false);
lblLandCount.setText("Land Count");
lblCreatureCount.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
lblCreatureCount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_creatures.png"))); // NOI18N
lblCreatureCount.setText("999");
lblCreatureCount.setToolTipText("Number of creatures.");
lblCreatureCount.setVerticalAlignment(javax.swing.SwingConstants.TOP);
lblCreatureCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblCreatureCount.setFocusable(false);
lblCreatureCount.setInheritsPopupMenu(false);
lblCreatureCount.setRequestFocusEnabled(false);
lblCreatureCount.setVerifyInputWhenFocusTarget(false);
lblSorceryCount.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
lblSorceryCount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_sorcery.png"))); // NOI18N
lblSorceryCount.setText("999");
lblSorceryCount.setToolTipText("Number of sorceries.");
lblSorceryCount.setVerticalAlignment(javax.swing.SwingConstants.TOP);
lblSorceryCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblSorceryCount.setFocusable(false);
lblSorceryCount.setInheritsPopupMenu(false);
lblSorceryCount.setRequestFocusEnabled(false);
lblSorceryCount.setVerifyInputWhenFocusTarget(false);
lblInstantCount.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
lblInstantCount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_instant.png"))); // NOI18N
lblInstantCount.setText("999");
lblInstantCount.setToolTipText("Number of instants.");
lblInstantCount.setVerticalAlignment(javax.swing.SwingConstants.TOP);
lblInstantCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblInstantCount.setFocusable(false);
lblInstantCount.setInheritsPopupMenu(false);
lblInstantCount.setRequestFocusEnabled(false);
lblInstantCount.setVerifyInputWhenFocusTarget(false);
lblEnchantmentCount.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
lblEnchantmentCount.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_enchantment.png"))); // NOI18N
lblEnchantmentCount.setText("999");
lblEnchantmentCount.setToolTipText("Number of enchantments.");
lblEnchantmentCount.setVerticalAlignment(javax.swing.SwingConstants.TOP);
lblEnchantmentCount.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
lblEnchantmentCount.setFocusable(false);
lblEnchantmentCount.setInheritsPopupMenu(false);
lblEnchantmentCount.setRequestFocusEnabled(false);
lblEnchantmentCount.setVerifyInputWhenFocusTarget(false);
chkPiles.setText("Piles");
chkPiles.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
chkPiles.setMargin(new java.awt.Insets(3, 2, 2, 2));
chkPiles.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
chkPilesActionPerformed(evt);
@ -452,10 +542,11 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
cbSortBy.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SortBy" }));
cbSortBy.setToolTipText("Sort the cards if card view is active.");
cbSortBy.setMaximumSize(new java.awt.Dimension(80, 20));
cbSortBy.setMinimumSize(new java.awt.Dimension(80, 20));
cbSortBy.setMaximumSize(new java.awt.Dimension(120, 20));
cbSortBy.setMinimumSize(new java.awt.Dimension(120, 20));
cbSortBy.setName("SortBy"); // NOI18N
cbSortBy.setPreferredSize(new java.awt.Dimension(80, 20));
cbSortBy.setOpaque(false);
cbSortBy.setPreferredSize(new java.awt.Dimension(120, 20));
cbSortBy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbSortByActionPerformed(evt);
@ -465,10 +556,12 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
bgView.add(jToggleListView);
jToggleListView.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/list_panel.png"))); // NOI18N
jToggleListView.setToolTipText("Shows the cards as a list.");
jToggleListView.setBorder(null);
jToggleListView.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
jToggleListView.setMargin(new java.awt.Insets(2, 6, 2, 6));
jToggleListView.setMaximumSize(new java.awt.Dimension(37, 25));
jToggleListView.setMinimumSize(new java.awt.Dimension(37, 25));
jToggleListView.setPreferredSize(new java.awt.Dimension(37, 22));
jToggleListView.setPreferredSize(new java.awt.Dimension(44, 22));
jToggleListView.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jToggleListViewActionPerformed(evt);
@ -478,8 +571,9 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
bgView.add(jToggleCardView);
jToggleCardView.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/card_panel.png"))); // NOI18N
jToggleCardView.setToolTipText("Shows the card as images.");
jToggleCardView.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
jToggleCardView.setMargin(new java.awt.Insets(2, 6, 2, 6));
jToggleCardView.setPreferredSize(new java.awt.Dimension(33, 22));
jToggleCardView.setPreferredSize(new java.awt.Dimension(40, 22));
jToggleCardView.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jToggleCardViewActionPerformed(evt);
@ -490,36 +584,44 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
panelControl.setLayout(panelControlLayout);
panelControlLayout.setHorizontalGroup(
panelControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelControlLayout.createSequentialGroup()
.addContainerGap()
.addComponent(lblCount, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(panelControlLayout.createSequentialGroup()
.addComponent(lblCount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblCreatureCount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblLandCount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblCreatureCount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblSorceryCount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblInstantCount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblEnchantmentCount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblLandCount, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkPiles)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(cbSortBy, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cbSortBy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jToggleListView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jToggleCardView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(287, 287, 287))
.addGap(0, 55, Short.MAX_VALUE))
);
panelControlLayout.setVerticalGroup(
panelControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelControlLayout.createSequentialGroup()
.addGroup(panelControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cbSortBy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblCount)
.addComponent(lblCreatureCount)
.addComponent(lblLandCount)
.addComponent(chkPiles)
.addComponent(jToggleListView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(lblCreatureCount)
.addComponent(lblSorceryCount)
.addComponent(lblInstantCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblEnchantmentCount)
.addComponent(chkPiles))
.addComponent(cbSortBy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jToggleListView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jToggleCardView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
.addGap(0, 0, 0))
);
jToggleListView.getAccessibleContext().setAccessibleDescription("Switch between image and table view.");
@ -531,15 +633,18 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelCardArea)
.addComponent(panelControl, javax.swing.GroupLayout.DEFAULT_SIZE, 818, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelControl, javax.swing.GroupLayout.DEFAULT_SIZE, 654, Short.MAX_VALUE)
.addComponent(panelCardArea)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(panelControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(panelControl, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(panelCardArea, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE))
.addComponent(panelCardArea, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
@ -580,7 +685,10 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
private javax.swing.JToggleButton jToggleListView;
private javax.swing.JLabel lblCount;
private javax.swing.JLabel lblCreatureCount;
private javax.swing.JLabel lblEnchantmentCount;
private javax.swing.JLabel lblInstantCount;
private javax.swing.JLabel lblLandCount;
private javax.swing.JLabel lblSorceryCount;
private javax.swing.JScrollPane panelCardArea;
private javax.swing.JPanel panelControl;
// End of variables declaration//GEN-END:variables
@ -595,15 +703,15 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
e.consume();
Object obj = e.getSource();
if (obj instanceof Card) {
if (e.isShiftDown()) {
cardEventSource.shiftDoubleClick(((Card)obj).getOriginal(), "shift-double-click");
if (e.isAltDown()) {
cardEventSource.altDoubleClick(((Card)obj).getOriginal(), "alt-double-click");
}
else {
cardEventSource.doubleClick(((Card)obj).getOriginal(), "double-click");
}
} else if (obj instanceof MageCard) {
if (e.isShiftDown()) {
cardEventSource.shiftDoubleClick(((MageCard)obj).getOriginal(), "shift-double-click");
if (e.isAltDown()) {
cardEventSource.altDoubleClick(((MageCard)obj).getOriginal(), "alt-double-click");
}
else {
cardEventSource.doubleClick(((MageCard)obj).getOriginal(), "double-click");

View file

@ -21,9 +21,9 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tbColor" alignment="0" max="32767" attributes="0"/>
<Component id="tbTypes" alignment="0" pref="897" max="32767" attributes="0"/>
<Component id="tbTypes" alignment="0" pref="1057" max="32767" attributes="0"/>
<Component id="cardSelectorScrollPane" alignment="0" max="32767" attributes="0"/>
<Component id="cardSelectorBottomPanel" alignment="0" max="32767" attributes="0"/>
<Component id="cardSelectorBottomPanel" alignment="0" pref="1057" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@ -45,7 +45,7 @@
<Properties>
<Property name="floatable" type="boolean" value="false"/>
<Property name="rollover" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" value="Click with ALT to deselect all other colors or with CTRL to invert selection."/>
<Property name="toolTipText" type="java.lang.String" value="Hold the ALT-key while clicking to deselect all other colors or hold the CTRL-key to select only all other colors."/>
<Property name="borderPainted" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
@ -144,7 +144,7 @@
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&lt;font color=&apos;white&apos;&gt;&lt;strong&gt;White&lt;/strong&gt;&lt;/font&gt;&lt;br/&gt;&quot; + tbColor.getToolTipText()" type="code"/>
<Connection code="&quot;&lt;html&gt;&lt;font color=&apos;grey&apos;&gt;&lt;strong&gt;White&lt;/strong&gt;&lt;/font&gt;&lt;br/&gt;&quot; + tbColor.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="White"/>
<Property name="focusable" type="boolean" value="false"/>
@ -235,7 +235,7 @@
<Properties>
<Property name="floatable" type="boolean" value="false"/>
<Property name="rollover" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" value="Click with ALT to deselect all other card types or with CTRL to deselect only clicked type." noResource="true"/>
<Property name="toolTipText" type="java.lang.String" value="Hold the ALT-key while clicking to deselect all other card types or hold the CTRL-key to only select all other card types." noResource="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[732, 27]"/>
</Property>
@ -243,103 +243,133 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
<SubComponents>
<Component class="javax.swing.JRadioButton" name="rdoLand">
<Component class="javax.swing.JToggleButton" name="tbLand">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_land.png"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&gt;&lt;strong&gt;Land&lt;/strong&gt;&lt;br/&gt;&quot; &#xd;&#xa;+ tbTypes.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="Lands"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="4"/>
<Property name="label" type="java.lang.String" value="Land "/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoLandActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbLandActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdoCreatures">
<Component class="javax.swing.JToggleButton" name="tbCreatures">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_creatures.png"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&gt;&lt;strong&gt;Creatures&lt;/strong&gt;&lt;br/&gt;&quot; &#xd;&#xa;+ tbTypes.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="Creatures"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="4"/>
<Property name="label" type="java.lang.String" value="Creatures "/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoCreaturesActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbCreaturesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdoArtifacts">
<Component class="javax.swing.JToggleButton" name="tbArifiacts">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_artifact.png"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Artifacts "/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&gt;&lt;strong&gt;Artifacts&lt;/strong&gt;&lt;br/&gt;&quot; &#xd;&#xa;+ tbTypes.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="Artifacts"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="4"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoArtifactsActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbArifiactsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdoEnchantments">
<Component class="javax.swing.JToggleButton" name="tbSorceries">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_sorcery.png"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&gt;&lt;strong&gt;Sorceries&lt;/strong&gt;&lt;br/&gt;&quot; &#xd;&#xa;+ tbTypes.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="Soceries"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbSorceriesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="tbInstants">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_instant.png"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&gt;&lt;strong&gt;Instants&lt;/strong&gt;&lt;br/&gt;&quot; &#xd;&#xa;+ tbTypes.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="Instants"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbInstantsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="tbEnchantments">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_enchantment.png"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Enchantments "/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&gt;&lt;strong&gt;Enchantments&lt;/strong&gt;&lt;br/&gt;&quot; &#xd;&#xa;+ tbTypes.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="Enchantments"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="4"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoEnchantmentsActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbEnchantmentsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdoInstants">
<Component class="javax.swing.JToggleButton" name="tbPlaneswalkers">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/type_planeswalker.png"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Instants "/>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="&quot;&lt;html&gt;&lt;strong&gt;Planeswalker&lt;/strong&gt;&lt;br/&gt;&quot; &#xd;&#xa;+ tbTypes.getToolTipText()" type="code"/>
</Property>
<Property name="actionCommand" type="java.lang.String" value="Planeswalkers"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="4"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoInstantsActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbPlaneswalkersActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdoSorceries">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Sorceries "/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="4"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoSorceriesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdoPlaneswalkers">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Planeswalkers "/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="4"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoPlaneswalkersActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToolBar$Separator" name="jSeparator5">
<Component class="javax.swing.JToolBar$Separator" name="jSeparator6">
</Component>
<Component class="javax.swing.JCheckBox" name="chkPiles">
<Properties>
@ -448,6 +478,9 @@
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="cardSelectorScrollPane">
<Properties>
<Property name="toolTipText" type="java.lang.String" value="&lt;HTML&gt;Double click to add the card to the main deck.&lt;br/&gt;&#xa;ALT + Double click to add the card to the sideboard."/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
</Container>
@ -514,7 +547,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/deck_in.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Add selected cards to deck"/>
<Property name="toolTipText" type="java.lang.String" value="&lt;html&gt;Add selected cards to deck.&lt;br/&gt;&#xa;Alternative: &lt;strong&gt;Double click&lt;/strong&gt; the card in card selector to move a card to the deck."/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="null"/>
</Property>
@ -525,7 +558,7 @@
<Dimension value="[42, 23]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[28, 22]"/>
<Dimension value="[40, 28]"/>
</Property>
</Properties>
<Events>
@ -537,7 +570,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/buttons/sideboard_in.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Add selected cards to sideboard."/>
<Property name="toolTipText" type="java.lang.String" value="&lt;html&gt;Add selected cards to sideboard.&lt;br/&gt;&#xa;Alternative: &lt;strong&gt;ALT key + Double click&lt;/strong&gt; the card in card selector to move a card to the sideboard."/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[2, 0, 2, 0]"/>
</Property>
@ -548,7 +581,7 @@
<Dimension value="[10, 30]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[28, 22]"/>
<Dimension value="[40, 28]"/>
</Property>
</Properties>
<Events>
@ -617,7 +650,7 @@
<Dimension value="[42, 23]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[28, 22]"/>
<Dimension value="[40, 28]"/>
</Property>
</Properties>
<Events>
@ -640,7 +673,7 @@
<Dimension value="[100, 30]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[28, 22]"/>
<Dimension value="[40, 28]"/>
</Property>
</Properties>
<Events>

View file

@ -144,6 +144,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
mainTable.getColumnModel().getColumn(6).setPreferredWidth(15);
mainTable.getColumnModel().getColumn(7).setPreferredWidth(15);
// mainTable.setToolTipText(cardSelectorScrollPane.getToolTipText());
cardSelectorScrollPane.setViewportView(mainTable);
mainTable.setOpaque(false);
cbSortBy.setEnabled(false);
@ -154,7 +155,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
public void mousePressed(MouseEvent e) {
if (e.getClickCount() == 2 && !e.isConsumed()) {
e.consume();
if (e.isShiftDown()) {
if (e.isAltDown()) {
jButtonAddToSideboardActionPerformed(null);
} else {
jButtonAddToMainActionPerformed(null);
@ -242,25 +243,25 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
filter.add(Predicates.or(predicates));
predicates.clear();
if (this.rdoLand.isSelected()) {
if (this.tbLand.isSelected()) {
predicates.add(new CardTypePredicate(CardType.LAND));
}
if (this.rdoArtifacts.isSelected()) {
if (this.tbArifiacts.isSelected()) {
predicates.add(new CardTypePredicate(CardType.ARTIFACT));
}
if (this.rdoCreatures.isSelected()) {
if (this.tbCreatures.isSelected()) {
predicates.add(new CardTypePredicate(CardType.CREATURE));
}
if (this.rdoEnchantments.isSelected()) {
if (this.tbEnchantments.isSelected()) {
predicates.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
if (this.rdoInstants.isSelected()) {
if (this.tbInstants.isSelected()) {
predicates.add(new CardTypePredicate(CardType.INSTANT));
}
if (this.rdoSorceries.isSelected()) {
if (this.tbSorceries.isSelected()) {
predicates.add(new CardTypePredicate(CardType.SORCERY));
}
if (this.rdoPlaneswalkers.isSelected()) {
if (this.tbPlaneswalkers.isSelected()) {
predicates.add(new CardTypePredicate(CardType.PLANESWALKER));
}
filter.add(Predicates.or(predicates));
@ -290,25 +291,25 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
criteria.white(this.tbWhite.isSelected());
criteria.colorless(this.tbColorless.isSelected());
if (this.rdoLand.isSelected()) {
if (this.tbLand.isSelected()) {
criteria.types(CardType.LAND);
}
if (this.rdoArtifacts.isSelected()) {
if (this.tbArifiacts.isSelected()) {
criteria.types(CardType.ARTIFACT);
}
if (this.rdoCreatures.isSelected()) {
if (this.tbCreatures.isSelected()) {
criteria.types(CardType.CREATURE);
}
if (this.rdoEnchantments.isSelected()) {
if (this.tbEnchantments.isSelected()) {
criteria.types(CardType.ENCHANTMENT);
}
if (this.rdoInstants.isSelected()) {
if (this.tbInstants.isSelected()) {
criteria.types(CardType.INSTANT);
}
if (this.rdoSorceries.isSelected()) {
if (this.tbSorceries.isSelected()) {
criteria.types(CardType.SORCERY);
}
if (this.rdoPlaneswalkers.isSelected()) {
if (this.tbPlaneswalkers.isSelected()) {
criteria.types(CardType.PLANESWALKER);
}
@ -349,13 +350,13 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
// ALT or CTRL button was pushed
if ((modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK || (modifiers & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {
boolean invert = (modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK;
rdoArtifacts.setSelected(inverter(invert, rdoArtifacts.getActionCommand(), actionCommand));
rdoCreatures.setSelected(inverter(invert, rdoCreatures.getActionCommand(), actionCommand));
rdoEnchantments.setSelected(inverter(invert, rdoEnchantments.getActionCommand(), actionCommand));
rdoInstants.setSelected(inverter(invert, rdoInstants.getActionCommand(), actionCommand));
rdoLand.setSelected(inverter(invert, rdoLand.getActionCommand(), actionCommand));
rdoPlaneswalkers.setSelected(inverter(invert, rdoPlaneswalkers.getActionCommand(), actionCommand));
rdoSorceries.setSelected(inverter(invert, rdoSorceries.getActionCommand(), actionCommand));
tbArifiacts.setSelected(inverter(invert, tbArifiacts.getActionCommand(), actionCommand));
tbCreatures.setSelected(inverter(invert, tbCreatures.getActionCommand(), actionCommand));
tbEnchantments.setSelected(inverter(invert, tbEnchantments.getActionCommand(), actionCommand));
tbInstants.setSelected(inverter(invert, tbInstants.getActionCommand(), actionCommand));
tbLand.setSelected(inverter(invert, tbLand.getActionCommand(), actionCommand));
tbPlaneswalkers.setSelected(inverter(invert, tbPlaneswalkers.getActionCommand(), actionCommand));
tbSorceries.setSelected(inverter(invert, tbSorceries.getActionCommand(), actionCommand));
}
filterCards();
}
@ -437,14 +438,14 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
btnBooster = new javax.swing.JButton();
btnClear = new javax.swing.JButton();
tbTypes = new javax.swing.JToolBar();
rdoLand = new javax.swing.JRadioButton();
rdoCreatures = new javax.swing.JRadioButton();
rdoArtifacts = new javax.swing.JRadioButton();
rdoEnchantments = new javax.swing.JRadioButton();
rdoInstants = new javax.swing.JRadioButton();
rdoSorceries = new javax.swing.JRadioButton();
rdoPlaneswalkers = new javax.swing.JRadioButton();
jSeparator5 = new javax.swing.JToolBar.Separator();
tbLand = new javax.swing.JToggleButton();
tbCreatures = new javax.swing.JToggleButton();
tbArifiacts = new javax.swing.JToggleButton();
tbSorceries = new javax.swing.JToggleButton();
tbInstants = new javax.swing.JToggleButton();
tbEnchantments = new javax.swing.JToggleButton();
tbPlaneswalkers = new javax.swing.JToggleButton();
jSeparator6 = new javax.swing.JToolBar.Separator();
chkPiles = new javax.swing.JCheckBox();
jSeparator3 = new javax.swing.JToolBar.Separator();
cbSortBy = new javax.swing.JComboBox<SortBy>();
@ -466,7 +467,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbColor.setFloatable(false);
tbColor.setRollover(true);
tbColor.setToolTipText("Click with ALT to deselect all other colors or with CTRL to invert selection.");
tbColor.setToolTipText("Hold the ALT-key while clicking to deselect all other colors or hold the CTRL-key to select only all other colors.");
tbColor.setBorderPainted(false);
tbColor.setName(""); // NOI18N
@ -534,7 +535,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbWhite.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/color_white_off.png"))); // NOI18N
tbWhite.setSelected(true);
tbWhite.setToolTipText("<html<font color='white'><strong>White</strong></font><br/>" + tbColor.getToolTipText());
tbWhite.setToolTipText("<html><font color='grey'><strong>White</strong></font><br/>" + tbColor.getToolTipText());
tbWhite.setActionCommand("White");
tbWhite.setFocusable(false);
tbWhite.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
@ -601,101 +602,114 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
tbTypes.setFloatable(false);
tbTypes.setRollover(true);
tbTypes.setToolTipText("Click with ALT to deselect all other card types or with CTRL to deselect only clicked type."); // NOI18N
tbTypes.setToolTipText("Hold the ALT-key while clicking to deselect all other card types or hold the CTRL-key to only select all other card types."); // NOI18N
tbTypes.setPreferredSize(new java.awt.Dimension(732, 27));
rdoLand.setSelected(true);
rdoLand.setToolTipText("<html><strong>Land</strong><br/>"
tbLand.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_land.png"))); // NOI18N
tbLand.setSelected(true);
tbLand.setToolTipText("<html><strong>Land</strong><br/>"
+ tbTypes.getToolTipText());
rdoLand.setFocusable(false);
rdoLand.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
rdoLand.setLabel("Land ");
rdoLand.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
rdoLand.addActionListener(new java.awt.event.ActionListener() {
tbLand.setActionCommand("Lands");
tbLand.setFocusable(false);
tbLand.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
tbLand.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbLand.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdoLandActionPerformed(evt);
tbLandActionPerformed(evt);
}
});
tbTypes.add(rdoLand);
tbTypes.add(tbLand);
rdoCreatures.setSelected(true);
rdoCreatures.setToolTipText("<html><strong>Creatures</strong><br/>"
tbCreatures.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_creatures.png"))); // NOI18N
tbCreatures.setSelected(true);
tbCreatures.setToolTipText("<html><strong>Creatures</strong><br/>"
+ tbTypes.getToolTipText());
rdoCreatures.setFocusable(false);
rdoCreatures.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
rdoCreatures.setLabel("Creatures ");
rdoCreatures.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
rdoCreatures.addActionListener(new java.awt.event.ActionListener() {
tbCreatures.setActionCommand("Creatures");
tbCreatures.setFocusable(false);
tbCreatures.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
tbCreatures.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbCreatures.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdoCreaturesActionPerformed(evt);
tbCreaturesActionPerformed(evt);
}
});
tbTypes.add(rdoCreatures);
tbTypes.add(tbCreatures);
rdoArtifacts.setSelected(true);
rdoArtifacts.setText("Artifacts ");
rdoArtifacts.setToolTipText("<html><strong>Artifacts</strong><br/>"
tbArifiacts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_artifact.png"))); // NOI18N
tbArifiacts.setSelected(true);
tbArifiacts.setToolTipText("<html><strong>Artifacts</strong><br/>"
+ tbTypes.getToolTipText());
rdoArtifacts.setFocusable(false);
rdoArtifacts.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
rdoArtifacts.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
rdoArtifacts.addActionListener(new java.awt.event.ActionListener() {
tbArifiacts.setActionCommand("Artifacts");
tbArifiacts.setFocusable(false);
tbArifiacts.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
tbArifiacts.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbArifiacts.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdoArtifactsActionPerformed(evt);
tbArifiactsActionPerformed(evt);
}
});
tbTypes.add(rdoArtifacts);
tbTypes.add(tbArifiacts);
rdoEnchantments.setSelected(true);
rdoEnchantments.setText("Enchantments ");
rdoEnchantments.setToolTipText("<html><strong>Enchantments</strong><br/>"
tbSorceries.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_sorcery.png"))); // NOI18N
tbSorceries.setSelected(true);
tbSorceries.setToolTipText("<html><strong>Sorceries</strong><br/>"
+ tbTypes.getToolTipText());
rdoEnchantments.setFocusable(false);
rdoEnchantments.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
rdoEnchantments.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
rdoEnchantments.addActionListener(new java.awt.event.ActionListener() {
tbSorceries.setActionCommand("Soceries");
tbSorceries.setFocusable(false);
tbSorceries.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
tbSorceries.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbSorceries.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdoEnchantmentsActionPerformed(evt);
tbSorceriesActionPerformed(evt);
}
});
tbTypes.add(rdoEnchantments);
tbTypes.add(tbSorceries);
rdoInstants.setSelected(true);
rdoInstants.setText("Instants ");
rdoInstants.setFocusable(false);
rdoInstants.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
rdoInstants.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
rdoInstants.addActionListener(new java.awt.event.ActionListener() {
tbInstants.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_instant.png"))); // NOI18N
tbInstants.setSelected(true);
tbInstants.setToolTipText("<html><strong>Instants</strong><br/>"
+ tbTypes.getToolTipText());
tbInstants.setActionCommand("Instants");
tbInstants.setFocusable(false);
tbInstants.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
tbInstants.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbInstants.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdoInstantsActionPerformed(evt);
tbInstantsActionPerformed(evt);
}
});
tbTypes.add(rdoInstants);
tbTypes.add(tbInstants);
rdoSorceries.setSelected(true);
rdoSorceries.setText("Sorceries ");
rdoSorceries.setFocusable(false);
rdoSorceries.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
rdoSorceries.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
rdoSorceries.addActionListener(new java.awt.event.ActionListener() {
tbEnchantments.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_enchantment.png"))); // NOI18N
tbEnchantments.setSelected(true);
tbEnchantments.setToolTipText("<html><strong>Enchantments</strong><br/>"
+ tbTypes.getToolTipText());
tbEnchantments.setActionCommand("Enchantments");
tbEnchantments.setFocusable(false);
tbEnchantments.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
tbEnchantments.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbEnchantments.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdoSorceriesActionPerformed(evt);
tbEnchantmentsActionPerformed(evt);
}
});
tbTypes.add(rdoSorceries);
tbTypes.add(tbEnchantments);
rdoPlaneswalkers.setSelected(true);
rdoPlaneswalkers.setText("Planeswalkers ");
rdoPlaneswalkers.setFocusable(false);
rdoPlaneswalkers.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
rdoPlaneswalkers.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
rdoPlaneswalkers.addActionListener(new java.awt.event.ActionListener() {
tbPlaneswalkers.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/type_planeswalker.png"))); // NOI18N
tbPlaneswalkers.setSelected(true);
tbPlaneswalkers.setToolTipText("<html><strong>Planeswalker</strong><br/>"
+ tbTypes.getToolTipText());
tbPlaneswalkers.setActionCommand("Planeswalkers");
tbPlaneswalkers.setFocusable(false);
tbPlaneswalkers.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
tbPlaneswalkers.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
tbPlaneswalkers.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rdoPlaneswalkersActionPerformed(evt);
tbPlaneswalkersActionPerformed(evt);
}
});
tbTypes.add(rdoPlaneswalkers);
tbTypes.add(jSeparator5);
tbTypes.add(tbPlaneswalkers);
tbTypes.add(jSeparator6);
chkPiles.setText("Piles");
chkPiles.setToolTipText("Shows the card in piles by the selected sort.");
@ -759,15 +773,17 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
});
tbTypes.add(jToggleCardView);
cardSelectorScrollPane.setToolTipText("<HTML>Double click to add the card to the main deck.<br/>\nALT + Double click to add the card to the sideboard.");
cardSelectorBottomPanel.setOpaque(false);
cardSelectorBottomPanel.setPreferredSize(new java.awt.Dimension(897, 40));
jButtonAddToMain.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/deck_in.png"))); // NOI18N
jButtonAddToMain.setToolTipText("Add selected cards to deck");
jButtonAddToMain.setToolTipText("<html>Add selected cards to deck.<br/>\nAlternative: <strong>Double click</strong> the card in card selector to move a card to the deck.");
jButtonAddToMain.setMargin(null);
jButtonAddToMain.setMaximumSize(new java.awt.Dimension(42, 23));
jButtonAddToMain.setMinimumSize(new java.awt.Dimension(42, 23));
jButtonAddToMain.setPreferredSize(new java.awt.Dimension(28, 22));
jButtonAddToMain.setPreferredSize(new java.awt.Dimension(40, 28));
jButtonAddToMain.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonAddToMainActionPerformed(evt);
@ -775,11 +791,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
});
jButtonAddToSideboard.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/sideboard_in.png"))); // NOI18N
jButtonAddToSideboard.setToolTipText("Add selected cards to sideboard.");
jButtonAddToSideboard.setToolTipText("<html>Add selected cards to sideboard.<br/>\nAlternative: <strong>ALT key + Double click</strong> the card in card selector to move a card to the sideboard.");
jButtonAddToSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0));
jButtonAddToSideboard.setMaximumSize(new java.awt.Dimension(100, 30));
jButtonAddToSideboard.setMinimumSize(new java.awt.Dimension(10, 30));
jButtonAddToSideboard.setPreferredSize(new java.awt.Dimension(28, 22));
jButtonAddToSideboard.setPreferredSize(new java.awt.Dimension(40, 28));
jButtonAddToSideboard.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonAddToSideboardActionPerformed(evt);
@ -817,7 +833,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
jButtonRemoveFromMain.setMargin(null);
jButtonRemoveFromMain.setMaximumSize(new java.awt.Dimension(42, 23));
jButtonRemoveFromMain.setMinimumSize(new java.awt.Dimension(42, 23));
jButtonRemoveFromMain.setPreferredSize(new java.awt.Dimension(28, 22));
jButtonRemoveFromMain.setPreferredSize(new java.awt.Dimension(40, 28));
jButtonRemoveFromMain.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonRemoveFromMainActionPerformed(evt);
@ -829,7 +845,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
jButtonRemoveFromSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0));
jButtonRemoveFromSideboard.setMaximumSize(new java.awt.Dimension(10, 30));
jButtonRemoveFromSideboard.setMinimumSize(new java.awt.Dimension(100, 30));
jButtonRemoveFromSideboard.setPreferredSize(new java.awt.Dimension(28, 22));
jButtonRemoveFromSideboard.setPreferredSize(new java.awt.Dimension(40, 28));
jButtonRemoveFromSideboard.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonRemoveFromSideboardActionPerformed(evt);
@ -889,9 +905,9 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tbColor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tbTypes, javax.swing.GroupLayout.DEFAULT_SIZE, 897, Short.MAX_VALUE)
.addComponent(tbTypes, javax.swing.GroupLayout.DEFAULT_SIZE, 1057, Short.MAX_VALUE)
.addComponent(cardSelectorScrollPane)
.addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1057, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -906,34 +922,6 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
);
}// </editor-fold>//GEN-END:initComponents
private void rdoLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoLandActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_rdoLandActionPerformed
private void rdoCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoCreaturesActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_rdoCreaturesActionPerformed
private void rdoArtifactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoArtifactsActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_rdoArtifactsActionPerformed
private void rdoEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoEnchantmentsActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_rdoEnchantmentsActionPerformed
private void rdoInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoInstantsActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_rdoInstantsActionPerformed
private void rdoSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoSorceriesActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_rdoSorceriesActionPerformed
private void rdoPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoPlaneswalkersActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_rdoPlaneswalkersActionPerformed
private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed
filterCards();
}//GEN-LAST:event_cbExpansionSetActionPerformed
@ -1021,7 +1009,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
List<Integer> indexes = asList(n);
Collections.reverse(indexes);
for (Integer index : indexes) {
mainModel.shiftDoubleClick(index);
mainModel.altDoubleClick(index);
}
//if (!mode.equals(Constants.DeckEditorMode.Constructed))
if (limited) {
@ -1072,6 +1060,34 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
filterCardsColor(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbColorlessActionPerformed
private void tbCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbCreaturesActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbCreaturesActionPerformed
private void tbArifiactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbArifiactsActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbArifiactsActionPerformed
private void tbSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbSorceriesActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbSorceriesActionPerformed
private void tbInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbInstantsActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbInstantsActionPerformed
private void tbEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbEnchantmentsActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbEnchantmentsActionPerformed
private void tbPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbPlaneswalkersActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbPlaneswalkersActionPerformed
private void tbLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbLandActionPerformed
filterCardsType(evt.getModifiers(), evt.getActionCommand());
}//GEN-LAST:event_tbLandActionPerformed
private void toggleViewMode() {
if (currentView instanceof CardGrid) {
jToggleListView.setSelected(true);
@ -1137,23 +1153,23 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
private javax.swing.JToolBar.Separator jSeparator2;
private javax.swing.JToolBar.Separator jSeparator3;
private javax.swing.JToolBar.Separator jSeparator4;
private javax.swing.JToolBar.Separator jSeparator5;
private javax.swing.JToolBar.Separator jSeparator6;
private javax.swing.JTextField jTextFieldSearch;
private javax.swing.JToggleButton jToggleCardView;
private javax.swing.JToggleButton jToggleListView;
private javax.swing.JRadioButton rdoArtifacts;
private javax.swing.JRadioButton rdoCreatures;
private javax.swing.JRadioButton rdoEnchantments;
private javax.swing.JRadioButton rdoInstants;
private javax.swing.JRadioButton rdoLand;
private javax.swing.JRadioButton rdoPlaneswalkers;
private javax.swing.JRadioButton rdoSorceries;
private javax.swing.JToggleButton tbArifiacts;
private javax.swing.JToggleButton tbBlack;
private javax.swing.JToggleButton tbBlue;
private javax.swing.JToolBar tbColor;
private javax.swing.JToggleButton tbColorless;
private javax.swing.JToggleButton tbCreatures;
private javax.swing.JToggleButton tbEnchantments;
private javax.swing.JToggleButton tbGreen;
private javax.swing.JToggleButton tbInstants;
private javax.swing.JToggleButton tbLand;
private javax.swing.JToggleButton tbPlaneswalkers;
private javax.swing.JToggleButton tbRed;
private javax.swing.JToggleButton tbSorceries;
private javax.swing.JToolBar tbTypes;
private javax.swing.JToggleButton tbWhite;
// End of variables declaration//GEN-END:variables

View file

@ -213,7 +213,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
case "double-click":
moveSelectorCardToDeck(event);
break;
case "shift-double-click":
case "alt-double-click":
if (mode == DeckEditorMode.FREE_BUILDING) {
moveSelectorCardToSideboard(event);
} else {
@ -252,7 +252,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
refreshDeck();
break;
}
case "shift-double-click":
case "alt-double-click":
{
SimpleCardView cardView = (SimpleCardView) event.getSource();
for (Card card : deck.getCards()) {
@ -275,7 +275,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
// constructing phase or sideboarding during match -> card goes always to sideboard
switch (event.getEventName()) {
case "double-click":
case "shift-double-click":
case "alt-double-click":
{
SimpleCardView cardView = (SimpleCardView) event.getSource();
for (Card card : deck.getCards()) {
@ -313,7 +313,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
hidePopup();
refreshDeck();
break;
case "shift-double-click":
case "alt-double-click":
// remove card from sideboard
cardView = (SimpleCardView) event.getSource();
for (Card card : deck.getSideboard()) {
@ -335,7 +335,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
// construct phase or sideboarding during match
switch (event.getEventName()) {
case "double-click":
case "shift-double-click":
case "alt-double-click":
SimpleCardView cardView = (SimpleCardView) event.getSource();
for (Card card : deck.getSideboard()) {
if (card.getId().equals(cardView.getId())) {

View file

@ -119,6 +119,9 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
this.gameId = gameId;
int landCount = 0;
int creatureCount = 0;
int instantCount = 0;
int sorceryCount = 0;
int enchantmentCount = 0;
if (!merge) {
this.clearCards();
for (CardView card : showCards.values()) {
@ -136,6 +139,15 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
if (card.getCardTypes().contains(CardType.CREATURE)) {
creatureCount++;
}
if (card.getCardTypes().contains(CardType.INSTANT)) {
instantCount++;
}
if (card.getCardTypes().contains(CardType.SORCERY)) {
sorceryCount++;
}
if (card.getCardTypes().contains(CardType.ENCHANTMENT)) {
enchantmentCount++;
}
}
}
@ -186,7 +198,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
}
if (updateCountsCallback != null) {
updateCountsCallback.update(cards.size(), creatureCount, landCount);
updateCountsCallback.update(cards.size(), creatureCount, landCount, sorceryCount, instantCount, enchantmentCount);
}
}
@ -318,9 +330,9 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
cardEventSource.doubleClick(card, "double-click");
}
public void shiftDoubleClick(int index) {
public void altDoubleClick(int index) {
CardView card = view.get(index);
cardEventSource.shiftDoubleClick(card, "shift-double-click");
cardEventSource.altDoubleClick(card, "alt-double-click");
}
public void removeFromMainEvent(int index) {

View file

@ -1,6 +1,6 @@
package mage.client.deckeditor.table;
import javax.swing.*;
import javax.swing.JLabel;
/**
* Updates counts in deck editor.
@ -11,16 +11,25 @@ public class UpdateCountsCallback {
private final javax.swing.JLabel lblCount;
private final javax.swing.JLabel lblCreatureCount;
private final javax.swing.JLabel lblLandCount;
private final javax.swing.JLabel lblSoerceryCount;
private final javax.swing.JLabel lblInstantCount;
private final javax.swing.JLabel lblEnchantmentCount;
public UpdateCountsCallback(JLabel count, JLabel creatures, JLabel lands) {
public UpdateCountsCallback(JLabel count, JLabel creatures, JLabel lands, JLabel sorceries, JLabel instants, JLabel enchantments) {
this.lblCount = count;
this.lblCreatureCount = creatures;
this.lblLandCount = lands;
this.lblSoerceryCount = sorceries;
this.lblInstantCount = instants;
this.lblEnchantmentCount = enchantments;
}
public void update(int count, int creatures, int lands) {
this.lblCount.setText("Count: " + Integer.toString(count));
this.lblCreatureCount.setText("Creatures: " + Integer.toString(creatures));
this.lblLandCount.setText("Lands: " + Integer.toString(lands));
public void update(int count, int creatures, int lands, int sorceries, int instants, int enchantments) {
this.lblCount.setText(Integer.toString(count));
this.lblCreatureCount.setText(Integer.toString(creatures));
this.lblLandCount.setText(Integer.toString(lands));
this.lblSoerceryCount.setText(Integer.toString(sorceries));
this.lblInstantCount.setText(Integer.toString(instants));
this.lblEnchantmentCount.setText(Integer.toString(enchantments));
}
}

View file

@ -54,7 +54,7 @@ public class TableSpinnerEditor extends DefaultCellEditor {
JSpinner.DefaultEditor editor;
JTextField textField;
boolean valueSet;
private JTable lastTable;
private JTable table;
private int lastRow = -1;
private int currentRow = -1;
private int lastOriginalHeigh;
@ -75,6 +75,14 @@ public class TableSpinnerEditor extends DefaultCellEditor {
textField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent fe) {
lastOriginalHeigh = currentOriginalHeigh;
currentOriginalHeigh = 0;
lastRow = currentRow;
currentRow = -1;
if (lastOriginalHeigh < NEEDED_HIGH) {
table.setRowHeight(lastRow, NEEDED_HIGH);
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
@ -86,7 +94,8 @@ public class TableSpinnerEditor extends DefaultCellEditor {
}
@Override
public void focusLost(FocusEvent fe) {
public void focusLost(FocusEvent fe) {
resetRow();
if (currentRow < 0) {
stopCellEditing();
}
@ -100,31 +109,23 @@ public class TableSpinnerEditor extends DefaultCellEditor {
});
}
private synchronized void setTableRowHeigh(JTable table, int row) {
if (lastRow >=0 && lastOriginalHeigh < NEEDED_HIGH) {
lastTable.setRowHeight(lastRow, lastOriginalHeigh);
}
if (row >= 0 && currentRow >=0) {
lastRow = currentRow;
lastOriginalHeigh = currentOriginalHeigh;
currentRow = -1;
currentOriginalHeigh = -1;
}
lastRow = -1;
if (table != null) {
lastTable = table;
currentOriginalHeigh = table.getRowHeight(row);
currentRow = row;
if (currentOriginalHeigh < NEEDED_HIGH) {
lastTable.setRowHeight(currentRow, NEEDED_HIGH);
}
}
private synchronized void resetRow() {
if (lastRow >= 0) {
cardsList.handleSetNumber((Integer) spinner.getValue());
table.setRowHeight(lastRow, lastOriginalHeigh);
lastRow = -1;
}
}
// Prepares the spinner component and returns it.
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
setTableRowHeigh(table, row);
if (this.table == null) {
this.table = table;
}
currentOriginalHeigh = table.getRowHeight(row);
currentRow = row;
if (!valueSet) {
spinner.setValue(value);
}
@ -159,9 +160,9 @@ public class TableSpinnerEditor extends DefaultCellEditor {
public boolean stopCellEditing() {
try {
editor.commitEdit();
spinner.commitEdit();
cardsList.handleSetNumber((Integer) spinner.getValue());
setTableRowHeigh(null, 0);
spinner.commitEdit();
resetRow();
} catch (java.text.ParseException e) {
JOptionPane.showMessageDialog(null,
"Invalid value, discarding.");

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

View file

@ -27,6 +27,8 @@ git log 9c5d5208b96e28e1e767574e1143b845e6b7308f..HEAD --diff-filter=A --name-st
since 1.3.0-2014-02-15
git log 88d8c30b6c3dbf7c90354eccfd04107641c308f1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
since 1.3.0-2014-04-25
git log a1cfd040d74dd6d2100168754961cfebb154f153..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
3. Copy added_cards.txt to trunk\Utils folder