X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FAnnotationRenderer.java;h=d5b2f492e7a7c1c241c7d90420d56f004a8bb616;hb=2273eba5668e5340354da60fed329c6c716cc439;hp=e7319106ed016fa1586b01595aca924dc0966627;hpb=cce26350d1d8106b82701deab38a8b20022b4737;p=jalview.git diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index e731910..d5b2f49 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -27,6 +27,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.ColumnSelection; import jalview.schemes.ColourSchemeI; +import jalview.schemes.ResidueProperties; import java.awt.BasicStroke; import java.awt.Color; @@ -77,17 +78,17 @@ public class AnnotationRenderer int x2 = (x * charWidth); Regex closeparen = new Regex("(\\))"); - String dc = (column == 0 || row_annotations[column - 1] == null) ? "" - : row_annotations[column - 1].displayCharacter; + char dc = (column == 0 || row_annotations[column - 1] == null) ? ' ' + : row_annotations[column - 1].secondaryStructure; boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null - || !dc.equals(row_annotations[sCol - 1].displayCharacter); + || dc != row_annotations[sCol - 1].secondaryStructure; boolean diffdownstream = !validRes || !validEnd || row_annotations[column] == null - || !dc.equals(row_annotations[column].displayCharacter); + || dc != row_annotations[column].secondaryStructure; // System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream); // If a closing base pair half of the stem, display a backward arrow - if (column > 0 && closeparen.search(dc)) + if (column > 0 && ResidueProperties.isCloseParenRNA(dc)) { if (diffupstream) @@ -574,11 +575,15 @@ public class AnnotationRenderer } } } - if (!row.isValidStruc()) + if (row.getInvalidStrucPos() > x) { g.setColor(Color.orange); - g.fillRect((int) row.getInvalidStrucPos() * charWidth, y, - charWidth, charHeight); + g.fillRect(x * charWidth, y, charWidth, charHeight); + } + else if (row.getInvalidStrucPos() == x) + { + g.setColor(Color.orange.darker()); + g.fillRect(x * charWidth, y, charWidth, charHeight); } if (validCharWidth && validRes @@ -617,9 +622,13 @@ public class AnnotationRenderer charOffset = (int) ((charWidth - fmWidth) / 2f); if (row_annotations[column].colour == null) + { g.setColor(Color.black); + } else + { g.setColor(row_annotations[column].colour); + } if (column == 0 || row.graph > 0) { @@ -1190,9 +1199,13 @@ public class AnnotationRenderer } if (aa_annotations[column].colour == null) + { g.setColor(Color.black); + } else + { g.setColor(aa_annotations[column].colour); + } y1 = y - (int) (((aa_annotations[column - 1].value - min) / range) * graphHeight); @@ -1264,9 +1277,13 @@ public class AnnotationRenderer continue; } if (aa_annotations[column].colour == null) + { g.setColor(Color.black); + } else + { g.setColor(aa_annotations[column].colour); + } y1 = y - (int) (((aa_annotations[column].value - min) / (range)) * _aa.graphHeight); @@ -1384,9 +1401,13 @@ public class AnnotationRenderer if (aa_annotations[j] != null) { if (aa_annotations[j].colour == null) + { g.setColor(Color.black); + } else + { g.setColor(aa_annotations[j].colour); + } height = (int) ((aa_annotations[j].value / _aa.graphMax) * y); if (height > y)