X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Farchaeopteryx%2FJalviewBinding.java;h=7ec721ce51633011a3b4f3fa8a414695e98f8d15;hb=1324dff27831e7bed84dd9e1332d249047820780;hp=d2072cc7d038d67799bf2b915cbade91ecb5f0cb;hpb=66a53ac8f1816e4e6b08ac6909066a867048e286;p=jalview.git 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)) {