diff --git a/Mage.Client/src/main/java/mage/client/cards/CardsList.form b/Mage.Client/src/main/java/mage/client/cards/CardsList.form index 5a917b1b44..7156ed9cc2 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardsList.form +++ b/Mage.Client/src/main/java/mage/client/cards/CardsList.form @@ -1,6 +1,10 @@
+ + + + @@ -30,7 +34,7 @@ - + @@ -38,7 +42,7 @@ - + @@ -74,23 +78,28 @@ - - - - + + + + - - - - - - - - + + + + + + + + + + + + + @@ -147,34 +156,48 @@ - - - + + + + + + + + + + - + - + + - + + + + - - - + + - - + + + + + + - + diff --git a/Mage.Client/src/main/java/mage/client/cards/CardsList.java b/Mage.Client/src/main/java/mage/client/cards/CardsList.java index 294733b0da..1f7e12bb0e 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardsList.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardsList.java @@ -142,23 +142,19 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar mainTable.getColumnModel().getColumn(7).setPreferredWidth(15); if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_DRAFT_VIEW, "cardView").equals("listView")) { + jToggleListView.setSelected(true); panelCardArea.setViewportView(mainTable); currentView = mainModel; cbSortBy.setEnabled(false); chkPiles.setEnabled(false); } else { jToggleCardView.setSelected(true); - jToggleListView.setSelected(false); currentView = this; panelCardArea.setViewportView(cardArea); cbSortBy.setEnabled(true); chkPiles.setEnabled(true); } - - mainTable.setOpaque(false); - - mainTable.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { @@ -388,6 +384,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar // //GEN-BEGIN:initComponents private void initComponents() { + bgView = new javax.swing.ButtonGroup(); panelControl = new javax.swing.JPanel(); lblCount = new javax.swing.JLabel(); lblCreatureCount = new javax.swing.JLabel(); @@ -434,22 +431,25 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar } }); - jToggleListView.setSelected(true); - jToggleListView.setText("ListView"); - jToggleListView.setFocusable(false); - jToggleListView.setMaximumSize(new java.awt.Dimension(45, 21)); - jToggleListView.setMinimumSize(new java.awt.Dimension(54, 21)); - jToggleListView.setPreferredSize(new java.awt.Dimension(45, 21)); + bgView.add(jToggleListView); + jToggleListView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\list_panel.png")); // NOI18N + jToggleListView.setToolTipText("Shows the cards as a list."); + 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.setOpaque(false); + jToggleListView.setPreferredSize(new java.awt.Dimension(37, 22)); jToggleListView.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleListViewActionPerformed(evt); } }); - jToggleCardView.setText("CardView"); - jToggleCardView.setMaximumSize(new java.awt.Dimension(77, 21)); - jToggleCardView.setMinimumSize(new java.awt.Dimension(77, 21)); - jToggleCardView.setPreferredSize(new java.awt.Dimension(77, 21)); + bgView.add(jToggleCardView); + jToggleCardView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\card_panel.png")); // NOI18N + jToggleCardView.setToolTipText("Shows the card as images."); + jToggleCardView.setMargin(new java.awt.Insets(2, 6, 2, 6)); + jToggleCardView.setPreferredSize(new java.awt.Dimension(33, 22)); jToggleCardView.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleCardViewActionPerformed(evt); @@ -472,23 +472,28 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar .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(jToggleListView, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) + .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, 85, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(92, 92, 92)) + .addComponent(jToggleCardView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(195, 195, 195)) ); panelControlLayout.setVerticalGroup( 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(jToggleCardView, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(chkPiles) - .addComponent(jToggleListView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .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(jToggleCardView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) ); + jToggleListView.getAccessibleContext().setAccessibleDescription("Switch between image and table view."); + panelCardArea.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); panelCardArea.setViewportView(cardArea); @@ -497,35 +502,24 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelCardArea) - .addComponent(panelControl, javax.swing.GroupLayout.DEFAULT_SIZE, 674, Short.MAX_VALUE) + .addComponent(panelControl, javax.swing.GroupLayout.DEFAULT_SIZE, 754, Short.MAX_VALUE) ); 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) .addGap(0, 0, 0) - .addComponent(panelCardArea, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)) + .addComponent(panelCardArea, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)) ); }// //GEN-END:initComponents - private void jToggleCardViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleCardViewActionPerformed - jToggleListView.setSelected(false); - currentView = this; - panelCardArea.setViewportView(cardArea); - cbSortBy.setEnabled(true); - chkPiles.setEnabled(true); - redrawCards(); - PreferencesDialog.saveValue(PreferencesDialog.KEY_DRAFT_VIEW, "cardView"); - }//GEN-LAST:event_jToggleCardViewActionPerformed - private void jToggleListViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleListViewActionPerformed - jToggleCardView.setSelected(false); currentView = mainModel; panelCardArea.setViewportView(mainTable); cbSortBy.setEnabled(false); - chkPiles.setEnabled(false); - redrawCards(); + chkPiles.setEnabled(false); PreferencesDialog.saveValue(PreferencesDialog.KEY_DRAFT_VIEW, "listView"); + redrawCards(); }//GEN-LAST:event_jToggleListViewActionPerformed private void cbSortByActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSortByActionPerformed @@ -538,7 +532,17 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar drawCards(sortSetting); }//GEN-LAST:event_chkPilesActionPerformed + private void jToggleCardViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleCardViewActionPerformed + currentView = this; + panelCardArea.setViewportView(cardArea); + cbSortBy.setEnabled(true); + chkPiles.setEnabled(true); + PreferencesDialog.saveValue(PreferencesDialog.KEY_DRAFT_VIEW, "cardView"); + redrawCards(); + }//GEN-LAST:event_jToggleCardViewActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.ButtonGroup bgView; private javax.swing.JLayeredPane cardArea; private javax.swing.JComboBox cbSortBy; private javax.swing.JCheckBox chkPiles; diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form index 7209ee1fa2..3ccc88699d 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form +++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form @@ -1,6 +1,10 @@ + + + + @@ -28,10 +32,10 @@ - - + + - + @@ -41,84 +45,142 @@ + - + + + + - + + + + - + + + + - + - + + + + - + + + + - + + + + + - + - + + + + - + + + + - + + + + - + - + + + + - + + + + - + + + + - + - + + + + - + + + + - + + + + - + - + + + + - + + + + - + + + + - + + + @@ -146,9 +208,12 @@ + + + @@ -174,6 +239,7 @@ + @@ -265,9 +331,12 @@ + + + @@ -276,6 +345,8 @@ + + @@ -303,10 +374,18 @@ + + + + + + + + - + @@ -314,15 +393,14 @@ - + - + - + - @@ -330,7 +408,13 @@ - + + + + + + + @@ -338,13 +422,14 @@ - + - + + - + @@ -379,7 +464,7 @@ - + @@ -402,7 +487,7 @@ - + @@ -410,7 +495,7 @@ - + @@ -418,8 +503,10 @@ - - + + + + @@ -430,7 +517,7 @@ - + @@ -439,8 +526,10 @@ - - + + + + @@ -451,23 +540,28 @@ - + - + - + + + + + + @@ -476,6 +570,7 @@ + @@ -484,6 +579,7 @@ + @@ -499,8 +595,10 @@ - - + + + + @@ -511,7 +609,7 @@ - + @@ -520,8 +618,10 @@ - - + + + + @@ -532,7 +632,7 @@ - + diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java index 1e77f391ab..283ee7e003 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java @@ -145,9 +145,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene mainTable.getColumnModel().getColumn(7).setPreferredWidth(15); cardSelectorScrollPane.setViewportView(mainTable); - mainTable.setOpaque(false); - cbSortBy.setEnabled(false); chkPiles.setEnabled(false); @@ -164,6 +162,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene } } }); + + jToggleCardView.setToolTipText(jToggleCardView.getToolTipText() + " (works only up to " + CardGrid.MAX_IMAGES + " cards)."); } /** @@ -221,22 +221,22 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene if (limited) { ArrayList> predicates = new ArrayList<>(); - if (this.rdoGreen.isSelected()) { + if (this.tbGreen.isSelected()) { predicates.add(new ColorPredicate(ObjectColor.GREEN)); } - if (this.rdoRed.isSelected()) { + if (this.tbRed.isSelected()) { predicates.add(new ColorPredicate(ObjectColor.RED)); } - if (this.rdoBlack.isSelected()) { + if (this.tbBlack.isSelected()) { predicates.add(new ColorPredicate(ObjectColor.BLACK)); } - if (this.rdoBlue.isSelected()) { + if (this.tbBlue.isSelected()) { predicates.add(new ColorPredicate(ObjectColor.BLUE)); } - if (this.rdoWhite.isSelected()) { + if (this.tbWhite.isSelected()) { predicates.add(new ColorPredicate(ObjectColor.WHITE)); } - if (this.rdoColorless.isSelected()) { + if (this.tbColorless.isSelected()) { predicates.add(new ColorlessPredicate()); } filter.add(Predicates.or(predicates)); @@ -283,12 +283,12 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene private CardCriteria buildCriteria() { CardCriteria criteria = new CardCriteria(); - criteria.black(this.rdoBlack.isSelected()); - criteria.blue(this.rdoBlue.isSelected()); - criteria.green(this.rdoGreen.isSelected()); - criteria.red(this.rdoRed.isSelected()); - criteria.white(this.rdoWhite.isSelected()); - criteria.colorless(this.rdoColorless.isSelected()); + criteria.black(this.tbBlack.isSelected()); + criteria.blue(this.tbBlue.isSelected()); + criteria.green(this.tbGreen.isSelected()); + criteria.red(this.tbRed.isSelected()); + criteria.white(this.tbWhite.isSelected()); + criteria.colorless(this.tbColorless.isSelected()); if (this.rdoLand.isSelected()) { criteria.types(CardType.LAND); @@ -323,6 +323,42 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene return criteria; } + private boolean inverter(boolean invert, String string1, String string2) { + if (invert) { + return string1.equals(string2); + } else { + return !string1.equals(string2); + } + } + + private void filterCardsColor(int modifiers, String actionCommand) { + // ALT 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; + tbBlack.setSelected(inverter(invert, tbBlack.getActionCommand(), actionCommand)); + tbBlue.setSelected(inverter(invert, tbBlue.getActionCommand(), actionCommand)); + tbColorless.setSelected(inverter(invert, tbColorless.getActionCommand(), actionCommand)); + tbGreen.setSelected(inverter(invert, tbGreen.getActionCommand(), actionCommand)); + tbRed.setSelected(inverter(invert, tbRed.getActionCommand(), actionCommand)); + tbWhite.setSelected(inverter(invert, tbWhite.getActionCommand(), actionCommand)); + } + filterCards(); + } + + private void filterCardsType(int modifiers, String actionCommand) { + // ALT Button was pushed + if ((modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK) { + rdoArtifacts.setSelected(rdoArtifacts.getActionCommand().equals(actionCommand)); + rdoCreatures.setSelected(rdoCreatures.getActionCommand().equals(actionCommand)); + rdoEnchantments.setSelected(rdoEnchantments.getActionCommand().equals(actionCommand)); + rdoInstants.setSelected(rdoInstants.getActionCommand().equals(actionCommand)); + rdoLand.setSelected(rdoLand.getActionCommand().equals(actionCommand)); + rdoPlaneswalkers.setSelected(rdoPlaneswalkers.getActionCommand().equals(actionCommand)); + rdoSorceries.setSelected(rdoSorceries.getActionCommand().equals(actionCommand)); + } + filterCards(); + } + private void filterCards() { FilterCard filter = buildFilter(); try { @@ -386,14 +422,17 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene // //GEN-BEGIN:initComponents private void initComponents() { + bgView = new javax.swing.ButtonGroup(); tbColor = new javax.swing.JToolBar(); - rdoRed = new javax.swing.JRadioButton(); - rdoGreen = new javax.swing.JRadioButton(); - rdoBlue = new javax.swing.JRadioButton(); - rdoBlack = new javax.swing.JRadioButton(); - rdoWhite = new javax.swing.JRadioButton(); - rdoColorless = new javax.swing.JRadioButton(); + tbRed = new javax.swing.JToggleButton(); + tbGreen = new javax.swing.JToggleButton(); + tbBlue = new javax.swing.JToggleButton(); + tbBlack = new javax.swing.JToggleButton(); + tbWhite = new javax.swing.JToggleButton(); + tbColorless = new javax.swing.JToggleButton(); + jSeparator1 = new javax.swing.JToolBar.Separator(); cbExpansionSet = new javax.swing.JComboBox(); + jSeparator2 = new javax.swing.JToolBar.Separator(); btnBooster = new javax.swing.JButton(); btnClear = new javax.swing.JButton(); tbTypes = new javax.swing.JToolBar(); @@ -404,15 +443,18 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene rdoInstants = new javax.swing.JRadioButton(); rdoSorceries = new javax.swing.JRadioButton(); rdoPlaneswalkers = new javax.swing.JRadioButton(); + jSeparator5 = new javax.swing.JToolBar.Separator(); chkPiles = new javax.swing.JCheckBox(); + jSeparator3 = new javax.swing.JToolBar.Separator(); cbSortBy = new javax.swing.JComboBox(); + jSeparator4 = new javax.swing.JToolBar.Separator(); jToggleListView = new javax.swing.JToggleButton(); jToggleCardView = new javax.swing.JToggleButton(); cardSelectorScrollPane = new javax.swing.JScrollPane(); cardSelectorBottomPanel = new javax.swing.JPanel(); jButtonAddToMain = new javax.swing.JButton(); jButtonAddToSideboard = new javax.swing.JButton(); - jLabel1 = new javax.swing.JLabel(); + jLabelSearch = new javax.swing.JLabel(); jTextFieldSearch = new javax.swing.JTextField(); jButtonSearch = new javax.swing.JButton(); jButtonClean = new javax.swing.JButton(); @@ -423,80 +465,102 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene tbColor.setFloatable(false); tbColor.setRollover(true); + tbColor.setToolTipText("Click with ALT to deselct all other colors or CTRL for invert selection."); tbColor.setBorderPainted(false); tbColor.setName(""); // NOI18N - rdoRed.setSelected(true); - rdoRed.setText("Red "); - rdoRed.setFocusable(false); - rdoRed.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); - rdoRed.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - rdoRed.addActionListener(new java.awt.event.ActionListener() { + tbRed.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_red_off.png")); // NOI18N + tbRed.setSelected(true); + tbRed.setToolTipText("Red
" + + tbColor.getToolTipText()); + tbRed.setActionCommand("Red"); + tbRed.setFocusable(false); + tbRed.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + tbRed.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_red.png")); // NOI18N + tbRed.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + tbRed.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - rdoRedActionPerformed(evt); + tbRedActionPerformed(evt); } }); - tbColor.add(rdoRed); + tbColor.add(tbRed); - rdoGreen.setSelected(true); - rdoGreen.setText("Green "); - rdoGreen.setFocusable(false); - rdoGreen.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); - rdoGreen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - rdoGreen.addActionListener(new java.awt.event.ActionListener() { + tbGreen.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_green_off.png")); // NOI18N + tbGreen.setSelected(true); + tbGreen.setToolTipText("Green
" + tbColor.getToolTipText()); + tbGreen.setActionCommand("Green"); + tbGreen.setFocusable(false); + tbGreen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + tbGreen.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_green.png")); // NOI18N + tbGreen.setVerifyInputWhenFocusTarget(false); + tbGreen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + tbGreen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - rdoGreenActionPerformed(evt); + tbGreenActionPerformed(evt); } }); - tbColor.add(rdoGreen); + tbColor.add(tbGreen); - rdoBlue.setSelected(true); - rdoBlue.setText("Blue "); - rdoBlue.setFocusable(false); - rdoBlue.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); - rdoBlue.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - rdoBlue.addActionListener(new java.awt.event.ActionListener() { + tbBlue.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_blueOff.png")); // NOI18N + tbBlue.setSelected(true); + tbBlue.setToolTipText("Blue
" + tbColor.getToolTipText()); + tbBlue.setActionCommand("Blue"); + tbBlue.setFocusable(false); + tbBlue.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + tbBlue.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_blue.png")); // NOI18N + tbBlue.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + tbBlue.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - rdoBlueActionPerformed(evt); + tbBlueActionPerformed(evt); } }); - tbColor.add(rdoBlue); + tbColor.add(tbBlue); - rdoBlack.setSelected(true); - rdoBlack.setText("Black "); - rdoBlack.setFocusable(false); - rdoBlack.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); - rdoBlack.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - rdoBlack.addActionListener(new java.awt.event.ActionListener() { + tbBlack.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_black_off.png")); // NOI18N + tbBlack.setSelected(true); + tbBlack.setToolTipText("Black
" + tbColor.getToolTipText()); + tbBlack.setActionCommand("Black"); + tbBlack.setFocusable(false); + tbBlack.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + tbBlack.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_black.png")); // NOI18N + tbBlack.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + tbBlack.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - rdoBlackActionPerformed(evt); + tbBlackActionPerformed(evt); } }); - tbColor.add(rdoBlack); + tbColor.add(tbBlack); - rdoWhite.setSelected(true); - rdoWhite.setText("White "); - rdoWhite.setFocusable(false); - rdoWhite.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); - rdoWhite.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - rdoWhite.addActionListener(new java.awt.event.ActionListener() { + tbWhite.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_white_off.png")); // NOI18N + tbWhite.setSelected(true); + tbWhite.setToolTipText("White
" + tbColor.getToolTipText()); + tbWhite.setActionCommand("White"); + tbWhite.setFocusable(false); + tbWhite.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + tbWhite.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\color_white.png")); // NOI18N + tbWhite.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + tbWhite.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - rdoWhiteActionPerformed(evt); + tbWhiteActionPerformed(evt); } }); - tbColor.add(rdoWhite); + tbColor.add(tbWhite); - rdoColorless.setSelected(true); - rdoColorless.setText("Colorless "); - rdoColorless.setFocusable(false); - rdoColorless.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); - rdoColorless.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - rdoColorless.addActionListener(new java.awt.event.ActionListener() { + tbColorless.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\colorless_off.png")); // NOI18N + tbColorless.setSelected(true); + tbColorless.setToolTipText("Colorless
" + tbColor.getToolTipText()); + tbColorless.setActionCommand("Colorless"); + tbColorless.setFocusable(false); + tbColorless.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + tbColorless.setSelectedIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\colorless.png")); // NOI18N + tbColorless.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + tbColorless.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - rdoColorlessActionPerformed(evt); + tbColorlessActionPerformed(evt); } }); - tbColor.add(rdoColorless); + tbColor.add(tbColorless); + tbColor.add(jSeparator1); cbExpansionSet.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cbExpansionSet.setMaximumSize(new java.awt.Dimension(250, 25)); @@ -508,8 +572,10 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene } }); tbColor.add(cbExpansionSet); + tbColor.add(jSeparator2); btnBooster.setText("Open Booster"); + btnBooster.setToolTipText("(CURRENTLY NOT WORKING) Generates a booster of the selected set and adds the cards to the card selector."); btnBooster.setFocusable(false); btnBooster.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnBooster.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); @@ -533,6 +599,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene tbTypes.setFloatable(false); tbTypes.setRollover(true); + tbTypes.setToolTipText("Click card type with ALT-KEY to only get the clicked card type."); tbTypes.setPreferredSize(new java.awt.Dimension(732, 27)); rdoLand.setSelected(true); @@ -618,8 +685,10 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene } }); tbTypes.add(rdoPlaneswalkers); + tbTypes.add(jSeparator5); chkPiles.setText("Piles"); + chkPiles.setToolTipText("Shows the card in piles by the selected sort."); chkPiles.setFocusable(false); chkPiles.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); chkPiles.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); @@ -629,6 +698,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene } }); tbTypes.add(chkPiles); + tbTypes.add(jSeparator3); cbSortBy.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); cbSortBy.setMaximumSize(new java.awt.Dimension(120, 20)); @@ -640,17 +710,19 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene } }); tbTypes.add(cbSortBy); + tbTypes.add(jSeparator4); + bgView.add(jToggleListView); + jToggleListView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\list_panel.png")); // NOI18N jToggleListView.setSelected(true); - jToggleListView.setText("ListView"); + jToggleListView.setToolTipText("Shows the cards as a list."); jToggleListView.setBorderPainted(false); jToggleListView.setFocusable(false); jToggleListView.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jToggleListView.setMargin(new java.awt.Insets(2, 2, 2, 2)); - jToggleListView.setMaximumSize(new java.awt.Dimension(70, 23)); - jToggleListView.setMinimumSize(new java.awt.Dimension(70, 23)); - jToggleListView.setPreferredSize(new java.awt.Dimension(70, 23)); - jToggleListView.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToggleListView.setMaximumSize(new java.awt.Dimension(37, 22)); + jToggleListView.setMinimumSize(new java.awt.Dimension(37, 22)); + jToggleListView.setPreferredSize(new java.awt.Dimension(37, 22)); jToggleListView.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleListViewActionPerformed(evt); @@ -658,14 +730,17 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); tbTypes.add(jToggleListView); - jToggleCardView.setText("CardView"); + bgView.add(jToggleCardView); + jToggleCardView.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\card_panel.png")); // NOI18N + jToggleCardView.setToolTipText("Shows the card as images."); jToggleCardView.setBorderPainted(false); jToggleCardView.setFocusable(false); jToggleCardView.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jToggleCardView.setMargin(new java.awt.Insets(2, 2, 2, 2)); - jToggleCardView.setMaximumSize(new java.awt.Dimension(70, 23)); - jToggleCardView.setMinimumSize(new java.awt.Dimension(70, 23)); - jToggleCardView.setPreferredSize(new java.awt.Dimension(70, 23)); + jToggleCardView.setMaximumSize(new java.awt.Dimension(37, 22)); + jToggleCardView.setMinimumSize(new java.awt.Dimension(37, 22)); + jToggleCardView.setName(""); // NOI18N + jToggleCardView.setPreferredSize(new java.awt.Dimension(37, 22)); jToggleCardView.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jToggleCardView.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -677,33 +752,37 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene cardSelectorBottomPanel.setOpaque(false); cardSelectorBottomPanel.setPreferredSize(new java.awt.Dimension(897, 40)); - jButtonAddToMain.setText("+"); - jButtonAddToMain.setToolTipText("Add selected card to deck"); + jButtonAddToMain.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\deck_in.png")); // NOI18N + jButtonAddToMain.setToolTipText("Add selected cards to 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(42, 30)); + jButtonAddToMain.setPreferredSize(new java.awt.Dimension(28, 22)); jButtonAddToMain.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonAddToMainActionPerformed(evt); } }); - jButtonAddToSideboard.setText("+S"); - jButtonAddToSideboard.setToolTipText("Add to Sideboard"); + jButtonAddToSideboard.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\sideboard_in.png")); // NOI18N + jButtonAddToSideboard.setToolTipText("Add selected cards to 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(50, 30)); + jButtonAddToSideboard.setPreferredSize(new java.awt.Dimension(28, 22)); jButtonAddToSideboard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonAddToSideboardActionPerformed(evt); } }); - jLabel1.setText("Search (by name,in rules):"); + jLabelSearch.setText("Search:"); + jLabelSearch.setToolTipText("Searches for card names and in the rule text of the card."); + + jTextFieldSearch.setToolTipText("Searches for card names and in the rule text of the card."); jButtonSearch.setText("Search"); + jButtonSearch.setToolTipText("Performs the search."); jButtonSearch.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonSearchActionPerformed(evt); @@ -711,6 +790,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); jButtonClean.setText("Clear"); + jButtonClean.setToolTipText("Clears the search field."); jButtonClean.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonCleanActionPerformed(evt); @@ -718,27 +798,28 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }); cardCountLabel.setText("Card count:"); + cardCountLabel.setToolTipText("Number of cards currently shown."); cardCount.setText("0"); - jButtonRemoveFromMain.setText("-"); - jButtonRemoveFromMain.setToolTipText("Remove selected card from deck"); + jButtonRemoveFromMain.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\deck_out.png")); // NOI18N + jButtonRemoveFromMain.setToolTipText("Remove selected cards from deck"); 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(42, 30)); + jButtonRemoveFromMain.setPreferredSize(new java.awt.Dimension(28, 22)); jButtonRemoveFromMain.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRemoveFromMainActionPerformed(evt); } }); - jButtonRemoveFromSideboard.setText("-S"); - jButtonRemoveFromSideboard.setToolTipText("Remove from Sideboard"); + jButtonRemoveFromSideboard.setIcon(new javax.swing.ImageIcon("D:\\Projekte\\mag\\mageRep\\localmage\\Mage.Client\\src\\main\\resources\\buttons\\sideboard_out.png")); // NOI18N + jButtonRemoveFromSideboard.setToolTipText("Remove selected cards from sideboard."); 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(50, 30)); + jButtonRemoveFromSideboard.setPreferredSize(new java.awt.Dimension(28, 22)); jButtonRemoveFromSideboard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRemoveFromSideboardActionPerformed(evt); @@ -759,7 +840,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonRemoveFromSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel1) + .addComponent(jLabelSearch) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(2, 2, 2) @@ -780,14 +861,14 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene .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(jButtonRemoveFromSideboard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel1) + .addComponent(jLabelSearch) .addComponent(jTextFieldSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButtonSearch) .addComponent(jButtonClean) .addComponent(cardCountLabel) .addComponent(cardCount) .addComponent(jButtonAddToMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(4, 4, 4)) ); cardCountLabel.getAccessibleContext().setAccessibleName("cardCountLabel"); @@ -808,63 +889,39 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene .addComponent(tbColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(tbTypes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE) .addGap(0, 0, 0) - .addComponent(cardSelectorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) - .addGap(0, 0, 0) - .addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(cardSelectorBottomPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) ); }//
//GEN-END:initComponents - private void rdoGreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoGreenActionPerformed - filterCards(); - }//GEN-LAST:event_rdoGreenActionPerformed - - private void rdoBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlackActionPerformed - filterCards(); - }//GEN-LAST:event_rdoBlackActionPerformed - - private void rdoWhiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoWhiteActionPerformed - filterCards(); - }//GEN-LAST:event_rdoWhiteActionPerformed - - private void rdoRedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoRedActionPerformed - filterCards(); - }//GEN-LAST:event_rdoRedActionPerformed - - private void rdoBlueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlueActionPerformed - filterCards(); - }//GEN-LAST:event_rdoBlueActionPerformed - - private void rdoColorlessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoColorlessActionPerformed - filterCards(); - }//GEN-LAST:event_rdoColorlessActionPerformed - private void rdoLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoLandActionPerformed - filterCards(); + filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_rdoLandActionPerformed private void rdoCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoCreaturesActionPerformed - filterCards(); + filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_rdoCreaturesActionPerformed private void rdoArtifactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoArtifactsActionPerformed - filterCards(); + filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_rdoArtifactsActionPerformed private void rdoEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoEnchantmentsActionPerformed - filterCards(); + filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_rdoEnchantmentsActionPerformed private void rdoInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoInstantsActionPerformed - filterCards(); + filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_rdoInstantsActionPerformed private void rdoSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoSorceriesActionPerformed - filterCards(); + filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_rdoSorceriesActionPerformed private void rdoPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoPlaneswalkersActionPerformed - filterCards(); + filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_rdoPlaneswalkersActionPerformed private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed @@ -916,8 +973,6 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene private void jToggleListViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleListViewActionPerformed if (!(currentView instanceof TableModel)) { toggleViewMode(); - } else { - jToggleListView.setSelected(true); } filterCards(); }//GEN-LAST:event_jToggleListViewActionPerformed @@ -925,13 +980,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene private void jToggleCardViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleCardViewActionPerformed if (currentView.cardsSize() > CardGrid.MAX_IMAGES) { jToggleCardView.setSelected(false); + jToggleListView.setSelected(true); JOptionPane.showMessageDialog(this, new StringBuilder("The card view can't be used for more than ").append(CardGrid.MAX_IMAGES).append(" cards.").toString()); - } else { if (!(currentView instanceof CardGrid)) { toggleViewMode(); - } else { - jToggleCardView.setSelected(true); } filterCards(); } @@ -985,6 +1038,30 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene filterCards(); }//GEN-LAST:event_jButtonCleanActionPerformed + private void tbRedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbRedActionPerformed + filterCardsColor(evt.getModifiers(), evt.getActionCommand()); + }//GEN-LAST:event_tbRedActionPerformed + + private void tbGreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbGreenActionPerformed + filterCardsColor(evt.getModifiers(), evt.getActionCommand()); + }//GEN-LAST:event_tbGreenActionPerformed + + private void tbBlueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbBlueActionPerformed + filterCardsColor(evt.getModifiers(), evt.getActionCommand()); + }//GEN-LAST:event_tbBlueActionPerformed + + private void tbBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbBlackActionPerformed + filterCardsColor(evt.getModifiers(), evt.getActionCommand()); + }//GEN-LAST:event_tbBlackActionPerformed + + private void tbWhiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbWhiteActionPerformed + filterCardsColor(evt.getModifiers(), evt.getActionCommand()); + }//GEN-LAST:event_tbWhiteActionPerformed + + private void tbColorlessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbColorlessActionPerformed + filterCardsColor(evt.getModifiers(), evt.getActionCommand()); + }//GEN-LAST:event_tbColorlessActionPerformed + private void toggleViewMode() { if (currentView instanceof CardGrid) { jToggleListView.setSelected(true); @@ -1029,6 +1106,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene private ICardGrid currentView; // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.ButtonGroup bgView; private javax.swing.JButton btnBooster; private javax.swing.JButton btnClear; private javax.swing.JLabel cardCount; @@ -1044,25 +1122,30 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene private javax.swing.JButton jButtonRemoveFromMain; private javax.swing.JButton jButtonRemoveFromSideboard; private javax.swing.JButton jButtonSearch; - private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabelSearch; + private javax.swing.JToolBar.Separator jSeparator1; + 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.JTextField jTextFieldSearch; private javax.swing.JToggleButton jToggleCardView; private javax.swing.JToggleButton jToggleListView; private javax.swing.JRadioButton rdoArtifacts; - private javax.swing.JRadioButton rdoBlack; - private javax.swing.JRadioButton rdoBlue; - private javax.swing.JRadioButton rdoColorless; private javax.swing.JRadioButton rdoCreatures; private javax.swing.JRadioButton rdoEnchantments; - private javax.swing.JRadioButton rdoGreen; private javax.swing.JRadioButton rdoInstants; private javax.swing.JRadioButton rdoLand; private javax.swing.JRadioButton rdoPlaneswalkers; - private javax.swing.JRadioButton rdoRed; private javax.swing.JRadioButton rdoSorceries; - private javax.swing.JRadioButton rdoWhite; + private javax.swing.JToggleButton tbBlack; + private javax.swing.JToggleButton tbBlue; private javax.swing.JToolBar tbColor; + private javax.swing.JToggleButton tbColorless; + private javax.swing.JToggleButton tbGreen; + private javax.swing.JToggleButton tbRed; private javax.swing.JToolBar tbTypes; + private javax.swing.JToggleButton tbWhite; // End of variables declaration//GEN-END:variables private final mage.client.cards.CardGrid cardGrid; diff --git a/Mage.Client/src/main/resources/buttons/card_panel.png b/Mage.Client/src/main/resources/buttons/card_panel.png new file mode 100644 index 0000000000..382dbc35e5 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/card_panel.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_black.png b/Mage.Client/src/main/resources/buttons/color_black.png new file mode 100644 index 0000000000..bd82d24807 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_black.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_black_off.png b/Mage.Client/src/main/resources/buttons/color_black_off.png new file mode 100644 index 0000000000..9285181355 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_black_off.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_blue.png b/Mage.Client/src/main/resources/buttons/color_blue.png new file mode 100644 index 0000000000..c1a9fd92e2 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_blue.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_blueOff.png b/Mage.Client/src/main/resources/buttons/color_blueOff.png new file mode 100644 index 0000000000..ecefe3f3f9 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_blueOff.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_green.png b/Mage.Client/src/main/resources/buttons/color_green.png new file mode 100644 index 0000000000..53ab1ed516 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_green.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_green_off.png b/Mage.Client/src/main/resources/buttons/color_green_off.png new file mode 100644 index 0000000000..be8641c97e Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_green_off.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_red.png b/Mage.Client/src/main/resources/buttons/color_red.png new file mode 100644 index 0000000000..9f517a74d9 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_red.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_red_off.png b/Mage.Client/src/main/resources/buttons/color_red_off.png new file mode 100644 index 0000000000..5a151cd24a Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_red_off.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_white.png b/Mage.Client/src/main/resources/buttons/color_white.png new file mode 100644 index 0000000000..de986b2ec4 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_white.png differ diff --git a/Mage.Client/src/main/resources/buttons/color_white_off.png b/Mage.Client/src/main/resources/buttons/color_white_off.png new file mode 100644 index 0000000000..d6406b7380 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/color_white_off.png differ diff --git a/Mage.Client/src/main/resources/buttons/colorless.png b/Mage.Client/src/main/resources/buttons/colorless.png new file mode 100644 index 0000000000..592d4d1668 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/colorless.png differ diff --git a/Mage.Client/src/main/resources/buttons/colorless_off.png b/Mage.Client/src/main/resources/buttons/colorless_off.png new file mode 100644 index 0000000000..8850c2b37f Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/colorless_off.png differ diff --git a/Mage.Client/src/main/resources/buttons/deck_in.png b/Mage.Client/src/main/resources/buttons/deck_in.png new file mode 100644 index 0000000000..91315aa9b7 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/deck_in.png differ diff --git a/Mage.Client/src/main/resources/buttons/deck_out.png b/Mage.Client/src/main/resources/buttons/deck_out.png new file mode 100644 index 0000000000..187f5696b4 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/deck_out.png differ diff --git a/Mage.Client/src/main/resources/buttons/list_panel.png b/Mage.Client/src/main/resources/buttons/list_panel.png new file mode 100644 index 0000000000..da34fef9f2 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/list_panel.png differ diff --git a/Mage.Client/src/main/resources/buttons/sideboard_in.png b/Mage.Client/src/main/resources/buttons/sideboard_in.png new file mode 100644 index 0000000000..05d5e49831 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/sideboard_in.png differ diff --git a/Mage.Client/src/main/resources/buttons/sideboard_out.png b/Mage.Client/src/main/resources/buttons/sideboard_out.png new file mode 100644 index 0000000000..eeaca2c5a9 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/sideboard_out.png differ diff --git a/Mage.Client/src/main/resources/wwk.txt b/Mage.Client/src/main/resources/wwk.txt deleted file mode 100644 index 298771a95d..0000000000 --- a/Mage.Client/src/main/resources/wwk.txt +++ /dev/null @@ -1,145 +0,0 @@ -1|Admonition Angel -2|Apex Hawks -3|Archon of Redemption -4|Battle Hurda -5|Fledgling Griffin -6|Guardian Zendikon -7|Hada Freeblade -8|Iona's Judgment -9|Join the Ranks -10|Kitesail Apprentice -11|Kor Firewalker -12|Lightkeeper of Emeria -13|Loam Lion -14|Marsh Threader -15|Marshal's Anthem -16|Perimeter Captain -17|Refraction Trap -18|Rest for the Weary -19|Ruin Ghost -20|Stoneforge Mystic -21|Talus Paladin -22|Terra Eternal -23|Veteran's Reflexes -24|AEther Tradewinds -25|Calcite Snapper -26|Dispel -27|Enclave Elite -28|Goliath Sphinx -29|Halimar Excavator -30|Horizon Drake -31|Jace, the Mind Sculptor -32|Jwari Shapeshifter -33|Mysteries of the Deep -34|Permafrost Trap -35|Quest for Ula's Temple -36|Sejiri Merfolk -37|Selective Memory -38|Spell Contortion -39|Surrakar Banisher -40|Thada Adel, Acquisitor -41|Tideforce Elemental -42|Treasure Hunt -43|Twitch -44|Vapor Snare -45|Voyager Drake -46|Wind Zendikon -47|Abyssal Persecutor -48|Agadeem Occultist -49|Anowon, the Ruin Sage -50|Bloodhusk Ritualist -51|Bojuka Brigand -52|Brink of Disaster -53|Butcher of Malakir -54|Caustic Crawler -55|Corrupted Zendikon -56|Dead Reckoning -57|Death's Shadow -58|Jagwasp Swarm -59|Kalastria Highborn -60|Mire's Toll -61|Nemesis Trap -62|Pulse Tracker -63|Quag Vampires -64|Quest for the Nihil Stone -65|Ruthless Cullblade -66|Scrib Nibblers -67|Shoreline Salvager -68|Smother -69|Tomb Hex -70|Urge to Feed -71|Akoum Battlesinger -72|Bazaar Trader -73|Bull Rush -74|Chain Reaction -75|Claws of Valakut -76|Comet Storm -77|Cosi's Ravager -78|Crusher Zendikon -79|Cunning Sparkmage -80|Deathforge Shaman -81|Dragonmaster Outcast -82|Goblin Roughrider -83|Grotag Thrasher -84|Kazuul, Tyrant of the Cliffs -85|Mordant Dragon -86|Quest for the Goblin Lord -87|Ricochet Trap -88|Roiling Terrain -89|Rumbling Aftershocks -90|Searing Blaze -91|Skitter of Lizards -92|Slavering Nulls -93|Stone Idol Trap -94|Tuktuk Scrapper -95|Arbor Elf -96|Avenger of Zendikar -97|Bestial Menace -98|Canopy Cover -99|Explore -100|Feral Contest -101|Gnarlid Pack -102|Grappler Spider -103|Graypelt Hunter -104|Groundswell -105|Harabaz Druid -106|Joraga Warcaller -107|Leatherback Baloth -108|Nature's Claim -109|Omnath, Locus of Mana -110|Quest for Renewal -111|Slingbow Trap -112|Snapping Creeper -113|Strength of the Tajuru -114|Summit Apes -115|Terastodon -116|Vastwood Animist -117|Vastwood Zendikon -118|Wolfbriar Elemental -119|Novablast Wurm -120|Wrexial, the Risen Deep -121|Amulet of Vigor -122|Basilisk Collar -123|Everflowing Chalice -124|Hammer of Ruin -125|Hedron Rover -126|Kitesail -127|Lodestone Golem -128|Pilgrim's Eye -129|Razor Boomerang -130|Seer's Sundial -131|Walking Atlas -132|Bojuka Bog -133|Celestial Colonnade -134|Creeping Tar Pit -135|Dread Statuary -136|Eye of Ugin -137|Halimar Depths -138|Khalni Garden -139|Lavaclaw Reaches -140|Quicksand -141|Raging Ravine -142|Sejiri Steppe -143|Smoldering Spires -144|Stirring Wildwood -145|Tectonic Edge \ No newline at end of file diff --git a/Mage.Client/src/main/resources/zen.txt b/Mage.Client/src/main/resources/zen.txt deleted file mode 100644 index 062c57abe6..0000000000 --- a/Mage.Client/src/main/resources/zen.txt +++ /dev/null @@ -1,269 +0,0 @@ -1|Armament Master -2|Arrow Volley Trap -3|Bold Defense -4|Brave the Elements -5|Caravan Hurda -6|Celestial Mantle -7|Cliff Threader -8|Conqueror's Pledge -9|Day of Judgment -10|Devout Lightcaster -11|Emeria Angel -12|Felidar Sovereign -13|Iona, Shield of Emeria -14|Journey to Nowhere -15|Kabira Evangel -16|Kazandu Blademaster -17|Kor Aeronaut -18|Kor Cartographer -19|Kor Duelist -20|Kor Hookmaster -21|Kor Outfitter -22|Kor Sanctifiers -23|Kor Skyfisher -24|Landbind Ritual -25|Luminarch Ascension -26|Makindi Shieldmate -27|Narrow Escape -28|Nimbus Wings -29|Noble Vestige -30|Ondu Cleric -31|Pillarfield Ox -32|Pitfall Trap -33|Quest for the Holy Relic -34|Shepherd of the Lost -35|Shieldmate's Blessing -36|Steppe Lynx -37|Sunspring Expedition -38|Windborne Charge -39|World Queller -40|AEther Figment -41|Archive Trap -42|Archmage Ascension -43|Caller of Gales -44|Cancel -45|Cosi's Trickster -46|Gomazoa -47|Hedron Crab -48|Into the Roil -49|Ior Ruin Expedition -50|Kraken Hatchling -51|Lethargy Trap -52|Living Tsunami -53|Lorthos, the Tidemaker -54|Lullmage Mentor -55|Merfolk Seastalkers -56|Merfolk Wayfinder -57|Mindbreak Trap -58|Paralyzing Grasp -59|Quest for Ancient Secrets -60|Reckless Scholar -61|Rite of Replication -62|Roil Elemental -63|Sea Gate Loremaster -64|Seascape Aerialist -65|Shoal Serpent -66|Sky Ruin Drake -67|Spell Pierce -68|Sphinx of Jwar Isle -69|Sphinx of Lost Truths -70|Spreading Seas -71|Summoner's Bane -72|Tempest Owl -73|Trapfinder's Trick -74|Trapmaker's Snare -75|Umara Raptor -76|Welkin Tern -77|Whiplash Trap -78|Windrider Eel -79|Bala Ged Thief -80|Blood Seeker -81|Blood Tribute -82|Bloodchief Ascension -83|Bloodghast -84|Bog Tatters -85|Crypt Ripper -86|Desecrated Earth -87|Disfigure -88|Feast of Blood -89|Gatekeeper of Malakir -90|Giant Scorpion -91|Grim Discovery -92|Guul Draz Specter -93|Guul Draz Vampire -94|Hagra Crocodile -95|Hagra Diabolist -96|Halo Hunter -97|Heartstabber Mosquito -98|Hideous End -99|Kalitas, Bloodchief of Ghet -100|Malakir Bloodwitch -101|Marsh Casualties -102|Mind Sludge -103|Mindless Null -104|Mire Blight -105|Needlebite Trap -106|Nimana Sell-Sword -107|Ob Nixilis, the Fallen -108|Quest for the Gravelord -109|Ravenous Trap -110|Sadistic Sacrament -111|Sorin Markov -112|Soul Stair Expedition -113|Surrakar Marauder -114|Vampire Hexmage -115|Vampire Lacerator -116|Vampire Nighthawk -117|Vampire's Bite -118|Bladetusk Boar -119|Burst Lightning -120|Chandra Ablaze -121|Demolish -122|Electropotence -123|Elemental Appeal -124|Geyser Glider -125|Goblin Bushwhacker -126|Goblin Guide -127|Goblin Ruinblaster -128|Goblin Shortcutter -129|Goblin War Paint -130|Hellfire Mongrel -131|Hellkite Charger -132|Highland Berserker -133|Inferno Trap -134|Kazuul Warlord -135|Lavaball Trap -136|Magma Rift -137|Mark of Mutiny -138|Molten Ravager -139|Murasa Pyromancer -140|Obsidian Fireheart -141|Plated Geopede -142|Punishing Fire -143|Pyromancer Ascension -144|Quest for Pure Flame -145|Ruinous Minotaur -146|Runeflare Trap -147|Seismic Shudder -148|Shatterskull Giant -149|Slaughter Cry -150|Spire Barrage -151|Torch Slinger -152|Tuktuk Grunts -153|Unstable Footing -154|Warren Instigator -155|Zektar Shrine Expedition -156|Baloth Cage Trap -157|Baloth Woodcrasher -158|Beast Hunt -159|Beastmaster Ascension -160|Cobra Trap -161|Frontier Guide -162|Gigantiform -163|Grazing Gladehart -164|Greenweaver Druid -165|Harrow -166|Joraga Bard -167|Khalni Heart Expedition -168|Lotus Cobra -169|Mold Shambler -170|Nissa Revane -171|Nissa's Chosen -172|Oracle of Mul Daya -173|Oran-Rief Recluse -174|Oran-Rief Survivalist -175|Predatory Urge -176|Primal Bellow -177|Quest for the Gemblades -178|Rampaging Baloths -179|Relic Crush -180|River Boa -181|Savage Silhouette -182|Scute Mob -183|Scythe Tiger -184|Summoning Trap -185|Tajuru Archer -186|Tanglesap -187|Terra Stomper -188|Territorial Baloth -189|Timbermaw Larva -190|Turntimber Basilisk -191|Turntimber Ranger -192|Vastwood Gorger -193|Vines of Vastwood -194|Zendikar Farguide -195|Adventuring Gear -196|Blade of the Bloodchief -197|Blazing Torch -198|Carnage Altar -199|Eldrazi Monument -200|Eternity Vessel -201|Expedition Map -202|Explorer's Scope -203|Grappling Hook -204|Hedron Scrabbler -205|Khalni Gem -206|Spidersilk Net -207|Stonework Puma -208|Trailblazer's Boots -209|Trusty Machete -210|Akoum Refuge -211|Arid Mesa -212|Crypt of Agadeem -213|Emeria, the Sky Ruin -214|Graypelt Refuge -215|Jwar Isle Refuge -216|Kabira Crossroads -217|Kazandu Refuge -218|Magosi, the Waterveil -219|Marsh Flats -220|Misty Rainforest -221|Oran-Rief, the Vastwood -222|Piranha Marsh -223|Scalding Tarn -224|Sejiri Refuge -225|Soaring Seacliff -226|Teetering Peaks -227|Turntimber Grove -228|Valakut, the Molten Pinnacle -229|Verdant Catacombs -230|Plains -230|Plains -231|Plains -231|Plains -232|Plains -232|Plains -233|Plains -233|Plains -234|Island -234|Island -235|Island -235|Island -236|Island -236|Island -237|Island -237|Island -238|Swamp -238|Swamp -239|Swamp -239|Swamp -240|Swamp -240|Swamp -241|Swamp -241|Swamp -242|Mountain -242|Mountain -243|Mountain -243|Mountain -244|Mountain -244|Mountain -245|Mountain -245|Mountain -246|Forest -246|Forest -247|Forest -247|Forest -248|Forest -248|Forest -249|Forest -249|Forest \ No newline at end of file