*/
public class OWLKBAssertedGraphModel extends OWLKBAbstractGraphModel {
public OWLKBAssertedGraphModel(OWLModel model) {
super(model);
final OWLVizOptions options = OWLVizOptions.getInstance();
model.addKnowledgeBaseListener(new KnowledgeBaseAdapter() {
public void clsCreated(KnowledgeBaseEvent event) {
ArrayList list = new ArrayList(1);
list.add(event.getCls());
fireObjectsAddedEvent(list);
}
public void clsDeleted(KnowledgeBaseEvent event) {
ArrayList list = new ArrayList(1);
list.add(event.getCls());
fireObjectsRemovedEvent(list);
}
});
model.addClsListener(new ClsListener() {
public void directInstanceAdded(ClsEvent event) {
if(options.isDisplayIndividuals() == true) {
fireChildAddedEvent(event.getCls(), event.getInstance());
}
}
public void directInstanceRemoved(ClsEvent event) {
if(options.isDisplayIndividuals() == true) {
fireChildRemovedEvent(event.getCls(), event.getInstance());
}
}