From: Jim Procter Date: Thu, 20 Oct 2022 13:00:49 +0000 (+0100) Subject: JAL-4033 fix drag selections and distinguish row/columnwise highlights from intersect... X-Git-Tag: Release_2_11_4_0~533 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ea863c6d3cf66cd10edd5ba5c22c9216aef5ac0b;p=jalview.git JAL-4033 fix drag selections and distinguish row/columnwise highlights from intersections on matrix --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 4f5b7d0..f0c2404 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -889,15 +889,17 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, ContactGeometry lastXcgeom = new ContactGeometry(forFromX, cma.graphHeight); ContactGeometry.contactInterval lastXci = lastXcgeom - .mapFor(rowIndex[1], rowIndex[1] + deltaY); + .mapFor(rowIndex[1], rowIndex[1] - deltaY); + ContactGeometry cXcgeom = new ContactGeometry(forToX, cma.graphHeight); ContactGeometry.contactInterval cXci = cXcgeom.mapFor(rowIndex[1], - rowIndex[1] + deltaY); + rowIndex[1] - deltaY); + // mark rectangular region formed by drag - System.err.println("Matrix Selection from last(" + lastXci.cStart - + "," + lastXci.cEnd + ") to cur(" + cXci.cStart + "," - + cXci.cEnd + ")"); + System.err.println("Matrix Selection from last(" + fromXc + ",[" + + lastXci.cStart + "," + lastXci.cEnd + "]) to cur(" + toXc + + ",[" + cXci.cStart + "," + cXci.cEnd + "])"); int fr, to; fr = Math.min(lastXci.cStart, lastXci.cEnd); to = Math.max(lastXci.cStart, lastXci.cEnd); diff --git a/src/jalview/renderer/ContactMapRenderer.java b/src/jalview/renderer/ContactMapRenderer.java index 58fb984..29ee22e 100644 --- a/src/jalview/renderer/ContactMapRenderer.java +++ b/src/jalview/renderer/ContactMapRenderer.java @@ -94,7 +94,7 @@ public class ContactMapRenderer implements AnnotationRowRendererI // also need a 'getMaxPosForRange(start,end)' to accurately render Color col; boolean rowsel = false; - if (!colsel && columnSelection != null) + if (columnSelection != null) { if (_aa.sequenceRef == null) { @@ -118,6 +118,14 @@ public class ContactMapRenderer implements AnnotationRowRendererI col = getSelectedColorForRange(min, max, contacts, ci.cStart, ci.cEnd); + if (colsel && rowsel) + { + col = new Color(col.getBlue(), col.getGreen(), col.getRed()); + } + else + { + col = new Color(col.getBlue(), col.getBlue(), col.getBlue()); + } g.setColor(col); } else