private boolean seqAssociated = false;
IdentityHashMap<SequenceI, AlignmentAnnotation> seqannot = null;
-
+ @Override
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ {
+ AnnotationColourGradient acg = new AnnotationColourGradient(annotation, colourScheme, aboveAnnotationThreshold);
+ acg.thresholdIsMinMax = thresholdIsMinMax;
+ acg.annotationThreshold = (annotationThreshold==null) ? null : new GraphLine(annotationThreshold);
+ acg.r1 = r1;
+ acg.g1 = g1;
+ acg.b1 = b1;
+ acg.rr = rr;
+ acg.gg = gg;
+ acg.bb = bb;
+ acg.dr = dr;
+ acg.dg = dg;
+ acg.db = db;
+ acg.predefinedColours = predefinedColours;
+ acg.seqAssociated = seqAssociated;
+
+ return acg;
+ }
/**
* Creates a new AnnotationColourGradient object.
*/
import jalview.analysis.AAFrequency;
import java.awt.Color;
+import java.util.Map;
+
+import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
public class Blosum62ColourScheme extends ResidueColourScheme
return currentColour;
}
+ @Override
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ {
+ ColourSchemeI newcs = super.applyTo(sg, hiddenRepSequences);
+ return newcs;
+ }
}
{
this.includeGaps = includeGaps;
}
+ @Override
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ {
+ ClustalxColourScheme css= new ClustalxColourScheme(sg, hiddenRepSequences);
+ css.includeGaps = includeGaps;
+ return css;
+ }
}
class ConsensusColour
public void alignmentChanged(AnnotatedCollectionI alignment,
Map<SequenceI, SequenceCollectionI> hiddenReps);
+ /**
+ * create a new instance of the colourscheme configured to colour the given connection
+ * @param sg
+ * @param hiddenRepSequences
+ * @return copy of current scheme with any inherited settings transfered
+ */
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
+
}
{
}
+ @Override
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ {
+ try {
+ return getClass().newInstance();
+ }
+ catch (Exception q)
+ {
+ throw new Error("Serious implementation error: cannot duplicate colourscheme "+getClass().getName(), q);
+ }
+ }
}
}
return cols[j];
}
+
+ @Override
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ {
+ return new TCoffeeColourScheme(sg);
+ }
}
package jalview.schemes;
import java.awt.Color;
+import java.util.Map;
import java.util.StringTokenizer;
+
+import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
public class UserColourScheme extends ResidueColourScheme
super(ResidueProperties.aaIndex);
colors = newColors;
}
-
+ @Override
+ public ColourSchemeI applyTo(AnnotatedCollectionI sg,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ {
+ UserColourScheme usc = new UserColourScheme(colors);
+ if (lowerCaseColours!=null) {
+ usc.schemeName = new String(schemeName);
+ usc.lowerCaseColours = new Color[lowerCaseColours.length];
+ System.arraycopy(lowerCaseColours, 0, usc.lowerCaseColours, 0, lowerCaseColours.length);
+ }
+ return usc;
+ }
public UserColourScheme(String colour)
{
super(ResidueProperties.aaIndex);