X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FAnnotationRenderer.java;h=5973710ab8f3613567d4f1ad609b62609c0a3383;hb=ef7288c0cdbcb714f7c0cb4acbdb35e8f33ecfc6;hp=3fdcb3b7f548e080a804d25cee8de8d80f6dfaf1;hpb=853624fb32058cccc544ae7d13af6ad4b0800b6c;p=jalview.git diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 3fdcb3b..5973710 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -28,8 +28,13 @@ import jalview.api.AlignViewportI; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.ColumnSelection; +import jalview.datamodel.ProfilesI; +import jalview.schemes.CollectionColourScheme; +import jalview.schemes.CollectionColourSchemeI; import jalview.schemes.ColourSchemeI; +import jalview.schemes.NucleotideColourScheme; import jalview.schemes.ResidueProperties; +import jalview.schemes.ZappoColourScheme; import jalview.util.Platform; import java.awt.BasicStroke; @@ -69,11 +74,11 @@ public class AnnotationRenderer boolean av_renderHistogram = true, av_renderProfile = true, av_normaliseProfile = false; - ColourSchemeI profcolour = null; + CollectionColourSchemeI profcolour = null; private ColumnSelection columnSelection; - private Hashtable[] hconsensus; + private ProfilesI hconsensus; private Hashtable[] complementConsensus; @@ -311,13 +316,17 @@ public class AnnotationRenderer av_renderHistogram = av.isShowConsensusHistogram(); av_renderProfile = av.isShowSequenceLogo(); av_normaliseProfile = av.isNormaliseSequenceLogo(); - profcolour = av.getGlobalColourScheme(); - if (profcolour == null) + profcolour = av.getViewportColourScheme(); + if (profcolour == null || profcolour.getColourScheme() == null) { - // Set the default colour for sequence logo if the alignnent has no - // colourscheme set - profcolour = av.getAlignment().isNucleotide() ? new jalview.schemes.NucleotideColourScheme() - : new jalview.schemes.ZappoColourScheme(); + /* + * Use default colour for sequence logo if + * the alignment has no colourscheme set + * (would like to use user preference but n/a for applet) + */ + ColourSchemeI col = av.getAlignment().isNucleotide() ? new NucleotideColourScheme() + : new ZappoColourScheme(); + profcolour = new CollectionColourScheme(col); } columnSelection = av.getColumnSelection(); hconsensus = av.getSequenceConsensusHash(); @@ -351,7 +360,7 @@ public class AnnotationRenderer { // TODO? group consensus for cDNA complement return AAFrequency.extractProfile( - aa.groupRef.consensusData[column], + aa.groupRef.consensusData.get(column), aa.groupRef.getIgnoreGapsConsensus()); } // TODO extend annotation row to enable dynamic and static profile data to @@ -365,7 +374,8 @@ public class AnnotationRenderer } else { - return AAFrequency.extractProfile(hconsensus[column], + return AAFrequency.extractProfile( +hconsensus.get(column), av_ignoreGapsConsensus); } }