X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FAnnotationRenderer.java;h=e7319106ed016fa1586b01595aca924dc0966627;hb=8c0f33de9bd3c211883eddcc313ebc7978f7b0b5;hp=06014c5e3d9fa6c96bf98a17fef82d5a6b7af384;hpb=0c0bbd65f29e9dcd63ec0f37427b6000fa1999f8;p=jalview.git diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 06014c5..e731910 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -297,6 +297,7 @@ public class AnnotationRenderer profcolour = av.getAlignment().isNucleotide() ? new jalview.schemes.NucleotideColourScheme() : new jalview.schemes.ZappoColourScheme(); } + boolean rna = av.getAlignment().isNucleotide(); columnSelection = av.getColumnSelection(); hconsensus = av.getSequenceConsensusHash();// hconsensus; hStrucConsensus = av.getRnaStructureConsensusHash(); // hStrucConsensus; @@ -353,6 +354,8 @@ public class AnnotationRenderer return null; } + boolean rna = false; + /** * Render the annotation rows associated with an alignment. * @@ -402,7 +405,7 @@ public class AnnotationRenderer AlignmentAnnotation consensusAnnot = av .getAlignmentConsensusAnnotation(), structConsensusAnnot = av .getAlignmentStrucConsensusAnnotation(); - boolean renderHistogram = true, renderProfile = true, normaliseProfile = false; + boolean renderHistogram = true, renderProfile = true, normaliseProfile = false, isRNA = rna; BitSet graphGroupDrawn = new BitSet(); int charOffset = 0; // offset for a label @@ -416,6 +419,7 @@ public class AnnotationRenderer for (int i = 0; i < aa.length; i++) { AlignmentAnnotation row = aa[i]; + isRNA = row.isRNA(); { // check if this is a consensus annotation row and set the display // settings appropriately @@ -696,23 +700,31 @@ public class AnnotationRenderer // System.out.println("\t type :"+lastSS+"\t x :"+x+"\t nbre annot :"+nb_annot); switch (lastSS) { - - case '$': - drawHelixAnnot(g, row_annotations, lastSSX, x, y, - iconOffset, startRes, column, validRes, validEnd); - break; - - case 0xCE: - drawSheetAnnot(g, row_annotations, lastSSX, x, y, - iconOffset, startRes, column, validRes, validEnd); - break; - case '(': // Stem case for RNA secondary structure case ')': // and opposite direction drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd); temp = x; break; + + case 'H': + if (!isRNA) + { + drawHelixAnnot(g, row_annotations, lastSSX, x, y, + iconOffset, startRes, column, validRes, + validEnd); + break; + } + + case 'E': + if (!isRNA) + { + drawSheetAnnot(g, row_annotations, lastSSX, x, y, + iconOffset, startRes, column, validRes, + validEnd); + break; + } + case '{': case '}': case '[': @@ -727,13 +739,11 @@ public class AnnotationRenderer case 'c': case 'D': case 'd': - case 'E': case 'e': case 'F': case 'f': case 'G': case 'g': - case 'H': case 'h': case 'I': case 'i': @@ -828,17 +838,25 @@ public class AnnotationRenderer { switch (lastSS) { - case '$': - drawHelixAnnot(g, row_annotations, lastSSX, x, y, iconOffset, - startRes, column, validRes, validEnd); - break; - case '�': - drawSheetAnnot(g, row_annotations, lastSSX, x, y, iconOffset, - startRes, column, validRes, validEnd); - break; - case 's': - case 'S': // Stem case for RNA secondary structure + case 'H': + if (!isRNA) + { + drawHelixAnnot(g, row_annotations, lastSSX, x, y, iconOffset, + startRes, column, validRes, validEnd); + break; + } + + case 'E': + if (!isRNA) + { + drawSheetAnnot(g, row_annotations, lastSSX, x, y, iconOffset, + startRes, column, validRes, validEnd); + break; + } + + case '(': + case ')': // Stem case for RNA secondary structure drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd); @@ -858,13 +876,11 @@ public class AnnotationRenderer case 'c': case 'D': case 'd': - case 'E': case 'e': case 'F': case 'f': case 'G': case 'g': - case 'H': case 'h': case 'I': case 'i': @@ -1008,13 +1024,13 @@ public class AnnotationRenderer return !usedFaded; } - private final Color GLYPHLINE_COLOR = Color.gray; + public static final Color GLYPHLINE_COLOR = Color.gray; - private final Color SHEET_COLOUR = Color.green; + public static final Color SHEET_COLOUR = Color.green; - private final Color HELIX_COLOUR = Color.red; + public static final Color HELIX_COLOUR = Color.red; - private final Color STEM_COLOUR = Color.blue; + public static final Color STEM_COLOUR = Color.blue; private Color sdNOTCANONICAL_COLOUR;