import jalview.util.MessageManager;
import java.awt.Color;
-import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
SequenceGroup sg = viewport.getSelectionGroup();
ColumnSelection cs = viewport.getColumnSelection();
SequenceGroup[] gps = null;
- if (sg != null
- && (cs == null || cs.getSelected() == null || cs.size() == 0))
+ if (sg != null && (cs == null || cs.isEmpty()))
{
gps = jalview.analysis.Grouping.makeGroupsFrom(viewport
.getSequenceSelection(), viewport.getAlignmentView(true)
}
@Override
- public void sortAlignmentByFeatureDensity(String[] typ)
+ public void sortAlignmentByFeatureDensity(List<String> typ)
{
sortBy(typ, "Sort by Density", AlignmentSorter.FEATURE_DENSITY);
}
- protected void sortBy(String[] typ, String methodText, final String method)
+ protected void sortBy(List<String> typ, String methodText,
+ final String method)
{
FeatureRenderer fr = alignPanel.getFeatureRenderer();
- if (typ == null)
+ if (typ == null && fr != null)
{
- typ = fr == null ? null : fr.getDisplayedFeatureTypes();
+ typ = fr.getDisplayedFeatureTypes();
}
- String gps[] = null;
- gps = fr == null ? null : fr.getDisplayedFeatureGroups();
- if (typ != null)
+ List<String> gps = null;
+ if (fr != null)
{
- ArrayList types = new ArrayList();
- for (int i = 0; i < typ.length; i++)
- {
- if (typ[i] != null)
- {
- types.add(typ[i]);
- }
- typ = new String[types.size()];
- types.toArray(typ);
- }
- }
- if (gps != null)
- {
- ArrayList grps = new ArrayList();
-
- for (int i = 0; i < gps.length; i++)
- {
- if (gps[i] != null)
- {
- grps.add(gps[i]);
- }
- }
- gps = new String[grps.size()];
- grps.toArray(gps);
+ gps = fr.getDisplayedFeatureGroups();
}
AlignmentI al = viewport.getAlignment();
}
@Override
- public void sortAlignmentByFeatureScore(String[] typ)
+ public void sortAlignmentByFeatureScore(List<String> typ)
{
sortBy(typ, "Sort by Feature Score", AlignmentSorter.FEATURE_SCORE);
}
boolean featuresFile = false;
try
{
- featuresFile = new FeaturesFile(file, protocol).parse(viewport
+ featuresFile = new FeaturesFile(false, file, protocol).parse(viewport
.getAlignment().getDataset(), alignPanel.getFeatureRenderer()
.getFeatureColours(), false, relaxedIdMatching);
} catch (Exception ex)