|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.annotation.wordfreak.AbstractAnnotationView org.annotation.wordfreak.DefaultAnnotationView
Field Summary |
Fields inherited from class org.annotation.wordfreak.AbstractAnnotationView |
selectionMode, sort |
Constructor Summary | |
DefaultAnnotationView(AnnotationTree t)
|
|
DefaultAnnotationView(AnnotationTree t,
AnnotationFilter af)
|
|
DefaultAnnotationView(AnnotationTree t,
AnnotationFilter af,
AnnotationFilter baf)
|
|
DefaultAnnotationView(AnnotationTree t,
AnnotationFilter af,
AnnotationFilter baf,
SortedAnnotations sa)
|
Method Summary | |
void |
addTreeModelListener(javax.swing.event.TreeModelListener tml)
|
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 s,
int e)
Creates and inserts a new annotation specified type and span given by the specified start and end indices. |
javax.swing.event.TreeModelEvent |
doTreeNodesChanged(Annotation node,
Annotation[] objects)
|
javax.swing.event.TreeModelEvent |
doTreeNodesInserted(Annotation node,
Annotation[] objects)
|
javax.swing.event.TreeModelEvent |
doTreeNodesRemoved(Annotation node,
Annotation[] objects)
|
void |
filter(AnnotationFilter f)
Applies the specified filter to this view. |
void |
fireTreeNodesChanged(Annotation node,
Annotation[] objects)
Used to notify listener that the nodes specificed as changelings have been changed and their parent is node is specified by parent. |
void |
fireTreeNodesInserted(Annotation parent,
Annotation[] objects)
Used to notify listener that the nodes specificed as insertions have been inserted under the specified parent. |
void |
fireTreeNodesMoved(Annotation[] children,
Annotation oldParent,
Annotation newParent)
Used to notify listener that the nodes specificed as children have been moved from oldParent to newParent. |
void |
fireTreeNodesRemoved(Annotation node,
Annotation[] objects)
Used to notify listener that the nodes specificed as deletions have been deleted under the specified parent. |
void |
fireTreeStructureChanged(Annotation node)
Used to notify listener that the structure under the specified node has changed substantually. |
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 i)
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 |
getChild(java.lang.Object parent,
int i)
|
int |
getChildCount(java.lang.Object parent)
|
java.lang.Object |
getContainingLeaf(int offset)
Returns the leaf which contains the offset. |
Annotation |
getContainingNode(Span span)
Returns the leaf which contains the offset. |
java.util.List |
getFilteredAnnotations()
Returns a list of annotation which match the current filter criteria. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
|
java.util.List |
getLeavesInRange(int s,
int e)
|
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 o)
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. |
java.lang.Object |
getRoot()
|
int |
getSize()
|
SortedAnnotations |
getSortedAnnotations()
Returns the object which manages sorted annotations. |
AnnotationSource |
getSource()
Returns the source data associated with the file for this view. |
java.lang.String |
getText()
|
Annotation |
getUnsortedAnnotation(int i)
Returns filtered annotation at index i. |
AnnotationSelection |
getValidSelection(AnnotationSelection selectedAnnotations)
Returns appropiate selection based on selection mode and attempted selection, null is returned if no selection is appropiate. |
Span |
getValidSelection(int start,
int end)
Returns appropiate selection based on selection mode and attempted selection, null is returned if no selection is appropiate. |
java.util.List |
getValidSelection(java.util.List selectedAnnotations)
|
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 o)
Returns the index of an annotation in the list of annotations which new annotation are based on which contains the specified offset. |
int |
indexOfBaseOffset1(int o)
|
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 s,
int e,
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 s,
Annotation e)
Returns an annotation with the specified type, start, and end that has been inserted into the view. |
Annotation |
insert(java.lang.String type,
int s,
int e)
Returns an annotation with the specified type, start, and end that has been inserted into the view. |
Annotation |
insert(java.lang.String type,
int s,
int e,
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 |
isLeaf(java.lang.Object node)
|
boolean |
isTerminalSpan(int s,
int e)
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 dest)
Makes annotation parent the parent of annotaiton node. |
void |
put(int role,
Annotation ann,
Relation rel)
Puts the specified annotation at the specified role index in the specified relation. |
void |
put(java.lang.String role,
Annotation ann,
Relation rel)
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 |
removeTreeModelListener(javax.swing.event.TreeModelListener tml)
|
void |
resetSelection()
Resets the selection. |
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 s,
int e)
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. |
void |
validate()
|
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
|
Methods inherited from class org.annotation.wordfreak.AbstractAnnotationView |
getFirstLeaf, getLastLeaf, getSelectionMode, setSelectionMode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultAnnotationView(AnnotationTree t)
public DefaultAnnotationView(AnnotationTree t, AnnotationFilter af)
public DefaultAnnotationView(AnnotationTree t, AnnotationFilter af, AnnotationFilter baf)
public DefaultAnnotationView(AnnotationTree t, AnnotationFilter af, AnnotationFilter baf, SortedAnnotations sa)
Method Detail |
public void close()
AnnotationView
close
in interface AnnotationView
close
in class AbstractAnnotationView
public java.util.List getFilteredAnnotations()
SortedAnnotationsSource
getFilteredAnnotations
in interface SortedAnnotationsSource
public void sort(java.util.Comparator c)
AnnotationView
sort
in interface AnnotationView
c
- The criteria on which the sort is based.public void filter(AnnotationFilter f)
AnnotationView
filter
in interface AnnotationView
f
- The filter to be applied to this view.public void validate()
public void update()
AnnotationView
update
in interface AnnotationView
public int getSize()
public SortedAnnotations getSortedAnnotations()
AnnotationView
getSortedAnnotations
in interface AnnotationView
getSortedAnnotations
in class AbstractAnnotationView
public Annotation getBase(int i)
AnnotationView
getBase
in interface AnnotationView
i
- The index of the annotation to be returned.
public int getBaseSize()
AnnotationView
getBaseSize
in interface AnnotationView
public java.util.Iterator getBaseIterator()
AnnotationView
getBaseIterator
in interface AnnotationView
public Annotation getAnnotation(int i)
AnnotationView
getAnnotation
in interface AnnotationView
i
- index
public Annotation getUnsortedAnnotation(int i)
AnnotationView
getUnsortedAnnotation
in interface AnnotationView
i
- index
public int getAnnotationSize()
AnnotationView
getAnnotationSize
in interface AnnotationView
public java.util.Iterator getAnnotationIterator()
AnnotationView
getAnnotationIterator
in interface AnnotationView
public int indexOfAnnotation(Annotation a)
AnnotationView
indexOfAnnotation
in interface AnnotationView
a
- Annotation.
public int indexOfUnsortedAnnotation(Annotation a)
AnnotationView
indexOfUnsortedAnnotation
in interface AnnotationView
a
- Annotation.
public int indexOfBase(Annotation a)
AnnotationView
indexOfBase
in interface AnnotationView
a
- The annotation whose index is being searched for.
public int indexOfAnnotationOffset(int o)
AnnotationView
indexOfAnnotationOffset
in interface AnnotationView
o
- offset.
public int indexOfBaseOffset1(int o)
public int indexOfBaseOffset(int o)
AnnotationView
indexOfBaseOffset
in interface AnnotationView
o
- The offset the base annotation at the returned index will contain.
public java.util.List getLeavesInRange(int s, int e)
public int binarySearchAnnotation(Annotation a)
AnnotationView
binarySearchAnnotation
in interface AnnotationView
a
- The annotation being searched for.
public int binarySearchBase(Annotation a)
AnnotationView
binarySearchBase
in interface AnnotationView
a
- The annotation being searched for.
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent, int i)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public boolean containsAll(java.util.List list, java.lang.Object node)
AnnotationView
containsAll
in interface AnnotationView
list
- A list of children.node
- The node of a tree.
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
public java.lang.Object getParent(java.lang.Object node)
AnnotationView
getParent
in interface AnnotationView
getParent
in class AbstractAnnotationView
public javax.swing.tree.TreeNode[] getPath(java.lang.Object o)
AnnotationView
getPath
in interface AnnotationView
o
- The node in the tree from which to start the part.
public java.lang.Object getContainingLeaf(int offset)
getContainingLeaf
in interface AnnotationView
offset
- The offset.
public Annotation getContainingNode(Span span)
span
- The span.
public java.lang.String getText()
public java.lang.Object getNextLeaf(java.lang.Object node)
AnnotationView
getNextLeaf
in interface AnnotationView
node
- An existing leaft node.
public java.lang.Object getPreviousLeaf(java.lang.Object node)
AnnotationView
getPreviousLeaf
in interface AnnotationView
node
- An existing leaft node.
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
public void addTreeModelListener(javax.swing.event.TreeModelListener tml)
addTreeModelListener
in interface javax.swing.tree.TreeModel
addTreeModelListener
in class AbstractAnnotationView
public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
removeTreeModelListener
in class AbstractAnnotationView
public void move(Annotation node, Annotation dest)
AnnotationView
move
in interface AnnotationView
node
- The annotation being moved.dest
- The parent annotation.public void remove(Annotation node)
AnnotationView
remove
in interface AnnotationView
node
- The annotation to be removed.public void remove(Annotation node, boolean shrink)
AnnotationView
remove
in interface AnnotationView
node
- The node to be removed.shrink
- Whether nodes which contains the specifed annotation should be shunk.public Annotation insert(int s, int e)
AnnotationView
s
and e
.
insert
in interface AnnotationView
s
- the start of the span for the annotation.e
- the end of the span for the annotation.public Annotation insert(int s, int e, Annotation parent)
AnnotationView
insert
in interface AnnotationView
s
- The start value of the annotation's span.e
- The end value of the annotation's span.parent
- The parent of the annotation.
public Annotation insert(java.lang.String type, int s, int e)
AnnotationView
insert
in interface AnnotationView
type
- The type of the new annotation.s
- The start of the new annotation's span.e
- The end of the new annotation's span.
public Annotation insert(java.lang.String type, int s, int e, Annotation parent)
AnnotationView
insert
in interface AnnotationView
type
- The type of the new annotation.s
- The start of the new annotation's span.e
- The end of the new annotation's span.parent
- The parent of the new annotation.
public Annotation insert(java.lang.String type, Annotation s, Annotation e)
AnnotationView
insert
in interface AnnotationView
type
- The type of the new annotation.s
- The start annotation of the new annotation's span.e
- The end annotation of the new annotation's span.
public Annotation deepInsert(java.lang.String type, int s, int e)
AnnotationView
deepInsert
in interface AnnotationView
type
- The type of the annotation to be inserted.s
- the start of the span for the annotation.e
- the end of the span for the annotation.public void deepInsert(Annotation a)
AnnotationView
deepInsert
in interface AnnotationView
a
- The annotation to insert.public boolean isTerminalSpan(int s, int e)
AnnotationView
isTerminalSpan
in interface AnnotationView
s
- The start value of the span.e
- The end value of the span.
public Annotation terminalInsert(java.lang.String type, int s, int e)
AnnotationView
terminalInsert
in interface AnnotationView
type
- The type of annotation to create.s
- The start of the span of the new annotation.e
- The end of the span of the new annotation.
public void insert(Annotation a)
AnnotationView
insert
in interface AnnotationView
a
- The annotation to insert.public Annotation insertParent(Annotation child)
AnnotationView
insertParent
in interface AnnotationView
child
- The annotation on which the new annotation is based.
public Annotation insertZeroLengthAnnotationBefore(Annotation before)
AnnotationView
insertZeroLengthAnnotationBefore
in interface AnnotationView
before
- The annotation which the the new annotaiton is before.
public Annotation insertZeroLengthAnnotationAfter(Annotation after)
AnnotationView
insertZeroLengthAnnotationAfter
in interface AnnotationView
after
- The annotation which the the new annotaiton is after.
public Annotation insertParent(java.lang.String type, Annotation child)
AnnotationView
insertParent
in interface AnnotationView
type
- The type of the new annotation.child
- The annotation on which the new annotation is based.
public Annotation insertZeroLengthAnnotationBefore(java.lang.String type, Annotation before)
AnnotationView
insertZeroLengthAnnotationBefore
in interface AnnotationView
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)
AnnotationView
insertZeroLengthAnnotationAfter
in interface AnnotationView
type
- The type of the new annotation.after
- The annotation which the the new annotaiton is after.
public void chainAnnotations(Annotation a, Annotation b)
AnnotationView
chainAnnotations
in interface AnnotationView
a
- The first annotation in the chain.b
- The second annotation in the chain.public Annotation[] getChain(Annotation a)
AnnotationView
getChain
in interface AnnotationView
a
- An annotation in a chain.
public Annotation removeFromChain(Annotation a)
AnnotationView
removeFromChain
in interface AnnotationView
a
- The annotation to be removed.
public Relation createRelation(java.lang.String type, java.lang.Object key, java.lang.String[] frame, Annotation[] annotations)
AnnotationView
createRelation
in interface AnnotationView
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 role, Annotation ann, Relation rel)
AnnotationView
put
in interface AnnotationView
role
- 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.rel
- The annotation to be modified.public void put(java.lang.String role, Annotation ann, Relation rel)
AnnotationView
put
in interface AnnotationView
role
- The name of the role slot in the relation when the annotation will be placed.ann
- The annotation to put in the relation.rel
- The relation to be modified.public void remove(Relation relation)
AnnotationView
remove
in interface AnnotationView
relation
- The relation to be removed.public void remove(Annotation annotation, Relation relation)
AnnotationView
remove
in interface AnnotationView
annotation
- The annotation to remove.relation
- The relation from which the spevified annotation is removed.public void update(Annotation a)
AnnotationView
update
in interface AnnotationView
update
in class AbstractAnnotationView
public Relation[] getRelations(java.lang.String type)
AnnotationView
getRelations
in interface AnnotationView
type
- The type of relations to be returned.
public Relation[] getRelations(Annotation a)
AnnotationView
getRelations
in interface AnnotationView
a
- The annotation which the returned relations contain.
public Relation[] getRelations(java.lang.String type, Annotation a)
AnnotationView
getRelations
in interface AnnotationView
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)
AnnotationView
getRelation
in interface AnnotationView
type
- The type of relation to be returned.a
- The anchor of the relations to be returned.
public javax.swing.event.TreeModelEvent doTreeNodesInserted(Annotation node, Annotation[] objects)
public javax.swing.event.TreeModelEvent doTreeNodesRemoved(Annotation node, Annotation[] objects)
public javax.swing.event.TreeModelEvent doTreeNodesChanged(Annotation node, Annotation[] objects)
public void fireTreeNodesInserted(Annotation parent, Annotation[] objects)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesInserted
in interface org.annotation.wordfreak.AnnotationTreeListener
parent
- The parent of the nodes being inserted.objects
- The nodes that are being inserted.public void fireTreeNodesRemoved(Annotation node, Annotation[] objects)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesRemoved
in interface org.annotation.wordfreak.AnnotationTreeListener
node
- The parent of the nodes being deleted.objects
- The nodes that are being deleted.public void fireTreeNodesMoved(Annotation[] children, Annotation oldParent, Annotation newParent)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesMoved
in interface org.annotation.wordfreak.AnnotationTreeListener
children
- The nodes being moved.oldParent
- The old parent of the moved nodes.newParent
- The new parent of the moved nodes.public void fireTreeNodesChanged(Annotation node, Annotation[] objects)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesChanged
in interface org.annotation.wordfreak.AnnotationTreeListener
node
- objects
- public void fireTreeStructureChanged(Annotation node)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeStructureChanged
in interface org.annotation.wordfreak.AnnotationTreeListener
node
- The specified node.public void resetSelection()
AnnotationView
resetSelection
in interface AnnotationView
public Span getValidSelection(int start, int end)
AnnotationView
getValidSelection
in interface AnnotationView
public AnnotationSelection getValidSelection(AnnotationSelection selectedAnnotations)
AnnotationView
getValidSelection
in interface AnnotationView
public java.util.List getValidSelection(java.util.List selectedAnnotations)
public AnnotationSource getSource()
AnnotationView
getSource
in interface AnnotationView
getSource
in class AbstractAnnotationView
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |