X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPopupMenu.java;fp=src%2Fjalview%2Fgui%2FPopupMenu.java;h=8e0e6e3f0e8d082b3d39d53f04ea98bd7dda6525;hb=ec493e27abc6b3be84b3c8a873c295a3f589bd53;hp=3da449446b684cf6df1a02e032bbf56083f1b9e4;hpb=8ba65cbf8dde2faeff8a84eae78127fb99b765a5;p=jalview.git diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 3da4494..8e0e6e3 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -22,6 +22,7 @@ package jalview.gui; import jalview.analysis.AAFrequency; import jalview.analysis.AlignmentAnnotationUtils; +import jalview.analysis.AnnotationSorter; import jalview.analysis.Conservation; import jalview.commands.ChangeCaseCommand; import jalview.commands.EditCommand; @@ -1875,7 +1876,6 @@ public class PopupMenu extends JPopupMenu * Add annotations at the top of the annotation, in the same order as their * related sequences. */ - int insertPosition = 0; for (SequenceI seq : candidates.keySet()) { for (AlignmentAnnotation ann : candidates.get(seq)) @@ -1896,10 +1896,15 @@ public class PopupMenu extends JPopupMenu // adjust for gaps copyAnn.adjustForAlignment(); // add to the alignment and set visible - this.ap.getAlignment().addAnnotation(copyAnn, insertPosition++); + this.ap.getAlignment().addAnnotation(copyAnn); copyAnn.visible = true; } } + // TODO: save annotation sort order on AlignViewport + // do sorting from AlignmentPanel.updateAnnotation() + new AnnotationSorter(this.ap.getAlignment()) + .sortBySequenceAndType(this.ap.getAlignment() + .getAlignmentAnnotation()); refresh(); }