Changeset 648
- Timestamp:
- Jan 25, 2013, 1:15:31 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller
- Files:
-
- 19 added
- 3 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/AEInstaller.properties
r647 r648 1 1 appname=AE Installer 2 2 appversion=0.99 d2 appversion=0.99e -
AE/installer2/src/net/oni2/aeinstaller/AEInstaller2.java
r646 r648 185 185 } 186 186 187 boolean forcedOffline = false; 188 for (String a : args) 189 if (a.equalsIgnoreCase("-offline")) 190 forcedOffline = true; 191 187 192 boolean offline = !DepotManager.getInstance().checkConnection(); 188 if (offline) { 193 194 if (forcedOffline || offline) { 189 195 JOptionPane.showMessageDialog(null, 190 196 globalBundle.getString("offlineModeStartup.text"), … … 192 198 JOptionPane.INFORMATION_MESSAGE); 193 199 } 194 Settings.getInstance().setOfflineMode( offline);200 Settings.getInstance().setOfflineMode(forcedOffline || offline); 195 201 196 202 SwingUtilities.invokeLater(new Runnable() { -
AE/installer2/src/net/oni2/aeinstaller/Images.properties
r645 r648 20 20 img.transparent=/net/oni2/aeinstaller/images/transparent.png 21 21 22 img. mandatory=/net/oni2/aeinstaller/images/open_icon_library/edit-delete-6.png22 img.core=/net/oni2/aeinstaller/images/open_icon_library/edit-delete-6.png -
AE/installer2/src/net/oni2/aeinstaller/backend/depot/DepotConfig.java
r636 r648 77 77 78 78 /** 79 * @return First package number that's not a mandatorytool/mod. Everything80 * below is considered mandatory79 * @return First package number that's not a core tool/mod. Everything 80 * below is considered a core package 81 81 */ 82 public static int get MandatoryLimit() {82 public static int getCoreNumberLimit() { 83 83 return 8000; 84 84 } -
AE/installer2/src/net/oni2/aeinstaller/backend/depot/model/NodeMod.java
r635 r648 7 7 import net.oni2.aeinstaller.backend.depot.DepotConfig; 8 8 import net.oni2.aeinstaller.backend.depot.DepotManager; 9 import net.oni2.aeinstaller.backend. mods.ECompatiblePlatform;9 import net.oni2.aeinstaller.backend.packages.ECompatiblePlatform; 10 10 11 11 import org.json.JSONArray; -
AE/installer2/src/net/oni2/aeinstaller/backend/oni/Installer.java
r631 r648 24 24 import net.oni2.aeinstaller.backend.Settings; 25 25 import net.oni2.aeinstaller.backend.Settings.Platform; 26 import net.oni2.aeinstaller.backend. mods.EBSLInstallType;27 import net.oni2.aeinstaller.backend. mods.Mod;28 import net.oni2.aeinstaller.backend. mods.ModManager;26 import net.oni2.aeinstaller.backend.packages.EBSLInstallType; 27 import net.oni2.aeinstaller.backend.packages.Package; 28 import net.oni2.aeinstaller.backend.packages.PackageManager; 29 29 30 30 import org.apache.commons.io.FileUtils; … … 62 62 public static Vector<Integer> getInstalledMods() { 63 63 File installCfg = new File(Paths.getEditionGDF(), "installed_mods.xml"); 64 return ModManager.getInstance().loadModSelection(installCfg);64 return PackageManager.getInstance().loadModSelection(installCfg); 65 65 } 66 66 … … 109 109 * Tools to install 110 110 */ 111 public static void installTools(TreeSet< Mod> tools) {111 public static void installTools(TreeSet<Package> tools) { 112 112 TreeSet<Integer> installed = getInstalledTools(); 113 for ( Modm : tools) {113 for (Package m : tools) { 114 114 File plain = new File(m.getLocalPath(), "plain"); 115 115 if (plain.exists()) { … … 138 138 * Tools to uninstall 139 139 */ 140 public static void uninstallTools(TreeSet< Mod> tools) {140 public static void uninstallTools(TreeSet<Package> tools) { 141 141 TreeSet<Integer> installed = getInstalledTools(); 142 for ( Modm : tools) {142 for (Package m : tools) { 143 143 if (installed.contains(m.getPackageNumber())) { 144 144 File plain = new File(m.getLocalPath(), "plain"); … … 205 205 * Listener for install progress updates 206 206 */ 207 public static void install(TreeSet< Mod> mods,207 public static void install(TreeSet<Package> mods, 208 208 InstallProgressListener listener) { 209 209 try { … … 214 214 215 215 File installCfg = new File(Paths.getEditionGDF(), "installed_mods.xml"); 216 ModManager.getInstance().saveModSelection(installCfg, mods);216 PackageManager.getInstance().saveModSelection(installCfg, mods); 217 217 218 218 HashSet<Integer> unlockLevels = new HashSet<Integer>(); … … 221 221 foldersOni.add(Paths.getVanillaOnisPath()); 222 222 223 for ( Modm : mods) {223 for (Package m : mods) { 224 224 for (int lev : m.getUnlockLevels()) 225 225 unlockLevels.add(lev); … … 253 253 } 254 254 255 private static void combineBSLFolders(TreeSet< Mod> mods,255 private static void combineBSLFolders(TreeSet<Package> mods, 256 256 InstallProgressListener listener) { 257 257 listener.installProgressUpdate(95, 100, "Installing BSL files"); 258 258 259 HashMap<EBSLInstallType, Vector< Mod>> modsToInclude = new HashMap<EBSLInstallType, Vector<Mod>>();260 modsToInclude.put(EBSLInstallType.NORMAL, new Vector< Mod>());261 modsToInclude.put(EBSLInstallType.ADDON, new Vector< Mod>());262 263 for ( Modm : mods.descendingSet()) {259 HashMap<EBSLInstallType, Vector<Package>> modsToInclude = new HashMap<EBSLInstallType, Vector<Package>>(); 260 modsToInclude.put(EBSLInstallType.NORMAL, new Vector<Package>()); 261 modsToInclude.put(EBSLInstallType.ADDON, new Vector<Package>()); 262 263 for (Package m : mods.descendingSet()) { 264 264 File bsl = new File(m.getLocalPath(), "bsl"); 265 265 if (bsl.exists()) { … … 281 281 } 282 282 283 for ( Modm : modsToInclude.get(EBSLInstallType.NORMAL)) {283 for (Package m : modsToInclude.get(EBSLInstallType.NORMAL)) { 284 284 copyBSL(m, false); 285 285 } 286 Vector< Mod> addons = modsToInclude.get(EBSLInstallType.ADDON);286 Vector<Package> addons = modsToInclude.get(EBSLInstallType.ADDON); 287 287 for (int i = addons.size() - 1; i >= 0; i--) { 288 288 copyBSL(addons.get(i), true); … … 290 290 } 291 291 292 private static void copyBSL( ModsourceMod, boolean addon) {292 private static void copyBSL(Package sourceMod, boolean addon) { 293 293 File targetBaseFolder = new File(Paths.getEditionGDF(), "IGMD"); 294 294 if (!targetBaseFolder.exists()) -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r647 r648 44 44 import net.oni2.aeinstaller.backend.SizeFormatter; 45 45 import net.oni2.aeinstaller.backend.depot.DepotManager; 46 import net.oni2.aeinstaller.backend.mods.Mod; 47 import net.oni2.aeinstaller.backend.mods.ModManager; 48 import net.oni2.aeinstaller.backend.mods.Type; 49 import net.oni2.aeinstaller.backend.mods.download.ModDownloader; 50 import net.oni2.aeinstaller.backend.mods.download.ModDownloader.State; 51 import net.oni2.aeinstaller.backend.mods.download.ModDownloaderListener; 46 import net.oni2.aeinstaller.backend.packages.Package; 47 import net.oni2.aeinstaller.backend.packages.PackageManager; 48 import net.oni2.aeinstaller.backend.packages.Type; 52 49 import net.oni2.aeinstaller.backend.oni.InstallProgressListener; 53 50 import net.oni2.aeinstaller.backend.oni.Installer; 54 51 import net.oni2.aeinstaller.backend.oni.OniSplit; 52 import net.oni2.aeinstaller.backend.packages.download.ModDownloader; 53 import net.oni2.aeinstaller.backend.packages.download.ModDownloaderListener; 54 import net.oni2.aeinstaller.backend.packages.download.ModDownloader.State; 55 55 import net.oni2.aeinstaller.gui.about.AboutDialog; 56 import net.oni2.aeinstaller.gui.corepackages.CorePackagesDialog; 56 57 import net.oni2.aeinstaller.gui.downloadwindow.Downloader; 57 import net.oni2.aeinstaller.gui.mandatorypackages.MandatoryPackagesDialog;58 58 import net.oni2.aeinstaller.gui.modtable.DownloadSizeListener; 59 59 import net.oni2.aeinstaller.gui.modtable.ModSelectionListener; … … 105 105 private JButton btnInstall; 106 106 107 private TreeSet< Mod> execMandatoryUpdates = new TreeSet<Mod>();108 private TreeSet< Mod> execUpdates = null;107 private TreeSet<Package> execCoreUpdates = new TreeSet<Package>(); 108 private TreeSet<Package> execUpdates = null; 109 109 110 110 private enum EInstallState { … … 118 118 119 119 private EInstallState installState = EInstallState.DONE; 120 private TreeSet< Mod> installMods = null;121 private TreeSet< Mod> installDeps = null;120 private TreeSet<Package> installMods = null; 121 private TreeSet<Package> installDeps = null; 122 122 123 123 /** … … 153 153 154 154 TreeMap<String, Type> types = new TreeMap<String, Type>(); 155 for (Type t : ModManager.getInstance().getTypesWithContent()) {155 for (Type t : PackageManager.getInstance().getTypesWithContent()) { 156 156 types.put(t.getName(), t); 157 157 } … … 187 187 } 188 188 189 ModManager.getInstance().init();189 PackageManager.getInstance().init(); 190 190 tblMods.reloadData(); 191 191 initModTypeBox(); … … 206 206 } 207 207 } else { 208 TreeSet< Mod> mods = ModManager.getInstance().getUpdatableMods();209 TreeSet< Mod> tools = ModManager.getInstance()208 TreeSet<Package> mods = PackageManager.getInstance().getUpdatableMods(); 209 TreeSet<Package> tools = PackageManager.getInstance() 210 210 .getUpdatableTools(); 211 211 int size = 0; 212 212 JPanel panPackages = new JPanel(new GridLayout(0, 1)); 213 execUpdates = new TreeSet< Mod>();213 execUpdates = new TreeSet<Package>(); 214 214 execUpdates.addAll(mods); 215 215 execUpdates.addAll(tools); 216 for (final Modm : mods) {216 for (final Package m : mods) { 217 217 size += m.getZipSize(); 218 218 JCheckBox check = new JCheckBox("Mod: " + m.getName()); … … 229 229 panPackages.add(check); 230 230 } 231 for (final Modm : tools) {231 for (final Package m : tools) { 232 232 size += m.getZipSize(); 233 233 JCheckBox check = new JCheckBox("Tool: " + m.getName()); … … 285 285 if (dl.isFinished()) { 286 286 TreeSet<Integer> installed = Installer.getInstalledTools(); 287 TreeSet< Mod> tools = new TreeSet<Mod>();288 for ( Modm : execUpdates)287 TreeSet<Package> tools = new TreeSet<Package>(); 288 for (Package m : execUpdates) 289 289 if (m.isTool() 290 290 && installed.contains(m.getPackageNumber())) … … 315 315 316 316 @SuppressWarnings("unused") 317 private void show MandatoryPackagesDialog() {318 new MandatoryPackagesDialog().setVisible(true);317 private void showCorePackagesDialog() { 318 new CorePackagesDialog().setVisible(true); 319 319 } 320 320 … … 369 369 if (!f.getName().endsWith(".xml")) 370 370 f = new File(f.getParentFile(), f.getName() + ".xml"); 371 ModManager.getInstance().saveModSelection(f,371 PackageManager.getInstance().saveModSelection(f, 372 372 tblMods.getSelectedMods()); 373 373 } … … 397 397 } 398 398 toolsMenuItems.clear(); 399 for ( Mod m : ModManager.getInstance().getInstalledTools()) {399 for (Package m : PackageManager.getInstance().getInstalledTools()) { 400 400 File exe = m.getExeFile(); 401 401 if (exe != null && exe.exists()) { … … 441 441 } 442 442 443 @DoInBackground(progressMessage = " mandatoryFiles.title", cancelable = false, indeterminateProgress = false)444 private void check MandatoryFiles(final BackgroundEvent evt) {443 @DoInBackground(progressMessage = "checkCorePackages.title", cancelable = false, indeterminateProgress = false) 444 private void checkCorePackages(final BackgroundEvent evt) { 445 445 if (!Settings.getInstance().isOfflineMode()) { 446 for ( Mod m : ModManager.getInstance().getMandatoryTools()) {446 for (Package m : PackageManager.getInstance().getCoreTools()) { 447 447 if (m.isNewerAvailable()) { 448 exec MandatoryUpdates.add(m);449 } 450 } 451 for ( Mod m : ModManager.getInstance().getMandatoryMods()) {448 execCoreUpdates.add(m); 449 } 450 } 451 for (Package m : PackageManager.getInstance().getCoreMods()) { 452 452 if (m.isNewerAvailable()) { 453 exec MandatoryUpdates.add(m);454 } 455 } 456 if (exec MandatoryUpdates.size() > 0) {457 ModDownloader m = new ModDownloader(exec MandatoryUpdates,453 execCoreUpdates.add(m); 454 } 455 } 456 if (execCoreUpdates.size() > 0) { 457 ModDownloader m = new ModDownloader(execCoreUpdates, 458 458 new ModDownloaderListener() { 459 459 @Override 460 460 public void updateStatus(ModDownloader source, 461 ModcurrentDownload, State state,461 Package currentDownload, State state, 462 462 int filesDown, int filesTotal, 463 463 int bytesDown, int bytesTotal, … … 476 476 } 477 477 evt.setProgressMessage(bundle 478 .getString(" mandatoryToolsInstall.title"));478 .getString("coreToolsInstall.title")); 479 479 Installer 480 .installTools( ModManager.getInstance().getMandatoryTools());481 } 482 } 483 484 @SuppressWarnings("unused") 485 private void info MandatoryFiles() {486 if (exec MandatoryUpdates.size() > 0) {480 .installTools(PackageManager.getInstance().getCoreTools()); 481 } 482 } 483 484 @SuppressWarnings("unused") 485 private void infoCorePackages() { 486 if (execCoreUpdates.size() > 0) { 487 487 String packages = ""; 488 for ( Mod m : execMandatoryUpdates) {488 for (Package m : execCoreUpdates) { 489 489 packages += String.format("\n - %s (%s)", m.getName(), 490 490 m.getVersion()); 491 491 } 492 492 JOptionPane.showMessageDialog(this, String.format( 493 bundle.getString(" mandatoryFilesUpdated.text"), packages),494 bundle.getString(" mandatoryFilesUpdated.title"),493 bundle.getString("corePackagesUpdated.text"), packages), 494 bundle.getString("corePackagesUpdated.title"), 495 495 JOptionPane.INFORMATION_MESSAGE); 496 496 } … … 499 499 @SuppressWarnings("unused") 500 500 private void install() { 501 TreeSet< Mod> mods = new TreeSet<Mod>();502 mods.addAll( ModManager.getInstance().getMandatoryMods());501 TreeSet<Package> mods = new TreeSet<Package>(); 502 mods.addAll(PackageManager.getInstance().getCoreMods()); 503 503 mods.addAll(tblMods.getSelectedMods()); 504 504 505 installDeps = new TreeSet< Mod>();505 installDeps = new TreeSet<Package>(); 506 506 507 507 installState = EInstallState.CHECKING; 508 508 509 509 while (installState == EInstallState.CHECKING) { 510 TreeSet< Mod> toDownload = new TreeSet<Mod>();511 for ( Modm : mods) {510 TreeSet<Package> toDownload = new TreeSet<Package>(); 511 for (Package m : mods) { 512 512 if (!m.isLocalAvailable()) 513 513 toDownload.add(m); … … 529 529 } 530 530 } 531 HashMap< Mod, HashSet<Mod>> dependencies = ModManager.getInstance()531 HashMap<Package, HashSet<Package>> dependencies = PackageManager.getInstance() 532 532 .checkDependencies(mods); 533 533 if (dependencies.size() > 0) { 534 for (HashSet< Mod> hm : dependencies.values()) {534 for (HashSet<Package> hm : dependencies.values()) { 535 535 installDeps.addAll(hm); 536 for (Mod mDep : hm) {537 if (!mods.contains(mDep))538 mods.add(mDep);539 }540 536 } 541 537 … … 545 541 String depsLocalString = ""; 546 542 String depsDownloadString = ""; 547 for ( Modm : dependencies.keySet()) {548 for ( ModmDep : dependencies.get(m)) {543 for (Package m : dependencies.keySet()) { 544 for (Package mDep : dependencies.get(m)) { 549 545 if (!mods.contains(mDep)) { 550 546 mods.add(mDep); … … 584 580 } 585 581 } else { 586 HashMap< Mod, HashSet<Mod>> incompatibilities = ModManager582 HashMap<Package, HashSet<Package>> incompatibilities = PackageManager 587 583 .getInstance().checkIncompabitilites(mods); 588 584 if (incompatibilities.size() > 0) { … … 590 586 591 587 String incompatString = ""; 592 for ( Modm : incompatibilities.keySet()) {588 for (Package m : incompatibilities.keySet()) { 593 589 if (incompatString.length() > 0) 594 590 incompatString += "\n"; 595 591 incompatString += m.getName() + ": "; 596 592 String confMods = ""; 597 for ( ModmConf : incompatibilities.get(m)) {593 for (Package mConf : incompatibilities.get(m)) { 598 594 if (confMods.length() > 0) 599 595 confMods += ", "; … … 616 612 617 613 if (installState == EInstallState.READY) { 618 installMods = new TreeSet< Mod>();619 TreeSet< Mod> actuallyTools = new TreeSet<Mod>();620 621 for ( Modm : mods) {614 installMods = new TreeSet<Package>(); 615 TreeSet<Package> actuallyTools = new TreeSet<Package>(); 616 617 for (Package m : mods) { 622 618 if (m.isTool()) 623 619 actuallyTools.add(m); … … 652 648 @SuppressWarnings("unused") 653 649 private void installDone() { 654 ModManager.getInstance().updateInstalledMods();650 PackageManager.getInstance().updateInstalledMods(); 655 651 switch (installState) { 656 652 case DONE: … … 660 656 false)) { 661 657 String installedDeps = ""; 662 for ( Modm : installDeps) {658 for (Package m : installDeps) { 663 659 if (installedDeps.length() > 0) 664 660 installedDeps += "\n"; … … 690 686 691 687 @Override 692 public void modSelectionChanged(ModTable source, Modm) {688 public void modSelectionChanged(ModTable source, Package m) { 693 689 lblTitleVal.setText(""); 694 690 lblCreatorVal.setText(""); -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r645 r648 6 6 locationRelativeTo: null 7 7 defaultCloseOperation: doNothingOnClose 8 onWindowOpened: [execDepotUpdate,check MandatoryFiles,infoMandatoryFiles,checkInitialize,initialize,checkUpdates,doUpdate,refreshToolsMenu,focus]8 onWindowOpened: [execDepotUpdate,checkCorePackages,infoCorePackages,checkInitialize,initialize,checkUpdates,doUpdate,refreshToolsMenu,focus] 9 9 onWindowClosing: [saveLocalData,exit] 10 10 iconImage: img.ae … … 21 21 - Action(name=tools, text=menu.manageTools, toolTipText=menu.manageToolsTooltip, icon=img.tools, onAction=[tools,refreshToolsMenu]) 22 22 - Action(name=update, text=menu.update, toolTipText=menu.updateTooltip, icon=img.update, onAction=[checkUpdates,doUpdate]) 23 - Action(name= mandatoryPackages, text=menu.mandatoryPackages, toolTipText=menu.mandatoryPackagesTooltip, icon=img.mandatory, onAction=[showMandatoryPackagesDialog])23 - Action(name=corePackages, text=menu.corePackages, toolTipText=menu.corePackagesTooltip, icon=img.core, onAction=[showCorePackagesDialog]) 24 24 - JMenuBar: 25 25 - JMenu(name=mainMenu, text=menu.main): … … 38 38 - JMenuItem(action=openEditionFolder) 39 39 - JSeparator() 40 - JMenuItem(action= mandatoryPackages)40 - JMenuItem(action=corePackages) 41 41 - JMenuItem(action=reglobalize) 42 42 - JMenu(name=toolsMenu, text=menu.tools): -
AE/installer2/src/net/oni2/aeinstaller/gui/downloadwindow/Downloader.java
r646 r648 11 11 12 12 import net.oni2.aeinstaller.backend.SizeFormatter; 13 import net.oni2.aeinstaller.backend. mods.Mod;14 import net.oni2.aeinstaller.backend. mods.download.ModDownloader;15 import net.oni2.aeinstaller.backend. mods.download.ModDownloader.State;16 import net.oni2.aeinstaller.backend. mods.download.ModDownloaderListener;13 import net.oni2.aeinstaller.backend.packages.Package; 14 import net.oni2.aeinstaller.backend.packages.download.ModDownloader; 15 import net.oni2.aeinstaller.backend.packages.download.ModDownloaderListener; 16 import net.oni2.aeinstaller.backend.packages.download.ModDownloader.State; 17 17 18 18 import org.javabuilders.BuildResult; … … 43 43 44 44 private ModDownloader downloader; 45 private TreeSet< Mod> dependencies = new TreeSet<Mod>();45 private TreeSet<Package> dependencies = new TreeSet<Package>(); 46 46 47 47 /** … … 51 51 * List of mods that only are auto-resolved dependencies 52 52 */ 53 public Downloader(TreeSet< Mod> mods, TreeSet<Mod> dependencies) {53 public Downloader(TreeSet<Package> mods, TreeSet<Package> dependencies) { 54 54 super(); 55 55 … … 92 92 93 93 @Override 94 public void updateStatus(ModDownloader source, ModcurrentDownload,94 public void updateStatus(ModDownloader source, Package currentDownload, 95 95 State state, int filesDown, int filesTotal, int bytesDown, 96 96 int bytesTotal, int duration, int remaining, int speed) { -
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(); -
AE/installer2/src/net/oni2/aeinstaller/gui/toolmanager/ToolManager.java
r646 r648 28 28 import net.oni2.aeinstaller.backend.Settings; 29 29 import net.oni2.aeinstaller.backend.SizeFormatter; 30 import net.oni2.aeinstaller.backend. mods.Mod;31 import net.oni2.aeinstaller.backend. mods.ModManager;30 import net.oni2.aeinstaller.backend.packages.Package; 31 import net.oni2.aeinstaller.backend.packages.PackageManager; 32 32 import net.oni2.aeinstaller.backend.oni.Installer; 33 33 import net.oni2.aeinstaller.gui.HTMLLinkLabel; … … 97 97 98 98 DefaultListModel dlm = new DefaultListModel(); 99 TreeMap<String, Mod> tools = ModManager.getInstance().getTools();99 TreeMap<String, Package> tools = PackageManager.getInstance().getTools(); 100 100 for (String name : tools.keySet()) 101 101 dlm.addElement(tools.get(name)); … … 113 113 private void install() { 114 114 Object o = lstTools.getSelectedValue(); 115 if (o instanceof Mod) {116 Mod theMod = (Mod) o;115 if (o instanceof Package) { 116 Package theMod = (Package) o; 117 117 118 118 if (theMod.isInstalled()) { 119 TreeSet< Mod> tools = new TreeSet<Mod>();119 TreeSet<Package> tools = new TreeSet<Package>(); 120 120 tools.add(theMod); 121 121 Installer.uninstallTools(tools); … … 130 130 } 131 131 132 TreeSet< Mod> toDownload = new TreeSet<Mod>();132 TreeSet<Package> toDownload = new TreeSet<Package>(); 133 133 toDownload.add(theMod); 134 134 … … 143 143 } 144 144 145 TreeSet< Mod> tools = new TreeSet<Mod>();145 TreeSet<Package> tools = new TreeSet<Package>(); 146 146 tools.add(theMod); 147 147 Installer.installTools(tools); … … 164 164 btnInstall.setIcon(icoInstall); 165 165 166 if (lstTools.getSelectedValue() instanceof Mod) {167 Mod m = (Mod) lstTools.getSelectedValue();166 if (lstTools.getSelectedValue() instanceof Package) { 167 Package m = (Package) lstTools.getSelectedValue(); 168 168 lblTitleVal.setText(m.getName()); 169 169 lblCreatorVal.setText(m.getCreator()); -
AE/installer2/src/net/oni2/aeinstaller/localization/MainWin.properties
r646 r648 22 22 menu.saveConfigTooltip=Save current mod selection to a file 23 23 24 menu. mandatoryPackages=&Show mandatorypackages25 menu. mandatoryPackagesTooltip=View which mandatorypackages are used24 menu.corePackages=&Show core packages 25 menu.corePackagesTooltip=View which core packages are used 26 26 menu.reglobalize=&Rebuild Core Data 27 27 menu.reglobalizeTooltip=Rebuild Core Data … … 79 79 initializingEdition.title=Initializing Edition core 80 80 installing.title=Installing mods 81 mandatoryFiles.title=Checking for mandatorypackages82 mandatoryToolsInstall.title=Installing mandatorytools83 mandatoryFilesUpdated.title=Updated mandatorypackages84 mandatoryFilesUpdated.text=The following mandatorypackages have been updated:%s81 checkCorePackages.title=Checking for core packages 82 coreToolsInstall.title=Installing core tools 83 corePackagesUpdated.title=Updated core packages 84 corePackagesUpdated.text=The following core packages have been updated:%s 85 85 86 86 doUpdate.title=Updating packages
Note:
See TracChangeset
for help on using the changeset viewer.