- Timestamp:
- Jan 18, 2013, 1:03:21 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/AEInstaller.properties
r629 r630 1 1 appname=AE Installer 2 2 appversion=0.8 82 appversion=0.89 -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r629 r630 36 36 import javax.swing.JPanel; 37 37 import javax.swing.JPopupMenu; 38 import javax.swing.JRadioButton; 38 39 import javax.swing.JSplitPane; 39 40 import javax.swing.JTable; … … 99 100 100 101 private JComboBox cmbModTypes; 102 private JRadioButton radAll; 103 private JRadioButton radOnline; 104 private JRadioButton radLocal; 101 105 private JTable tblMods; 102 106 private ModTableModel model; … … 139 143 getRootPane().setDefaultButton(btnInstall); 140 144 lblDownloadSizeVal.setText(SizeFormatter.format(0, 2)); 145 radAll.setSelected(true); 141 146 } 142 147 … … 148 153 types.put(t.getName(), t); 149 154 } 155 cmbModTypes.addItem("-All-"); 150 156 for (Type t : types.values()) { 151 157 cmbModTypes.addItem(t); … … 232 238 tblMods.setRowSorter(sorter); 233 239 234 sorter.setRowFilter(new ModTableFilter(null ));240 sorter.setRowFilter(new ModTableFilter(null, 0)); 235 241 236 242 List<RowSorter.SortKey> sortKeys = new ArrayList<RowSorter.SortKey>(); … … 662 668 } 663 669 670 private void updateTableFilter() { 671 Object o = cmbModTypes.getSelectedItem(); 672 Type t = null; 673 if (o instanceof Type) 674 t = (Type) o; 675 int downloadState = 0; 676 if (radOnline.isSelected()) 677 downloadState = 1; 678 if (radLocal.isSelected()) 679 downloadState = 2; 680 sorter.setRowFilter(new ModTableFilter(t, downloadState)); 681 } 682 664 683 @SuppressWarnings("unused") 665 684 private void modTypeSelection() { 666 Type t = (Type) cmbModTypes.getSelectedItem(); 667 if (t != null) 668 sorter.setRowFilter(new ModTableFilter(t)); 669 else 670 sorter.setRowFilter(new ModTableFilter(null)); 685 updateTableFilter(); 686 } 687 688 @SuppressWarnings("unused") 689 private void showTypeSelection() { 690 updateTableFilter(); 671 691 } 672 692 -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r623 r630 50 50 - JLabel(name=lblModTypes, text=lblModTypes.text) 51 51 - JComboBox(name=cmbModTypes, onAction=modTypeSelection) 52 - JLabel(name=lblShowOnly, text=lblShowOnly.text) 53 - JRadioButton(name=radAll, text=radAll.text, onAction=showTypeSelection) 54 - JRadioButton(name=radOnline, text=radOnline.text, onAction=showTypeSelection) 55 - JRadioButton(name=radLocal, text=radLocal.text, onAction=showTypeSelection) 56 - ButtonGroup: [radAll,radOnline,radLocal] 52 57 - JScrollPane(name=scrollMods, vScrollBar=always, hScrollBar=never): 53 58 JTable(name=tblMods, visible=false) … … 58 63 - MigLayout: | 59 64 [grow] 60 lblModTypes<,cmbModTypes [min] 61 scrollMods [grow] 62 >btnRevertSelection,btnInstall [min] 63 lblDownloadSize,lblDownloadSizeVal [min] 65 lblModTypes<,cmbModTypes [min] 66 lblShowOnly<,radAll,radOnline,radLocal [min] 67 scrollMods [grow] 68 >btnRevertSelection,btnInstall [min] 69 lblDownloadSize,lblDownloadSizeVal [min] 64 70 - JPanel(name=panInfo): 65 71 - JLabel(name=lblSubmitter, text=lblSubmitter.text) -
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 } -
AE/installer2/src/net/oni2/aeinstaller/localization/MainWin.properties
r629 r630 36 36 btnInstall.tooltip=Install selected mods 37 37 lblModTypes.text=Mod type: 38 lblShowOnly.text=Show only: 39 radAll.text=All 40 radOnline.text=Online 41 radLocal.text=Downloaded 38 42 lblDownloadSize.text=Size of files to download: 39 43 -
AE/installer2/src/net/oni2/aeinstaller/localization/ModTableModel.properties
r629 r630 2 2 mod.package_number=Pkg# 3 3 mod.install=Install 4 mod.creator=Creator
Note:
See TracChangeset
for help on using the changeset viewer.