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-3453 Some tests require different Desktop constructor
[jalview.git]
/
src
/
jalview
/
analysis
/
AlignmentSorter.java
diff --git
a/src/jalview/analysis/AlignmentSorter.java
b/src/jalview/analysis/AlignmentSorter.java
index
b764787
..
8634db6
100755
(executable)
--- a/
src/jalview/analysis/AlignmentSorter.java
+++ b/
src/jalview/analysis/AlignmentSorter.java
@@
-22,7
+22,8
@@
package jalview.analysis;
import jalview.analysis.scoremodels.PIDModel;
import jalview.analysis.scoremodels.SimilarityParams;
import jalview.analysis.scoremodels.PIDModel;
import jalview.analysis.scoremodels.SimilarityParams;
-import jalview.bin.Jalview;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
@@
-52,9
+53,20
@@
import java.util.List;
* from the first tobesorted position in the alignment. e.g. (a,tb2,b,tb1,c,tb3
* becomes a,tb1,tb2,tb3,b,c)
*/
* from the first tobesorted position in the alignment. e.g. (a,tb2,b,tb1,c,tb3
* becomes a,tb1,tb2,tb3,b,c)
*/
-public class AlignmentSorter
+public class AlignmentSorter implements ApplicationSingletonI
{
{
+ private AlignmentSorter()
+ {
+ // private singleton
+ }
+
+ private static AlignmentSorter getInstance()
+ {
+ return (AlignmentSorter) ApplicationSingletonProvider
+ .getInstance(AlignmentSorter.class);
+ }
+
/**
* types of feature ordering: Sort by score : average score - or total score -
* over all features in region Sort by feature label text: (or if null -
/**
* types of feature ordering: Sort by score : average score - or total score -
* over all features in region Sort by feature label text: (or if null -
@@
-67,14
+79,6
@@
public class AlignmentSorter
public static final String FEATURE_DENSITY = "density";
public static final String FEATURE_DENSITY = "density";
- public static AlignmentSorter getInstance()
- {
- Jalview j = Jalview.getInstance();
- return (j.alignmentSorter == null
- ? j.alignmentSorter = new AlignmentSorter()
- : j.alignmentSorter);
- }
-
/*
* todo: refactor searches to follow a basic pattern: (search property, last
* search state, current sort direction)
/*
* todo: refactor searches to follow a basic pattern: (search property, last
* search state, current sort direction)