From: gmungoc Date: Fri, 15 May 2015 13:13:28 +0000 (+0100) Subject: JAL-1737 ignore non-positional annotations for display X-Git-Tag: Release_2_10_0~673 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c4609f79463d463d471b207a092f4d5af807391d;p=jalview.git JAL-1737 ignore non-positional annotations for display --- diff --git a/src/jalview/analysis/AlignmentAnnotationUtils.java b/src/jalview/analysis/AlignmentAnnotationUtils.java index 9bdbf73..e02aa9e 100644 --- a/src/jalview/analysis/AlignmentAnnotationUtils.java +++ b/src/jalview/analysis/AlignmentAnnotationUtils.java @@ -1,9 +1,5 @@ package jalview.analysis; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.SequenceI; -import jalview.renderer.AnnotationRenderer; - import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; @@ -12,6 +8,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.SequenceI; +import jalview.renderer.AnnotationRenderer; + public class AlignmentAnnotationUtils { @@ -63,6 +63,14 @@ public class AlignmentAnnotationUtils for (AlignmentAnnotation aa : annotations) { + /* + * Ignore non-positional annotations, can't render these against an + * alignment + */ + if (aa.annotations == null) + { + continue; + } if (forSequences != null && (aa.sequenceRef != null && forSequences .contains(aa.sequenceRef))) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 1b2410a..1cd2ea8 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5961,6 +5961,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, for (AlignmentAnnotation aa : alignPanel.getAlignment() .getAlignmentAnnotation()) { + /* + * don't display non-positional annotations on an alignment + */ + if (aa.annotations == null) + { + continue; + } boolean apply = (aa.sequenceRef == null && forAlignment) || (aa.sequenceRef != null && forSequences); if (apply)