From: gmungoc Date: Fri, 12 May 2017 13:32:33 +0000 (+0100) Subject: JAL-2480 efficient test for features present on sequence X-Git-Tag: Release_2_10_3b1~287 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9ccd0ca3146f4b7fe41b7d7bc307501d2ccd9a31;p=jalview.git JAL-2480 efficient test for features present on sequence --- diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index bf0ab70..da026b5 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -1006,15 +1006,11 @@ public class SequenceFetcher extends JPanel implements Runnable { for (SequenceI sq : alsqs) { - if ((sfs = sq.getSequenceFeatures()) != null) + if (sq.getFeatures().hasFeatures()) { - if (sfs.length > 0) - { - af.setShowSeqFeatures(true); - break; - } + af.setShowSeqFeatures(true); + break; } - } } diff --git a/src/jalview/renderer/seqfeatures/FeatureRenderer.java b/src/jalview/renderer/seqfeatures/FeatureRenderer.java index f4648c4..d6be4c2 100644 --- a/src/jalview/renderer/seqfeatures/FeatureRenderer.java +++ b/src/jalview/renderer/seqfeatures/FeatureRenderer.java @@ -215,13 +215,6 @@ public class FeatureRenderer extends FeatureRendererModel return null; } - SequenceFeature[] sequenceFeatures = seq.getSequenceFeatures(); - - if (sequenceFeatures == null || sequenceFeatures.length == 0) - { - return null; - } - if (Comparison.isGap(seq.getCharAt(column))) { return Color.white; @@ -270,8 +263,7 @@ public class FeatureRenderer extends FeatureRendererModel final SequenceI seq, int start, int end, int y1, boolean colourOnly) { - SequenceFeature[] sequenceFeatures = seq.getSequenceFeatures(); - if (sequenceFeatures == null || sequenceFeatures.length == 0) + if (!seq.getFeatures().hasFeatures()) { return null; } @@ -286,7 +278,7 @@ public class FeatureRenderer extends FeatureRendererModel } int startPos = seq.findPosition(start); - int endPos = seq.findPosition(end); + int endPos = seq.findPosition(end);// todo a performant overload of this! Color drawnColour = null;