private Comparator<TaxonNode> comparator;
public MatrixRowComparator() {
- if (PreferencesUtil.getSortNodesNaturally()){
+ if (PreferencesUtil.isNodesSortedNaturally()){
comparator = new TaxonNaturalComparator();
- } else if (PreferencesUtil.getSortNodesStrictlyAlphabetically()){
+ } else if (PreferencesUtil.isNodesSortedByName()){
comparator = new TaxonNodeByNameComparator();
}else {
comparator = new TaxonNodeByRankAndNameComparator();
@Override
public int compare(Object o1, Object o2) {
+ if(o1 instanceof TaxonNode){
+ if(o2 instanceof RowWrapperDTO){
+ return 1;
+ }
+ }
+ else{
+ if(o2 instanceof TaxonNode){
+ return -1;
+ }
+ }
if(o1 instanceof TaxonNode && o2 instanceof TaxonNode){
return comparator.compare((TaxonNode)o1, (TaxonNode)o2);
}