Changeset 593 for AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
- Timestamp:
- Dec 31, 2012, 2:48:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r592 r593 10 10 11 11 import javax.swing.JComboBox; 12 import javax.swing.JComponent; 12 13 import javax.swing.JFrame; 13 14 import javax.swing.JLabel; 15 import javax.swing.JMenu; 16 import javax.swing.JOptionPane; 14 17 import javax.swing.JSplitPane; 15 18 import javax.swing.JTable; … … 23 26 24 27 import net.oni2.aeinstaller.backend.Settings; 28 import net.oni2.aeinstaller.backend.Settings.Platform; 25 29 import net.oni2.aeinstaller.backend.depot.DepotCacheUpdateProgressListener; 26 30 import net.oni2.aeinstaller.backend.depot.DepotConfig; … … 29 33 import net.oni2.aeinstaller.backend.depot.model.TaxonomyTerm; 30 34 import net.oni2.aeinstaller.backend.depot.model.TaxonomyVocabulary; 35 import net.oni2.aeinstaller.gui.about.AboutDialog; 31 36 import net.oni2.aeinstaller.gui.modtable.ModTableFilter; 32 37 import net.oni2.aeinstaller.gui.modtable.ModTableModel; … … 37 42 import org.javabuilders.event.BackgroundEvent; 38 43 import org.javabuilders.swing.SwingJavaBuilder; 44 import org.simplericity.macify.eawt.ApplicationEvent; 45 import org.simplericity.macify.eawt.ApplicationListener; 39 46 40 47 /** 41 48 * @author Christian Illy 42 49 */ 43 public class MainWin extends JFrame {50 public class MainWin extends JFrame implements ApplicationListener { 44 51 private static final long serialVersionUID = -4027395051382659650L; 45 52 … … 48 55 @SuppressWarnings("unused") 49 56 private BuildResult result = SwingJavaBuilder.build(this, bundle); 57 58 private JMenu mainMenu; 50 59 51 60 private JSplitPane contents; … … 66 75 */ 67 76 public MainWin() { 68 this.setTitle(bundle.getString("frame.title") + " - v" 69 + bundle.getString("version")); 77 this.setTitle(SwingJavaBuilder.getConfig().getResource("appname") 78 + " - v" 79 + SwingJavaBuilder.getConfig().getResource("appversion")); 70 80 71 81 contents.setDividerLocation(400); 72 82 initTable(); 73 83 initModTypeBox(); 84 85 if (Settings.getPlatform() == Platform.MACOS) { 86 mainMenu.setVisible(false); 87 } 74 88 } 75 89 … … 115 129 }); 116 130 131 // To get checkbox-cells with background of row 132 ((JComponent) tblMods.getDefaultRenderer(Boolean.class)) 133 .setOpaque(true); 134 117 135 model = new ModTableModel(); 118 136 … … 148 166 } 149 167 150 @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 151 176 private boolean closeFrames() { 152 177 System.gc(); … … 158 183 } 159 184 160 @SuppressWarnings("unused")161 185 private void exit() { 162 186 setVisible(false); … … 164 188 } 165 189 166 @SuppressWarnings("unused")167 190 private void saveLocalData() { 168 191 Settings.getInstance().serializeToFile(); … … 213 236 } 214 237 215 @SuppressWarnings("unused")216 238 private void showSettings() { 217 SettingsDialog.openWindow(); 218 } 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 219 275 220 276 private void modSelection(NodeMod n) { … … 243 299 sorter.setRowFilter(new ModTableFilter(-1)); 244 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 } 245 340 }
Note:
See TracChangeset
for help on using the changeset viewer.