From c2e0797f0a114da79ed00e67ec029a3e83496d8d Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 12 Dec 2016 21:08:44 +0000 Subject: [PATCH] JAL-2349 fixed rendering method and switched to using color from contact range to allow subsampling --- src/jalview/renderer/ContactMapRenderer.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/jalview/renderer/ContactMapRenderer.java b/src/jalview/renderer/ContactMapRenderer.java index 1f235b3..809ced0 100644 --- a/src/jalview/renderer/ContactMapRenderer.java +++ b/src/jalview/renderer/ContactMapRenderer.java @@ -73,17 +73,15 @@ public class ContactMapRenderer implements AnnotationRowRendererI double scale = (_aa.graphHeight < contacts.getContactHeight()) ? 1 : (((double) _aa.graphHeight) / (double) contacts .getContactHeight()); - // distance between contact map per cell - int step = (int) ((contacts.getContactHeight()) * scale / _aa.graphHeight); - - // profl[1] is the number of values in the profile - for (int stp = 0, ht = y2, eht = y2 - _aa.graphHeight; ht > eht; ht -= scale, stp++) + int cstart, cend = -1; + for (int ht = y2, eht = y2 - _aa.graphHeight; ht >= eht; ht -= scale) { - // TODO show maximum colour for range + cstart = cend + 1; + cend = -1 + + (contacts.getContactHeight() * (ht - eht) / _aa.graphHeight); + // TODO show maximum colour for range - sort of done // also need a 'getMaxPosForRange(start,end)' - g.setColor(contacts - .getColorForScore((int) (stp * step * ((double) _aa.graphHeight / (double) contacts - .getContactHeight())))); + g.setColor(contacts.getColorForRange(cstart, cend)); if (scale > 1) { -- 1.7.10.2