if (fc.isColourByAttribute())
{
String[] attributeName = fc.getAttributeName();
- colourByTextCombo
- .setSelectedItem(toAttributeDisplayName(attributeName));
+ colourByTextCombo.setSelectedItem(
+ FeatureMatcher.toAttributeDisplayName(attributeName));
}
else
{
if (fc.isColourByAttribute())
{
String[] attributeName = fc.getAttributeName();
- colourByRangeCombo
- .setSelectedItem(toAttributeDisplayName(attributeName));
+ colourByRangeCombo.setSelectedItem(
+ FeatureMatcher.toAttributeDisplayName(attributeName));
}
else
{
{
// colour by attribute range
minMax = FeatureAttributes.getInstance().getMinMax(featureType,
- fromAttributeDisplayName(attName));
+ FeatureMatcher.fromAttributeDisplayName(attName));
}
return minMax;
}
String byWhat = (String) colourByTextCombo.getSelectedItem();
if (!LABEL_18N.equals(byWhat))
{
- fc.setAttributeName(fromAttributeDisplayName(byWhat));
+ fc.setAttributeName(
+ FeatureMatcher.fromAttributeDisplayName(byWhat));
}
return fc;
}
String byWhat = (String) colourByRangeCombo.getSelectedItem();
if (!SCORE_18N.equals(byWhat))
{
- fc.setAttributeName(fromAttributeDisplayName(byWhat));
+ fc.setAttributeName(FeatureMatcher.fromAttributeDisplayName(byWhat));
}
/*
return fc;
}
- /**
- * A helper method that converts a 'compound' attribute name from its display
- * form, e.g. CSQ:PolyPhen to array form, e.g. { "CSQ", "PolyPhen" }
- *
- * @param attribute
- * @return
- */
- private String[] fromAttributeDisplayName(String attribute)
- {
- return attribute == null ? null : attribute.split(COLON);
- }
-
- /**
- * A helper method that converts a 'compound' attribute name to its display
- * form, e.g. CSQ:PolyPhen from its array form, e.g. { "CSQ", "PolyPhen" }
- *
- * @param attName
- * @return
- */
- private String toAttributeDisplayName(String[] attName)
- {
- return attName == null ? "" : String.join(COLON, attName);
- }
-
@Override
protected void raiseClosed()
{
{
continue;
}
- displayAtts.add(toAttributeDisplayName(attName));
+ displayAtts.add(FeatureMatcher.toAttributeDisplayName(attName));
String desc = fa.getDescription(featureType, attName);
if (desc != null && desc.length() > MAX_TOOLTIP_LENGTH)
{
}
else
{
- attCombo.setSelectedItem(toAttributeDisplayName(attName));
+ attCombo.setSelectedItem(
+ FeatureMatcher.toAttributeDisplayName(attName));
}
attCombo.addItemListener(new ItemListener()
{
}
else
{
- item = toAttributeDisplayName(filter.getAttribute());
+ item = FeatureMatcher.toAttributeDisplayName(filter.getAttribute());
}
attCombo.setSelectedItem(item);
return item;
JComboBox<Condition> condCombo, JTextField patternField)
{
Datatype type = FeatureAttributes.getInstance().getDatatype(featureType,
- fromAttributeDisplayName(attName));
+ FeatureMatcher.fromAttributeDisplayName(attName));
if (LABEL_18N.equals(attName))
{
type = Datatype.Character;
else
{
km = FeatureMatcher.byAttribute(cond, pattern,
- fromAttributeDisplayName(attName));
+ FeatureMatcher.fromAttributeDisplayName(attName));
}
filters.set(filterIndex, km);