From: Jim Procter Date: Mon, 12 Dec 2016 21:08:44 +0000 (+0000) Subject: JAL-2349 fixed rendering method and switched to using color from contact range to... X-Git-Tag: Release_2_11_3_0~23^2~60^2~9^2~19 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c2e0797f0a114da79ed00e67ec029a3e83496d8d;p=jalview.git JAL-2349 fixed rendering method and switched to using color from contact range to allow subsampling --- 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) {