use of edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor in project webprotege by protegeproject.
the class PropertyValueListEditor method getValue.
@Override
public Optional<PropertyValueList> getValue() {
Optional<List<PropertyValueDescriptor>> value = editor.getValue();
if (!value.isPresent()) {
return Optional.empty();
}
List<PropertyValue> propertyValues = Lists.newArrayList();
for (PropertyValueDescriptor val : value.get()) {
java.util.Optional<PropertyValue> propertyValue = val.toPropertyValue();
if (propertyValue.isPresent()) {
propertyValues.add(propertyValue.get());
}
}
return Optional.of(new PropertyValueList(propertyValues));
}
use of edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor in project webprotege by protegeproject.
the class PropertyValueDescriptorEditorImpl method getValue.
@Override
public Optional<PropertyValueDescriptor> getValue() {
if (state == State.DERIVED) {
return currentValue;
} else {
if (propertyField.getValue().isPresent() && valueField.getValue().isPresent()) {
Set<OWLAxiom> augmentingAxioms = Sets.newHashSet();
java.util.Optional<EntitySuggestion> selectedSuggestion = valueField.getSelectedSuggestion();
if (selectedSuggestion.isPresent()) {
if (selectedSuggestion.get() instanceof FreshEntitySuggestion) {
augmentingAxioms.addAll(((FreshEntitySuggestion) selectedSuggestion.get()).getAugmentingAxioms());
}
}
return Optional.of(new PropertyValueDescriptor((OWLPropertyData) propertyField.getValue().get(), valueField.getValue().get(), state, false, augmentingAxioms));
} else {
return Optional.empty();
}
}
}
use of edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor in project webprotege by protegeproject.
the class PropertyValueListEditor method fillUp.
private void fillUp(PropertyValueList propertyValueList) {
List<PropertyValueDescriptor> vals = Lists.newArrayList();
for (PropertyValue propertyValue : propertyValueList.getPropertyValues()) {
// if (propertyValue.getState() == State.ASSERTED) {
Optional<PropertyValueDescriptor> val = addRelationship(propertyValue);
if (val.isPresent()) {
vals.add(val.get());
}
// }
}
editor.setValue(vals);
}
Aggregations