|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.annotation.wordfreak.AbstractAnnotationView
org.annotation.wordfreak.UnmarkedTextAnnotationView
A wrapper class for AnnotationViews which inserts nodes for any source text which is not part of an annotation in the view.
This is used by the TreeViewer to render the annotations in the view.
| Field Summary |
| Fields inherited from class org.annotation.wordfreak.AbstractAnnotationView |
selectionMode, sort, treeDataListeners |
| Constructor Summary | |
UnmarkedTextAnnotationView(AnnotationView v)
|
|
| 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. |
boolean |
containsAll(java.util.List l,
java.lang.Object n)
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. |
void |
filter(AnnotationFilter f)
Applies the specified filter to this view. |
void |
fireTreeNodesChanged(Annotation parent,
Annotation[] changelings)
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[] insertions)
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 parent,
Annotation[] deletions)
Used to notify listener that the nodes specificed as deletions have been deleted under the specified parent. |
void |
fireTreeStructureChanged(Annotation a)
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.Class |
getColumnClass(int col)
Returns the type for column number column. |
int |
getColumnCount()
Returns the number ofs availible column. |
java.lang.String |
getColumnName(int col)
Returns the name for column number column. |
java.lang.Object |
getContainingLeaf(int offset)
Returns the leaf node which contains the specified offset. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
|
java.lang.Object |
getNextLeaf(java.lang.Object node)
Returns the susequent leaf node to the right 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()
|
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 s)
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. |
java.lang.Object |
getValueAt(java.lang.Object node,
int column)
Returns the value to be displayed for node node,
at column number column. |
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 |
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 |
isCellEditable(java.lang.Object node,
int column)
Indicates whether the the value for node node,
at column number column is editable. |
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 |
resetSelection()
Resets the selection. |
void |
setValueAt(java.lang.Object aValue,
java.lang.Object node,
int column)
Sets the value for node node,
at column number column. |
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 |
treeNodesChanged(javax.swing.event.TreeModelEvent e)
|
void |
treeNodesInserted(javax.swing.event.TreeModelEvent e)
|
void |
treeNodesRemoved(javax.swing.event.TreeModelEvent e)
|
void |
treeStructureChanged(javax.swing.event.TreeModelEvent e)
|
void |
update()
Rebuilds the view based on the AnnotationTree. |
void |
update(Annotation a)
Indicates that the specified annotation has been changed. |
void |
updateTree(javax.swing.tree.TreeNode root)
|
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
|
| Methods inherited from class org.annotation.wordfreak.AbstractAnnotationView |
addTreeModelListener, close, getFirstLeaf, getLastLeaf, getParent, getSelectionMode, getSortedAnnotations, removeTreeModelListener, setSelectionMode |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.tree.TreeModel |
addTreeModelListener, removeTreeModelListener |
| Constructor Detail |
public UnmarkedTextAnnotationView(AnnotationView v)
| Method Detail |
public void update()
AnnotationView
update in interface AnnotationViewpublic void updateTree(javax.swing.tree.TreeNode root)
public void filter(AnnotationFilter f)
AnnotationView
filter in interface AnnotationViewf - The filter to be applied to this view.public void sort(java.util.Comparator c)
AnnotationView
sort in interface AnnotationViewc - The criteria on which the sort is based.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.TreeModelpublic int getChildCount(java.lang.Object parent)
getChildCount in interface javax.swing.tree.TreeModel
public int getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
getIndexOfChild in interface javax.swing.tree.TreeModelpublic boolean isLeaf(java.lang.Object node)
isLeaf in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
valueForPathChanged in interface javax.swing.tree.TreeModelpublic javax.swing.tree.TreeNode[] getPath(java.lang.Object o)
AnnotationView
getPath in interface AnnotationViewo - The node in the tree from which to start the part.
public java.lang.Object getNextLeaf(java.lang.Object node)
AnnotationView
getNextLeaf in interface AnnotationViewnode - An existing leaft node.
public java.lang.Object getPreviousLeaf(java.lang.Object node)
AnnotationView
getPreviousLeaf in interface AnnotationViewnode - An existing leaft node.
public java.lang.Object getContainingLeaf(int offset)
AnnotationView
getContainingLeaf in interface AnnotationViewoffset - The offset that the returned leaf should contain.
public boolean containsAll(java.util.List l,
java.lang.Object n)
AnnotationView
containsAll in interface AnnotationViewl - A list of children.n - The node of a tree.
public void move(Annotation node,
Annotation dest)
AnnotationView
move in interface AnnotationViewnode - The annotation being moved.dest - The parent annotation.public void remove(Annotation node)
AnnotationView
remove in interface AnnotationViewnode - The annotation to be removed.
public Annotation insert(int s,
int e)
AnnotationViews and e.
insert in interface AnnotationViews - 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 AnnotationViews - 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 AnnotationViewtype - 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,
Annotation s,
Annotation e)
AnnotationView
insert in interface AnnotationViewtype - 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 insert(java.lang.String type,
int s,
int e,
Annotation parent)
AnnotationView
insert in interface AnnotationViewtype - 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 insertParent(Annotation child)
AnnotationView
insertParent in interface AnnotationViewchild - The annotation on which the new annotation is based.
public Annotation insertZeroLengthAnnotationBefore(Annotation before)
AnnotationView
insertZeroLengthAnnotationBefore in interface AnnotationViewbefore - The annotation which the the new annotaiton is before.
public Annotation insertZeroLengthAnnotationAfter(Annotation after)
AnnotationView
insertZeroLengthAnnotationAfter in interface AnnotationViewafter - The annotation which the the new annotaiton is after.
public Annotation insertParent(java.lang.String type,
Annotation child)
AnnotationView
insertParent in interface AnnotationViewtype - 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 AnnotationViewtype - 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 AnnotationViewtype - The type of the new annotation.after - The annotation which the the new annotaiton is after.
public Annotation getBase(int i)
AnnotationView
getBase in interface AnnotationViewi - The index of the annotation to be returned.
public int getBaseSize()
AnnotationView
getBaseSize in interface AnnotationViewpublic java.util.Iterator getBaseIterator()
AnnotationView
getBaseIterator in interface AnnotationViewpublic Annotation getAnnotation(int i)
AnnotationView
getAnnotation in interface AnnotationViewi - index
public Annotation getUnsortedAnnotation(int i)
AnnotationView
getUnsortedAnnotation in interface AnnotationViewi - index
public int getAnnotationSize()
AnnotationView
getAnnotationSize in interface AnnotationViewpublic java.util.Iterator getAnnotationIterator()
AnnotationView
getAnnotationIterator in interface AnnotationViewpublic int indexOfBase(Annotation a)
AnnotationView
indexOfBase in interface AnnotationViewa - The annotation whose index is being searched for.
public int indexOfAnnotation(Annotation a)
AnnotationView
indexOfAnnotation in interface AnnotationViewa - Annotation.
public int indexOfUnsortedAnnotation(Annotation a)
AnnotationView
indexOfUnsortedAnnotation in interface AnnotationViewa - Annotation.
public int indexOfBaseOffset(int o)
AnnotationView
indexOfBaseOffset in interface AnnotationViewo - The offset the base annotation at the returned index will contain.
public int indexOfAnnotationOffset(int o)
AnnotationView
indexOfAnnotationOffset in interface AnnotationViewo - offset.
public int binarySearchAnnotation(Annotation a)
AnnotationView
binarySearchAnnotation in interface AnnotationViewa - The annotation being searched for.
public int binarySearchBase(Annotation a)
AnnotationView
binarySearchBase in interface AnnotationViewa - The annotation being searched for.
public void resetSelection()
AnnotationView
resetSelection in interface AnnotationViewpublic AnnotationSelection getValidSelection(AnnotationSelection s)
AnnotationView
getValidSelection in interface AnnotationView
public Span getValidSelection(int s,
int e)
AnnotationView
getValidSelection in interface AnnotationViewpublic AnnotationSource getSource()
AnnotationView
getSource in interface AnnotationViewgetSource in class AbstractAnnotationView
public void chainAnnotations(Annotation a,
Annotation b)
AnnotationView
chainAnnotations in interface AnnotationViewa - The first annotation in the chain.b - The second annotation in the chain.public Annotation[] getChain(Annotation a)
AnnotationView
getChain in interface AnnotationViewa - An annotation in a chain.
public Annotation removeFromChain(Annotation a)
AnnotationView
removeFromChain in interface AnnotationViewa - 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 AnnotationViewtype - 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 AnnotationViewrole - 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 AnnotationViewrole - 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 AnnotationViewrelation - The relation to be removed.
public void remove(Annotation annotation,
Relation relation)
AnnotationView
remove in interface AnnotationViewannotation - The annotation to remove.relation - The relation from which the spevified annotation is removed.public void update(Annotation a)
AnnotationView
update in interface AnnotationViewupdate in class AbstractAnnotationViewpublic Relation[] getRelations(java.lang.String type)
AnnotationView
getRelations in interface AnnotationViewtype - The type of relations to be returned.
public Relation[] getRelations(Annotation a)
AnnotationView
getRelations in interface AnnotationViewa - The annotation which the returned relations contain.
public Relation[] getRelations(java.lang.String type,
Annotation a)
AnnotationView
getRelations in interface AnnotationViewtype - 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 AnnotationViewtype - The type of relation to be returned.a - The anchor of the relations to be returned.
public void treeNodesChanged(javax.swing.event.TreeModelEvent e)
treeNodesChanged in interface javax.swing.event.TreeModelListenerpublic void treeNodesInserted(javax.swing.event.TreeModelEvent e)
treeNodesInserted in interface javax.swing.event.TreeModelListenerpublic void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
treeNodesRemoved in interface javax.swing.event.TreeModelListener
public boolean isTerminalSpan(int s,
int e)
AnnotationView
isTerminalSpan in interface AnnotationViews - The start value of the span.e - The end value of the span.
public void treeStructureChanged(javax.swing.event.TreeModelEvent e)
treeStructureChanged in interface javax.swing.event.TreeModelListener
public Annotation deepInsert(java.lang.String type,
int s,
int e)
AnnotationView
deepInsert in interface AnnotationViewtype - 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 AnnotationViewa - The annotation to insert.
public Annotation terminalInsert(java.lang.String type,
int s,
int e)
AnnotationView
terminalInsert in interface AnnotationViewtype - 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 AnnotationViewa - The annotation to insert.
public void remove(Annotation node,
boolean shrink)
AnnotationView
remove in interface AnnotationViewnode - The node to be removed.shrink - Whether nodes which contains the specifed annotation should be shunk.
public void fireTreeNodesChanged(Annotation parent,
Annotation[] changelings)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesChanged in interface org.annotation.wordfreak.AnnotationTreeListenerparent - changelings -
public void fireTreeNodesInserted(Annotation parent,
Annotation[] insertions)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesInserted in interface org.annotation.wordfreak.AnnotationTreeListenerparent - The parent of the nodes being inserted.insertions - The nodes that are being inserted.
public void fireTreeNodesMoved(Annotation[] children,
Annotation oldParent,
Annotation newParent)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesMoved in interface org.annotation.wordfreak.AnnotationTreeListenerchildren - The nodes being moved.oldParent - The old parent of the moved nodes.newParent - The new parent of the moved nodes.
public void fireTreeNodesRemoved(Annotation parent,
Annotation[] deletions)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeNodesRemoved in interface org.annotation.wordfreak.AnnotationTreeListenerparent - The parent of the nodes being deleted.deletions - The nodes that are being deleted.public void fireTreeStructureChanged(Annotation a)
org.annotation.wordfreak.AnnotationTreeListener
fireTreeStructureChanged in interface org.annotation.wordfreak.AnnotationTreeListenera - The specified node.public int getColumnCount()
TreeTableModel
getColumnCount in interface TreeTableModelpublic java.lang.String getColumnName(int col)
TreeTableModelcolumn.
getColumnName in interface TreeTableModelpublic java.lang.Class getColumnClass(int col)
TreeTableModelcolumn.
getColumnClass in interface TreeTableModel
public java.lang.Object getValueAt(java.lang.Object node,
int column)
TreeTableModelnode,
at column number column.
getValueAt in interface TreeTableModel
public boolean isCellEditable(java.lang.Object node,
int column)
TreeTableModelnode,
at column number column is editable.
isCellEditable in interface TreeTableModel
public void setValueAt(java.lang.Object aValue,
java.lang.Object node,
int column)
TreeTableModelnode,
at column number column.
setValueAt in interface TreeTableModel
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||