JAL-1632 similarity options on TreeChooser panel affect tree by PID
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 27 Feb 2017 14:56:22 +0000 (14:56 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 27 Feb 2017 14:56:22 +0000 (14:56 +0000)
src/jalview/analysis/NJTree.java
src/jalview/analysis/scoremodels/SimilarityParams.java
src/jalview/bin/Jalview.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/gui/TreeChooser.java
src/jalview/gui/TreePanel.java
src/jalview/io/VamsasAppDatastore.java
src/jalview/ws/jws1/SeqSearchWSThread.java

index cc0e473..255d6df 100644 (file)
@@ -20,7 +20,6 @@
  */
 package jalview.analysis;
 
-import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.DistanceScoreModelI;
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
@@ -316,7 +315,7 @@ public class NJTree
        * compute similarity and invert it to give a distance measure
        */
       MatrixI result = ((SimilarityScoreModelI) sm).findSimilarities(
-              seqData, SimilarityParams.Jalview);
+              seqData, scoreOptions);
       result.reverseRange(true);
       distances = result;
     }
index 4cc5b1f..b6f2ba2 100644 (file)
@@ -65,7 +65,7 @@ public class SimilarityParams implements SimilarityParamsI
    *          if true, the denominator is the shorter sequence length (possibly
    *          including gaps)
    */
-  SimilarityParams(boolean includeGapGap, boolean matchGap,
+  public SimilarityParams(boolean includeGapGap, boolean matchGap,
           boolean includeGaps, boolean shortestLength)
   {
     includeGappedColumns = includeGapGap;
index 966e952..954bb34 100755 (executable)
@@ -578,18 +578,14 @@ public class Jalview
         data = aparser.getValue("tree", true);
         if (data != null)
         {
-          jalview.io.NewickFile fin = null;
           try
           {
             System.out.println("CMD [-tree " + data
                     + "] executed successfully!");
-            fin = new NewickFile(data,
+            NewickFile nf = new NewickFile(data,
                     AppletFormatAdapter.checkProtocol(data));
-            if (fin != null)
-            {
-              af.getViewport().setCurrentTree(
-                      af.ShowNewickTree(fin, data).getTree());
-            }
+            af.getViewport().setCurrentTree(
+                    af.showNewickTree(nf, data).getTree());
           } catch (IOException ex)
           {
             System.err.println("Couldn't add tree " + data);
index 4fd80b2..681a700 100644 (file)
@@ -24,7 +24,6 @@ import jalview.analysis.AlignmentSorter;
 import jalview.analysis.AlignmentUtils;
 import jalview.analysis.CrossRef;
 import jalview.analysis.Dna;
-import jalview.analysis.NJTree;
 import jalview.analysis.ParseProperties;
 import jalview.analysis.SequenceIdMatcher;
 import jalview.api.AlignExportSettingI;
@@ -36,6 +35,7 @@ import jalview.api.FeatureSettingsControllerI;
 import jalview.api.SplitContainerI;
 import jalview.api.ViewStyleI;
 import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.SimilarityParamsI;
 import jalview.bin.Cache;
 import jalview.bin.Jalview;
 import jalview.commands.CommandI;
@@ -3588,17 +3588,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   }
 
   /**
-   * DOCUMENT ME!
+   * Constructs a tree panel and adds it to the desktop
    * 
    * @param type
-   *          DOCUMENT ME!
-   * @param pwType
-   *          DOCUMENT ME!
-   * @param title
-   *          DOCUMENT ME!
+   *          tree type (NJ or AV)
+   * @param sm
+   *          distance or similarity score model used to compute the tree
+   * @param options
+   *          parameters for the distance or similarity calculation
    */
-  void newTreePanel(String type, String pwType, String title)
+  void newTreePanel(String type, ScoreModelI sm, SimilarityParamsI options)
   {
+    String frameTitle = "";
     TreePanel tp;
 
     if (viewport.getSelectionGroup() != null
@@ -3637,8 +3638,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         }
       }
 
-      title = title + " on region";
-      tp = new TreePanel(alignPanel, type, pwType);
+      tp = new TreePanel(alignPanel, type, sm, options);
+      frameTitle = tp.getPanelTitle() + " on region";
     }
     else
     {
@@ -3662,19 +3663,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         return;
       }
 
-      tp = new TreePanel(alignPanel, type, pwType);
+      tp = new TreePanel(alignPanel, type, sm, options);
+      frameTitle = tp.getPanelTitle();
     }
 
-    title += " from ";
+    frameTitle += " from ";
 
     if (viewport.viewName != null)
     {
-      title += viewport.viewName + " of ";
+      frameTitle += viewport.viewName + " of ";
     }
 
-    title += this.title;
+    frameTitle += this.title;
 
-    Desktop.addInternalFrame(tp, title, 600, 500);
+    Desktop.addInternalFrame(tp, frameTitle, 600, 500);
   }
 
   /**
@@ -3950,13 +3952,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (value == JalviewFileChooser.APPROVE_OPTION)
     {
-      String choice = chooser.getSelectedFile().getPath();
-      jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
-      jalview.io.NewickFile fin = null;
+      String filePath = chooser.getSelectedFile().getPath();
+      Cache.setProperty("LAST_DIRECTORY", filePath);
+      NewickFile fin = null;
       try
       {
-        fin = new NewickFile(choice, DataSourceType.FILE);
-        viewport.setCurrentTree(ShowNewickTree(fin, choice).getTree());
+        fin = new NewickFile(filePath, DataSourceType.FILE);
+        viewport.setCurrentTree(showNewickTree(fin, filePath).getTree());
       } catch (Exception ex)
       {
         JvOptionPane
@@ -3978,19 +3980,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
   }
 
-  public TreePanel ShowNewickTree(NewickFile nf, String title)
+  public TreePanel showNewickTree(NewickFile nf, String treeTitle)
   {
-    return ShowNewickTree(nf, title, 600, 500, 4, 5);
+    return showNewickTree(nf, treeTitle, 600, 500, 4, 5);
   }
 
-  public TreePanel ShowNewickTree(NewickFile nf, String title, int w,
+  public TreePanel showNewickTree(NewickFile nf, String treeTitle, int w,
           int h, int x, int y)
   {
-    return ShowNewickTree(nf, title, null, w, h, x, y);
+    return showNewickTree(nf, treeTitle, null, w, h, x, y);
   }
 
   /**
-   * Add a treeviewer for the tree extracted from a newick file object to the
+   * Add a treeviewer for the tree extracted from a Newick file object to the
    * current alignment view
    * 
    * @param nf
@@ -4009,7 +4011,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    *          position
    * @return TreePanel handle
    */
-  public TreePanel ShowNewickTree(NewickFile nf, String title,
+  public TreePanel showNewickTree(NewickFile nf, String treeTitle,
           AlignmentView input, int w, int h, int x, int y)
   {
     TreePanel tp = null;
@@ -4020,7 +4022,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       if (nf.getTree() != null)
       {
-        tp = new TreePanel(alignPanel, NJTree.FROM_FILE, title, nf, input);
+        tp = new TreePanel(alignPanel, nf, treeTitle, input);
 
         tp.setSize(w, h);
 
@@ -4029,7 +4031,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           tp.setLocation(x, y);
         }
 
-        Desktop.addInternalFrame(tp, title, w, h);
+        Desktop.addInternalFrame(tp, treeTitle, w, h);
       }
     } catch (Exception ex)
     {
@@ -5631,13 +5633,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     ColourMenuHelper.setColourSelected(colourMenu, schemeName);
   }
-
-  public void newTreePanel(String treeType, ScoreModelI sm)
-  {
-    String scoreModelName = sm.getName();
-    final String ttl = TreePanel.getPanelTitle(treeType, scoreModelName);
-    newTreePanel(treeType, scoreModelName, ttl);
-  }
 }
 
 class PrintThread extends Thread
index 3ac453f..68184e9 100644 (file)
@@ -3666,7 +3666,7 @@ public class Jalview2XML
         TreePanel tp = (TreePanel) retrieveExistingObj(tree.getId());
         if (tp == null)
         {
-          tp = af.ShowNewickTree(
+          tp = af.showNewickTree(
                   new jalview.io.NewickFile(tree.getNewick()),
                   tree.getTitle(), tree.getWidth(), tree.getHeight(),
                   tree.getXpos(), tree.getYpos());
index e751a2c..70a341d 100755 (executable)
@@ -464,7 +464,7 @@ public class Jalview2XML_V1
 
           Tree tree = jms.getTree(t);
 
-          TreePanel tp = af.ShowNewickTree(
+          TreePanel tp = af.showNewickTree(
                   new jalview.io.NewickFile(tree.getNewick()),
                   tree.getTitle(), tree.getWidth(), tree.getHeight(),
                   tree.getXpos(), tree.getYpos());
index 8e2bff0..3542532 100644 (file)
@@ -22,18 +22,24 @@ package jalview.gui;
 
 import jalview.analysis.NJTree;
 import jalview.analysis.scoremodels.ScoreModels;
+import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.SimilarityParamsI;
 import jalview.util.MessageManager;
 
 import java.awt.Color;
 import java.awt.FlowLayout;
 import java.awt.Font;
+import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
+import java.beans.PropertyVetoException;
 
 import javax.swing.ButtonGroup;
 import javax.swing.JButton;
+import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
 import javax.swing.JLayeredPane;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
@@ -57,6 +63,14 @@ public class TreeChooser extends JPanel
 
   private ButtonGroup treeTypes;
 
+  private JCheckBox includeGaps;
+
+  private JCheckBox matchGaps;
+
+  private JCheckBox includeGappedColumns;
+
+  private JCheckBox shorterSequence;
+
   /**
    * Constructor
    * 
@@ -68,12 +82,22 @@ public class TreeChooser extends JPanel
     init();
   }
 
+  /**
+   * Lays out the panel and adds it to the desktop
+   */
   void init()
   {
     frame = new JInternalFrame();
     frame.setContentPane(this);
     this.setBackground(Color.white);
 
+    /*
+     * Layout consists of 4 panels:
+     * - first with choice of tree method NJ or AV
+     * - second with choice of score model
+     * - third with score model parameter options
+     * - fourth with OK and Cancel
+     */
     neighbourJoining = new JRadioButton(
             MessageManager.getString("label.tree_calc_nj"));
     neighbourJoining.setOpaque(false);
@@ -83,7 +107,14 @@ public class TreeChooser extends JPanel
     treeTypes.add(neighbourJoining);
     treeTypes.add(averageDistance);
     neighbourJoining.setSelected(true);
-
+    JPanel treeChoicePanel = new JPanel();
+    treeChoicePanel.setOpaque(false);
+    treeChoicePanel.add(neighbourJoining);
+    treeChoicePanel.add(averageDistance);
+
+    /*
+     * score model drop-down
+     */
     matrixNames = new JComboBox<String>();
     ScoreModels scoreModels = ScoreModels.getInstance();
     for (ScoreModelI sm : scoreModels.getModels())
@@ -94,7 +125,28 @@ public class TreeChooser extends JPanel
         matrixNames.addItem(sm.getName());
       }
     }
-
+    JPanel scoreModelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
+    scoreModelPanel.setOpaque(false);
+    scoreModelPanel.add(matrixNames, FlowLayout.LEFT);
+
+    /*
+     * score model parameters
+     */
+    JPanel paramsPanel = new JPanel(new GridLayout(5, 1));
+    paramsPanel.setOpaque(false);
+    includeGaps = new JCheckBox("Include gaps");
+    matchGaps = new JCheckBox("Match gaps");
+    includeGappedColumns = new JCheckBox("Include gapped columns");
+    shorterSequence = new JCheckBox("Match on shorter sequence");
+    paramsPanel.add(new JLabel("Pairwise sequence scoring options"));
+    paramsPanel.add(includeGaps);
+    paramsPanel.add(matchGaps);
+    paramsPanel.add(includeGappedColumns);
+    paramsPanel.add(shorterSequence);
+
+    /*
+     * OK / Cancel buttons
+     */
     JButton ok = new JButton(MessageManager.getString("action.ok"));
     ok.setFont(VERDANA_11PT);
     ok.addActionListener(new java.awt.event.ActionListener()
@@ -105,7 +157,6 @@ public class TreeChooser extends JPanel
         ok_actionPerformed(e);
       }
     });
-
     JButton cancel = new JButton(MessageManager.getString("action.cancel"));
     cancel.setFont(VERDANA_11PT);
     cancel.addActionListener(new java.awt.event.ActionListener()
@@ -116,25 +167,18 @@ public class TreeChooser extends JPanel
         cancel_actionPerformed(e);
       }
     });
+    JPanel actionPanel = new JPanel();
+    actionPanel.setOpaque(false);
+    actionPanel.add(ok);
+    actionPanel.add(cancel);
 
-    JPanel p1 = new JPanel();
-    p1.setOpaque(false);
-    p1.add(neighbourJoining);
-    p1.add(averageDistance);
-    this.add(p1);
-    JPanel p2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
-    p2.setOpaque(false);
-    p2.add(matrixNames, FlowLayout.LEFT);
-    this.add(p2);
-    JPanel p3 = new JPanel();
-    p3.setOpaque(false);
-    p3.add(ok);
-    p3.add(cancel);
-    this.add(p3);
+    this.add(treeChoicePanel);
+    this.add(scoreModelPanel);
+    this.add(paramsPanel);
+    this.add(actionPanel);
 
     Desktop.addInternalFrame(frame,
-            MessageManager.getString("label.choose_tree"),
-              400, 200, false);
+            MessageManager.getString("label.choose_tree"), 400, 400, false);
 
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
   }
@@ -146,19 +190,29 @@ public class TreeChooser extends JPanel
    */
   protected void ok_actionPerformed(ActionEvent e)
   {
+    String treeType = neighbourJoining.isSelected() ? NJTree.NEIGHBOUR_JOINING
+            : NJTree.AVERAGE_DISTANCE;
+    ScoreModelI sm = ScoreModels.getInstance().forName(
+            matrixNames.getSelectedItem().toString());
+    SimilarityParamsI params = getSimilarityParameters();
+    af.newTreePanel(treeType, sm, params);
+
     try
     {
       frame.setClosed(true);
-      String treeType = neighbourJoining.isSelected() ? NJTree.NEIGHBOUR_JOINING
-              : NJTree.AVERAGE_DISTANCE;
-      ScoreModelI sm = ScoreModels.getInstance().forName(
-              matrixNames.getSelectedItem().toString());
-      af.newTreePanel(treeType, sm);
-    } catch (Exception ex)
+    } catch (PropertyVetoException ex)
     {
     }
   }
 
+  private SimilarityParamsI getSimilarityParameters()
+  {
+    SimilarityParamsI params = new SimilarityParams(
+            includeGappedColumns.isSelected(), matchGaps.isSelected(),
+            includeGaps.isSelected(), shorterSequence.isSelected());
+    return params;
+  }
+
   /**
    * Closes dialog on cancel
    * 
index 857e77c..9ac2872 100755 (executable)
@@ -22,9 +22,8 @@ package jalview.gui;
 
 import jalview.analysis.AlignmentSorter;
 import jalview.analysis.NJTree;
-import jalview.analysis.scoremodels.ScoreModels;
-import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.SimilarityParamsI;
 import jalview.api.analysis.ViewBasedAnalysisI;
 import jalview.bin.Cache;
 import jalview.commands.CommandI;
@@ -72,9 +71,13 @@ import org.jibble.epsgraphics.EpsGraphics2D;
  */
 public class TreePanel extends GTreePanel
 {
-  String type;
+  String treeType;
 
-  String pwtype;
+  ScoreModelI scoreModel; // if tree computed
+
+  String treeTitle; // if tree loaded
+
+  SimilarityParamsI similarityParams;
 
   TreeCanvas treeCanvas;
 
@@ -85,34 +88,29 @@ public class TreePanel extends GTreePanel
   /**
    * Creates a new TreePanel object.
    * 
-   * @param av
-   *          DOCUMENT ME!
-   * @param seqVector
-   *          DOCUMENT ME!
+   * @param ap
    * @param type
-   *          DOCUMENT ME!
-   * @param pwtype
-   *          DOCUMENT ME!
-   * @param s
-   *          DOCUMENT ME!
-   * @param e
-   *          DOCUMENT ME!
+   * @param sm
+   * @param options
    */
-  public TreePanel(AlignmentPanel ap, String type, String pwtype)
+  public TreePanel(AlignmentPanel ap, String type, ScoreModelI sm,
+          SimilarityParamsI options)
   {
     super();
-    initTreePanel(ap, type, pwtype, null, null);
+    this.similarityParams = options;
+    initTreePanel(ap, type, sm, null, null);
 
     // We know this tree has distances. JBPNote TODO: prolly should add this as
     // a userdefined default
     // showDistances(true);
   }
 
-  public TreePanel(AlignmentPanel av, String type, String pwtype,
-          NewickFile newtree, AlignmentView inputData)
+  public TreePanel(AlignmentPanel alignPanel, NewickFile newtree,
+          String theTitle, AlignmentView inputData)
   {
     super();
-    initTreePanel(av, type, pwtype, newtree, inputData);
+    this.treeTitle = theTitle;
+    initTreePanel(alignPanel, null, null, newtree, inputData);
   }
 
   public AlignmentI getAlignment()
@@ -125,13 +123,13 @@ public class TreePanel extends GTreePanel
     return treeCanvas.av;
   }
 
-  void initTreePanel(AlignmentPanel ap, String type, String pwtype,
+  void initTreePanel(AlignmentPanel ap, String type, ScoreModelI sm,
           NewickFile newTree, AlignmentView inputData)
   {
 
     av = ap.av;
-    this.type = type;
-    this.pwtype = pwtype;
+    this.treeType = type;
+    this.scoreModel = sm;
 
     treeCanvas = new TreeCanvas(this, ap, scrollPane);
     scrollPane.setViewportView(treeCanvas);
@@ -247,17 +245,17 @@ public class TreePanel extends GTreePanel
   {
     NewickFile newtree;
 
-    jalview.datamodel.AlignmentView odata = null;
+    AlignmentView odata = null;
 
-    public TreeLoader(NewickFile newtree)
+    public TreeLoader(NewickFile newickFile)
     {
-      this.newtree = newtree;
-      if (newtree != null)
+      this.newtree = newickFile;
+      if (newickFile != null)
       {
         // Must be outside run(), as Jalview2XML tries to
         // update distance/bootstrap visibility at the same time
-        showBootstrap(newtree.HasBootstrap());
-        showDistances(newtree.HasDistances());
+        showBootstrap(newickFile.HasBootstrap());
+        showDistances(newickFile.HasDistances());
       }
     }
 
@@ -283,26 +281,8 @@ public class TreePanel extends GTreePanel
       }
       else
       {
-        int start, end;
-        SequenceI[] seqs;
-        boolean selview = av.getSelectionGroup() != null
-                && av.getSelectionGroup().getSize() > 1;
-        AlignmentView seqStrings = av.getAlignmentView(selview);
-        if (!selview)
-        {
-          start = 0;
-          end = av.getAlignment().getWidth();
-          seqs = av.getAlignment().getSequencesArray();
-        }
-        else
-        {
-          start = av.getSelectionGroup().getStartRes();
-          end = av.getSelectionGroup().getEndRes() + 1;
-          seqs = av.getSelectionGroup().getSequencesInOrder(
-                  av.getAlignment());
-        }
-        ScoreModelI sm = configureScoreModel(pwtype);
-        tree = new NJTree(av, type, sm, SimilarityParams.Jalview);
+        ScoreModelI sm = configureScoreModel();
+        tree = new NJTree(av, treeType, sm, similarityParams);
         showDistances(true);
       }
 
@@ -362,7 +342,7 @@ public class TreePanel extends GTreePanel
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer();
 
-    String newTitle = getPanelTitle(type, pwtype);
+    String newTitle = getPanelTitle();
 
     NewickFile fout = new NewickFile(tree.getTopNode());
     try
@@ -575,11 +555,11 @@ public class TreePanel extends GTreePanel
 
   public CommandI sortAlignmentIn(AlignmentPanel ap)
   {
-    AlignmentViewport av = ap.av;
-    SequenceI[] oldOrder = av.getAlignment().getSequencesArray();
-    AlignmentSorter.sortByTree(av.getAlignment(), tree);
+    AlignmentViewport viewport = ap.av;
+    SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
+    AlignmentSorter.sortByTree(viewport.getAlignment(), tree);
     CommandI undo;
-    undo = new OrderCommand("Tree Sort", oldOrder, av.getAlignment());
+    undo = new OrderCommand("Tree Sort", oldOrder, viewport.getAlignment());
 
     ap.paintAlignment(true);
     return undo;
@@ -607,11 +587,11 @@ public class TreePanel extends GTreePanel
     return treeCanvas.font;
   }
 
-  public void setTreeFont(Font font)
+  public void setTreeFont(Font f)
   {
     if (treeCanvas != null)
     {
-      treeCanvas.setFont(font);
+      treeCanvas.setFont(f);
     }
   }
 
@@ -834,8 +814,8 @@ public class TreePanel extends GTreePanel
           }
           if (newname != null)
           {
-            String oldname = ((SequenceNode) node).getName();
-            // TODO : save in the undo object for this modification.
+            // String oldname = ((SequenceNode) node).getName();
+            // TODO : save oldname in the undo object for this modification.
             ((SequenceNode) node).setName(newname);
           }
         }
@@ -849,17 +829,13 @@ public class TreePanel extends GTreePanel
    * Neighbour Joining Using BLOSUM62
    * <p>
    * For a tree loaded from file, just uses the file name
-   * 
-   * @param treeType
-   *          NJ or AV or FromFile
-   * @param modelOrFileName
    * @return
    */
-  public static String getPanelTitle(String treeType, String modelOrFileName)
+  public String getPanelTitle()
   {
-    if (NJTree.FROM_FILE.equals(treeType))
+    if (treeTitle != null)
     {
-      return modelOrFileName;
+      return treeTitle;
     }
 
     /*
@@ -869,10 +845,10 @@ public class TreePanel extends GTreePanel
             + treeType.toLowerCase());
 
     /*
-     * i18n description (if any) of score model used
+     * i18n description (if available) of score model used
      */
     String smn = MessageManager.getStringOrReturn("label.score_model_",
-            modelOrFileName);
+            scoreModel.getName());
 
     /*
      * put them together as <method> Using <model>
@@ -883,27 +859,26 @@ public class TreePanel extends GTreePanel
   }
 
   /**
-   * Gets the score model for the given name. If the score model is one that
-   * requires to get state data from the current view, allow it to do so
+   * If the score model is one that requires to get state data from the current
+   * view, create and configure a new instance of it
    * 
-   * @param sm
    * @return
    */
-  protected ScoreModelI configureScoreModel(String modelName)
+  protected ScoreModelI configureScoreModel()
   {
-    ScoreModelI sm = ScoreModels.getInstance().forName(modelName);
-    if (sm instanceof ViewBasedAnalysisI)
+    if (scoreModel instanceof ViewBasedAnalysisI)
     {
       try
       {
-        sm = sm.getClass().newInstance();
-        ((ViewBasedAnalysisI) sm).configureFromAlignmentView(treeCanvas.ap);
+        scoreModel = scoreModel.getClass().newInstance();
+        ((ViewBasedAnalysisI) scoreModel)
+                .configureFromAlignmentView(treeCanvas.ap);
       } catch (Exception q)
       {
         Cache.log.error("Couldn't create a scoremodel instance for "
-                + sm.getName());
+                + scoreModel.getName());
       }
     }
-    return sm;
+    return scoreModel;
   }
 }
index 2c35547..1cab8ca 100644 (file)
@@ -1942,7 +1942,7 @@ public class VamsasAppDatastore
                 TreePanel tp = null;
                 if (vstree.isValidTree())
                 {
-                  tp = alignFrame.ShowNewickTree(vstree.getNewickTree(),
+                  tp = alignFrame.showNewickTree(vstree.getNewickTree(),
                           vstree.getTitle(), vstree.getInputData(), 600,
                           500, t * 20 + 50, t * 20 + 50);
 
index b14917e..edc9ae8 100644 (file)
@@ -666,7 +666,7 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI
               AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
       if (nf != null)
       {
-        af.ShowNewickTree(nf, MessageManager.formatMessage(
+        af.showNewickTree(nf, MessageManager.formatMessage(
                 "label.tree_from", new String[] { this.alTitle }));
       }
       // initialise with same renderer settings as in parent alignframe.