Changeset 658 for AE/installer2
- Timestamp:
- Jan 29, 2013, 1:34:16 PM (12 years ago)
- Location:
- AE/installer2
- Files:
-
- 5 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/locales/net/oni2/aeinstaller/localization/CorePackagesDialog_de.properties
r651 r658 1 1 frame.title=AE Installer: Kernpakete 2 3 lblDownloadSize.text=Downloadgröße dieses Pakets: -
AE/installer2/locales/net/oni2/aeinstaller/localization/Global_de.properties
r656 r658 10 10 offlineModeStartup.title=Offline-Modus 11 11 offlineModeStartup.text=Es konnte keine Verbindung zum ModDepot hergestellt werden.\nAEI wird im Offline-Modus ausgeführt.\nAktualisierungen oder Downloads sind nicht möglich. 12 13 14 lblTitle.text=Name:15 lblCreator.text=Entwickler:16 lblTypes.text=Typen:17 lblPlatform.text=Plattform:18 lblPackageNumber.text=Paketnummer:19 lblVersionNumber.text=Versionsnummer:20 lblLastChange.text=Letzte Änderung:21 lblFiles.text=Anzahl der Dateien:22 lblDescription.text=Beschreibung: -
AE/installer2/locales/net/oni2/aeinstaller/localization/ToolManager_de.properties
r651 r658 5 5 btnInstall.un.text=Entferne 6 6 btnInstall.un.tooltip=Entferne dieses Tool 7 8 lblDownloadSize.text=Downloadgröße dieses Pakets: -
AE/installer2/src/net/oni2/aeinstaller/backend/packages/PackageManager.java
r648 r658 10 10 import java.util.HashMap; 11 11 import java.util.HashSet; 12 import java.util.TreeMap;13 12 import java.util.TreeSet; 14 13 import java.util.Vector; 15 16 import com.thoughtworks.xstream.XStream;17 import com.thoughtworks.xstream.io.xml.StaxDriver;18 14 19 15 import net.oni2.aeinstaller.backend.Paths; … … 22 18 import net.oni2.aeinstaller.backend.depot.model.TaxonomyTerm; 23 19 import net.oni2.aeinstaller.backend.oni.Installer; 20 21 import com.thoughtworks.xstream.XStream; 22 import com.thoughtworks.xstream.io.xml.StaxDriver; 24 23 25 24 /** … … 217 216 * @return Collection of tools valid on this platform and not core 218 217 */ 219 public TreeMap<String,Package> getTools() {220 TreeMap<String, Package> res = new TreeMap<String,Package>();218 public Collection<Package> getTools() { 219 Vector<Package> res = new Vector<Package>(); 221 220 for (Package m : tools.values()) 222 221 if (m.isValidOnPlatform() && !m.isCorePackage()) 223 res. put(m.getName(),m);222 res.add(m); 224 223 return res; 225 224 } -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r657 r658 4 4 import java.awt.Desktop; 5 5 import java.awt.GridLayout; 6 import java.awt.Insets;7 6 import java.awt.event.ActionEvent; 8 7 import java.awt.event.ItemEvent; … … 32 31 import javax.swing.JPanel; 33 32 import javax.swing.JRadioButton; 33 import javax.swing.JScrollPane; 34 34 import javax.swing.JSplitPane; 35 35 import javax.swing.SwingUtilities; … … 44 44 import net.oni2.aeinstaller.backend.SizeFormatter; 45 45 import net.oni2.aeinstaller.backend.depot.DepotManager; 46 import net.oni2.aeinstaller.backend.oni.InstallProgressListener; 47 import net.oni2.aeinstaller.backend.oni.Installer; 48 import net.oni2.aeinstaller.backend.oni.OniSplit; 46 49 import net.oni2.aeinstaller.backend.packages.Package; 47 50 import net.oni2.aeinstaller.backend.packages.PackageManager; 48 51 import net.oni2.aeinstaller.backend.packages.Type; 49 import net.oni2.aeinstaller.backend.oni.InstallProgressListener;50 import net.oni2.aeinstaller.backend.oni.Installer;51 import net.oni2.aeinstaller.backend.oni.OniSplit;52 52 import net.oni2.aeinstaller.backend.packages.download.ModDownloader; 53 import net.oni2.aeinstaller.backend.packages.download.ModDownloader.State; 53 54 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 56 import net.oni2.aeinstaller.gui.corepackages.CorePackagesDialog; … … 59 59 import net.oni2.aeinstaller.gui.modtable.ModSelectionListener; 60 60 import net.oni2.aeinstaller.gui.modtable.ModTable; 61 import net.oni2.aeinstaller.gui.modtable.ModTable.ETableContentType; 62 import net.oni2.aeinstaller.gui.packageinfobox.PackageInfoBox; 61 63 import net.oni2.aeinstaller.gui.settings.SettingsDialog; 62 64 import net.oni2.aeinstaller.gui.toolmanager.ToolManager; … … 92 94 private JRadioButton radOnline; 93 95 private JRadioButton radLocal; 96 private JScrollPane scrollMods; 94 97 private ModTable tblMods; 95 98 private JLabel lblDownloadSizeVal; 96 99 97 private JLabel lblTitleVal; 98 private JLabel lblCreatorVal; 99 private JLabel lblTypesVal; 100 private JLabel lblPlatformVal; 101 private JLabel lblPackageNumberVal; 102 private JLabel lblVersionNumberVal; 103 private HTMLLinkLabel lblDescriptionVal; 104 100 private PackageInfoBox pkgInfo; 101 105 102 private JButton btnInstall; 106 103 … … 129 126 + SwingJavaBuilder.getConfig().getResource("appversion")); 130 127 131 setSize(getWidth() + 150, getHeight()); 128 tblMods = new ModTable(ETableContentType.MODS); 129 tblMods.setVisible(false); 130 scrollMods.setViewportView(tblMods); 131 132 132 contents.setDividerLocation(550); 133 133 contents.setResizeWeight(0.4); … … 145 145 tblMods.addModSelectionListener(this); 146 146 tblMods.addDownloadSizeListener(this); 147 148 lblDescriptionVal.setMargin(new Insets(-15, 0, 0, 0));149 147 } 150 148 … … 452 450 tblMods.revertSelection(); 453 451 } 454 452 455 453 @SuppressWarnings("unused") 456 454 private void unSelectAll() { … … 705 703 @Override 706 704 public void modSelectionChanged(ModTable source, Package m) { 707 lblTitleVal.setText(""); 708 lblCreatorVal.setText(""); 709 lblDescriptionVal.setText(""); 710 lblTypesVal.setText(""); 711 lblPlatformVal.setText(""); 712 lblPackageNumberVal.setText(""); 713 lblVersionNumberVal.setText(""); 714 if (m != null) { 715 lblTitleVal.setText(m.getName()); 716 lblCreatorVal.setText(m.getCreator()); 717 lblDescriptionVal.setText(m.getDescription()); 718 719 String types = ""; 720 for (Type t : m.getTypes()) { 721 if (types.length() > 0) 722 types += ", "; 723 types += t.getName(); 724 } 725 lblTypesVal.setText(types); 726 lblPlatformVal.setText(m.getPlatform().toString()); 727 lblPackageNumberVal.setText(m.getPackageNumberString()); 728 lblVersionNumberVal.setText(m.getVersion()); 729 } 705 pkgInfo.updateInfo(m); 730 706 } 731 707 -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r657 r658 2 2 name: frame 3 3 title: appname 4 size: 800x6004 size: 950x600 5 5 minimumSize: 400x300 6 6 locationRelativeTo: null … … 57 57 - JRadioButton(name=radLocal, text=radLocal.text, onAction=showTypeSelection) 58 58 - ButtonGroup: [radAll,radOnline,radLocal] 59 - JScrollPane(name=scrollMods, vScrollBar=always, hScrollBar=never): 60 ModTable(name=tblMods, visible=false) 59 - JScrollPane(name=scrollMods, vScrollBar=always, hScrollBar=never) 61 60 - JButton(name=btnUnSelectAll, icon=img.unSelect16, text=btnUnSelectAll.text, onAction=[unSelectAll]) 62 61 - JButton(name=btnRevertSelection, icon=img.undo16, text=btnRevertSelection.text, toolTipText=btnRevertSelection.tooltip, onAction=[revertSelection]) … … 71 70 >btnUnSelectAll,>btnRevertSelection,btnInstall [min] 72 71 lblDownloadSize,lblDownloadSizeVal [min] 73 - JPanel(name=panInfo): 74 - JLabel(name=lblTitle, text=lblTitle.text) 75 - JLabel(name=lblTitleVal) 76 - JLabel(name=lblCreator, text=lblCreator.text) 77 - JLabel(name=lblCreatorVal) 78 - JLabel(name=lblTypes, text=lblTypes.text) 79 - JLabel(name=lblTypesVal) 80 - JLabel(name=lblPlatform, text=lblPlatform.text) 81 - JLabel(name=lblPlatformVal) 82 - JLabel(name=lblPackageNumber, text=lblPackageNumber.text) 83 - JLabel(name=lblPackageNumberVal) 84 - JLabel(name=lblVersionNumber, text=lblVersionNumber.text) 85 - JLabel(name=lblVersionNumberVal) 86 - JLabel(name=lblDescription, text=lblDescription.text) 87 - JScrollPane(name=scrollDescription, vScrollBar=always, hScrollBar=asNeeded): 88 HTMLLinkLabel(name=lblDescriptionVal) 89 - MigLayout: | 90 [min] [grow] 91 >lblTitle lblTitleVal [min] 92 >lblCreator lblCreatorVal [min] 93 >lblTypes lblTypesVal [min] 94 >lblPlatform lblPlatformVal [min] 95 >lblPackageNumber lblPackageNumberVal [min] 96 >lblVersionNumber lblVersionNumberVal [min] 97 >^lblDescription scrollDescription [grow] 72 - PackageInfoBox(name=pkgInfo) 98 73 - MigLayout: 99 74 layoutConstraints: wrap 1 -
AE/installer2/src/net/oni2/aeinstaller/gui/corepackages/CorePackagesDialog.java
r655 r658 1 1 package net.oni2.aeinstaller.gui.corepackages; 2 2 3 import java.awt.Dimension;4 import java.awt.Insets;5 3 import java.awt.event.ActionEvent; 6 4 import java.awt.event.KeyEvent; 7 import java.text.SimpleDateFormat;8 import java.util.Date;9 5 import java.util.ResourceBundle; 10 import java.util.TreeSet;11 6 12 7 import javax.swing.AbstractAction; 13 import javax.swing.DefaultListModel;14 8 import javax.swing.JComponent; 15 9 import javax.swing.JDialog; 16 import javax.swing.JLabel; 17 import javax.swing.JList; 10 import javax.swing.JScrollPane; 18 11 import javax.swing.JSplitPane; 19 12 import javax.swing.KeyStroke; 20 import javax.swing.ListSelectionModel;21 import javax.swing.event.ListSelectionEvent;22 import javax.swing.event.ListSelectionListener;23 13 24 import net.oni2.aeinstaller.backend.SizeFormatter;25 14 import net.oni2.aeinstaller.backend.packages.Package; 26 import net.oni2.aeinstaller.backend.packages.PackageManager; 27 import net.oni2.aeinstaller.backend.packages.Type; 28 import net.oni2.aeinstaller.gui.HTMLLinkLabel; 15 import net.oni2.aeinstaller.gui.modtable.ModSelectionListener; 16 import net.oni2.aeinstaller.gui.modtable.ModTable; 17 import net.oni2.aeinstaller.gui.modtable.ModTable.ETableContentType; 18 import net.oni2.aeinstaller.gui.packageinfobox.PackageInfoBox; 29 19 30 20 import org.javabuilders.BuildResult; … … 34 24 * @author Christian Illy 35 25 */ 36 public class CorePackagesDialog extends JDialog implements 37 ListSelectionListener { 26 public class CorePackagesDialog extends JDialog implements ModSelectionListener { 38 27 private static final long serialVersionUID = -5444213842599816301L; 39 28 … … 46 35 private JSplitPane contents; 47 36 48 private JList lstTools; 37 private JScrollPane scrollTools; 38 private ModTable tblTools; 49 39 50 private JLabel lblTitleVal; 51 private JLabel lblCreatorVal; 52 private JLabel lblTypesVal; 53 private JLabel lblPlatformVal; 54 private JLabel lblPackageNumberVal; 55 private JLabel lblVersionNumberVal; 56 private JLabel lblLastChangeVal; 57 private HTMLLinkLabel lblDescriptionVal; 58 private JLabel lblDownloadSizeVal; 59 60 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 40 private PackageInfoBox pkgInfo; 61 41 62 42 /** … … 64 44 */ 65 45 public CorePackagesDialog() { 66 setMinimumSize(new Dimension(getWidth() + 100, getHeight() + 100));67 68 46 AbstractAction closeAction = new AbstractAction() { 69 47 … … 81 59 getRootPane().getActionMap().put("close", closeAction); 82 60 83 contents.setDividerLocation( 200);61 contents.setDividerLocation(550); 84 62 contents.setResizeWeight(0.4); 85 63 86 lstTools.addListSelectionListener(this); 87 lstTools.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 64 tblTools = new ModTable(ETableContentType.CORE); 65 tblTools.reloadData(); 66 scrollTools.setViewportView(tblTools); 88 67 89 DefaultListModel dlm = new DefaultListModel(); 90 TreeSet<Package> tools = PackageManager.getInstance().getCoreTools(); 91 for (Package m : tools) 92 dlm.addElement(m); 93 TreeSet<Package> mods = PackageManager.getInstance().getCoreMods(); 94 for (Package m : mods) 95 dlm.addElement(m); 96 lstTools.setModel(dlm); 68 tblTools.addModSelectionListener(this); 97 69 98 70 setLocationRelativeTo(null); 99 lblDescriptionVal.setMargin(new Insets(-15, 0, 0, 0));100 71 } 101 72 102 73 @Override 103 public void valueChanged(ListSelectionEvent evt) { 104 lblTitleVal.setText(""); 105 lblCreatorVal.setText(""); 106 lblDescriptionVal.setText(""); 107 lblTypesVal.setText(""); 108 lblPlatformVal.setText(""); 109 lblPackageNumberVal.setText(""); 110 lblVersionNumberVal.setText(""); 111 lblLastChangeVal.setText(""); 112 lblDownloadSizeVal.setText(""); 113 114 if (lstTools.getSelectedValue() instanceof Package) { 115 Package m = (Package) lstTools.getSelectedValue(); 116 lblTitleVal.setText(m.getName()); 117 lblCreatorVal.setText(m.getCreator()); 118 lblDescriptionVal.setText(m.getDescription()); 119 120 String types = ""; 121 for (Type t : m.getTypes()) { 122 if (types.length() > 0) 123 types += ", "; 124 types += t.getName(); 125 } 126 lblTypesVal.setText(types); 127 lblPlatformVal.setText(m.getPlatform().toString()); 128 lblPackageNumberVal.setText(m.getPackageNumberString()); 129 lblVersionNumberVal.setText(m.getVersion()); 130 if (m.getFile() != null) 131 lblLastChangeVal.setText(sdf.format(new Date(m.getFile() 132 .getTimestamp() * 1000))); 133 lblDownloadSizeVal.setText(SizeFormatter.format(m.getZipSize(), 3)); 134 } 74 public void modSelectionChanged(ModTable source, Package mod) { 75 pkgInfo.updateInfo(mod); 135 76 } 136 77 } -
AE/installer2/src/net/oni2/aeinstaller/gui/corepackages/CorePackagesDialog.yml
r648 r658 2 2 name: frame 3 3 title: frame.title 4 size: packed4 size: 900x500 5 5 locationRelativeTo: null 6 6 defaultCloseOperation: disposeOnClose … … 10 10 - JSplitPane(name=contents, orientation=horizontalSplit, continuousLayout=true): 11 11 - JPanel(name=panTools): 12 - JScrollPane(name=scrollTools, vScrollBar=always, hScrollBar=asNeeded): 13 JList(name=lstTools) 12 - JScrollPane(name=scrollTools, vScrollBar=always, hScrollBar=never) 14 13 - MigLayout: | 15 14 [grow] 16 15 scrollTools [grow] 17 - JPanel(name=panInfo): 18 - JLabel(name=lblTitle, text=lblTitle.text) 19 - JLabel(name=lblTitleVal) 20 - JLabel(name=lblCreator, text=lblCreator.text) 21 - JLabel(name=lblCreatorVal) 22 - JLabel(name=lblTypes, text=lblTypes.text) 23 - JLabel(name=lblTypesVal) 24 - JLabel(name=lblPlatform, text=lblPlatform.text) 25 - JLabel(name=lblPlatformVal) 26 - JLabel(name=lblPackageNumber, text=lblPackageNumber.text) 27 - JLabel(name=lblPackageNumberVal) 28 - JLabel(name=lblVersionNumber, text=lblVersionNumber.text) 29 - JLabel(name=lblVersionNumberVal) 30 - JLabel(name=lblLastChange, text=lblLastChange.text) 31 - JLabel(name=lblLastChangeVal) 32 - JLabel(name=lblDescription, text=lblDescription.text) 33 - JScrollPane(name=scrollDescription, vScrollBar=always, hScrollBar=asNeeded): 34 HTMLLinkLabel(name=lblDescriptionVal) 35 - JLabel(name=lblDownloadSize, text=lblDownloadSize.text) 36 - JLabel(name=lblDownloadSizeVal) 37 - MigLayout: | 38 [min] [grow] 39 >lblTitle lblTitleVal [min] 40 >lblCreator lblCreatorVal [min] 41 >lblTypes lblTypesVal [min] 42 >lblPlatform lblPlatformVal [min] 43 >lblPackageNumber lblPackageNumberVal [min] 44 >lblVersionNumber lblVersionNumberVal [min] 45 >lblLastChange lblLastChangeVal [min] 46 >^lblDescription scrollDescription [grow] 47 >lblDownloadSize lblDownloadSizeVal [min] 16 - PackageInfoBox(name=pkgInfo) 48 17 - MigLayout: | 49 18 [grow] -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTable.java
r657 r658 70 70 /** 71 71 * Create a new ModTable 72 */ 73 public ModTable() { 72 * 73 * @param contentType 74 * Content to show 75 */ 76 public ModTable(ETableContentType contentType) { 74 77 super(); 78 79 this.contentType = contentType; 75 80 76 81 setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 81 86 ((JComponent) getDefaultRenderer(Boolean.class)).setOpaque(true); 82 87 83 model = new ModTableModel( );88 model = new ModTableModel(contentType); 84 89 85 90 setModel(model); … … 101 106 for (int i = 0; i < model.getColumnCount(); i++) { 102 107 model.setColumnConstraints(i, getColumnModel().getColumn(i)); 108 } 109 110 if (contentType != ETableContentType.MODS) { 111 getColumnModel().removeColumn(getColumnModel().getColumn(0)); 103 112 } 104 113 } -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r657 r658 14 14 import net.oni2.aeinstaller.backend.packages.Package; 15 15 import net.oni2.aeinstaller.backend.packages.PackageManager; 16 import net.oni2.aeinstaller.gui.modtable.ModTable.ETableContentType; 16 17 17 18 /** … … 32 33 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 33 34 35 private ETableContentType contentType = ETableContentType.MODS; 36 34 37 /** 35 38 * Create a new model 36 */ 37 public ModTableModel() { 39 * 40 * @param contentType 41 * Content type to show 42 */ 43 public ModTableModel(ETableContentType contentType) { 44 this.contentType = contentType; 38 45 } 39 46 … … 182 189 public void reloadData() { 183 190 items.clear(); 184 items.addAll(PackageManager.getInstance().getModsValidAndNotCore()); 191 switch (contentType) { 192 case MODS: 193 items.addAll(PackageManager.getInstance() 194 .getModsValidAndNotCore()); 195 break; 196 case TOOLS: 197 items.addAll(PackageManager.getInstance().getTools()); 198 break; 199 case CORE: 200 items.addAll(PackageManager.getInstance().getCoreTools()); 201 items.addAll(PackageManager.getInstance().getCoreMods()); 202 break; 203 } 185 204 revertSelection(); 186 205 } … … 205 224 */ 206 225 public void reloadSelection(File config) { 207 Vector<Integer> selected = PackageManager.getInstance() 208 .loadModSelection(config); 209 install.clear(); 210 for (int i = 0; i < items.size(); i++) { 211 install.add(i, selected.contains(items.get(i).getPackageNumber())); 212 } 213 fireTableDataChanged(); 226 if (contentType == ETableContentType.MODS) { 227 Vector<Integer> selected = PackageManager.getInstance() 228 .loadModSelection(config); 229 install.clear(); 230 for (int i = 0; i < items.size(); i++) { 231 install.add(i, 232 selected.contains(items.get(i).getPackageNumber())); 233 } 234 fireTableDataChanged(); 235 } 214 236 } 215 237 -
AE/installer2/src/net/oni2/aeinstaller/gui/toolmanager/ToolManager.java
r655 r658 1 1 package net.oni2.aeinstaller.gui.toolmanager; 2 2 3 import java.awt.Dimension;4 import java.awt.Insets;5 3 import java.awt.event.ActionEvent; 6 4 import java.awt.event.KeyEvent; 7 import java.text.SimpleDateFormat;8 import java.util.Date;9 5 import java.util.ResourceBundle; 10 import java.util.TreeMap;11 6 import java.util.TreeSet; 12 7 13 8 import javax.swing.AbstractAction; 14 import javax.swing.DefaultListModel;15 9 import javax.swing.Icon; 16 10 import javax.swing.ImageIcon; … … 18 12 import javax.swing.JComponent; 19 13 import javax.swing.JDialog; 20 import javax.swing.JLabel;21 import javax.swing.JList;22 14 import javax.swing.JOptionPane; 15 import javax.swing.JScrollPane; 23 16 import javax.swing.JSplitPane; 24 17 import javax.swing.KeyStroke; 25 import javax.swing.ListSelectionModel;26 import javax.swing.event.ListSelectionEvent;27 import javax.swing.event.ListSelectionListener;28 18 29 19 import net.oni2.aeinstaller.backend.Settings; 30 import net.oni2.aeinstaller.backend. SizeFormatter;20 import net.oni2.aeinstaller.backend.oni.Installer; 31 21 import net.oni2.aeinstaller.backend.packages.Package; 32 import net.oni2.aeinstaller.backend.packages.PackageManager;33 import net.oni2.aeinstaller.backend.oni.Installer;34 import net.oni2.aeinstaller.gui.HTMLLinkLabel;35 22 import net.oni2.aeinstaller.gui.downloadwindow.Downloader; 23 import net.oni2.aeinstaller.gui.modtable.ModSelectionListener; 24 import net.oni2.aeinstaller.gui.modtable.ModTable; 25 import net.oni2.aeinstaller.gui.modtable.ModTable.ETableContentType; 26 import net.oni2.aeinstaller.gui.packageinfobox.PackageInfoBox; 36 27 37 28 import org.javabuilders.BuildResult; … … 41 32 * @author Christian Illy 42 33 */ 43 public class ToolManager extends JDialog implements ListSelectionListener {34 public class ToolManager extends JDialog implements ModSelectionListener { 44 35 private static final long serialVersionUID = 343221630538866384L; 45 36 … … 52 43 private JSplitPane contents; 53 44 54 private JList lstTools; 45 private JScrollPane scrollTools; 46 private ModTable tblTools; 55 47 56 private JLabel lblTitleVal; 57 private JLabel lblCreatorVal; 58 private JLabel lblPlatformVal; 59 private JLabel lblPackageNumberVal; 60 private JLabel lblVersionNumberVal; 61 private JLabel lblLastChangeVal; 62 private HTMLLinkLabel lblDescriptionVal; 63 private JLabel lblDownloadSizeVal; 64 48 private PackageInfoBox pkgInfo; 65 49 private JButton btnInstall; 66 50 … … 68 52 private Icon icoUninstall = null; 69 53 70 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");54 private Package selectedPackage = null; 71 55 72 56 /** … … 74 58 */ 75 59 public ToolManager() { 76 setMinimumSize(new Dimension(getWidth() + 100, getHeight() + 100));77 78 60 AbstractAction closeAction = new AbstractAction() { 79 61 … … 91 73 getRootPane().getActionMap().put("close", closeAction); 92 74 93 contents.setDividerLocation( 200);75 contents.setDividerLocation(550); 94 76 contents.setResizeWeight(0.4); 95 77 96 lstTools.addListSelectionListener(this); 97 lstTools.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 78 tblTools = new ModTable(ETableContentType.TOOLS); 79 tblTools.reloadData(); 80 scrollTools.setViewportView(tblTools); 98 81 99 DefaultListModel dlm = new DefaultListModel(); 100 TreeMap<String, Package> tools = PackageManager.getInstance().getTools(); 101 for (String name : tools.keySet()) 102 dlm.addElement(tools.get(name)); 103 lstTools.setModel(dlm); 82 tblTools.addModSelectionListener(this); 104 83 105 84 icoInstall = new ImageIcon(getClass().getResource( … … 109 88 110 89 setLocationRelativeTo(null); 111 lblDescriptionVal.setMargin(new Insets(-15, 0, 0, 0));112 90 } 113 91 114 92 @SuppressWarnings("unused") 115 93 private void install() { 116 Object o = lstTools.getSelectedValue(); 117 if (o instanceof Package) { 118 Package theMod = (Package) o; 119 120 if (theMod.isInstalled()) { 94 if (selectedPackage != null) { 95 if (selectedPackage.isInstalled()) { 121 96 TreeSet<Package> tools = new TreeSet<Package>(); 122 tools.add( theMod);97 tools.add(selectedPackage); 123 98 Installer.uninstallTools(tools); 124 99 } else { 125 if (! theMod.isLocalAvailable()) {100 if (!selectedPackage.isLocalAvailable()) { 126 101 if (Settings.getInstance().isOfflineMode()) { 127 102 JOptionPane.showMessageDialog(this, … … 133 108 134 109 TreeSet<Package> toDownload = new TreeSet<Package>(); 135 toDownload.add( theMod);110 toDownload.add(selectedPackage); 136 111 137 112 Downloader dl = new Downloader(toDownload, null); … … 146 121 147 122 TreeSet<Package> tools = new TreeSet<Package>(); 148 tools.add( theMod);123 tools.add(selectedPackage); 149 124 Installer.installTools(tools); 150 125 } 151 126 } 152 valueChanged(null);127 modSelectionChanged(tblTools, selectedPackage); 153 128 } 154 129 155 130 @Override 156 public void valueChanged(ListSelectionEvent evt) { 157 lblTitleVal.setText(""); 158 lblCreatorVal.setText(""); 159 lblDescriptionVal.setText(""); 160 lblPlatformVal.setText(""); 161 lblPackageNumberVal.setText(""); 162 lblVersionNumberVal.setText(""); 163 lblLastChangeVal.setText(""); 164 lblDownloadSizeVal.setText(""); 165 btnInstall.setEnabled(false); 166 btnInstall.setIcon(icoInstall); 131 public void modSelectionChanged(ModTable source, Package mod) { 132 selectedPackage = mod; 167 133 168 if (lstTools.getSelectedValue() instanceof Package) { 169 Package m = (Package) lstTools.getSelectedValue(); 170 lblTitleVal.setText(m.getName()); 171 lblCreatorVal.setText(m.getCreator()); 172 lblDescriptionVal.setText(m.getDescription()); 173 lblPlatformVal.setText(m.getPlatform().toString()); 174 lblPackageNumberVal.setText(m.getPackageNumberString()); 175 lblVersionNumberVal.setText(m.getVersion()); 176 if (m.getFile() != null) 177 lblLastChangeVal.setText(sdf.format(new Date(m.getFile() 178 .getTimestamp() * 1000))); 179 lblDownloadSizeVal.setText(SizeFormatter.format(m.getZipSize(), 3)); 134 pkgInfo.updateInfo(mod); 135 if (mod != null) { 180 136 btnInstall.setEnabled(true); 181 if (m .isInstalled()) {137 if (mod.isInstalled()) { 182 138 btnInstall.setText(bundle.getString("btnInstall.un.text")); 183 139 btnInstall.setToolTipText(bundle … … 188 144 btnInstall.setToolTipText(bundle 189 145 .getString("btnInstall.tooltip")); 146 btnInstall.setIcon(icoInstall); 190 147 } 191 148 } -
AE/installer2/src/net/oni2/aeinstaller/gui/toolmanager/ToolManager.yml
r646 r658 2 2 name: frame 3 3 title: frame.title 4 size: packed4 size: 950x600 5 5 locationRelativeTo: null 6 6 defaultCloseOperation: disposeOnClose … … 10 10 - JSplitPane(name=contents, orientation=horizontalSplit, continuousLayout=true): 11 11 - JPanel(name=panTools): 12 - JScrollPane(name=scrollTools, vScrollBar=always, hScrollBar=asNeeded): 13 JList(name=lstTools) 12 - JScrollPane(name=scrollTools, vScrollBar=always, hScrollBar=never) 14 13 - MigLayout: | 15 14 [grow] 16 15 scrollTools [grow] 17 16 - JPanel(name=panInfo): 18 - JLabel(name=lblTitle, text=lblTitle.text) 19 - JLabel(name=lblTitleVal) 20 - JLabel(name=lblCreator, text=lblCreator.text) 21 - JLabel(name=lblCreatorVal) 22 - JLabel(name=lblPlatform, text=lblPlatform.text) 23 - JLabel(name=lblPlatformVal) 24 - JLabel(name=lblPackageNumber, text=lblPackageNumber.text) 25 - JLabel(name=lblPackageNumberVal) 26 - JLabel(name=lblVersionNumber, text=lblVersionNumber.text) 27 - JLabel(name=lblVersionNumberVal) 28 - JLabel(name=lblLastChange, text=lblLastChange.text) 29 - JLabel(name=lblLastChangeVal) 30 - JLabel(name=lblDescription, text=lblDescription.text) 31 - JScrollPane(name=scrollDescription, vScrollBar=always, hScrollBar=asNeeded): 32 HTMLLinkLabel(name=lblDescriptionVal) 33 - JLabel(name=lblDownloadSize, text=lblDownloadSize.text) 34 - JLabel(name=lblDownloadSizeVal) 17 - PackageInfoBox(name=pkgInfo) 35 18 - JButton(name=btnInstall, icon=img.install, text=btnInstall.text, toolTipText=btnInstall.tooltip, enabled=false, onAction=[install]) 36 19 - MigLayout: | 37 [min] [grow] 38 >lblTitle lblTitleVal [min] 39 >lblCreator lblCreatorVal [min] 40 >lblPlatform lblPlatformVal [min] 41 >lblPackageNumber lblPackageNumberVal [min] 42 >lblVersionNumber lblVersionNumberVal [min] 43 >lblLastChange lblLastChangeVal [min] 44 >^lblDescription scrollDescription [grow] 45 >lblDownloadSize lblDownloadSizeVal [min] 46 >btnInstall+*< [min] 20 [grow] 21 pkgInfo [grow] 22 >btnInstall< [min] 47 23 - MigLayout: | 48 24 [grow] -
AE/installer2/src/net/oni2/aeinstaller/localization/CorePackagesDialog.properties
r651 r658 1 1 frame.title=AE Installer: Core packages 2 3 lblDownloadSize.text=Download size of this package: -
AE/installer2/src/net/oni2/aeinstaller/localization/Global.properties
r656 r658 10 10 offlineModeStartup.title=Offline mode 11 11 offlineModeStartup.text=Connection to the ModDepot could not be established.\nAEI will run in offline mode.\nUpdates or installation of mods not already downloaded will not be possible. 12 13 14 lblTitle.text=Name:15 lblCreator.text=Creator:16 lblTypes.text=Types:17 lblPlatform.text=Platform:18 lblPackageNumber.text=Package number:19 lblVersionNumber.text=Version number:20 lblFiles.text=Number of files:21 lblLastChange.text=Last change:22 lblDescription.text=Description: -
AE/installer2/src/net/oni2/aeinstaller/localization/ToolManager.properties
r651 r658 5 5 btnInstall.un.text=Uninstall 6 6 btnInstall.un.tooltip=Uninstall this tool 7 8 lblDownloadSize.text=Download size of this package:
Note:
See TracChangeset
for help on using the changeset viewer.