gate.gui
Class STreeNode

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--gate.gui.STreeNode
All Implemented Interfaces:
Cloneable, MutableTreeNode, Serializable, TreeNode

public class STreeNode
extends DefaultMutableTreeNode

See Also:
Serialized Form

Inner classes inherited from class javax.swing.tree.DefaultMutableTreeNode
DefaultMutableTreeNode.BreadthFirstEnumeration, DefaultMutableTreeNode.PathBetweenNodesEnumeration, DefaultMutableTreeNode.PostorderEnumeration, DefaultMutableTreeNode.PreorderEnumeration
 
Field Summary
private static String ADDEDSET
           
(package private)  Annotation annot
           
private static boolean DEBUG
          Debug flag
(package private)  long end
           
(package private)  int level
           
(package private) static int nextID
           
(package private)  int nodeID
           
private static String REMOVEDSET
           
(package private)  long start
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
STreeNode()
           
STreeNode(Annotation annot)
           
STreeNode(long start, long end)
           
 
Method Summary
 boolean createAnnotation(Document doc, String type, String text, long utteranceOffset)
          Creates an annotation of the given type.
 void disconnectChildren()
           
 Annotation getAnnotation()
           
 long getEnd()
           
 int getID()
           
 int getLevel()
           
 long getStart()
           
 void removeAnnotation(Document doc)
          Store the annotation in the deleted list so it can retrieved later
 void setAnnotation(Annotation annot)
          This also sets the span to match the annotation span!
 void setEnd(long end)
           
 void setLevel(int level)
           
 void setLevel(long level)
           
 void setStart(long start)
           
static boolean transferAnnotations(Document doc, AnnotationSet targetAS)
          Transfers the annotations from added to the given annotation set Also, for each annotation in removed, removes it from the given annotation set Called by OkAction() in the treeViewer to finalise the changes.
static void undo(Document doc)
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
, add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, readObject, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString, writeObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

ADDEDSET

private static final String ADDEDSET

REMOVEDSET

private static final String REMOVEDSET

nextID

static int nextID

level

int level

nodeID

int nodeID

start

long start

end

long end

annot

Annotation annot
Constructor Detail

STreeNode

public STreeNode(Annotation annot)

STreeNode

public STreeNode(long start,
                 long end)

STreeNode

public STreeNode()
Method Detail

getLevel

public int getLevel()
Overrides:
getLevel in class DefaultMutableTreeNode

setLevel

public void setLevel(long level)

setLevel

public void setLevel(int level)

getID

public int getID()

getStart

public long getStart()

setStart

public void setStart(long start)

getEnd

public long getEnd()

setEnd

public void setEnd(long end)

setAnnotation

public void setAnnotation(Annotation annot)
This also sets the span to match the annotation span!

getAnnotation

public Annotation getAnnotation()

disconnectChildren

public void disconnectChildren()

createAnnotation

public boolean createAnnotation(Document doc,
                                String type,
                                String text,
                                long utteranceOffset)
Creates an annotation of the given type. If the children don't have their annotation objects created, it creates them and assigns the pointers. Expects the text string relative to which all offsets were created!

transferAnnotations

public static boolean transferAnnotations(Document doc,
                                          AnnotationSet targetAS)
Transfers the annotations from added to the given annotation set Also, for each annotation in removed, removes it from the given annotation set Called by OkAction() in the treeViewer to finalise the changes.

undo

public static void undo(Document doc)

removeAnnotation

public void removeAnnotation(Document doc)
Store the annotation in the deleted list so it can retrieved later