- boolean ignoreScore = method != FEATURE_SCORE;
- StringBuffer scoreLabel = new StringBuffer();
- scoreLabel.append(start + stop + method);
- // This doesn't quite work yet - we'd like to have a canonical ordering that
- // can be preserved from call to call
- if (featureLabels != null)
- {
- for (String label : featureLabels)
- {
- scoreLabel.append(label);
- }
- }
- if (groupLabels != null)
- {
- for (String label : groupLabels)
- {
- scoreLabel.append(label);
- }
- }
-
- /*
- * if resorting the same feature, toggle sort order
- */
- if (lastSortByFeatureScore == null
- || !scoreLabel.toString().equals(lastSortByFeatureScore))
- {
- sortByFeatureScoreAscending = true;
- }
- else
- {
- sortByFeatureScoreAscending = !sortByFeatureScoreAscending;
- }
- lastSortByFeatureScore = scoreLabel.toString();
+ flipFeatureSortIfUnchanged(method, featureTypes, groups, startCol,
+ endCol);