From: Jim Procter Date: Mon, 28 Apr 2014 12:31:59 +0000 (+0100) Subject: JAL-1340 simpler and more efficient interactive highlighting of redundant sequences X-Git-Tag: Jalview_2_9~191^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ad9fc20de0dcc3737c75a777915973497791e393;p=jalview.git JAL-1340 simpler and more efficient interactive highlighting of redundant sequences --- diff --git a/src/jalview/appletgui/RedundancyPanel.java b/src/jalview/appletgui/RedundancyPanel.java index 345c906..048a514 100644 --- a/src/jalview/appletgui/RedundancyPanel.java +++ b/src/jalview/appletgui/RedundancyPanel.java @@ -19,7 +19,7 @@ package jalview.appletgui; import java.util.*; - +import java.util.List; import java.awt.*; import java.awt.event.*; @@ -143,19 +143,16 @@ public class RedundancyPanel extends SliderPanel implements Runnable, float value = slider.getValue(); + List redundantSequences = new ArrayList(); for (int i = 0; i < redundancy.length; i++) { - if (value > redundancy[i]) - { - redundantSeqs.removeElement(originalSequences[i]); - } - else if (!redundantSeqs.contains(originalSequences[i])) + if (value <= redundancy[i]) { - redundantSeqs.addElement(originalSequences[i]); + redundantSequences.add(originalSequences[i]); } } - ap.idPanel.idCanvas.setHighlighted(redundantSeqs); + ap.idPanel.idCanvas.setHighlighted(redundantSequences); PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true); } diff --git a/src/jalview/gui/RedundancyPanel.java b/src/jalview/gui/RedundancyPanel.java index 3ff0ca3..323d7f1 100755 --- a/src/jalview/gui/RedundancyPanel.java +++ b/src/jalview/gui/RedundancyPanel.java @@ -173,21 +173,15 @@ public class RedundancyPanel extends GSliderPanel implements Runnable } float value = slider.getValue(); - + List redundantSequences = new ArrayList(); for (int i = 0; i < redundancy.length; i++) { - if (value > redundancy[i]) - { - redundantSeqs.remove(originalSequences[i]); - } - else if (!redundantSeqs.contains(originalSequences[i])) + if (value <= redundancy[i]) { - redundantSeqs.add(originalSequences[i]); + redundantSequences.add(originalSequences[i]); } - } - - ap.idPanel.idCanvas.setHighlighted(redundantSeqs); + ap.idPanel.idCanvas.setHighlighted(redundantSequences); } /**