package jalview.datamodel;
import jalview.datamodel.features.FeatureAttributeType;
+import jalview.datamodel.features.FeatureAttributes;
import jalview.datamodel.features.FeatureLocationI;
import jalview.datamodel.features.FeatureSourceI;
import jalview.datamodel.features.FeatureSources;
// private key for ENA location designed not to conflict with real GFF data
private static final String LOCATION = "!Location";
- private static final String ROW_DATA = "<tr><td width=\"10%%\">%s</td><td width=\"50%%\">%s</td><td width=\"40%%\">%s</td></tr>";
+ private static final String ROW_DATA = "<tr><td>%s</td><td>%s</td><td>%s</td></tr>";
/*
* map of otherDetails special keys, and their value fields' delimiter
this(newType, sf.getDescription(), newBegin, newEnd, newScore,
newGroup);
+ this.source = sf.source;
+
if (sf.otherDetails != null)
{
otherDetails = new HashMap<String, Object>();
}
/**
+ * Answers the value of the specified attribute as string, or null if no such
+ * value
+ *
+ * @param key
+ * @return
+ */
+ public String getValueAsString(String key)
+ {
+ if (otherDetails == null)
+ {
+ return null;
+ }
+ Object value = otherDetails.get(key);
+ return value == null ? null : value.toString();
+ }
+
+ /**
* Returns a property value for the given key if known, else the specified
* default value
*
}
otherDetails.put(key, value);
+ FeatureAttributes.getInstance().addAttribute(this.type, key);
}
}
return true;
}
- FeatureAttributeType attributeType = metadata.getAttributeType(key);
- if (attributeType == FeatureAttributeType.Float
- || attributeType.equals(FeatureAttributeType.Integer))
+ FeatureAttributeType attType = metadata.getAttributeType(key);
+ if (attType != null
+ && (attType == FeatureAttributeType.Float || attType
+ .equals(FeatureAttributeType.Integer)))
{
try
{