JAL-1233 JAL-1576 copy constructor to propagate helix colours and applyTo implementat...
authorJim Procter <jprocter@issues.jalview.org>
Thu, 3 Sep 2015 20:20:13 +0000 (21:20 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 3 Sep 2015 20:20:13 +0000 (21:20 +0100)
src/jalview/schemes/RNAHelicesColour.java

index 57fcba5..2beb4cf 100644 (file)
@@ -74,6 +74,19 @@ public class RNAHelicesColour extends ResidueColourScheme
     alignmentChanged(alignment, null);
   }
 
+  /**
+   * clones colour settings and annotation row data
+   * 
+   * @param rnaHelicesColour
+   */
+  public RNAHelicesColour(RNAHelicesColour rnaHelicesColour)
+  {
+    super(ResidueProperties.nucleotideIndex);
+    helixcolorhash = rnaHelicesColour.helixcolorhash;
+    annotation = rnaHelicesColour.annotation;
+    refresh();
+  }
+
   @Override
   public void alignmentChanged(AnnotatedCollectionI alignment,
           Map<SequenceI, SequenceCollectionI> hiddenReps)
@@ -193,4 +206,11 @@ public class RNAHelicesColour extends ResidueColourScheme
     // currentColour);
     return currentColour;
   }
+
+  @Override
+  public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+          Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+  {
+    return new RNAHelicesColour(this);
+  }
 }