From 279c6495df1a0de231600a2d283098c7411c4730 Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 22 May 2023 16:05:17 +0100 Subject: [PATCH] JAL-4134 efficiency improvement --- src/jalview/gui/TreeCanvas.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index f6b842d..bb028bf 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -1160,6 +1160,16 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, return; } + // TODO - sort indices for faster lookup + ColumnSelection cs = av.getColumnSelection(); + HiddenColumns hc = av.getAlignment().getHiddenColumns(); + ContactMatrixI cm = av.getContactMatrix(tp.assocAnnotation); + MappableContactMatrixI mcm = null; + int offp; + if (cm instanceof MappableContactMatrixI) + { + mcm = (MappableContactMatrixI) cm; + } for (BinaryNode bn : l) { int colm = -1; @@ -1171,15 +1181,8 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, { continue; } - // TODO - sort indices for faster lookup - ColumnSelection cs = av.getColumnSelection(); - HiddenColumns hc = av.getAlignment().getHiddenColumns(); - ContactMatrixI cm = av.getContactMatrix(tp.assocAnnotation); - MappableContactMatrixI mcm = null; - int offp; - if (cm instanceof MappableContactMatrixI) + if (mcm!=null) { - mcm = (MappableContactMatrixI) cm; int[] seqpos = mcm.getMappedPositionsFor( tp.assocAnnotation.sequenceRef, colm); if (seqpos == null) -- 1.7.10.2