| 9 |  | import java.util.TreeMap; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 |  | import javax.swing.JComboBox; | 
 
 
 
 
 
 
 
 | 12 | + | import javax.swing.JComponent; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 13 |  | import javax.swing.JFrame; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 14 |  | import javax.swing.JLabel; | 
 
 
 
 
 
 
 
 | 15 | + | import javax.swing.JMenu; | 
 
 
 
 
 
 
 
 | 16 | + | import javax.swing.JOptionPane; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 17 |  | import javax.swing.JSplitPane; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 18 |  | import javax.swing.JTable; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 19 |  | import javax.swing.ListSelectionModel; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 25 |  | import javax.swing.table.TableRowSorter; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 26 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 27 |  | import net.oni2.aeinstaller.backend.Settings; | 
 
 
 
 
 
 
 
 | 28 | + | import net.oni2.aeinstaller.backend.Settings.Platform; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 29 |  | import net.oni2.aeinstaller.backend.depot.DepotCacheUpdateProgressListener; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 30 |  | import net.oni2.aeinstaller.backend.depot.DepotConfig; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 31 |  | import net.oni2.aeinstaller.backend.depot.DepotManager; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 32 |  | import net.oni2.aeinstaller.backend.depot.model.NodeMod; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 33 |  | import net.oni2.aeinstaller.backend.depot.model.TaxonomyTerm; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 34 |  | import net.oni2.aeinstaller.backend.depot.model.TaxonomyVocabulary; | 
 
 
 
 
 
 
 
 | 35 | + | import net.oni2.aeinstaller.gui.about.AboutDialog; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 36 |  | import net.oni2.aeinstaller.gui.modtable.ModTableFilter; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 37 |  | import net.oni2.aeinstaller.gui.modtable.ModTableModel; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 |  | import net.oni2.aeinstaller.gui.settings.SettingsDialog; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 41 |  | import org.javabuilders.annotations.DoInBackground; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 42 |  | import org.javabuilders.event.BackgroundEvent; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 43 |  | import org.javabuilders.swing.SwingJavaBuilder; | 
 
 
 
 
 
 
 
 | 44 | + | import org.simplericity.macify.eawt.ApplicationEvent; | 
 
 
 
 
 
 
 
 | 45 | + | import org.simplericity.macify.eawt.ApplicationListener; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 |  | /** | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 48 |  | * @author Christian Illy | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 |  | */ | 
 
 
 
 
 
 
 
 
 
 
 | 50 | < | public class MainWin extends JFrame { | 
 
 
 
 
 
 
 
 
 | 50 | > | public class MainWin extends JFrame implements ApplicationListener { | 
 
 
 
 
 
 
 
 
 
 
 | 51 |  | private static final long serialVersionUID = -4027395051382659650L; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 52 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 53 |  | private ResourceBundle bundle = ResourceBundle.getBundle(getClass() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 55 |  | @SuppressWarnings("unused") | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 56 |  | private BuildResult result = SwingJavaBuilder.build(this, bundle); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 57 |  |  | 
 
 
 
 
 
 
 
 | 58 | + | private JMenu mainMenu; | 
 
 
 
 
 
 
 
 | 59 | + |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 60 |  | private JSplitPane contents; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 61 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 62 |  | private JComboBox cmbModTypes; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 |  | * Constructor of main window. | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 |  | */ | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 76 |  | public MainWin() { | 
 
 
 
 
 
 
 
 
 
 
 | 77 | < | this.setTitle(bundle.getString("frame.title") + " - v" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 78 | < | + bundle.getString("version")); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 77 | > | this.setTitle(SwingJavaBuilder.getConfig().getResource("appname") | 
 
 
 
 
 | 78 | > | + " - v" | 
 
 
 
 
 | 79 | > | + SwingJavaBuilder.getConfig().getResource("appversion")); | 
 
 
 
 
 
 
 
 
 
 
 | 80 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 81 |  | contents.setDividerLocation(400); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 82 |  | initTable(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 83 |  | initModTypeBox(); | 
 
 
 
 
 
 
 
 | 84 | + |  | 
 
 
 
 
 
 
 
 | 85 | + | if (Settings.getPlatform() == Platform.MACOS) { | 
 
 
 
 
 
 
 
 | 86 | + | mainMenu.setVisible(false); | 
 
 
 
 
 
 
 
 | 87 | + | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 88 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 89 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 90 |  | private void initModTypeBox() { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 128 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 129 |  | }); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 130 |  |  | 
 
 
 
 
 
 
 
 | 131 | + | // To get checkbox-cells with background of row | 
 
 
 
 
 
 
 
 | 132 | + | ((JComponent) tblMods.getDefaultRenderer(Boolean.class)) | 
 
 
 
 
 
 
 
 | 133 | + | .setOpaque(true); | 
 
 
 
 
 
 
 
 | 134 | + |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 135 |  | model = new ModTableModel(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 136 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 137 |  | tblMods.setModel(model); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 165 |  | // } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 166 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 167 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 168 | < | @SuppressWarnings("unused") | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 168 | > | private boolean askClose() { | 
 
 
 
 
 | 169 | > | int res = JOptionPane.showConfirmDialog(this, | 
 
 
 
 
 | 170 | > | bundle.getString("askClose.text"), | 
 
 
 
 
 | 171 | > | bundle.getString("askClose.title"), JOptionPane.YES_NO_OPTION, | 
 
 
 
 
 | 172 | > | JOptionPane.QUESTION_MESSAGE); | 
 
 
 
 
 | 173 | > | return res == JOptionPane.YES_OPTION; | 
 
 
 
 
 | 174 | > | } | 
 
 
 
 
 | 175 | > |  | 
 
 
 
 
 
 
 
 
 
 
 | 176 |  | private boolean closeFrames() { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 177 |  | System.gc(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 178 |  | for (Frame f : Frame.getFrames()) { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 182 |  | return true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 183 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 184 |  |  | 
 
 
 
 
 
 
 
 
 | 160 | – | @SuppressWarnings("unused") | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 185 |  | private void exit() { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 186 |  | setVisible(false); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 187 |  | dispose(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 188 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 189 |  |  | 
 
 
 
 
 
 
 
 
 | 166 | – | @SuppressWarnings("unused") | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 190 |  | private void saveLocalData() { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 191 |  | Settings.getInstance().serializeToFile(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 192 |  | DepotManager.getInstance().saveToFile( | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 235 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 236 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 237 |  |  | 
 
 
 
 
 
 
 
 
 | 215 | – | @SuppressWarnings("unused") | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 238 |  | private void showSettings() { | 
 
 
 
 
 
 
 
 
 
 
 | 239 | < | SettingsDialog.openWindow(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 239 | > | new SettingsDialog().setVisible(true); | 
 
 
 
 
 | 240 | > | } | 
 
 
 
 
 | 241 | > |  | 
 
 
 
 
 | 242 | > | private void showAbout() { | 
 
 
 
 
 | 243 | > | new AboutDialog().setVisible(true); | 
 
 
 
 
 | 244 | > | } | 
 
 
 
 
 | 245 | > |  | 
 
 
 
 
 | 246 | > | @SuppressWarnings("unused") | 
 
 
 
 
 | 247 | > | private void loadConfig() { | 
 
 
 
 
 | 248 | > | // TODO Auto-generated method stub | 
 
 
 
 
 | 249 | > | JOptionPane.showMessageDialog(this, "loadConfig", "todo", | 
 
 
 
 
 | 250 | > | JOptionPane.INFORMATION_MESSAGE); | 
 
 
 
 
 | 251 | > | } | 
 
 
 
 
 | 252 | > |  | 
 
 
 
 
 | 253 | > | @SuppressWarnings("unused") | 
 
 
 
 
 | 254 | > | private void saveConfig() { | 
 
 
 
 
 | 255 | > | // TODO Auto-generated method stub | 
 
 
 
 
 | 256 | > | JOptionPane.showMessageDialog(this, "saveConfig", "todo", | 
 
 
 
 
 | 257 | > | JOptionPane.INFORMATION_MESSAGE); | 
 
 
 
 
 | 258 | > | } | 
 
 
 
 
 | 259 | > |  | 
 
 
 
 
 | 260 | > | @SuppressWarnings("unused") | 
 
 
 
 
 | 261 | > | private void reglobalize() { | 
 
 
 
 
 | 262 | > | // TODO Auto-generated method stub | 
 
 
 
 
 | 263 | > | JOptionPane.showMessageDialog(this, "reglobalize", "todo", | 
 
 
 
 
 | 264 | > | JOptionPane.INFORMATION_MESSAGE); | 
 
 
 
 
 
 
 
 
 
 
 | 265 |  | } | 
 
 
 
 
 
 
 
 | 266 | + |  | 
 
 
 
 
 
 
 
 | 267 | + | @SuppressWarnings("unused") | 
 
 
 
 
 
 
 
 | 268 | + | private void revertSelection() { | 
 
 
 
 
 
 
 
 | 269 | + | // TODO Auto-generated method stub | 
 
 
 
 
 
 
 
 | 270 | + | JOptionPane.showMessageDialog(this, "revertSelection", "todo", | 
 
 
 
 
 
 
 
 | 271 | + | JOptionPane.INFORMATION_MESSAGE); | 
 
 
 
 
 
 
 
 | 272 | + | } | 
 
 
 
 
 
 
 
 | 273 | + |  | 
 
 
 
 
 
 
 
 | 274 | + |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 275 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 276 |  | private void modSelection(NodeMod n) { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 277 |  | lblSubmitterVal.setText(""); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 298 |  | else | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 299 |  | sorter.setRowFilter(new ModTableFilter(-1)); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 300 |  | } | 
 
 
 
 
 
 
 
 | 301 | + |  | 
 
 
 
 
 
 
 
 | 302 | + | @Override | 
 
 
 
 
 
 
 
 | 303 | + | public void handleAbout(ApplicationEvent event) { | 
 
 
 
 
 
 
 
 | 304 | + | event.setHandled(true); | 
 
 
 
 
 
 
 
 | 305 | + | showAbout(); | 
 
 
 
 
 
 
 
 | 306 | + | } | 
 
 
 
 
 
 
 
 | 307 | + |  | 
 
 
 
 
 
 
 
 | 308 | + | @Override | 
 
 
 
 
 
 
 
 | 309 | + | public void handleOpenApplication(ApplicationEvent event) { | 
 
 
 
 
 
 
 
 | 310 | + | } | 
 
 
 
 
 
 
 
 | 311 | + |  | 
 
 
 
 
 
 
 
 | 312 | + | @Override | 
 
 
 
 
 
 
 
 | 313 | + | public void handleOpenFile(ApplicationEvent event) { | 
 
 
 
 
 
 
 
 | 314 | + | } | 
 
 
 
 
 
 
 
 | 315 | + |  | 
 
 
 
 
 
 
 
 | 316 | + | @Override | 
 
 
 
 
 
 
 
 | 317 | + | public void handlePreferences(ApplicationEvent event) { | 
 
 
 
 
 
 
 
 | 318 | + | showSettings(); | 
 
 
 
 
 
 
 
 | 319 | + | } | 
 
 
 
 
 
 
 
 | 320 | + |  | 
 
 
 
 
 
 
 
 | 321 | + | @Override | 
 
 
 
 
 
 
 
 | 322 | + | public void handlePrintFile(ApplicationEvent event) { | 
 
 
 
 
 
 
 
 | 323 | + | } | 
 
 
 
 
 
 
 
 | 324 | + |  | 
 
 
 
 
 
 
 
 | 325 | + | @Override | 
 
 
 
 
 
 
 
 | 326 | + | public void handleQuit(ApplicationEvent event) { | 
 
 
 
 
 
 
 
 | 327 | + | if (askClose()) { | 
 
 
 
 
 
 
 
 | 328 | + | event.setHandled(true); | 
 
 
 
 
 
 
 
 | 329 | + | closeFrames(); | 
 
 
 
 
 
 
 
 | 330 | + | saveLocalData(); | 
 
 
 
 
 
 
 
 | 331 | + | exit(); | 
 
 
 
 
 
 
 
 | 332 | + | } else { | 
 
 
 
 
 
 
 
 | 333 | + | event.setHandled(false); | 
 
 
 
 
 
 
 
 | 334 | + | } | 
 
 
 
 
 
 
 
 | 335 | + | } | 
 
 
 
 
 
 
 
 | 336 | + |  | 
 
 
 
 
 
 
 
 | 337 | + | @Override | 
 
 
 
 
 
 
 
 | 338 | + | public void handleReOpenApplication(ApplicationEvent event) { | 
 
 
 
 
 
 
 
 | 339 | + | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 340 |  | } |