import jalview.analysis.Conservation;
import jalview.api.AlignViewportI;
+import jalview.commands.CommandI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceGroup;
}
}
- public void sortByTree_actionPerformed() {
+ @Override
+ public void sortByTree_actionPerformed()// modify for Aptx
+ {
+ //
+ // if (treeCanvas.applyToAllViews)
+ // {
+ // final ArrayList<CommandI> commands = new ArrayList<>();
+ // for (AlignmentPanel ap : PaintRefresher
+ // .getAssociatedPanels(av.getSequenceSetId()))
+ // {
+ // commands.add(sortAlignmentIn(ap.av.getAlignPanel()));
+ // }
+ // av.getAlignPanel().alignFrame.addHistoryItem(new CommandI()
+ // {
+ //
+ // @Override
+ // public void undoCommand(AlignmentI[] views)
+ // {
+ // for (CommandI tsort : commands)
+ // {
+ // tsort.undoCommand(views);
+ // }
+ // }
+ //
+ // @Override
+ // public int getSize()
+ // {
+ // return commands.size();
+ // }
+ //
+ // @Override
+ // public String getDescription()
+ // {
+ // return "Tree Sort (many views)";
+ // }
+ //
+ // @Override
+ // public void doCommand(AlignmentI[] views)
+ // {
+ //
+ // for (CommandI tsort : commands)
+ // {
+ // tsort.doCommand(views);
+ // }
+ // }
+ // });
+ // for (AlignmentPanel ap : PaintRefresher
+ // .getAssociatedPanels(av.getSequenceSetId()))
+ // {
+ // // ensure all the alignFrames refresh their GI after adding an undo item
+ // ap.alignFrame.updateEditMenuBar();
+ // }
+ // }
+ // else
+ // {
+ // treeCanvas.ap.alignFrame
+ // .addHistoryItem(sortAlignmentIn(treeCanvas.ap));
+ // }
+
+ }
+
+ public CommandI sortAlignmentIn(AlignmentPanel ap)
+ {
+ // // TODO: move to alignment view controller
+ // AlignmentViewport viewport = ap.av;
+ // SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
+ // AlignmentSorter.sortByTree(viewport.getAlignment(), tree);
+ // CommandI undo;
+ // undo = new OrderCommand("Tree Sort", oldOrder, viewport.getAlignment());
+ //
+ // ap.paintAlignment(true, false);
+ // return undo;
+ return null;
}