From: gmungoc Date: Mon, 14 Dec 2020 02:43:46 +0000 (+0000) Subject: JAL-3117 bring alignment to foreground on click on Overview X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=22bb2dfa2986f880ff9d717d4815792ecd53f28b;p=jalview.git JAL-3117 bring alignment to foreground on click on Overview --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 5370437..4a18067 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -46,6 +46,7 @@ import java.awt.event.MouseEvent; import java.awt.print.PageFormat; import java.awt.print.PrinterJob; import java.beans.PropertyChangeEvent; +import java.beans.PropertyVetoException; import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -3459,6 +3460,27 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { frame.addKeyListener(getKeyListeners()[0]); } + + /* + * bring alignment panel to front when Overview gets focus + * (even after New View / eXpand / Gather!) + */ + final AlignmentPanel ap = alignPanel; + frame.addFocusListener(new FocusAdapter() + { + @Override + public void focusGained(FocusEvent e) + { + try + { + ap.alignFrame.setSelected(true); + ap.alignFrame.setIcon(false); + ap.alignFrame.setDisplayedView(ap); + } catch (PropertyVetoException e1) + { + } + } + }); alignPanel.setOverviewPanel(overview); }