GATE
Version 3.1-2270

com.ontotext.gate.vr
Class ClassNode

java.lang.Object
  extended by com.ontotext.gate.vr.ClassNode
All Implemented Interfaces:
IFolder, Transferable, Serializable, Cloneable

public class ClassNode
extends Object
implements IFolder, Transferable, Cloneable, Serializable

Represents a single class node from the visualized ontology

See Also:
Serialized Form

Field Summary
static DataFlavor CLASS_NODE_FLAVOR
          flavor used for drag and drop
 
Constructor Summary
ClassNode(MappingNode mapNode)
          Constructs a class node given a mapping node
ClassNode(OInstance instance)
          Constructs a class node given an ontology instance
ClassNode(Taxonomy o)
          Constructs a root class node from an ontology
ClassNode(TClass clas)
          Constructs a class node given an ontology class
 
Method Summary
 void addSubNode(ClassNode sub)
          Adds a sub node
 Vector children()
           
static ClassNode createRootNode(Taxonomy o)
          create a structure representing the class hierarchy of an ontology
static ClassNode createRootNode(Taxonomy o, boolean includeInstances)
           
static ClassNode createRootNode(Taxonomy o, MappingDefinition mapping, Map nameVsNode)
          Creates a structure representing the class hierarchy of an ontology and the gazetteerLists mapped to it.
 boolean equals(Object o)
           
 IFolder getChild(int index)
           
 int getChildCount()
           
 Iterator getChildren()
           
 int getIndexOfChild(Object child)
           
 Object getSource()
          Gets the Source object
 Object getTransferData(DataFlavor df)
           
 DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(DataFlavor df)
           
 void removeSubNode(ClassNode sub)
          Removes a sub class
 void rename(String newName)
          Renames this class node
 void setChildren(Vector chldrn)
           
 void setSource(Object o)
          Sets the source object
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_NODE_FLAVOR

public static final DataFlavor CLASS_NODE_FLAVOR
flavor used for drag and drop

Constructor Detail

ClassNode

public ClassNode(Taxonomy o)
Constructs a root class node from an ontology

Parameters:
o - the ontology

ClassNode

public ClassNode(TClass clas)
Constructs a class node given an ontology class

Parameters:
clas - ontology class

ClassNode

public ClassNode(OInstance instance)
Constructs a class node given an ontology instance

Parameters:
instance - ontology instance

ClassNode

public ClassNode(MappingNode mapNode)
Constructs a class node given a mapping node

Parameters:
mapNode - mapping node
Method Detail

createRootNode

public static ClassNode createRootNode(Taxonomy o)
create a structure representing the class hierarchy of an ontology

Parameters:
includeInstances - if true, then instances of the ontology are also included
Returns:
the root node of the structure

createRootNode

public static ClassNode createRootNode(Taxonomy o,
                                       boolean includeInstances)

createRootNode

public static ClassNode createRootNode(Taxonomy o,
                                       MappingDefinition mapping,
                                       Map nameVsNode)
Creates a structure representing the class hierarchy of an ontology and the gazetteerLists mapped to it.

Parameters:
o - an ontology
mapping - mapping definition
nameVsNode - : this is actually a return value: should be initialized before passing to this method and afterwards one can find a mapping of class names vs class nodes there.
Returns:
the root node of the structure

getIndexOfChild

public int getIndexOfChild(Object child)
Specified by:
getIndexOfChild in interface IFolder

getChildren

public Iterator getChildren()
Specified by:
getChildren in interface IFolder

setChildren

public void setChildren(Vector chldrn)

children

public Vector children()
Specified by:
children in interface IFolder

toString

public String toString()
Specified by:
toString in interface IFolder
Overrides:
toString in class Object

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface IFolder

getChild

public IFolder getChild(int index)
Specified by:
getChild in interface IFolder

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getSource

public Object getSource()
Gets the Source object

Returns:
the source object e.g. an gate.creole.TClass or a gate.creole.Ontology

setSource

public void setSource(Object o)
Sets the source object

Parameters:
o - the source object to be set

rename

public void rename(String newName)
Renames this class node

Parameters:
newName - the new name of the node

removeSubNode

public void removeSubNode(ClassNode sub)
Removes a sub class

Parameters:
sub - the sub class to be removed

addSubNode

public void addSubNode(ClassNode sub)
Adds a sub node

Parameters:
sub - the sub node to be added

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor df)
Specified by:
isDataFlavorSupported in interface Transferable

getTransferData

public Object getTransferData(DataFlavor df)
                       throws UnsupportedFlavorException,
                              IOException
Specified by:
getTransferData in interface Transferable
Throws:
UnsupportedFlavorException
IOException

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface Transferable

GATE
Version 3.1-2270