JAL-2847 small things, filled in actionperformeds
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 22 Nov 2017 13:21:37 +0000 (13:21 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 22 Nov 2017 13:21:37 +0000 (13:21 +0000)
src/jalview/ext/archaeopteryx/AptxInit.java
src/jalview/ext/archaeopteryx/JalviewBinding.java
src/jalview/ext/forester/io/TreeDatabaseMenuBuilder.java [new file with mode: 0644]
src/jalview/gui/AlignFrame.java
src/jalview/jbgui/GAlignFrame.java

index 4a49734..e58a38d 100644 (file)
@@ -132,13 +132,13 @@ public final class AptxInit
           AlignmentViewport viewport)
           throws FileNotFoundException, IOException, RuntimeException
   {
-    
+    String treeTitle = treeUrl.getFile();
     Phylogeny[] trees = AptxUtil.readPhylogeniesFromUrl(treeUrl,
             VALIDATE_PHYLOXML_XSD,
              REPLACE_NHX_UNDERSCORES, INTERNAL_NUMBERS_AS_CONFIDENCE,
             TAXONOMY_EXTRACTION, MIDPOINT_REROOT);
     MainFrame aptxApp = Archaeopteryx.createApplication(trees, APTX_CONFIG,
-            null);
+            treeTitle);
 
     for (Phylogeny tree : trees)
     {
@@ -158,6 +158,7 @@ public final class AptxInit
 
 
 
+
   public static MainFrame createAptxFrame(
           final Phylogeny[] aptxTrees)
   {
@@ -194,4 +195,5 @@ public final class AptxInit
   }
 
 
+
 }
index deadfe4..3f69299 100644 (file)
@@ -100,11 +100,13 @@ public final class JalviewBinding
            * Resend the selection to the tree view when tabs get switched, this
            * has to be buried in invokeLater as Forester first resets the tree
            * view on switching tabs, without invokeLater this would get called
-           * before Forester resets which would nullify the selection
+           * before Forester resets which would nullify the selection.
            */
           public void run()
           {
             parentAvport.sendSelection();
+            // PaintRefresher.Refresh(treeView,
+            // parentAvport.getSequenceSetId());
 
           }
         });
@@ -212,7 +214,7 @@ public final class JalviewBinding
     {
       treeSelectionChanged(matchingSequence);
       parentAvport.sendSelection();
-      PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId());
+      PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId()); // redundant?
     }
   }
 
@@ -234,7 +236,7 @@ public final class JalviewBinding
       }
     }
     parentAvport.sendSelection();
-    PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId());
+    PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId()); // redundant?
   }
 
   /**
diff --git a/src/jalview/ext/forester/io/TreeDatabaseMenuBuilder.java b/src/jalview/ext/forester/io/TreeDatabaseMenuBuilder.java
new file mode 100644 (file)
index 0000000..45415d1
--- /dev/null
@@ -0,0 +1,40 @@
+package jalview.ext.forester.io;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import org.forester.archaeopteryx.webservices.PhylogeniesWebserviceClient;
+import org.forester.archaeopteryx.webservices.WebservicesManager;
+
+public class TreeDatabaseMenuBuilder
+{
+  final WebservicesManager webservicesManager;
+
+  JMenuItem[] treeDatabaseMenuItems;
+
+  public TreeDatabaseMenuBuilder()
+
+  {
+    webservicesManager = WebservicesManager
+            .getInstance();
+
+  }
+
+  public JMenu fillMenu(JMenu treeDbMenu) {
+    treeDatabaseMenuItems = new JMenuItem[webservicesManager
+                                          .getAvailablePhylogeniesWebserviceClients().size()];
+    
+    for (int i = 0; i < treeDatabaseMenuItems.length; ++i)
+    {
+      final PhylogeniesWebserviceClient client = webservicesManager
+              .getAvailablePhylogeniesWebserviceClient(i);
+      treeDatabaseMenuItems[i] = new JMenuItem(
+              client.getMenuName());
+      treeDbMenu.add(treeDatabaseMenuItems[i]);
+
+    }
+    return treeDbMenu;
+    
+  }
+
+}
index 427cb00..deb8d11 100644 (file)
@@ -3898,46 +3898,41 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   }
 
   @Override
-  protected void loadTreeDbItem_actionPerformed(ActionEvent e)
-  {
-    chooseTreeDb();
-  }
-
-  @Override
   protected void loadTreeBaseStudy_actionPerformed(ActionEvent e)
   {
-    // TODO Auto-generated method stub
+    chooseTreeDb();
 
   }
 
   @Override
   protected void loadTreeOfLife_actionPerformed(ActionEvent e)
   {
-    // TODO Auto-generated method stub
+    chooseTreeDb();
 
   }
 
   @Override
   protected void loadTreeFam_actionPerformed(ActionEvent e)
   {
-    // TODO Auto-generated method stub
+    chooseTreeDb();
 
   }
 
   @Override
   protected void loadTreePfam_actionPerformed(ActionEvent e)
   {
-    // TODO Auto-generated method stub
+    chooseTreeDb();
 
   }
 
   @Override
   protected void loadTreeBase_actionPerformed(ActionEvent e)
   {
-    // TODO Auto-generated method stub
+    chooseTreeDb();
 
   }
 
+
   public void chooseTreeFile()
   {
     // Pick the tree file
@@ -3960,7 +3955,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       String filePath = chooser.getSelectedFile().getPath();
       Cache.setProperty("LAST_DIRECTORY", filePath);
-
+      
+      
       TreeParser treeParser = new TreeParser(filePath);
       treeParser.loadTree(viewport);
 
@@ -4038,6 +4034,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
 
 
+
   }
 
   public TreePanel showNewickTree(NewickFile nf, String treeTitle)
index a202ed0..9b0c6a8 100755 (executable)
@@ -2507,10 +2507,7 @@ public class GAlignFrame extends JInternalFrame
 
   }
 
-  protected void loadTreeDbItem_actionPerformed(ActionEvent e)
-  {
 
-  }
 
   /**
    * Template method to handle the 'load T-Coffee scores' menu event.