public void setOntology(OWLOntology ont) { this.ont = ont; List<Object> data = new ArrayList<>(); data.add(directImportsHeader); // @@TODO ordering for (OWLImportsDeclaration decl : ont.getImportsDeclarations()) { data.add(new OntologyImportItem(ont, decl, editorKit)); } data.add(indirectImportsHeader); // @@TODO ordering try { for (OWLOntology ontRef : editorKit.getOWLModelManager().getOWLOntologyManager().getImportsClosure(ont)) { if (!ontRef.equals(ont)) { for (OWLImportsDeclaration dec : ontRef.getImportsDeclarations()) { if (!data.contains(dec)) { data.add(new OntologyImportItem(ontRef, dec, editorKit)); } } } } } catch (UnknownOWLOntologyException e) { throw new OWLRuntimeException(e); } setListData(data.toArray()); }
/** * Determines if the reference ontology (if set) is equal to the active ontology. * * @return <code>true</code> if the reference ontology is equal to the active ontology, otherwise * <code>false</code>. */ public boolean isReferenceOntologyActive() { return ontology != null && ontology.equals(editorKit.getOWLModelManager().getActiveOntology()); }