First attempt to install hidden regions
authoramwaterhouse <Andrew Waterhouse>
Fri, 24 Feb 2006 11:43:25 +0000 (11:43 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 24 Feb 2006 11:43:25 +0000 (11:43 +0000)
src/jalview/gui/SeqPanel.java

index 3209960..b9ba9f3 100755 (executable)
@@ -250,6 +250,9 @@ public class SeqPanel extends JPanel
         res = (x / av.getCharWidth()) + av.getStartRes();\r
     }\r
 \r
+    if(av.hasHiddenColumns)\r
+          res = av.getColumnSelection().adjustForHiddenColumns(res);\r
+\r
     return res;\r
 \r
    }\r
@@ -396,40 +399,48 @@ public class SeqPanel extends JPanel
         // use aa to see if the mouse pointer is on a\r
         if (av.showSequenceFeatures)\r
         {\r
-            Vector features = sequence.getDatasetSequence().getSequenceFeatures();\r
+            SequenceFeature [] features = sequence.getDatasetSequence().getSequenceFeatures();\r
             if(features!=null)\r
             {\r
               StringBuffer sbuffer = new StringBuffer("<html>");\r
 \r
-              for (int i = 0; i < features.size(); i++)\r
+              for (int i = 0; i < features.length; i++)\r
               {\r
-                SequenceFeature sf = (SequenceFeature) features.elementAt(i);\r
 \r
-                if ( (sf.getBegin() <= sequence.findPosition(res)) &&\r
-                    (sf.getEnd() >= sequence.findPosition(res)))\r
+                if ( (features[i].getBegin() <= sequence.findPosition(res)) &&\r
+                    (features[i].getEnd() >= sequence.findPosition(res)))\r
                 {\r
-                  if (sf.getType().equals("disulfide bond"))\r
+                  if(!av.featuresDisplayed.containsKey(features[i].getType()))\r
+                  continue;\r
+\r
+\r
+                  if (features[i].getType().equals("disulfide bond"))\r
                   {\r
-                    if (sf.getBegin() == sequence.findPosition(res)\r
-                        || sf.getEnd() == sequence.findPosition(res))\r
+                    if (features[i].getBegin() == sequence.findPosition(res)\r
+                        || features[i].getEnd() == sequence.findPosition(res))\r
                     {\r
                       if (sbuffer.length() > 6)\r
                         sbuffer.append("<br>");\r
-                      sbuffer.append("disulfide bond " + sf.getBegin() + ":" +\r
-                                     sf.getEnd());\r
+                      sbuffer.append("disulfide bond " + features[i].getBegin() + ":" +\r
+                                     features[i].getEnd());\r
                     }\r
                   }\r
                   else\r
                   {\r
                     if (sbuffer.length() > 6)\r
                       sbuffer.append("<br>");\r
-                    sbuffer.append(sf.getType());\r
-                    if (sf.getDescription() != null)\r
-                      sbuffer.append(" " + sf.getDescription());\r
+                    if(features[i].featureGroup!=null)\r
+                      sbuffer.append(features[i].featureGroup+";");\r
 \r
-                    if (sf.getStatus() != null)\r
+                    sbuffer.append(features[i].getType());\r
+\r
+                    if (features[i].getDescription() != null\r
+                        && !features[i].description.equals(features[i].getType()))\r
+                      sbuffer.append("; " + features[i].getDescription());\r
+\r
+                    if (features[i].getStatus() != null && features[i].getStatus().length()>0)\r
                     {\r
-                      sbuffer.append(" (" + sf.getStatus() + ")");\r
+                      sbuffer.append("; (" + features[i].getStatus() + ")");\r
                     }\r
                   }\r
                 }\r
@@ -599,19 +610,6 @@ public class SeqPanel extends JPanel
         seqCanvas.repaint();\r
     }\r
 \r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param seqstart DOCUMENT ME!\r
-     * @param seqend DOCUMENT ME!\r
-     * @param start DOCUMENT ME!\r
-     */\r
-    public void drawChars(int seqstart, int seqend, int start)\r
-    {\r
-        seqCanvas.drawPanel(seqCanvas.gg, start, av.getEndRes(), seqstart,\r
-            seqend, av.getStartRes(), av.getStartSeq(), 0);\r
-        seqCanvas.repaint();\r
-    }\r
 \r
     /**\r
      * DOCUMENT ME!\r