- Allows for sorting by value in the cardshop.

This commit is contained in:
jendave
2011-08-06 03:45:43 +00:00
parent 64706eb84c
commit fb8d27293e
3 changed files with 13 additions and 2 deletions

View File

@@ -252,7 +252,7 @@ public class Gui_DeckEditor_Menu extends JMenuBar implements NewConstants {
//private String column[] = {"Qty", "Name", "Cost", "Color", "Type", "Stats", "Rarity"};
Gui_DeckEditor g = (Gui_DeckEditor) deckDisplay;
g.getTopTableModel().sort(7, true);
g.getTopTableModel().sort(99, true);
}
});

View File

@@ -80,6 +80,7 @@ class TableModel extends AbstractTableModel {
column.setPreferredWidth(40);
column.setMaxWidth(40);
}
}//for
for(int j = 0; j < table.getColumnCount(); j++) {

View File

@@ -92,7 +92,12 @@ public class TableSorter implements Comparator<Card>, NewConstants
aCom = getRarity(a);
bCom = getRarity(b);
}
else if (column == 7)//New First
else if (column == 7)//Value
{
aCom = getValue(a);
bCom = getValue(b);
}
else if (column == 99)//New First
{
aCom = sortNewFirst(a);
bCom = sortNewFirst(b);
@@ -128,6 +133,11 @@ public class TableSorter implements Comparator<Card>, NewConstants
return Integer.valueOf(5);
}
final private Long getValue(Card c)
{
return c.getValue();
}
final public static String getColor(Card c)
{
ArrayList list = CardUtil.getColors(c);