From 4263dac5b885f760215fa599eb453e1221767d04 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Mar 2006 15:28:57 +0000 Subject: [PATCH] Reveal --- src/jalview/gui/IdPanel.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index bb6efd7..cb13692 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -76,7 +76,7 @@ public class IdPanel extends JPanel implements MouseListener, y = getWrappedY(y); } - int seq = av.getIndex(y); + final int seq = av.getIndex(y); if(seq!=-1) { StringBuffer tip = new StringBuffer(""); @@ -91,8 +91,30 @@ public class IdPanel extends JPanel implements MouseListener, setToolTipText(tip.toString()); } + if(av.hasHiddenRows) + { + if(av.adjustForHiddenSeqs(seq) - + av.adjustForHiddenSeqs(seq-1)>1) + { + JPopupMenu pop = new JPopupMenu(); + JMenuItem item = new JMenuItem("Reveal"); + item.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + av.showSequence(seq); + alignPanel.repaint(); + if(alignPanel.overviewPanel!=null) + alignPanel.overviewPanel.updateOverviewImage(); + } + }); + pop.add(item); + pop.show(this, e.getX(), e.getY()); + } + } } + int getWrappedY(int y) { int hgap = av.charHeight; -- 1.7.10.2