Changeset 752 for java/installer2/src/net/oni2/aeinstaller/gui/modtable
- Timestamp:
- Mar 28, 2013, 4:34:30 PM (12 years ago)
- Location:
- java/installer2/src/net/oni2/aeinstaller/gui/modtable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTable.java
r720 r752 267 267 for (int i = 0; i < getRowCount(); i++) { 268 268 int modRow = convertRowIndexToModel(i); 269 model.setValueAt(!isAll, modRow, 0); 270 } 269 model.selectPackage(modRow, !isAll); 270 } 271 model.updateDownloadSize(); 271 272 invalidate(); 272 273 repaint(); -
java/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r673 r752 271 271 } 272 272 273 /** 274 * Check the current download size and notify listeners 275 */ 276 public void updateDownloadSize() { 277 int size = 0; 278 int count = 0; 279 for (int i = 0; i < items.size(); i++) { 280 if (install.get(i)) { 281 count++; 282 Package m = items.get(i); 283 if (!m.isLocalAvailable()) 284 size += m.getZipSize(); 285 } 286 } 287 notifyDownloadSize(size, count); 288 } 289 273 290 @Override 274 291 public void setValueAt(Object aValue, int rowIndex, int columnIndex) { 275 292 super.setValueAt(aValue, rowIndex, columnIndex); 276 293 if (columnIndex == 0) { 277 install.set(rowIndex, (Boolean) aValue); 278 279 int size = 0; 280 int count = 0; 281 for (int i = 0; i < items.size(); i++) { 282 if (install.get(i)) { 283 count++; 284 Package m = items.get(i); 285 if (!m.isLocalAvailable()) 286 size += m.getZipSize(); 287 } 288 } 289 notifyDownloadSize(size, count); 290 } 294 selectPackage(rowIndex, (Boolean) aValue); 295 updateDownloadSize(); 296 } 297 } 298 299 /** 300 * Select package in given row 301 * 302 * @param row 303 * Row of package 304 * @param select 305 * Select or not 306 */ 307 public void selectPackage(int row, boolean select) { 308 install.set(row, select); 291 309 } 292 310
Note:
See TracChangeset
for help on using the changeset viewer.