+
+ /**
+ * Replace Cmd-F Find action with our version. This is necessary because the
+ * 'default' Finder searches in the first AlignFrame it finds. We need it to
+ * search in the half of the SplitFrame that has the mouse.
+ */
+ protected void overrideFind()
+ {
+ /*
+ * Ctrl-F / Cmd-F open Finder dialog, 'focused' on the right alignment
+ */
+ KeyStroke key_cmdF = KeyStroke.getKeyStroke(KeyEvent.VK_F, Toolkit
+ .getDefaultToolkit().getMenuShortcutKeyMask(), false);
+ AbstractAction action = new AbstractAction()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ Component c = getFrameAtMouse();
+ if (c != null && c instanceof AlignFrame)
+ {
+ AlignFrame af = (AlignFrame) c;
+ new Finder(af.viewport, af.alignPanel);
+ }
+ }
+ };
+ overrideKeyBinding(key_cmdF, action);
+ }