forked from External/mage
allowing sorting by piles in deck editor
This commit is contained in:
parent
85e1f68554
commit
8f2e4f09b6
6 changed files with 174 additions and 37 deletions
|
|
@ -255,6 +255,17 @@
|
|||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoPlaneswalkersActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkPiles">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Piles"/>
|
||||
<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="chkPilesActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbSortBy">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
filteredCards.add(card);
|
||||
}
|
||||
}
|
||||
this.cardGrid.loadCards(new CardsView(filteredCards), (SortBy) cbSortBy.getSelectedItem(), bigCard, null);
|
||||
this.cardGrid.loadCards(new CardsView(filteredCards), (SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected(), bigCard, null);
|
||||
}
|
||||
finally {
|
||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
|
|
@ -198,6 +198,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
rdoInstants = new javax.swing.JRadioButton();
|
||||
rdoSorceries = new javax.swing.JRadioButton();
|
||||
rdoPlaneswalkers = new javax.swing.JRadioButton();
|
||||
chkPiles = new javax.swing.JCheckBox();
|
||||
cbSortBy = new javax.swing.JComboBox();
|
||||
|
||||
tbColor.setFloatable(false);
|
||||
|
|
@ -394,6 +395,17 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
});
|
||||
tbTypes.add(rdoPlaneswalkers);
|
||||
|
||||
chkPiles.setText("Piles");
|
||||
chkPiles.setFocusable(false);
|
||||
chkPiles.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
chkPiles.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
chkPiles.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
chkPilesActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
tbTypes.add(chkPiles);
|
||||
|
||||
cbSortBy.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
cbSortBy.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
|
|
@ -530,9 +542,14 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
|
||||
private void cbSortByActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSortByActionPerformed
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem());
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||
}//GEN-LAST:event_cbSortByActionPerformed
|
||||
|
||||
private void chkPilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkPilesActionPerformed
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||
}//GEN-LAST:event_chkPilesActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnBooster;
|
||||
|
|
@ -540,6 +557,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
private mage.client.cards.CardGrid cardGrid;
|
||||
private javax.swing.JComboBox cbExpansionSet;
|
||||
private javax.swing.JComboBox cbSortBy;
|
||||
private javax.swing.JCheckBox chkPiles;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JRadioButton rdoArtifacts;
|
||||
private javax.swing.JRadioButton rdoBlack;
|
||||
|
|
@ -561,25 +579,25 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem());
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem());
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem());
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy)
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem());
|
||||
this.cardGrid.drawCards((SortBy) cbSortBy.getSelectedItem(), chkPiles.isSelected());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue