Changeset 673 for AE/installer2/src/net/oni2/aeinstaller/gui
- Timestamp:
- Feb 25, 2013, 5:52:49 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/gui
- Files:
-
- 1 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r672 r673 60 60 import net.oni2.aeinstaller.gui.corepackages.CorePackagesDialog; 61 61 import net.oni2.aeinstaller.gui.downloadwindow.Downloader; 62 import net.oni2.aeinstaller.gui.modtable. DownloadSizeListener;62 import net.oni2.aeinstaller.gui.modtable.ModInstallSelectionListener; 63 63 import net.oni2.aeinstaller.gui.modtable.EApplyFilterTo; 64 64 import net.oni2.aeinstaller.gui.modtable.ModSelectionListener; … … 80 80 */ 81 81 public class MainWin extends JFrame implements ApplicationListener, 82 DownloadSizeListener, ModSelectionListener {82 ModInstallSelectionListener, ModSelectionListener { 83 83 private static final long serialVersionUID = -4027395051382659650L; 84 84 … … 103 103 private JScrollPane scrollMods; 104 104 private ModTable tblMods; 105 private JLabel lblSelectedModsVal; 105 106 private JLabel lblDownloadSizeVal; 106 107 … … 147 148 148 149 getRootPane().setDefaultButton(btnInstall); 150 lblSelectedModsVal.setText("0"); 149 151 lblDownloadSizeVal.setText(SizeFormatter.format(0, 2)); 150 152 radAll.setSelected(true); … … 492 494 JOptionPane.ERROR_MESSAGE); 493 495 if (ex.getMessage().contains(".NET")) 494 JOptionPane.showMessageDialog(null, 496 JOptionPane.showMessageDialog( 497 null, 495 498 bundle.getString("dotNetNotFound.text"), 496 499 bundle.getString("dotNetNotFound.title"), … … 782 785 783 786 @Override 784 public void downloadSizeChanged(int newSize) { 787 public void modInstallSelectionChanged(int newSize, int newCount) { 788 lblSelectedModsVal.setText(String.valueOf(newCount)); 785 789 lblDownloadSizeVal.setText(SizeFormatter.format(newSize, 2)); 786 790 } -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r661 r673 64 64 - JButton(name=btnRevertSelection, icon=img.undo16, text=btnRevertSelection.text, toolTipText=btnRevertSelection.tooltip, onAction=[revertSelection]) 65 65 - JButton(name=btnInstall, icon=img.install, text=btnInstall.text, toolTipText=btnInstall.tooltip, onAction=[install,installExec,installDone]) 66 - JLabel(name=lblSelectedMods, text=lblSelectedMods.text) 67 - JLabel(name=lblSelectedModsVal) 66 68 - JLabel(name=lblDownloadSize, text=lblDownloadSize.text) 67 69 - JLabel(name=lblDownloadSizeVal) 68 70 - MigLayout: | 69 [min] [grow] 70 >lblModTypes cmbModTypes [min] 71 >lblShowOnly radAll,radOnline,radLocal [min] 72 >lblShowFilter txtShowFilter>,cmbShowFilterTo< [min] 73 scrollMods+* [grow] 74 >btnUnSelectAll+*,>btnRevertSelection,btnInstall [min] 75 lblDownloadSize+*,lblDownloadSizeVal [min] 71 [min] [grow] [min] 72 >lblModTypes cmbModTypes+* [min] 73 >lblShowOnly radAll+*,radOnline,radLocal [min] 74 >lblShowFilter txtShowFilter+*>,cmbShowFilterTo< [min] 75 scrollMods+* [grow] 76 >btnUnSelectAll+*,btnRevertSelection [min] 77 lblSelectedMods+2,lblSelectedModsVal >btnInstall+*+* [min] 78 lblDownloadSize+2,lblDownloadSizeVal [min] 76 79 - PackageInfoBox(name=pkgInfo) 77 80 - MigLayout: -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTable.java
r660 r673 38 38 import net.oni2.aeinstaller.backend.packages.Package; 39 39 import net.oni2.aeinstaller.backend.packages.Type; 40 import net.oni2.aeinstaller.gui.downloadwindow.Downloader; 40 41 41 42 /** … … 173 174 * Listener to add 174 175 */ 175 public void addDownloadSizeListener( DownloadSizeListener listener) {176 public void addDownloadSizeListener(ModInstallSelectionListener listener) { 176 177 model.addDownloadSizeListener(listener); 177 178 } … … 181 182 * Listener to remove 182 183 */ 183 public void removeDownloadSizeListener( DownloadSizeListener listener) {184 public void removeDownloadSizeListener(ModInstallSelectionListener listener) { 184 185 model.removeDownloadSizeListener(listener); 185 186 } … … 332 333 }); 333 334 popup.add(openDepotPage); 335 } 336 337 if (mod.getFile() != null) { 338 // Download package 339 JMenuItem downloadPackage = new JMenuItem( 340 bundle.getString("downloadPackage.text")); 341 downloadPackage.addActionListener(new ActionListener() { 342 @Override 343 public void actionPerformed(ActionEvent arg0) { 344 TreeSet<Package> toDo = new TreeSet<Package>(); 345 TreeSet<Package> deps = new TreeSet<Package>(); 346 toDo.add(mod); 347 Downloader dl = new Downloader(toDo, deps); 348 try { 349 dl.setVisible(true); 350 } finally { 351 dl.dispose(); 352 } 353 invalidate(); 354 repaint(); 355 } 356 }); 357 popup.add(downloadPackage); 334 358 } 335 359 -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r658 r673 29 29 private Vector<Boolean> install = new Vector<Boolean>(); 30 30 31 private HashSet< DownloadSizeListener> listeners = new HashSet<DownloadSizeListener>();31 private HashSet<ModInstallSelectionListener> listeners = new HashSet<ModInstallSelectionListener>(); 32 32 33 33 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); … … 210 210 public void revertSelection() { 211 211 install.clear(); 212 int count = 0; 212 213 for (int i = 0; i < items.size(); i++) { 213 install.add(i, items.get(i).isInstalled()); 214 } 215 notifyDownloadSize(0); 214 boolean installed = items.get(i).isInstalled(); 215 install.add(i, installed); 216 if (installed) 217 count++; 218 } 219 notifyDownloadSize(0, count); 216 220 fireTableDataChanged(); 217 221 } … … 262 266 } 263 267 264 private void notifyDownloadSize(int size ) {265 for ( DownloadSizeListener dsl : listeners)266 dsl. downloadSizeChanged(size);268 private void notifyDownloadSize(int size, int count) { 269 for (ModInstallSelectionListener dsl : listeners) 270 dsl.modInstallSelectionChanged(size, count); 267 271 } 268 272 … … 274 278 275 279 int size = 0; 280 int count = 0; 276 281 for (int i = 0; i < items.size(); i++) { 277 282 if (install.get(i)) { 283 count++; 278 284 Package m = items.get(i); 279 285 if (!m.isLocalAvailable()) … … 281 287 } 282 288 } 283 notifyDownloadSize(size );289 notifyDownloadSize(size, count); 284 290 } 285 291 } … … 289 295 * Listener to receive download size changed events 290 296 */ 291 public void addDownloadSizeListener( DownloadSizeListener lis) {297 public void addDownloadSizeListener(ModInstallSelectionListener lis) { 292 298 listeners.add(lis); 293 299 } … … 297 303 * Listener to no longer receive download size changed events 298 304 */ 299 public void removeDownloadSizeListener( DownloadSizeListener lis) {305 public void removeDownloadSizeListener(ModInstallSelectionListener lis) { 300 306 listeners.remove(lis); 301 307 }
Note:
See TracChangeset
for help on using the changeset viewer.