Changeset 648 for AE/installer2/src/net/oni2/aeinstaller/gui/modtable
- Timestamp:
- Jan 25, 2013, 1:15:31 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/gui/modtable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModSelectionListener.java
r631 r648 1 1 package net.oni2.aeinstaller.gui.modtable; 2 2 3 import net.oni2.aeinstaller.backend. mods.Mod;3 import net.oni2.aeinstaller.backend.packages.Package; 4 4 5 5 /** … … 15 15 * New selected mod 16 16 */ 17 public void modSelectionChanged(ModTable source, Modmod);17 public void modSelectionChanged(ModTable source, Package mod); 18 18 } -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTable.java
r645 r648 30 30 31 31 import net.oni2.aeinstaller.backend.Settings; 32 import net.oni2.aeinstaller.backend. mods.Mod;33 import net.oni2.aeinstaller.backend. mods.Type;32 import net.oni2.aeinstaller.backend.packages.Package; 33 import net.oni2.aeinstaller.backend.packages.Type; 34 34 35 35 /** … … 90 90 int modelCol = convertColumnIndexToModel(c); 91 91 if (modelCol == 4) { 92 final Mod mod = (Mod) getValueAt(r, -1);92 final Package mod = (Package) getValueAt(r, -1); 93 93 94 94 String tt = "<html>"; … … 126 126 } 127 127 128 private void notifyModSelectionListeners( Modm) {128 private void notifyModSelectionListeners(Package m) { 129 129 for (ModSelectionListener l : modSelListeners) { 130 130 l.modSelectionChanged(this, m); … … 175 175 * @return Mods selected for installation 176 176 */ 177 public TreeSet< Mod> getSelectedMods() {177 public TreeSet<Package> getSelectedMods() { 178 178 return model.getSelectedMods(); 179 179 } … … 212 212 notifyModSelectionListeners(null); 213 213 } else { 214 Mod mod = (Mod) getValueAt(viewRow, -1);214 Package mod = (Package) getValueAt(viewRow, -1); 215 215 notifyModSelectionListeners(mod); 216 216 } … … 228 228 if (rowindex >= 0) { 229 229 if (e.isPopupTrigger() && e.getComponent() instanceof JTable) { 230 final Mod mod = (Mod) getValueAt(rowindex, -1);230 final Package mod = (Package) getValueAt(rowindex, -1); 231 231 232 232 JPopupMenu popup = new JPopupMenu(); … … 292 292 String key = String.valueOf(e.getKeyChar()).toLowerCase(); 293 293 for (int i = 0; i < getRowCount(); i++) { 294 Mod m = (Mod) getValueAt(i, -1);294 Package m = (Package) getValueAt(i, -1); 295 295 if (m.getName().toLowerCase().startsWith(key)) { 296 296 setRowSelectionInterval(i, i); -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableFilter.java
r636 r648 3 3 import javax.swing.RowFilter; 4 4 5 import net.oni2.aeinstaller.backend. mods.Mod;6 import net.oni2.aeinstaller.backend. mods.Type;5 import net.oni2.aeinstaller.backend.packages.Package; 6 import net.oni2.aeinstaller.backend.packages.Type; 7 7 8 8 /** … … 28 28 public boolean include( 29 29 RowFilter.Entry<? extends ModTableModel, ? extends Integer> entry) { 30 Mod mod = (Mod) entry.getModel().getValueAt(entry.getIdentifier(), -1);30 Package mod = (Package) entry.getModel().getValueAt(entry.getIdentifier(), -1); 31 31 32 if (mod.is MandatoryMod())32 if (mod.isCorePackage()) 33 33 return false; 34 34 -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r646 r648 12 12 import javax.swing.table.TableColumn; 13 13 14 import net.oni2.aeinstaller.backend. mods.Mod;15 import net.oni2.aeinstaller.backend. mods.ModManager;14 import net.oni2.aeinstaller.backend.packages.Package; 15 import net.oni2.aeinstaller.backend.packages.PackageManager; 16 16 17 17 /** … … 25 25 .getBundle("net.oni2.aeinstaller.localization.ModTable"); 26 26 27 private Vector< Mod> items = new Vector<Mod>();27 private Vector<Package> items = new Vector<Package>(); 28 28 private Vector<Boolean> install = new Vector<Boolean>(); 29 29 … … 40 40 @Override 41 41 public Object getValueAt(int row, int col) { 42 Modmod = items.get(row);42 Package mod = items.get(row); 43 43 switch (col) { 44 44 case -1: … … 54 54 case 4: 55 55 String res = ""; 56 res += ( install.get(row) ? "I" : "_");56 res += (mod.isInstalled() ? "I" : "_"); 57 57 res += (mod.isLocalAvailable() && mod.isNewerAvailable() ? "U" 58 58 : "_"); … … 166 166 public void reloadData() { 167 167 items.clear(); 168 items.addAll( ModManager.getInstance().getModsValidAndNotMandatory());168 items.addAll(PackageManager.getInstance().getModsValidAndNotCore()); 169 169 revertSelection(); 170 170 } … … 189 189 */ 190 190 public void reloadSelection(File config) { 191 Vector<Integer> selected = ModManager.getInstance().loadModSelection(192 config);191 Vector<Integer> selected = PackageManager.getInstance() 192 .loadModSelection(config); 193 193 install.clear(); 194 194 for (int i = 0; i < items.size(); i++) { … … 203 203 * @return Items 204 204 */ 205 public Vector< Mod> getItems() {205 public Vector<Package> getItems() { 206 206 return items; 207 207 } … … 210 210 * @return Mods selected for installation 211 211 */ 212 public TreeSet< Mod> getSelectedMods() {213 TreeSet< Mod> res = new TreeSet<Mod>();212 public TreeSet<Package> getSelectedMods() { 213 TreeSet<Package> res = new TreeSet<Package>(); 214 214 for (int i = 0; i < items.size(); i++) { 215 215 if (install.get(i)) … … 223 223 return columnIndex == 0; 224 224 } 225 225 226 226 private void notifyDownloadSize(int size) { 227 227 for (DownloadSizeListener dsl : listeners) … … 238 238 for (int i = 0; i < items.size(); i++) { 239 239 if (install.get(i)) { 240 Modm = items.get(i);240 Package m = items.get(i); 241 241 if (!m.isLocalAvailable()) 242 242 size += m.getZipSize();
Note:
See TracChangeset
for help on using the changeset viewer.