gate.creole.ontology
Interface OntologyModificationListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
Gaze, OntologyClassView, OntologyEditor

public interface OntologyModificationListener
extends EventListener

Objects wishing to listen to various ontology events, must implement this interface (using implements java keyword) and the methods of this interface. They must get registered themselves with the respective ontology by using the ontology.addOntologyModificationListener(OntologyModificationListener) method.

Author:
Niraj Aswani

Method Summary
 void ontologyReset(Ontology ontology)
          This method is called whenever ontology is reset.
 void resourceAdded(Ontology ontology, OResource resource)
          This method is invoked whenever a resource (class/property/instance) is added to the ontology.
 void resourcePropertyValueChanged(Ontology ontology, OResource resource, RDFProperty property, Object value, int eventType)
          This method should be invoked when a property value is added or removed (specified by the event type).
 void resourceRelationChanged(Ontology ontology, OResource resource1, OResource resource2, int eventType)
          This method is invoked whenever a relation between two objects of the same class (e.g.
 void resourcesRemoved(Ontology ontology, String[] resources)
          This method is invoked whenever a resource (class/property/instance) is removed from the ontology.
 

Method Detail

resourceRelationChanged

void resourceRelationChanged(Ontology ontology,
                             OResource resource1,
                             OResource resource2,
                             int eventType)
This method is invoked whenever a relation between two objects of the same class (e.g. OClass and OClass, RDFPRoeprty and RDFProeprty etc) is changed.

Parameters:
ontology - the source of the event
resource1 - the affected OResource
resource2 - the affected OResource
eventType - the type of an event (@see OConstants) for more details

resourcePropertyValueChanged

void resourcePropertyValueChanged(Ontology ontology,
                                  OResource resource,
                                  RDFProperty property,
                                  Object value,
                                  int eventType)
This method should be invoked when a property value is added or removed (specified by the event type).

Parameters:
ontology - the source of the event
resource - the affected resource whose property value is added or removed
property - the property whose value has been added or removed
value - the actual value that is added or removed. If the value is null - it indicates all the values related to the property are deleted.
eventType - type of the event (@see OConstants) for more details

resourcesRemoved

void resourcesRemoved(Ontology ontology,
                      String[] resources)
This method is invoked whenever a resource (class/property/instance) is removed from the ontology.

Parameters:
ontology - the source of the event
resources - an array of URIs of resources which were deleted (including the resource which was asked to be deleted).

resourceAdded

void resourceAdded(Ontology ontology,
                   OResource resource)
This method is invoked whenever a resource (class/property/instance) is added to the ontology.

Parameters:
ontology - the source of the event
resource - an instance of OResource, which was created as a result of addition of a resource.

ontologyReset

void ontologyReset(Ontology ontology)
This method is called whenever ontology is reset. In other words when all resources of the ontology are deleted using the ontology.cleanup method.

Parameters:
ontology -