From be07d0d301bec85466a2d1b5c2dcb069593af0aa Mon Sep 17 00:00:00 2001
From: tjc <tjc@ee4ac58c-ac51-4696-9907-e4b3aa274f04>
Date: Fri, 9 Apr 2010 10:07:42 +0000
Subject: [PATCH] use ReferencePanel form

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@13650 ee4ac58c-ac51-4696-9907-e4b3aa274f04
---
 .../artemis/components/FeatureEdit.java       | 31 ++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/uk/ac/sanger/artemis/components/FeatureEdit.java b/uk/ac/sanger/artemis/components/FeatureEdit.java
index c85385785..f66d7b2d6 100644
--- a/uk/ac/sanger/artemis/components/FeatureEdit.java
+++ b/uk/ac/sanger/artemis/components/FeatureEdit.java
@@ -57,6 +57,7 @@ import uk.ac.sanger.artemis.components.genebuilder.GeneBuilderFrame;
 import uk.ac.sanger.artemis.components.genebuilder.GeneEditorPanel;
 import uk.ac.sanger.artemis.components.genebuilder.GeneUtils;
 import uk.ac.sanger.artemis.components.genebuilder.ProteinMapPanel;
+import uk.ac.sanger.artemis.components.genebuilder.ReferencesPanel;
 import uk.ac.sanger.artemis.components.genebuilder.cv.CVPanel;
 import uk.ac.sanger.artemis.components.genebuilder.gff.PropertiesPanel;
 import uk.ac.sanger.artemis.components.genebuilder.ortholog.MatchPanel;
@@ -155,6 +156,8 @@ public class FeatureEdit extends JPanel
   /** similarity/ortholog/paralog tab */
   private MatchPanel matchForm;
   
+  private ReferencesPanel refPanel;
+  
   private EntryInformation entry_information;
   
   private static boolean isTabbedView = false;
@@ -956,6 +959,9 @@ public class FeatureEdit extends JPanel
       propertiesPanel = new PropertiesPanel(getFeature());
       propertiesPanel.setBackground(Color.WHITE);
 
+      refPanel = new ReferencesPanel(getFeature());
+      refPanel.setBackground(Color.WHITE);
+      
       addGffAnnotationView(lower_panel);
       
       final JCheckBox tabbedView = new JCheckBox("Tab View", isTabbedView);
@@ -1123,6 +1129,13 @@ public class FeatureEdit extends JPanel
       cvForm.setVisible(true);      // ensure visible
       jspCV.setPreferredSize(jspCore.getPreferredSize());
       tabbedPane.add("CV", jspCV);
+      
+      
+      JScrollPane jspRef = new JScrollPane(refPanel);
+      refPanel.setVisible(true);      // ensure visible
+      jspRef.setPreferredSize(jspCore.getPreferredSize());
+      tabbedPane.add("References", jspRef);
+      
       JScrollPane jspOrtholog = new JScrollPane(matchForm);
       matchForm.setVisible(true);   // ensure visible
       jspOrtholog.setPreferredSize(getPreferredSize());
@@ -1139,7 +1152,7 @@ public class FeatureEdit extends JPanel
       }
       
       editorPanel = new GeneEditorPanel(qualifier_text_area, cvForm,
-          matchForm, propertiesPanel);
+          refPanel, matchForm, propertiesPanel);
       JScrollPane jsp = new JScrollPane(editorPanel);
           
       jsp.setPreferredSize(
@@ -1694,6 +1707,9 @@ public class FeatureEdit extends JPanel
       // load synonym
       if(cvForm != null)
         cvForm.updateFromFeature(getFeature());
+      
+      if(refPanel != null)
+        refPanel.updateFromFeature(getFeature());
 
       if(propertiesPanel != null)
         propertiesPanel.updateFromFeature(getFeature());
@@ -1724,6 +1740,7 @@ public class FeatureEdit extends JPanel
       // strip out CV qualifiers
       //
       if( (cvForm != null && CVPanel.isCvTag(this_qualifier)) ||
+          (refPanel != null && ReferencesPanel.isReferenceTag(this_qualifier)) ||
           (propertiesPanel != null && PropertiesPanel.isPropertiesTag(this_qualifier, getFeature())) ||
           (matchForm != null && MatchPanel.isMatchTag(this_qualifier)) ||
           (propertiesPanel != null && ProteinMapPanel.isProteinMapElement(this_qualifier)) )
@@ -1804,6 +1821,13 @@ public class FeatureEdit extends JPanel
           qualifiers.addAll(cvQualifiers);
       }
       
+      if(refPanel != null)
+      {
+        QualifierVector refQualifiers = refPanel.getQualifiers();
+        if(refQualifiers != null && refQualifiers.size() > 0)
+          qualifiers.addAll(refQualifiers);
+      }
+      
       if(propertiesPanel != null)
       {
         QualifierVector gffQualifiers = propertiesPanel.getGffQualifiers(getFeature());
@@ -1988,4 +2012,9 @@ public class FeatureEdit extends JPanel
     propertiesPanel.setObsoleteChanged(obsoleteChanged);
   }
 
+  public QualifierTextArea getQualifierTextArea()
+  {
+    return qualifier_text_area;
+  }
+
 }
-- 
GitLab