Changeset 871 for java/installer2/src/net/oni2
- Timestamp:
- May 20, 2013, 11:16:34 AM (12 years ago)
- Location:
- java/installer2/src/net/oni2/aeinstaller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/AEInstaller.properties
r870 r871 1 1 appname=AE Installer 2 2 appversion=.1 32 appversion=.14 -
java/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r863 r871 2 2 3 3 import java.awt.BorderLayout; 4 import java.awt.Component; 4 5 import java.awt.Desktop; 5 6 import java.awt.GridLayout; 7 import java.awt.KeyEventDispatcher; 8 import java.awt.KeyboardFocusManager; 6 9 import java.awt.Toolkit; 7 10 import java.awt.datatransfer.Clipboard; … … 91 94 */ 92 95 public class MainWin extends JFrame implements ApplicationListener, 93 ModInstallSelectionListener, ModSelectionListener {96 ModInstallSelectionListener, ModSelectionListener, KeyEventDispatcher { 94 97 private static final long serialVersionUID = -4027395051382659650L; 95 98 … … 180 183 tblMods.addModSelectionListener(this); 181 184 tblMods.addDownloadSizeListener(this); 185 186 KeyboardFocusManager.getCurrentKeyboardFocusManager() 187 .addKeyEventDispatcher(this); 182 188 183 189 setSize(SettingsManager.getInstance().get("win_main_width", 1050), … … 572 578 } 573 579 574 @SuppressWarnings("unused")575 580 private void refreshLocalMods() { 576 581 PackageManager.getInstance().updateLocalData(); … … 1013 1018 } 1014 1019 1020 private boolean componentBelongsToWindow(Component c) { 1021 while (c != null) { 1022 if (c == this) 1023 return true; 1024 c = c.getParent(); 1025 } 1026 return false; 1027 } 1028 1029 @Override 1030 public boolean dispatchKeyEvent(KeyEvent e) { 1031 if (e.getID() == KeyEvent.KEY_PRESSED) { 1032 switch (e.getKeyCode()) { 1033 case KeyEvent.VK_F5: 1034 if (componentBelongsToWindow(e.getComponent())) 1035 refreshLocalMods(); 1036 return true; 1037 } 1038 } 1039 return false; 1040 } 1041 1015 1042 @Override 1016 1043 public void handleAbout(ApplicationEvent event) {
Note:
See TracChangeset
for help on using the changeset viewer.