Sequence label colour stored for each sequence group
authorjprocter <Jim Procter>
Fri, 18 Jul 2008 12:31:53 +0000 (12:31 +0000)
committerjprocter <Jim Procter>
Fri, 18 Jul 2008 12:31:53 +0000 (12:31 +0000)
src/jalview/datamodel/SequenceGroup.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/TreeCanvas.java

index 24a2b2c..6ded8bd 100755 (executable)
@@ -46,7 +46,8 @@ public class SequenceGroup
   public ColourSchemeI cs;
   int startRes = 0;
   int endRes = 0;
-  Color outlineColour = Color.black;
+  public Color outlineColour = Color.black;
+  public Color idColour = null; 
   public int thresholdTextColour = 0;
   public Color textColour = Color.black;
   public Color textColour2 = Color.white;
@@ -625,4 +626,20 @@ public class SequenceGroup
 
     return seqs;
   }
+
+  /**
+   * @return the idColour
+   */
+  public Color getIdColour()
+  {
+    return idColour;
+  }
+
+  /**
+   * @param idColour the idColour to set
+   */
+  public void setIdColour(Color idColour)
+  {
+    this.idColour = idColour;
+  }
 }
index 39a7fac..15cbf01 100755 (executable)
@@ -3911,6 +3911,7 @@ public void drop(DropTargetDropEvent evt)
       {
         
         alignPanel.adjustAnnotationHeight();
+        viewport.updateSequenceIdColours();
         buildSortByAnnotationScoresMenu();
         alignPanel.paintAlignment(true);
       }
index 652d8d1..f798671 100755 (executable)
@@ -1907,4 +1907,24 @@ public class AlignViewport
     {
       centreColumnLabels =  centrecolumnlabels;
     }
+    public void updateSequenceIdColours()
+    {
+      Vector groups = alignment.getGroups();
+      if (sequenceColours==null)
+      {
+        sequenceColours = new Hashtable();
+      }
+      for (int ig=0,igSize=groups.size(); ig<igSize; ig++)
+      {
+        SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
+        if (sg.idColour!=null)
+        {
+          Vector sqs = sg.getSequences(hiddenRepSequences);
+          for (int s=0,sSize=sqs.size();s<sSize;s++)
+          {
+            sequenceColours.put(sqs.elementAt(s), sg.idColour);
+          } 
+        }
+      }
+    }
 }
index 2c1d478..3407c07 100755 (executable)
@@ -863,7 +863,7 @@ public class TreeCanvas
                                            av.alignment.getWidth() - 1);
 
       sg.setName("JTreeGroup:" + sg.hashCode());
-
+      sg.setIdColour(col);
       AlignmentPanel[] aps = getAssociatedPanels();
       for (int a = 0; a < aps.length; a++)
       {