コード例 #1
0
  @Override
  public void setValue(
      final LabelledFrame<NamedIndividualFrame> frame, HasEntityDataProvider entityDataProvider) {
    editedFrame = frame.getFrame();
    displayNameField.setValue(frame.getDisplayName());
    iriField.setValue(editedFrame.getSubject().getIRI().toString());
    assertions.setValue(editedFrame.getPropertyValueList());
    setDirty(false, EventStrategy.DO_NOT_FIRE_EVENTS);

    List<OWLPrimitiveData> dataList = new ArrayList<OWLPrimitiveData>();
    for (OWLClass cls : editedFrame.getClasses()) {
      final Optional<OWLEntityData> rendering = entityDataProvider.getEntityData(cls);
      if (rendering.isPresent()) {
        dataList.add(rendering.get());
      }
    }
    OWLPrimitiveDataList list = new OWLPrimitiveDataList(dataList);
    types.setValue(list);

    List<OWLPrimitiveData> sameAsList = new ArrayList<OWLPrimitiveData>();
    for (OWLNamedIndividual individual : editedFrame.getSameIndividuals()) {
      Optional<OWLEntityData> individualRendering = entityDataProvider.getEntityData(individual);
      if (individualRendering.isPresent()) {
        sameAsList.add(individualRendering.get());
      }
    }
    sameAs.setValue(new OWLPrimitiveDataList(sameAsList));
  }
コード例 #2
0
 @Override
 public Optional<LabelledFrame<NamedIndividualFrame>> getValue() {
   if (editedFrame == null) {
     return Optional.absent();
   }
   PropertyValueList propertyValueList = assertions.getValue().get();
   Set<OWLClass> rawTypes = getRawTypes();
   Set<OWLNamedIndividual> sameAs = getRawSameAs();
   NamedIndividualFrame reference =
       new NamedIndividualFrame(
           editedFrame.getSubject(), rawTypes, propertyValueList.getPropertyValues(), sameAs);
   return Optional.of(new LabelledFrame<NamedIndividualFrame>(getDisplayName(), reference));
 }