git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git]
/
src
/
jalview
/
analysis
/
scoremodels
/
ScoreModels.java
diff --git
a/src/jalview/analysis/scoremodels/ScoreModels.java
b/src/jalview/analysis/scoremodels/ScoreModels.java
index
8afc4fc
..
8700ec0
100644
(file)
--- a/
src/jalview/analysis/scoremodels/ScoreModels.java
+++ b/
src/jalview/analysis/scoremodels/ScoreModels.java
@@
-22,7
+22,8
@@
package jalview.analysis.scoremodels;
import jalview.api.AlignmentViewPanel;
import jalview.api.analysis.ScoreModelI;
import jalview.api.AlignmentViewPanel;
import jalview.api.analysis.ScoreModelI;
-import jalview.bin.Instance;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.io.DataSourceType;
import jalview.io.FileParse;
import jalview.io.ScoreMatrixFile;
import jalview.io.DataSourceType;
import jalview.io.FileParse;
import jalview.io.ScoreMatrixFile;
@@
-34,14
+35,8
@@
import java.util.Map;
/**
* A class that can register and serve instances of ScoreModelI
*/
/**
* A class that can register and serve instances of ScoreModelI
*/
-public class ScoreModels
+public class ScoreModels implements ApplicationSingletonI
{
{
- private final ScoreMatrix BLOSUM62;
-
- private final ScoreMatrix PAM250;
-
- private final ScoreMatrix DNA;
-
/**
* Answers the singleton instance of this class, with lazy initialisation
* (built-in score models are loaded on the first call to this method)
/**
* Answers the singleton instance of this class, with lazy initialisation
* (built-in score models are loaded on the first call to this method)
@@
-50,13
+45,9
@@
public class ScoreModels
*/
public static ScoreModels getInstance()
{
*/
public static ScoreModels getInstance()
{
- Instance j = Instance.getInstance();
- return (j.scoreModels == null ? j.scoreModels = new ScoreModels()
- : j.scoreModels);
+ return (ScoreModels) ApplicationSingletonProvider.getInstance(ScoreModels.class);
}
}
- private Map<String, ScoreModelI> models;
-
/**
* Private constructor to enforce use of singleton. Registers Jalview's
* "built-in" score models:
/**
* Private constructor to enforce use of singleton. Registers Jalview's
* "built-in" score models:
@@
-81,6
+72,14
@@
public class ScoreModels
registerScoreModel(new FeatureDistanceModel());
}
registerScoreModel(new FeatureDistanceModel());
}
+ private final ScoreMatrix BLOSUM62;
+
+ private final ScoreMatrix PAM250;
+
+ private final ScoreMatrix DNA;
+
+ private Map<String, ScoreModelI> models;
+
/**
* Tries to load a score matrix from the given resource file, and if
* successful, registers it.
/**
* Tries to load a score matrix from the given resource file, and if
* successful, registers it.
@@
-150,7
+149,7
@@
public class ScoreModels
*/
public void reset()
{
*/
public void reset()
{
- Instance.getInstance().scoreModels = new ScoreModels();
+ ApplicationSingletonProvider.removeInstance(this.getClass());
}
/**
}
/**