|
@@ -10,6 +10,10 @@ import java.awt.Point;
|
|
|
import java.awt.Toolkit;
|
|
|
import java.awt.event.ActionEvent;
|
|
|
import java.awt.event.ActionListener;
|
|
|
+import java.awt.event.InputEvent;
|
|
|
+import java.awt.event.KeyAdapter;
|
|
|
+import java.awt.event.KeyEvent;
|
|
|
+import java.awt.event.KeyListener;
|
|
|
import java.awt.event.MouseAdapter;
|
|
|
import java.awt.event.MouseEvent;
|
|
|
import java.beans.PropertyChangeEvent;
|
|
@@ -18,12 +22,16 @@ import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
+import javax.swing.AbstractAction;
|
|
|
+import javax.swing.ActionMap;
|
|
|
import javax.swing.BoxLayout;
|
|
|
import javax.swing.DefaultComboBoxModel;
|
|
|
import javax.swing.ImageIcon;
|
|
|
+import javax.swing.InputMap;
|
|
|
import javax.swing.JButton;
|
|
|
import javax.swing.JCheckBoxMenuItem;
|
|
|
import javax.swing.JComboBox;
|
|
|
+import javax.swing.JComponent;
|
|
|
import javax.swing.JEditorPane;
|
|
|
import javax.swing.JFileChooser;
|
|
|
import javax.swing.JFrame;
|
|
@@ -42,6 +50,7 @@ import javax.swing.JTable;
|
|
|
import javax.swing.JTextField;
|
|
|
import javax.swing.JToolBar;
|
|
|
import javax.swing.JTree;
|
|
|
+import javax.swing.KeyStroke;
|
|
|
import javax.swing.SwingUtilities;
|
|
|
import javax.swing.border.LineBorder;
|
|
|
import javax.swing.event.ChangeEvent;
|
|
@@ -230,6 +239,24 @@ public class GUI<E> implements CategoryListener {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ JPanel contentPane = (JPanel) frmCyberPhysical.getContentPane();
|
|
|
+
|
|
|
+ int condition = JComponent.WHEN_IN_FOCUSED_WINDOW;
|
|
|
+ InputMap inputMap = contentPane.getInputMap(condition);
|
|
|
+ ActionMap actionMap = contentPane.getActionMap();
|
|
|
+
|
|
|
+ String zDown = "z";
|
|
|
+ inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_Z, 0), zDown);
|
|
|
+ actionMap.put(zDown, new AbstractAction() {
|
|
|
+ @Override
|
|
|
+ public void actionPerformed(ActionEvent arg0) {
|
|
|
+ System.out.println("z");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
frmCyberPhysical.setJMenuBar(menuBar);
|
|
|
|
|
|
frmCyberPhysical.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
|