Search in sources :

Example 1 with BrowserTextChangedEvent

use of edu.stanford.bmir.protege.web.shared.event.BrowserTextChangedEvent in project webprotege by protegeproject.

the class BrowserTextChangedEventComputer method translateOntologyChanges.

@Override
public void translateOntologyChanges(Revision revision, ChangeApplicationResult<?> changes, List<ProjectEvent<?>> projectEventList) {
    Set<OWLEntity> processedEntities = new HashSet<>();
    for (OWLOntologyChange change : changes.getChangeList()) {
        for (OWLEntity entity : hasChangeSubject.getChangeSubjects(change)) {
            if (processedEntities.add(entity)) {
                String shortForm = shortFormProvider.getShortForm(entity);
                String oldShortForm = shortFormMap.get(entity);
                if (oldShortForm == null || !shortForm.equals(oldShortForm)) {
                    projectEventList.add(new BrowserTextChangedEvent(entity, shortForm, projectId));
                }
            }
        }
    }
}
Also used : OWLOntologyChange(org.semanticweb.owlapi.model.OWLOntologyChange) OWLEntity(org.semanticweb.owlapi.model.OWLEntity) BrowserTextChangedEvent(edu.stanford.bmir.protege.web.shared.event.BrowserTextChangedEvent) HashSet(java.util.HashSet)

Aggregations

BrowserTextChangedEvent (edu.stanford.bmir.protege.web.shared.event.BrowserTextChangedEvent)1 HashSet (java.util.HashSet)1 OWLEntity (org.semanticweb.owlapi.model.OWLEntity)1 OWLOntologyChange (org.semanticweb.owlapi.model.OWLOntologyChange)1