From a5ab6cce3a64d41c3f91ba49f5e4d9536a2b0018 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 2 May 2017 10:42:13 +0100 Subject: [PATCH] JAL-2499 inlined two 1-line methods --- src/jalview/appletgui/TreePanel.java | 18 +++--------------- src/jalview/gui/TreePanel.java | 15 ++------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/src/jalview/appletgui/TreePanel.java b/src/jalview/appletgui/TreePanel.java index 70a3c04..8b1f79c 100644 --- a/src/jalview/appletgui/TreePanel.java +++ b/src/jalview/appletgui/TreePanel.java @@ -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; - } - } diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index f2f0bf7..9dd805e 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -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); - } } -- 1.7.10.2