Exemplo n.º 1
0
  private void disableProtegeOntology() {
    if (OWLUtil.confirmSaveAndReload(owlModel.getProject())) {
      owlModel.getDefaultOWLOntology().removeImports(ProtegeNames.PROTEGE_OWL_ONTOLOGY);
      OWLUtil.saveAndReloadProject();
    }

    userDatatypesCBox.setSelected(false);
    userDatatypesCBox.setEnabled(false);
  }
Exemplo n.º 2
0
  ProtegeSettingsPanel(final JenaOWLModel owlModel) {
    this.owlModel = owlModel;

    importMetaCBox = new JCheckBox("Import Protege metadata ontology");
    importMetaCBox.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (importMetaCBox.isSelected()) {
              enableProtegeOntology();
            } else {
              disableProtegeOntology();
            }
          }
        });
    if (owlModel.isProtegeMetaOntologyImported()) {
      importMetaCBox.setSelected(true);
      if (!isMetadataOntologyImportedDirectly(OWLUtil.getActiveOntology(owlModel))) {
        importMetaCBox.setEnabled(false);
      }
    }

    userDatatypesCBox = new JCheckBox("Support user-defined XML Schema datatypes (numeric ranges)");
    userDatatypesCBox.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            setUserDefinedDatatypesSupported(owlModel, userDatatypesCBox.isSelected());
            ProtegeUI.reloadUI(owlModel);
          }
        });
    userDatatypesCBox.setEnabled(importMetaCBox.isSelected());
    userDatatypesCBox.setSelected(ProtegeSettingsPanel.isUserDefinedDatatypesSupported(owlModel));

    setBorder(BorderFactory.createTitledBorder("Protege Features"));
    setLayout(new GridLayout(2, 1));
    add(importMetaCBox);
    add(userDatatypesCBox);
  }