org.annotation.wordfreak
Class AbstractAnnotationView

java.lang.Object
  extended byorg.annotation.wordfreak.AbstractAnnotationView
All Implemented Interfaces:
org.annotation.wordfreak.AnnotationTreeListener, AnnotationView, javax.swing.tree.TreeModel
Direct Known Subclasses:
AbstractListAnnotationView, DefaultAnnotationView, UnmarkedTextAnnotationView

public abstract class AbstractAnnotationView
extends java.lang.Object
implements org.annotation.wordfreak.AnnotationTreeListener


Field Summary
protected  SelectionMode selectionMode
          Specifies what type of selections are valid for this view.
protected  SortedAnnotations sort
          Sorted version of filt based on comparator.
protected  java.util.List treeDataListeners
           
 
Constructor Summary
AbstractAnnotationView()
           
 
Method Summary
 void addTreeModelListener(javax.swing.event.TreeModelListener tml)
           
 void close()
          Does any clean up that needs to happen before the view goes away
 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.
 java.lang.Object getFirstLeaf(java.lang.Object parent)
          Returns the left-most leaf child of the specified start node.
 java.lang.Object getLastLeaf(java.lang.Object parent)
          Returns the right-most leaf child of the specified start node.
 java.lang.Object getParent(java.lang.Object node)
          Returns the parent of the specified node.
 SelectionMode getSelectionMode()
          Returns the types of selection which are valid.
 SortedAnnotations getSortedAnnotations()
          Returns the object which manages sorted annotations.
abstract  AnnotationSource getSource()
          Returns the source data associated with the file for this view.
 void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
           
 void setSelectionMode(SelectionMode sm)
          Specified what types of selection are valid.
abstract  void update(Annotation a)
          Indicates that the specified annotation has been changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.annotation.wordfreak.AnnotationView
binarySearchAnnotation, binarySearchBase, chainAnnotations, containsAll, createRelation, deepInsert, deepInsert, filter, getAnnotation, getAnnotationIterator, getAnnotationSize, getBase, getBaseIterator, getBaseSize, getChain, getContainingLeaf, getNextLeaf, getPath, getPreviousLeaf, getRelation, getRelations, getRelations, getRelations, getUnsortedAnnotation, getValidSelection, getValidSelection, indexOfAnnotation, indexOfAnnotationOffset, indexOfBase, indexOfBaseOffset, indexOfUnsortedAnnotation, insert, insert, insert, insert, insert, insert, insertParent, insertParent, insertZeroLengthAnnotationAfter, insertZeroLengthAnnotationAfter, insertZeroLengthAnnotationBefore, insertZeroLengthAnnotationBefore, isTerminalSpan, move, put, put, remove, remove, remove, remove, removeFromChain, resetSelection, sort, terminalInsert, update
 
Methods inherited from interface javax.swing.tree.TreeModel
getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, valueForPathChanged
 

Field Detail

selectionMode

protected SelectionMode selectionMode
Specifies what type of selections are valid for this view.


treeDataListeners

protected java.util.List treeDataListeners

sort

protected SortedAnnotations sort
Sorted version of filt based on comparator.

Constructor Detail

AbstractAnnotationView

public AbstractAnnotationView()
Method Detail

close

public void close()
Description copied from interface: AnnotationView
Does any clean up that needs to happen before the view goes away

Specified by:
close in interface AnnotationView

getSortedAnnotations

public SortedAnnotations getSortedAnnotations()
Description copied from interface: AnnotationView
Returns the object which manages sorted annotations.

Specified by:
getSortedAnnotations in interface AnnotationView

getParent

public java.lang.Object getParent(java.lang.Object node)
Description copied from interface: AnnotationView
Returns the parent of the specified node.

Specified by:
getParent in interface AnnotationView
Parameters:
node - The node whose parent is being requested.
Returns:
The parent of the specified node or null is no such parent exists..

getFirstLeaf

public java.lang.Object getFirstLeaf(java.lang.Object parent)
Description copied from interface: AnnotationView
Returns the left-most leaf child of the specified start node.

Specified by:
getFirstLeaf in interface AnnotationView
Parameters:
parent - The node at which to begin the search.
Returns:
The left-most leaf child of the specified start node.

getLastLeaf

public java.lang.Object getLastLeaf(java.lang.Object parent)
Description copied from interface: AnnotationView
Returns the right-most leaf child of the specified start node.

Specified by:
getLastLeaf in interface AnnotationView
Parameters:
parent - The node at which to begin the search.
Returns:
The right-most leaf child of the specified start node.

setSelectionMode

public void setSelectionMode(SelectionMode sm)
Description copied from interface: AnnotationView
Specified what types of selection are valid.

Specified by:
setSelectionMode in interface AnnotationView
Parameters:
sm - The types of selection which are valid.

getSelectionMode

public SelectionMode getSelectionMode()
Description copied from interface: AnnotationView
Returns the types of selection which are valid.

Specified by:
getSelectionMode in interface AnnotationView
Returns:
The types of selection which are valid.

getSource

public abstract AnnotationSource getSource()
Description copied from interface: AnnotationView
Returns the source data associated with the file for this view.

Specified by:
getSource in interface AnnotationView
Returns:
The source data associated with the file for this view.

update

public abstract void update(Annotation a)
Description copied from interface: AnnotationView
Indicates that the specified annotation has been changed.

Specified by:
update in interface AnnotationView
Parameters:
a - The annotation which needs to be updated.

addTreeModelListener

public void addTreeModelListener(javax.swing.event.TreeModelListener tml)
Specified by:
addTreeModelListener in interface javax.swing.tree.TreeModel

removeTreeModelListener

public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
Specified by:
removeTreeModelListener in interface javax.swing.tree.TreeModel

fireTreeNodesChanged

public 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.

Parameters:
parent -
changelings -

fireTreeNodesInserted

public void fireTreeNodesInserted(Annotation parent,
                                  Annotation[] insertions)
Used to notify listener that the nodes specificed as insertions have been inserted under the specified parent.

Parameters:
parent - The parent of the nodes being inserted.
insertions - The nodes that are being inserted.

fireTreeNodesMoved

public 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.

Parameters:
children - The nodes being moved.
oldParent - The old parent of the moved nodes.
newParent - The new parent of the moved nodes.

fireTreeNodesRemoved

public void fireTreeNodesRemoved(Annotation parent,
                                 Annotation[] deletions)
Used to notify listener that the nodes specificed as deletions have been deleted under the specified parent.

Parameters:
parent - The parent of the nodes being deleted.
deletions - The nodes that are being deleted.

fireTreeStructureChanged

public void fireTreeStructureChanged(Annotation a)
Used to notify listener that the structure under the specified node has changed substantually.

Parameters:
a - The specified node.


Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.