Changeset 630 for AE/installer2/src/net/oni2/aeinstaller/gui/modtable
- Timestamp:
- Jan 18, 2013, 1:03:21 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/gui/modtable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableFilter.java
r608 r630 11 11 public class ModTableFilter extends RowFilter<ModTableModel, Integer> { 12 12 Type type = null; 13 int downloadState = 0; 13 14 14 15 /** 15 16 * @param type 16 17 * Type of mods to show (null for all) 18 * @param downloadState 19 * Show only: 0 = all, 1 = online, 2 = downloaded 17 20 */ 18 public ModTableFilter(Type type ) {21 public ModTableFilter(Type type, int downloadState) { 19 22 super(); 20 23 this.type = type; 24 this.downloadState = downloadState; 21 25 } 22 26 … … 25 29 RowFilter.Entry<? extends ModTableModel, ? extends Integer> entry) { 26 30 Mod mod = (Mod) entry.getModel().getValueAt(entry.getIdentifier(), -1); 27 31 28 32 if (mod.isMandatoryMod()) 29 33 return false; … … 32 36 return false; 33 37 34 if (type == null) 35 return true; 36 37 return mod.getTypes().contains(type); 38 boolean result = true; 39 if (type != null) 40 result &= mod.getTypes().contains(type); 41 switch (downloadState) { 42 case 1: 43 result &= !mod.isLocalAvailable(); 44 break; 45 case 2: 46 result &= mod.isLocalAvailable(); 47 break; 48 } 49 50 return result; 38 51 } 39 52 } -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r629 r630 48 48 case 2: 49 49 return mod.getPackageNumberString(); 50 case 3: 51 return mod.getCreator(); 50 52 } 51 53 return null; … … 61 63 case 2: 62 64 return bundle.getString("mod.package_number"); 65 case 3: 66 return bundle.getString("mod.creator"); 63 67 } 64 68 return null; … … 72 76 @Override 73 77 public int getColumnCount() { 74 return 3;78 return 4; 75 79 } 76 80 … … 83 87 return String.class; 84 88 case 2: 89 return String.class; 90 case 3: 85 91 return String.class; 86 92 } … … 100 106 switch (colNum) { 101 107 case 0: 102 w = 50;108 w = 60; 103 109 col.setPreferredWidth(w); 104 110 col.setMinWidth(w); … … 113 119 col.setMinWidth(w); 114 120 col.setMaxWidth(w); 121 break; 122 case 3: 123 col.setPreferredWidth(90); 115 124 break; 116 125 }
Note:
See TracChangeset
for help on using the changeset viewer.