X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FAnnotationRenderer.java;h=5973710ab8f3613567d4f1ad609b62609c0a3383;hb=ef7288c0cdbcb714f7c0cb4acbdb35e8f33ecfc6;hp=e12b88ae02b9118ef1fab55ceb6772e72d4a6b6d;hpb=1c757dc1e6ee864277825c1ebd9c6a9fbe0da7b2;p=jalview.git diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index e12b88a..5973710 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -22,15 +22,19 @@ package jalview.renderer; import jalview.analysis.AAFrequency; import jalview.analysis.CodingUtils; -import jalview.analysis.Profile; import jalview.analysis.Rna; import jalview.analysis.StructureFrequency; 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; @@ -70,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 Profile[] hconsensus; + private ProfilesI hconsensus; private Hashtable[] complementConsensus; @@ -152,9 +156,9 @@ public class AnnotationRenderer annotationPanel = null; } - void drawStemAnnot(Graphics g, Annotation[] row_annotations, - int lastSSX, int x, int y, int iconOffset, int startRes, - int column, boolean validRes, boolean validEnd) + void drawStemAnnot(Graphics g, Annotation[] row_annotations, int lastSSX, + int x, int y, int iconOffset, int startRes, int column, + boolean validRes, boolean validEnd) { g.setColor(STEM_COLOUR); int sCol = (lastSSX / charWidth) + startRes; @@ -312,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(); @@ -352,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 @@ -366,7 +374,8 @@ public class AnnotationRenderer } else { - return AAFrequency.extractProfile(hconsensus[column], + return AAFrequency.extractProfile( +hconsensus.get(column), av_ignoreGapsConsensus); } } @@ -1086,8 +1095,8 @@ public class AnnotationRenderer private Color sdNOTCANONICAL_COLOUR; - void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX, - int x, int y, int iconOffset, int startRes, int column, + void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX, int x, + int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd) { g.setColor(GLYPHLINE_COLOR); @@ -1118,8 +1127,8 @@ public class AnnotationRenderer } - void drawHelixAnnot(Graphics g, Annotation[] row, int lastSSX, - int x, int y, int iconOffset, int startRes, int column, + void drawHelixAnnot(Graphics g, Annotation[] row, int lastSSX, int x, + int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd) { g.setColor(HELIX_COLOUR);