From b28c75ee284c48471485bb24031d859017e650a7 Mon Sep 17 00:00:00 2001
From: tjc <tjc@ee4ac58c-ac51-4696-9907-e4b3aa274f04>
Date: Wed, 29 Sep 2004 15:54:49 +0000
Subject: [PATCH] add product line

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@1895 ee4ac58c-ac51-4696-9907-e4b3aa274f04
---
 uk/ac/sanger/artemis/editor/Annotation.java       | 10 +++++++---
 .../sanger/artemis/editor/DataCollectionPane.java |  6 ++++--
 .../artemis/editor/DataViewInternalFrame.java     | 15 ++++-----------
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/uk/ac/sanger/artemis/editor/Annotation.java b/uk/ac/sanger/artemis/editor/Annotation.java
index 90dc3c8c4..161e2ec9f 100644
--- a/uk/ac/sanger/artemis/editor/Annotation.java
+++ b/uk/ac/sanger/artemis/editor/Annotation.java
@@ -184,7 +184,7 @@ public class Annotation extends JEditorPane
     s = getDatabaseHTML(s,"EMBL:");
     s = getGeneDBHTML(s);
 
-    int ind = s.indexOf("/gene");
+//  int ind = s.indexOf("/gene");
     
     Document doc = getDocument();
     int offset = doc.getLength();
@@ -394,9 +394,13 @@ public class Annotation extends JEditorPane
         ind1 = ind2+1;
     }
 
-    // if ortholog then delete gene line as well
+    // if ortholog then delete gene and product lines as well
     if(ortholog)
-      ind2 = txt.indexOf("<br>",ind2+4);
+    {
+      ind2 = txt.indexOf("<br>/product=");
+      if(ind2 > -1)
+        ind2 = txt.indexOf("<br>",ind2+4);
+    }
    
     if(ind2 == -1 || ind2 > txt.length())
       ind2 = txt.length();
diff --git a/uk/ac/sanger/artemis/editor/DataCollectionPane.java b/uk/ac/sanger/artemis/editor/DataCollectionPane.java
index c48bcd753..d5855547a 100644
--- a/uk/ac/sanger/artemis/editor/DataCollectionPane.java
+++ b/uk/ac/sanger/artemis/editor/DataCollectionPane.java
@@ -468,7 +468,6 @@ public class DataCollectionPane extends JScrollPane
     {
       public Object construct()
       {
-
         final String env[] = { "PATH=/usr/local/pubseq/bin/" };
 
         StringBuffer query = new StringBuffer();
@@ -841,7 +840,10 @@ public class DataCollectionPane extends JScrollPane
     {
       String geneName = hit.getGeneName();
       if(hit.getGeneName() != null)
-        orthoText = "<br>\n/gene=\""+hit.getGeneName()+"\"";
+        orthoText = "<br>\n/gene=\""+hit.getGeneName()+"\""+
+                    "<br>\n/product=\""+hit.getDescription()+"\"";
+      else
+        orthoText = "<br>\n/product=\""+hit.getDescription()+"\"";
     }
 
 //  System.out.println("ID "+hit.getID());
diff --git a/uk/ac/sanger/artemis/editor/DataViewInternalFrame.java b/uk/ac/sanger/artemis/editor/DataViewInternalFrame.java
index 366c7abee..d458e60fa 100644
--- a/uk/ac/sanger/artemis/editor/DataViewInternalFrame.java
+++ b/uk/ac/sanger/artemis/editor/DataViewInternalFrame.java
@@ -208,21 +208,14 @@ public class DataViewInternalFrame extends JInternalFrame
 
   protected void reReadSelectedResults()
   {
-    JSplitPane split = (JSplitPane)tabPane.getSelectedComponent();
+    ActiveJSplitPane split = (ActiveJSplitPane)tabPane.getSelectedComponent();
     Component comps[] = split.getComponents();
     for(int i=0; i<comps.length;i++)
     {
-      if(comps[i] instanceof JSplitPane) 
+      if(comps[i] instanceof FastaTextPane)
       {
-        Component comps2[] = ((JSplitPane)comps[i]).getComponents();
-        for(int j=0; j<comps2.length;j++)
-        {
-          if(comps2[j] instanceof FastaTextPane)
-          {
-            ((FastaTextPane)comps2[j]).reRead();
-            return;
-          }
-        }
+        ((FastaTextPane)comps[i]).reRead();
+        return;
       }
     }
   }
-- 
GitLab