use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistry in project webanno by webanno.
the class Renderer method getFeatures.
default Map<String, String> getFeatures(TypeAdapter aAdapter, AnnotationFS aFs, List<AnnotationFeature> aFeatures) {
FeatureSupportRegistry fsr = getFeatureSupportRegistry();
Map<String, String> features = new LinkedHashMap<>();
for (AnnotationFeature feature : aFeatures) {
if (!feature.isEnabled() || !feature.isVisible() || !MultiValueMode.NONE.equals(feature.getMultiValueMode())) {
continue;
}
Feature labelFeature = aFs.getType().getFeatureByBaseName(feature.getName());
String label = defaultString(fsr.getFeatureSupport(feature).renderFeatureValue(feature, aFs, labelFeature));
features.put(feature.getName(), label);
}
return features;
}
use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistry in project webanno by webanno.
the class Renderer method getHoverFeatures.
default Map<String, String> getHoverFeatures(TypeAdapter aAdapter, AnnotationFS aFs, List<AnnotationFeature> aFeatures) {
FeatureSupportRegistry fsr = getFeatureSupportRegistry();
Map<String, String> hoverfeatures = new LinkedHashMap<>();
if (aAdapter.getLayer().isShowTextInHover())
hoverfeatures.put("__spantext__", aFs.getCoveredText());
for (AnnotationFeature feature : aFeatures) {
if (!feature.isEnabled() || !feature.isIncludeInHover() || !MultiValueMode.NONE.equals(feature.getMultiValueMode())) {
continue;
}
Feature labelFeature = aFs.getType().getFeatureByBaseName(feature.getName());
String text = defaultString(fsr.getFeatureSupport(feature).renderFeatureValue(feature, aFs, labelFeature));
hoverfeatures.put(feature.getName(), text);
}
return hoverfeatures;
}
Aggregations