drawing-area: fix so that keyboard zoom works even when a button has focus

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@767 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-07-21 15:35:01 +00:00
parent 6851224c10
commit 060fdc4b94

View file

@ -182,9 +182,10 @@ public class MainWindow extends JFrame
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
setLocationRelativeTo(null);
getRootPane().getInputMap().put(KeyStroke.getKeyStroke("ADD"), "zoomIn");
getRootPane().getInputMap().put(KeyStroke.getKeyStroke("shift EQUALS"), "zoomIn");
getRootPane().getInputMap().put(KeyStroke.getKeyStroke("MINUS"), "zoomOut");
InputMap inputMap = getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(KeyStroke.getKeyStroke("ADD"), "zoomIn");
inputMap.put(KeyStroke.getKeyStroke("shift EQUALS"), "zoomIn");
inputMap.put(KeyStroke.getKeyStroke("MINUS"), "zoomOut");
getRootPane().getActionMap().put("zoomIn", new AbstractAction() {
public void actionPerformed(ActionEvent evt) {