From: kjvdheide Date: Fri, 24 Nov 2017 16:36:35 +0000 (+0000) Subject: JAL-2838 start on sorting X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1324dff27831e7bed84dd9e1332d249047820780;p=jalview.git JAL-2838 start on sorting --- diff --git a/forester b/forester index a2e1b38..642ccb7 160000 --- a/forester +++ b/forester @@ -1 +1 @@ -Subproject commit a2e1b38bab7e593d79946c24e653776e6d796e00 +Subproject commit 642ccb75fc1e4cb7def346cb2f56191907f82a34 diff --git a/src/jalview/ext/archaeopteryx/JalviewBinding.java b/src/jalview/ext/archaeopteryx/JalviewBinding.java index d2072cc..7ec721c 100644 --- a/src/jalview/ext/archaeopteryx/JalviewBinding.java +++ b/src/jalview/ext/archaeopteryx/JalviewBinding.java @@ -215,11 +215,13 @@ public final class JalviewBinding public void partitionTree(final MouseEvent e) { int x = e.getX(); + int lineLength = treeView.getHeight(); Phylogeny tree = treeView.getPhylogeny(); double treeHeight = tree.calculateHeight(true); + if (treeHeight != 0) { int viewWidth = treeView.getWidth(); @@ -236,6 +238,7 @@ public final class JalviewBinding } + @Override @@ -328,6 +331,80 @@ public final class JalviewBinding } } + public void sortByTree_actionPerformed() { + // parentAvport.mirrorCommand(command, undo, ssm, source); + + // alignFrame + // .addHistoryItem(sortAlignmentIn(treeCanvas.ap)); + + } + + + /** + * sort the associated alignment view by the current tree. + * + * @param e + */ + // @Override + // public void sortByTree_actionPerformed()// modify for Aptx + // { + // + // // if (treeCanvas.applyToAllViews) + // + // final ArrayList commands = new ArrayList<>(); + // for (AlignmentPanel ap : PaintRefresher + // .getAssociatedPanels(parentAvport.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)); + // } + + /** * TO BE MOVED @@ -335,7 +412,7 @@ public final class JalviewBinding * @param set * @param objectToCheck */ - public void addOrRemoveInSet(Set set, E objectToCheck) + public static void addOrRemoveInSet(Set set, E objectToCheck) { if (set.contains(objectToCheck)) {