use of edu.stanford.bmir.protege.web.shared.axiom.AxiomTypeGroup in project webprotege by protegeproject.
the class UsagePortletPresenter method applyFilter.
private void applyFilter(FilterSet filterSet) {
Set<EntityType<?>> entityTypeSet = new HashSet<>();
if (filterSet.hasSetting(CLASS_FILTER, FilterSetting.ON)) {
entityTypeSet.add(EntityType.CLASS);
}
if (filterSet.hasSetting(PROPERTY_FILTER, FilterSetting.ON)) {
entityTypeSet.add(EntityType.OBJECT_PROPERTY);
entityTypeSet.add(EntityType.DATA_PROPERTY);
entityTypeSet.add(EntityType.ANNOTATION_PROPERTY);
}
if (filterSet.hasSetting(INDIVIDUAL_FILTER, FilterSetting.ON)) {
entityTypeSet.add(EntityType.NAMED_INDIVIDUAL);
}
if (filterSet.hasSetting(DATATYPE_FILTER, FilterSetting.ON)) {
entityTypeSet.add(EntityType.DATATYPE);
}
Set<AxiomType<?>> axiomTypes = new HashSet<>();
for (AxiomTypeGroup group : AxiomTypeGroup.values()) {
FilterId id = new FilterId(group.getDisplayName());
if (filterSet.hasSetting(id, FilterSetting.ON)) {
axiomTypes.addAll(group.getAxiomTypes());
}
}
UsageFilter usageFilter = new UsageFilter(filterSet.hasSetting(SHOW_DEFINING_AXIOMS, FilterSetting.ON), entityTypeSet, axiomTypes);
this.filter = Optional.of(usageFilter);
updateDisplayForSelectedEntity();
}
Aggregations