JAL-2838 start on sorting
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Fri, 24 Nov 2017 16:36:35 +0000 (16:36 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Fri, 24 Nov 2017 16:36:35 +0000 (16:36 +0000)
forester
src/jalview/ext/archaeopteryx/JalviewBinding.java

index a2e1b38..642ccb7 160000 (submodule)
--- a/forester
+++ b/forester
@@ -1 +1 @@
-Subproject commit a2e1b38bab7e593d79946c24e653776e6d796e00
+Subproject commit 642ccb75fc1e4cb7def346cb2f56191907f82a34
index d2072cc..7ec721c 100644 (file)
@@ -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<CommandI> 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 <E> void addOrRemoveInSet(Set<E> set, E objectToCheck)
+  public static <E> void addOrRemoveInSet(Set<E> set, E objectToCheck)
   {
     if (set.contains(objectToCheck))
     {