Reveal
authoramwaterhouse <Andrew Waterhouse>
Thu, 16 Mar 2006 15:28:57 +0000 (15:28 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 16 Mar 2006 15:28:57 +0000 (15:28 +0000)
src/jalview/gui/IdPanel.java

index bb6efd7..cb13692 100755 (executable)
@@ -76,7 +76,7 @@ public class IdPanel extends JPanel implements MouseListener,
         y = getWrappedY(y);\r
       }\r
 \r
-      int seq = av.getIndex(y);\r
+      final int seq = av.getIndex(y);\r
       if(seq!=-1)\r
       {\r
         StringBuffer tip = new StringBuffer("<html>");\r
@@ -91,8 +91,30 @@ public class IdPanel extends JPanel implements MouseListener,
         setToolTipText(tip.toString());\r
       }\r
 \r
+      if(av.hasHiddenRows)\r
+      {\r
+        if(av.adjustForHiddenSeqs(seq) -\r
+           av.adjustForHiddenSeqs(seq-1)>1)\r
+        {\r
+          JPopupMenu pop = new JPopupMenu();\r
+          JMenuItem item = new JMenuItem("Reveal");\r
+          item.addActionListener(new ActionListener()\r
+          {\r
+            public void actionPerformed(ActionEvent e)\r
+            {\r
+              av.showSequence(seq);\r
+              alignPanel.repaint();\r
+              if(alignPanel.overviewPanel!=null)\r
+                alignPanel.overviewPanel.updateOverviewImage();\r
+            }\r
+          });\r
+          pop.add(item);\r
+          pop.show(this, e.getX(), e.getY());\r
+        }\r
+      }\r
     }\r
 \r
+\r
     int getWrappedY(int y)\r
     {\r
       int hgap = av.charHeight;\r