*/
package jalview.renderer;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.image.ImageObserver;
+import java.util.BitSet;
+import java.util.Hashtable;
+
import jalview.analysis.AAFrequency;
import jalview.analysis.CodingUtils;
import jalview.analysis.Rna;
import jalview.schemes.ZappoColourScheme;
import jalview.util.Platform;
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.geom.AffineTransform;
-import java.awt.image.ImageObserver;
-import java.util.BitSet;
-import java.util.Hashtable;
-
public class AnnotationRenderer
{
private static final int UPPER_TO_LOWER = 'a' - 'A'; // 32
int iconOffset, int startRes, int column, boolean validRes,
boolean validEnd)
{
- // System.out.println(nonCanColor);
+ // jalview.bin.Console.outPrintln(nonCanColor);
g.setColor(nonCanColor);
int sCol = (lastSSX / charWidth)
boolean diffdownstream = !validRes || !validEnd
|| row_annotations[column] == null
|| !dc.equals(row_annotations[column].displayCharacter);
- // System.out.println("Column "+column+" diff up: "+diffupstream+"
+ // jalview.bin.Console.outPrintln("Column "+column+" diff up: "+diffupstream+"
// down:"+diffdownstream);
// If a closing base pair half of the stem, display a backward arrow
if (column > 0 && Rna.isClosingParenthesis(dc))
boolean validRes = false;
boolean validEnd = false;
boolean labelAllCols = false;
-// boolean centreColLabels;
-// boolean centreColLabelsDef = av.isCentreColumnLabels();
+ // boolean centreColLabels;
+ // boolean centreColLabelsDef = av.isCentreColumnLabels();
boolean scaleColLabel = false;
final AlignmentAnnotation consensusAnnot = av
.getAlignmentConsensusAnnotation();
{
continue;
}
-// centreColLabels = row.centreColLabels || centreColLabelsDef;
+ // centreColLabels = row.centreColLabels || centreColLabelsDef;
labelAllCols = row.showAllColLabels;
scaleColLabel = row.scaleColLabel;
lastSS = ' ';
{
// int nb_annot = x - temp;
- // System.out.println("\t type :"+lastSS+"\t x :"+x+"\t nbre
+ // jalview.bin.Console.outPrintln("\t type :"+lastSS+"\t x :"+x+"\t nbre
// annot :"+nb_annot);
switch (lastSS)
{
case 'y':
case 'Z':
case 'z':
- // System.out.println(lastSS);
+ // jalview.bin.Console.outPrintln(lastSS);
Color nonCanColor = getNotCanonicalColor(lastSS);
drawNotCanonicalAnnot(g, nonCanColor, row_annotations, lastSSX,
x, y, iconOffset, startRes, column, validRes, validEnd);
.getRendererFor(row);
if (renderer != null)
{
- renderer.renderRow(g, charWidth, charHeight,
- hasHiddenColumns, av, hiddenColumns, columnSelection,
- row, row_annotations, startRes, endRes, row.graphMin,
+ renderer.renderRow(g, charWidth, charHeight, hasHiddenColumns,
+ av, hiddenColumns, columnSelection, row,
+ row_annotations, startRes, endRes, row.graphMin,
row.graphMax, y);
}
if (debugRedraw)
{
if (renderer == null)
{
- System.err.println("No renderer found for "
- + row.toString());
+ System.err
+ .println("No renderer found for " + row.toString());
}
else
{
- System.err.println("rendered with "
- + renderer.getClass().toString());
+ jalview.bin.Console.errPrintln(
+ "rendered with " + renderer.getClass().toString());
}
}
{
if (clipst)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Start clip at : " + yfrom + " (index " + f_i + ")");
}
if (clipend)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"End clip at : " + yto + " (index " + f_to + ")");
}
}
;
- System.err.println("Annotation Rendering time:"
+ jalview.bin.Console.errPrintln("Annotation Rendering time:"
+ (System.currentTimeMillis() - stime));
}
;
break;
}
- if (aa_annotations[column] == null
- || aa_annotations[column - 1] == null)
+ if (aa_annotations[column] == null)
{
x++;
continue;
g.setColor(aa_annotations[column].colour);
}
+ if (aa_annotations[column - 1] == null
+ && aa_annotations.length > column + 1
+ && aa_annotations[column + 1] == null)
+ {
+ // standalone value
+ y1 = y - (int) (((aa_annotations[column].value - min) / range)
+ * graphHeight);
+ g.drawLine(x * charWidth + charWidth / 4, y1,
+ x * charWidth + 3 * charWidth / 4, y1);
+ x++;
+ continue;
+ }
+
+ if (aa_annotations[column - 1] == null)
+ {
+ x++;
+ continue;
+ }
+
y1 = y - (int) (((aa_annotations[column - 1].value - min) / range)
* graphHeight);
y2 = y - (int) (((aa_annotations[column].value - min) / range)
// lm is not necessary - we can just use fm - could be off by no more
// than 0.5 px
// LineMetrics lm = g.getFontMetrics(ofont).getLineMetrics("Q", g);
- // System.out.println(asc + " " + dec + " " + (asc - lm.getAscent())
+ // jalview.bin.Console.outPrintln(asc + " " + dec + " " + (asc - lm.getAscent())
// + " " + (dec - lm.getDescent()));
double asc = fm.getAscent();
.deriveFont(AffineTransform.getScaleInstance(sx, sy));
g.setFont(font);
g.drawChars(dc, 0, dc.length, x * charWidth, hght);
+ g.setFont(ofont);
+
ht += newHeight;
}
}
return new Color(0, 80, 255);
default:
- System.out.println("This is not a interaction : " + lastss);
+ jalview.bin.Console.outPrintln("This is not a interaction : " + lastss);
return null;
}