JAL-2499 inlined two 1-line methods
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 2 May 2017 09:42:13 +0000 (10:42 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 2 May 2017 09:42:13 +0000 (10:42 +0100)
src/jalview/appletgui/TreePanel.java
src/jalview/gui/TreePanel.java

index 70a3c04..8b1f79c 100644 (file)
@@ -190,7 +190,9 @@ public class TreePanel extends EmbmenuFrame implements ActionListener,
       }
       else
       {
-        ScoreModelI sm = configureScoreModel(pwtype);
+        ScoreModelI sm1 = ScoreModels.getInstance().getScoreModel(pwtype,
+                treeCanvas.ap);
+        ScoreModelI sm = sm1;
         TreeBuilder njtree = type.equals(TreeBuilder.NEIGHBOUR_JOINING) ? new NJTree(
                 av, sm, SimilarityParams.Jalview)
                 : new AverageDistanceTree(av, sm, SimilarityParams.Jalview);
@@ -362,18 +364,4 @@ public class TreePanel extends EmbmenuFrame implements ActionListener,
     inputData.addActionListener(this);
   }
 
-  /**
-   * Gets an instantiated score model for the given name, configured for the
-   * current view if applicable
-   * 
-   * @param modelName
-   * @return
-   */
-  protected ScoreModelI configureScoreModel(String modelName)
-  {
-    ScoreModelI sm = ScoreModels.getInstance().getScoreModel(modelName,
-            treeCanvas.ap);
-    return sm;
-  }
-
 }
index f2f0bf7..9dd805e 100755 (executable)
@@ -275,7 +275,8 @@ public class TreePanel extends GTreePanel
       }
       else
       {
-        ScoreModelI sm = configureScoreModel();
+        ScoreModelI sm = ScoreModels.getInstance().getScoreModel(
+                scoreModelName, treeCanvas.ap);
         TreeBuilder njtree = treeType.equals(TreeBuilder.NEIGHBOUR_JOINING) ? new NJTree(
                 av, sm, similarityParams) : new AverageDistanceTree(av, sm,
                 similarityParams);
@@ -850,16 +851,4 @@ public class TreePanel extends GTreePanel
             treecalcnm, smn);
     return ttl;
   }
-
-  /**
-   * Instantiate an instance of the score model, configured for the current view
-   * if applicable
-   * 
-   * @return
-   */
-  protected ScoreModelI configureScoreModel()
-  {
-    return ScoreModels.getInstance().getScoreModel(scoreModelName,
-            treeCanvas.ap);
-  }
 }