|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides a tree inteface and a list interface to a group of annotations.
Which annotations are visible with the view depends on view filters.
The order in which annotation are accessed depends on the sort criteria set for the view.
Any modifications to annotations in the view should be done via the view or the view should be
notified of these changes with the update
method.
Method Summary | |
int |
binarySearchAnnotation(Annotation a)
Returns the index of the specified annotation in the list of annotations available for display. |
int |
binarySearchBase(Annotation a)
Returns the index of the specified annotation in the list of annotations on which other annotaitons are based. |
void |
chainAnnotations(Annotation a,
Annotation b)
Creates a chain between the two specified annotations. |
void |
close()
Does any clean up that needs to happen before the view goes away |
boolean |
containsAll(java.util.List list,
java.lang.Object node)
Checks whether each child of the specified node is contained in the specified list. |
Relation |
createRelation(java.lang.String type,
java.lang.Object key,
java.lang.String[] frame,
Annotation[] annotations)
Returns a new releation with the specified type, anchor key, frame, and annotations. |
void |
deepInsert(Annotation a)
Inserts the specified annotation as deep as possible. |
Annotation |
deepInsert(java.lang.String type,
int start,
int end)
Creates and inserts a new annotation specified type and span given by the specified start and end indices. |
void |
filter(AnnotationFilter f)
Applies the specified filter to this view. |
Annotation |
getAnnotation(int i)
Returns sorted annotation at index i. |
java.util.Iterator |
getAnnotationIterator()
Returns Iterator for filtered/sorted annotations. |
int |
getAnnotationSize()
Returns size of filtered/sorted annotations. |
Annotation |
getBase(int index)
Returns the annotation at the specified index from the list of annotations which new annotation are based on. |
java.util.Iterator |
getBaseIterator()
Returns an iterator over the list of annotations which new annotation are based on. |
int |
getBaseSize()
Returns the number of annotation in the list of annotations which new annotation are based on. |
Annotation[] |
getChain(Annotation a)
Returns the chains associated with the specified annotation. |
java.lang.Object |
getContainingLeaf(int offset)
Returns the leaf node which contains the specified offset. |
java.lang.Object |
getFirstLeaf(java.lang.Object startNode)
Returns the left-most leaf child of the specified start node. |
java.lang.Object |
getLastLeaf(java.lang.Object startNode)
Returns the right-most leaf child of the specified start node. |
java.lang.Object |
getNextLeaf(java.lang.Object node)
Returns the susequent leaf node to the right of the specified node. |
java.lang.Object |
getParent(java.lang.Object node)
Returns the parent of the specified node. |
javax.swing.tree.TreeNode[] |
getPath(java.lang.Object node)
Returns an array of nodes between the specified node and the root. |
java.lang.Object |
getPreviousLeaf(java.lang.Object node)
Returns the previous leaf node to the left of the specified node. |
Relation |
getRelation(java.lang.String type,
Annotation a)
Returns a relation which is of the specified type and has as its anchor the specified annotation. |
Relation[] |
getRelations(Annotation a)
Returns all relations which contain the specified annotation. |
Relation[] |
getRelations(java.lang.String type)
Returns all relations of the specified type. |
Relation[] |
getRelations(java.lang.String type,
Annotation a)
Returns all relation which are of the specified type and which contain the specified annotation. |
SelectionMode |
getSelectionMode()
Returns the types of selection which are valid. |
SortedAnnotations |
getSortedAnnotations()
Returns the object which manages sorted annotations. |
AnnotationSource |
getSource()
Returns the source data associated with the file for this view. |
Annotation |
getUnsortedAnnotation(int i)
Returns filtered annotation at index i. |
AnnotationSelection |
getValidSelection(AnnotationSelection annotations)
Returns appropiate selection based on selection mode and attempted selection, null is returned if no selection is appropiate. |
Span |
getValidSelection(int s,
int e)
Returns appropiate selection based on selection mode and attempted selection, null is returned if no selection is appropiate. |
int |
indexOfAnnotation(Annotation a)
Returns index of Annotation a in sorted annotations list if it is contained in the list; otherwise, (-(insertion point) - 1). |
int |
indexOfAnnotationOffset(int o)
Returns index of sorted annotation which contains the offset o or the offset of the annotation which is closest. |
int |
indexOfBase(Annotation a)
Returns index of Annotation a in base annotations list if it is contained in the list; otherwise, (-(insertion point) - 1). |
int |
indexOfBaseOffset(int offset)
Returns the index of an annotation in the list of annotations which new annotation are based on which contains the specified offset. |
int |
indexOfUnsortedAnnotation(Annotation a)
Returns index of the annotation in the filtered annotations list if it is contained in the list; otherwise, (-(insertion point) - 1). |
void |
insert(Annotation a)
Inserts the specified annotation into the view. |
Annotation |
insert(int s,
int e)
Creates and inserts a new annotation with the span specified by s and e . |
Annotation |
insert(int start,
int end,
Annotation parent)
Returns an annotation with the specified start, end, and parent that has been inserted into the view. |
Annotation |
insert(java.lang.String type,
Annotation start,
Annotation end)
Returns an annotation with the specified type, start, and end that has been inserted into the view. |
Annotation |
insert(java.lang.String type,
int start,
int end)
Returns an annotation with the specified type, start, and end that has been inserted into the view. |
Annotation |
insert(java.lang.String type,
int start,
int end,
Annotation parent)
Returns an annotation with the specified type, start, end, and parent that has been inserted into the view. |
Annotation |
insertParent(Annotation child)
Returns a new annotation which has the same span as the specified child annotation and is the parent of the specified child. |
Annotation |
insertParent(java.lang.String type,
Annotation child)
Returns a new annotation with the specified type which has the same span as the specified child annotation and is the parent of the specified child. |
Annotation |
insertZeroLengthAnnotationAfter(Annotation after)
Returns a zero length annotation which is inserted after the specified annotation. |
Annotation |
insertZeroLengthAnnotationAfter(java.lang.String type,
Annotation after)
Returns a zero length annotation with the specified type which is inserted after the specified annotation. |
Annotation |
insertZeroLengthAnnotationBefore(Annotation before)
Returns a zero length annotation which is inserted before the specified annotation. |
Annotation |
insertZeroLengthAnnotationBefore(java.lang.String type,
Annotation before)
Returns a zero length annotation of the specified type which is inserted before the specified annotation. |
boolean |
isTerminalSpan(int start,
int end)
Returns true if the span given by the specified start and end values can be inserted into this view as a leaf. |
void |
move(Annotation node,
Annotation parent)
Makes annotation parent the parent of annotaiton node. |
void |
put(int roleIndex,
Annotation ann,
Relation relation)
Puts the specified annotation at the specified role index in the specified relation. |
void |
put(java.lang.String role,
Annotation ann,
Relation relation)
Puts the specified annotation the specified relation with the specified role name. |
void |
remove(Annotation node)
Removes an annotation from the view. |
void |
remove(Annotation node,
boolean shrink)
Removes an annotation from the view and shinks annotations which contained it based on teh specified shrink value. |
void |
remove(Annotation annotation,
Relation relation)
Removes the specified annotation from the specified relation or if the specified annotation is the anchor of the relation, removes the relation from this view. |
void |
remove(Relation relation)
Removes the specified relation from this view. |
Annotation |
removeFromChain(Annotation a)
Removes the specified annotation from a chain and returns another annotation from the modified chain if such an annotation exists. |
void |
resetSelection()
Resets the selection. |
void |
setSelectionMode(SelectionMode sm)
Specified what types of selection are valid. |
void |
sort(java.util.Comparator c)
Sorts the annotations in this view based on the specified comparison criteria. |
Annotation |
terminalInsert(java.lang.String type,
int start,
int end)
Inserts a newly created annotation with the specified type and span in this tree and returns the newly created annotation. |
void |
update()
Rebuilds the view based on the AnnotationTree. |
void |
update(Annotation a)
Indicates that the specified annotation has been changed. |
Methods inherited from interface javax.swing.tree.TreeModel |
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged |
Method Detail |
public void close()
public void update()
public java.lang.Object getParent(java.lang.Object node)
node
- The node whose parent is being requested.
public java.lang.Object getFirstLeaf(java.lang.Object startNode)
startNode
- The node at which to begin the search.
public java.lang.Object getLastLeaf(java.lang.Object startNode)
startNode
- The node at which to begin the search.
public java.lang.Object getContainingLeaf(int offset)
offset
- The offset that the returned leaf should contain.
public javax.swing.tree.TreeNode[] getPath(java.lang.Object node)
node
- The node in the tree from which to start the part.
public java.lang.Object getNextLeaf(java.lang.Object node)
node
- An existing leaft node.
public java.lang.Object getPreviousLeaf(java.lang.Object node)
node
- An existing leaft node.
public void move(Annotation node, Annotation parent)
node
- The annotation being moved.parent
- The parent annotation.public AnnotationSource getSource()
public void sort(java.util.Comparator c)
c
- The criteria on which the sort is based.public void filter(AnnotationFilter f)
f
- The filter to be applied to this view.public Annotation getBase(int index)
index
- The index of the annotation to be returned.
public int getBaseSize()
public java.util.Iterator getBaseIterator()
public SortedAnnotations getSortedAnnotations()
public Annotation getAnnotation(int i)
i
- index
public Annotation getUnsortedAnnotation(int i)
i
- index
public int getAnnotationSize()
public java.util.Iterator getAnnotationIterator()
public int indexOfAnnotation(Annotation a)
a
- Annotation.
public boolean containsAll(java.util.List list, java.lang.Object node)
list
- A list of children.node
- The node of a tree.
public int indexOfUnsortedAnnotation(Annotation a)
a
- Annotation.
public int indexOfAnnotationOffset(int o)
o
- offset.
public int indexOfBase(Annotation a)
a
- The annotation whose index is being searched for.
public int indexOfBaseOffset(int offset)
offset
- The offset the base annotation at the returned index will contain.
public int binarySearchAnnotation(Annotation a)
a
- The annotation being searched for.
public int binarySearchBase(Annotation a)
a
- The annotation being searched for.
public void remove(Annotation node)
node
- The annotation to be removed.public void remove(Annotation node, boolean shrink)
node
- The node to be removed.shrink
- Whether nodes which contains the specifed annotation should be shunk.public Annotation insert(int s, int e)
s
and e
.
s
- the start of the span for the annotation.e
- the end of the span for the annotation.public Annotation deepInsert(java.lang.String type, int start, int end)
type
- The type of the annotation to be inserted.start
- the start of the span for the annotation.end
- the end of the span for the annotation.public boolean isTerminalSpan(int start, int end)
start
- The start value of the span.end
- The end value of the span.
public void insert(Annotation a)
a
- The annotation to insert.public Annotation terminalInsert(java.lang.String type, int start, int end)
type
- The type of annotation to create.start
- The start of the span of the new annotation.end
- The end of the span of the new annotation.
public void deepInsert(Annotation a)
a
- The annotation to insert.public Annotation insert(int start, int end, Annotation parent)
start
- The start value of the annotation's span.end
- The end value of the annotation's span.parent
- The parent of the annotation.
public Annotation insertZeroLengthAnnotationBefore(Annotation before)
before
- The annotation which the the new annotaiton is before.
public Annotation insertZeroLengthAnnotationAfter(Annotation after)
after
- The annotation which the the new annotaiton is after.
public Annotation insertParent(Annotation child)
child
- The annotation on which the new annotation is based.
public Annotation insert(java.lang.String type, int start, int end)
type
- The type of the new annotation.start
- The start of the new annotation's span.end
- The end of the new annotation's span.
public Annotation insert(java.lang.String type, int start, int end, Annotation parent)
type
- The type of the new annotation.start
- The start of the new annotation's span.end
- The end of the new annotation's span.parent
- The parent of the new annotation.
public Annotation insert(java.lang.String type, Annotation start, Annotation end)
type
- The type of the new annotation.start
- The start annotation of the new annotation's span.end
- The end annotation of the new annotation's span.
public Annotation insertZeroLengthAnnotationBefore(java.lang.String type, Annotation before)
type
- The type of the new annotation.before
- The annotation which the the new annotaiton is before.
public Annotation insertZeroLengthAnnotationAfter(java.lang.String type, Annotation after)
type
- The type of the new annotation.after
- The annotation which the the new annotaiton is after.
public Annotation insertParent(java.lang.String type, Annotation child)
type
- The type of the new annotation.child
- The annotation on which the new annotation is based.
public void update(Annotation a)
a
- The annotation which needs to be updated.public void chainAnnotations(Annotation a, Annotation b)
a
- The first annotation in the chain.b
- The second annotation in the chain.public Annotation[] getChain(Annotation a)
a
- An annotation in a chain.
public Annotation removeFromChain(Annotation a)
a
- The annotation to be removed.
public Relation createRelation(java.lang.String type, java.lang.Object key, java.lang.String[] frame, Annotation[] annotations)
type
- The type of the relations.key
- The anchor annotation of this relation.frame
- The names of the frame elements of the relation.annotations
- The annotation which occupy the frame elements.
public void put(int roleIndex, Annotation ann, Relation relation)
roleIndex
- The position in the frame of the specified relation when the specified annotaiton will be placed.ann
- The annotation to be placed at the specified role Index in the specified relation.relation
- The annotation to be modified.public void put(java.lang.String role, Annotation ann, Relation relation)
role
- The name of the role slot in the relation when the annotation will be placed.ann
- The annotation to put in the relation.relation
- The relation to be modified.public void remove(Relation relation)
relation
- The relation to be removed.public void remove(Annotation annotation, Relation relation)
annotation
- The annotation to remove.relation
- The relation from which the spevified annotation is removed.public Relation[] getRelations(java.lang.String type)
type
- The type of relations to be returned.
public Relation[] getRelations(Annotation a)
a
- The annotation which the returned relations contain.
public Relation[] getRelations(java.lang.String type, Annotation a)
type
- The type of relations to be returned.a
- The annotation which the returned relations contain.
public Relation getRelation(java.lang.String type, Annotation a)
type
- The type of relation to be returned.a
- The anchor of the relations to be returned.
public Span getValidSelection(int s, int e)
public AnnotationSelection getValidSelection(AnnotationSelection annotations)
public void resetSelection()
public void setSelectionMode(SelectionMode sm)
sm
- The types of selection which are valid.public SelectionMode getSelectionMode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |