## 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

Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
`EMPTY_ENUMERATION`

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, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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