コード例 #1
0
 private void removeSelectedProperty() {
   Collection oldValues = ((AbstractOWLModel) owlModel).getDefaultAnnotationPropertiesInView();
   oldValues.removeAll(list.getSelection());
   ((AbstractOWLModel) owlModel).setDefaultAnnotationPropertiesInView(oldValues);
   list.setListData(
       ((AbstractOWLModel) owlModel).getDefaultAnnotationPropertiesInView().toArray());
 }
コード例 #2
0
  private void addProperty() {
    Collection oldValues = ((AbstractOWLModel) owlModel).getDefaultAnnotationPropertiesInView();
    Collection properties = owlModel.getRDFProperties();
    for (Iterator it = properties.iterator(); it.hasNext(); ) {
      RDFProperty property = (RDFProperty) it.next();
      if (oldValues.contains(property)
          || (((Slot) property).getValueType() != ValueType.STRING
              && !property.isAnnotationProperty())) {
        it.remove();
      }
    }

    Collection neo = new HashSet(oldValues);
    neo.addAll(
        ProtegeUI.getSelectionDialogFactory()
            .selectResourcesFromCollection(this, owlModel, properties, "Add properties..."));
    ((AbstractOWLModel) owlModel).setDefaultAnnotationPropertiesInView(neo);
    list.setListData(
        ((AbstractOWLModel) owlModel).getDefaultAnnotationPropertiesInView().toArray());
  }