gate.creole.ontology
Interface OntologyEditor

All Superinterfaces:
FeatureBearer, NameBearer, Resource, Serializable, VisualResource

public interface OntologyEditor
extends VisualResource

An interface defining the methods of an Ontology Editor.


Method Summary
 void addSubClass(com.ontotext.gate.vr.ClassNode root, String className, String classComment)
          Adds Sub Class given a ClassNode and the resulting info from the Add Sub Class dialog.
 void addSubClass(int x, int y)
          Invokes an add sub class dialog in position x,y
 int AskWannaSave(Ontology o, int x, int y)
          Wanna Save Dialog invocation.
 void closeOntologies(Vector list)
          Closes list of ontologies
 void closeOntology(Ontology o, int x, int y)
          Closes an ontology.
 void createOntology(String name, String sourceURI, String theURL, String comment)
          Creates a new ontology
 void deleteOntology(Ontology o, int x, int y)
          Deletes an ontology.
 void editClassURI(OClass c, int x, int y)
          Edit the URI of an ontology class
 void editURI(Ontology o, int x, int y)
          Edits the URI of an ontology.
 void fileClose(int x, int y, Vector ontologies)
          Invokes a mutiple selection close dialog with a list of ontologies to be closed.
 void fileExit()
          Acts on choosing Exit from the File menu.
 void fileNew(int x, int y)
          Inovkes a new ontology dialog.
 void fileOpen(int x, int y)
          Acts on choosing Open from the File menu.
 void fileSave(int x, int y, Vector ontologies)
          Invoke a mutiple selection save dialog with a list of ontologies to be saved.
 Set getAllURIs()
          Gets all URIs that are present at the moment as ontology URIs.
 Set getAllURIs(Ontology o)
          Retrieve a set of all the class URIs in an ontology
 Vector getModifiedOntologies()
          Gets all modified ontologies.
 Ontology getOntology()
          Gets the loaded ontology
 Vector getOntologyList()
          Gets the list of ontologies currently in the editor
 void ontologySelected(Ontology o)
          Selects an ontology.
 void removeClass(com.ontotext.gate.vr.ClassNode node)
          Removes the node/class
 void renameClass(OClass c, com.ontotext.gate.vr.ClassNode n, int x, int y)
          Renames a class
 void renameOntology(Ontology o, int x, int y)
          Renames an ontology
 void saveAsOntology(Ontology o, int x, int y)
          Invokes a Save As dialog for this ontology and saves it to the specified location.
 void saveOntologies(Vector list)
          Saves a list of ontologies.
 void saveOntology(Ontology o)
          Saves this ontology
 void setOntology(Ontology o)
          Sets the ontology to be loaded in the editor
 void setOntologyList(Vector list)
          Sets the list of ontologies to be loaded in the editor
 void visualize()
          Visualizes the editor
 
Methods inherited from interface gate.VisualResource
setHandle, setTarget
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Method Detail

createOntology

public void createOntology(String name,
                           String sourceURI,
                           String theURL,
                           String comment)
                    throws ResourceInstantiationException
Creates a new ontology
Parameters:
name - the name of the ontology
sourceURI - the URI of the ontology
theURL - the URL of the ontology
comment - ontology comment

setOntology

public void setOntology(Ontology o)
Sets the ontology to be loaded in the editor
Parameters:
o - the ontology to be loaded

getOntology

public Ontology getOntology()
Gets the loaded ontology
Returns:
the current ontology in the editor

setOntologyList

public void setOntologyList(Vector list)
Sets the list of ontologies to be loaded in the editor
Parameters:
list - the list of ontologies

getOntologyList

public Vector getOntologyList()
Gets the list of ontologies currently in the editor
Returns:
the list of ontologies

visualize

public void visualize()
Visualizes the editor

addSubClass

public void addSubClass(int x,
                        int y)
Invokes an add sub class dialog in position x,y
Parameters:
x - the x coordinate of the dialog
y - the y coordinate of the dialog

addSubClass

public void addSubClass(com.ontotext.gate.vr.ClassNode root,
                        String className,
                        String classComment)
Adds Sub Class given a ClassNode and the resulting info from the Add Sub Class dialog.
Parameters:
root - the node which is root to the sub class being added
className - the name from the dialog
classComment - the comment from the dialog

removeClass

public void removeClass(com.ontotext.gate.vr.ClassNode node)
Removes the node/class
Parameters:
node - the node to be removed

renameClass

public void renameClass(OClass c,
                        com.ontotext.gate.vr.ClassNode n,
                        int x,
                        int y)
Renames a class
Parameters:
c - the class to be renamed
n - the class node associated with the class
x - coords
y - coords

ontologySelected

public void ontologySelected(Ontology o)
Selects an ontology. Is called when an ontology has been selecte from the ontology list.
Parameters:
o - the selected ontology

saveOntologies

public void saveOntologies(Vector list)
Saves a list of ontologies.
Parameters:
list - a list of ontologies to be saved

closeOntologies

public void closeOntologies(Vector list)
                     throws ResourceInstantiationException
Closes list of ontologies
Parameters:
list - a list of ontologies to be saved

getModifiedOntologies

public Vector getModifiedOntologies()
Gets all modified ontologies.
Returns:
list of the modified ontologies

saveOntology

public void saveOntology(Ontology o)
                  throws ResourceInstantiationException
Saves this ontology
Parameters:
o - the ontology to be saved
Throws:
-  

saveAsOntology

public void saveAsOntology(Ontology o,
                           int x,
                           int y)
                    throws ResourceInstantiationException
Invokes a Save As dialog for this ontology and saves it to the specified location.
Parameters:
o - the ontology to be saved
x - the x coordinate of the save as dialog
y - the y coordinate of the save as dialog

renameOntology

public void renameOntology(Ontology o,
                           int x,
                           int y)
Renames an ontology
Parameters:
o - the ontology to be renamed
x - the x coordinate of the rename dialog
y - the y coordinate of the rename dialog

deleteOntology

public void deleteOntology(Ontology o,
                           int x,
                           int y)
                    throws ResourceInstantiationException
Deletes an ontology. Invokes AreYouSureDialog if the ontology has been changed.
Parameters:
o - the ontology to be deleted
x - x coordinate of the option pane to be invoked
y - y coordinate of the option pane to be invoked

editURI

public void editURI(Ontology o,
                    int x,
                    int y)
Edits the URI of an ontology.
Parameters:
o - the ontology to be edited
x - coords of the dialog
y - coords of the dialog

editClassURI

public void editClassURI(OClass c,
                         int x,
                         int y)
Edit the URI of an ontology class
Parameters:
c - class to be edited
x - coords of the dialog
y - coords of the dialog

getAllURIs

public Set getAllURIs()
Gets all URIs that are present at the moment as ontology URIs.
Returns:
all the uris that are available in the editor

getAllURIs

public Set getAllURIs(Ontology o)
Retrieve a set of all the class URIs in an ontology
Parameters:
o - the ontology
Returns:
set of all the URIs in the ontology

closeOntology

public void closeOntology(Ontology o,
                          int x,
                          int y)
                   throws ResourceInstantiationException
Closes an ontology. Invokes AreYouSureDialog if the ontology has been changed.
Parameters:
o - the ontology to be closed
x - x coordinate of the option pane to be invoked
y - y coordinate of the option pane to be invoked

AskWannaSave

public int AskWannaSave(Ontology o,
                        int x,
                        int y)
Wanna Save Dialog invocation.
Parameters:
o - the ontology to be saved or not
x - x coordinate of the option pane to be invoked
y - y coordinate of the option pane to be invoked
Returns:
the result of the option pane

fileExit

public void fileExit()
Acts on choosing Exit from the File menu.

fileOpen

public void fileOpen(int x,
                     int y)
              throws ResourceInstantiationException
Acts on choosing Open from the File menu.
Parameters:
x - the x coordinate of the invocation
y - the y coordinate of the invocation
Throws:
ResourceInstantiationException - if something goes wrong with the loading.

fileSave

public void fileSave(int x,
                     int y,
                     Vector ontologies)
Invoke a mutiple selection save dialog with a list of ontologies to be saved.
Parameters:
x - coords of the dialog
y - coords of the dialog
ontologies - the list of ontologies to be optionally saved

fileClose

public void fileClose(int x,
                      int y,
                      Vector ontologies)
Invokes a mutiple selection close dialog with a list of ontologies to be closed.
Parameters:
x - coords of the dialog
y - coords of the dialog
ontologies - the list of ontologies to be optionally closed

fileNew

public void fileNew(int x,
                    int y)
Inovkes a new ontology dialog.
Parameters:
x - coords of the dialog
y - coords of the dialog