gate.gui.docview
Class CorefEditor

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.gui.docview.AbstractDocumentView
              extended by gate.gui.docview.CorefEditor
All Implemented Interfaces:
AnnotationSetListener, DocumentListener, FeatureMapListener, ActionsPublisher, DocumentView, Resource, FeatureBearer, NameBearer, VisualResource, ActionListener, Serializable, EventListener

public class CorefEditor
extends AbstractDocumentView
implements ActionListener, FeatureMapListener, DocumentListener, AnnotationSetListener

Display a tree that contains the co-references type of the document, highlight co-references in the document, allow creating co-references from existing annotations, editing and deleting co-references.

See Also:
Serialized Form

Nested Class Summary
protected  class CorefEditor.ChainToolTipAction
          When user hovers over the chainnodes
protected  class CorefEditor.CorefTreeCellRenderer
          Cell renderer to add the checkbox in the tree
protected  class CorefEditor.CorefTreeMouseListener
          Action for mouseClick on the Tree
protected  class CorefEditor.CorefTreeNode
           
protected  class CorefEditor.NewCorefAction
          When user hovers over the annotations which have been highlighted by show button
protected  class CorefEditor.TextPaneMouseListener
           
 
Field Summary
 
Fields inherited from class gate.gui.docview.AbstractDocumentView
active, document, guiInitialised, handle, owner
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Fields inherited from interface gate.gui.docview.DocumentView
CENTRAL, HORIZONTAL, VERTICAL
 
Constructor Summary
CorefEditor()
           
 
Method Summary
 void actionPerformed(ActionEvent ae)
          ActionPerformed Activity
 void annotationAdded(AnnotationSetEvent ase)
          Called when a new Annotation has been added
 void annotationRemoved(AnnotationSetEvent ase)
          Called when an Annotation has been removed
 void annotationSetAdded(DocumentEvent de)
          This method is called when any new annotationSet is added
 void annotationSetRemoved(DocumentEvent de)
          This method is called when any annotationSet is removed outside the co-reference editor..
 void cleanup()
          This methods cleans up the memory by removing all listener registrations
 void contentEdited(DocumentEvent e)
          Called when the content of the document has changed through an edit operation.
 void featureMapUpdated()
          Called when features are changed outside the co-refEditor
 CorefEditor.CorefTreeNode findOutChainNode(String chainNodeString, String set)
           
 Annotation findOutTheLongestAnnotation(ArrayList matches, AnnotationSet set)
          Given arrayList containing Ids of the annotations, and an annotationSet, this method returns the annotations that has longest string among the matches
 Component getGUI()
          Returns the actual UI component this view represents.
 String getString(Annotation ann)
          Given an annotation, this method returns the string of that annotation
 int getType()
          Returns the type of this view.
 void highlightAnnotations()
          This methods highlights the annotations
protected  void initGUI()
          This method intiates the GUI for co-reference editor
 void mouseClicked(MouseEvent me)
           
protected  void registerHooks()
          This method will be called whenever the view becomes active.
 void reinitAllVariables()
           
 void removeChainReference(Annotation annot, CorefEditor.CorefTreeNode chainHead)
          Removes the reference of this annotation from the current chain.
protected  void unregisterHooks()
          This method will be called whenever this view becomes inactive.
 
Methods inherited from class gate.gui.docview.AbstractDocumentView
getActions, getDocument, getHandle, getOwner, isActive, setActive, setHandle, setOwner, setSelectedAnnotations, setTarget
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.Resource
getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Constructor Detail

CorefEditor

public CorefEditor()
Method Detail

initGUI

protected void initGUI()
This method intiates the GUI for co-reference editor

Specified by:
initGUI in class AbstractDocumentView

reinitAllVariables

public void reinitAllVariables()

cleanup

public void cleanup()
This methods cleans up the memory by removing all listener registrations

Specified by:
cleanup in interface Resource
Overrides:
cleanup in class AbstractResource

findOutTheLongestAnnotation

public Annotation findOutTheLongestAnnotation(ArrayList matches,
                                              AnnotationSet set)
Given arrayList containing Ids of the annotations, and an annotationSet, this method returns the annotations that has longest string among the matches


annotationSetRemoved

public void annotationSetRemoved(DocumentEvent de)
This method is called when any annotationSet is removed outside the co-reference editor..

Specified by:
annotationSetRemoved in interface DocumentListener
Parameters:
de -

annotationSetAdded

public void annotationSetAdded(DocumentEvent de)
This method is called when any new annotationSet is added

Specified by:
annotationSetAdded in interface DocumentListener
Parameters:
de -

contentEdited

public void contentEdited(DocumentEvent e)
Called when the content of the document has changed through an edit operation.

Specified by:
contentEdited in interface DocumentListener

annotationAdded

public void annotationAdded(AnnotationSetEvent ase)
Description copied from interface: AnnotationSetListener
Called when a new Annotation has been added

Specified by:
annotationAdded in interface AnnotationSetListener

annotationRemoved

public void annotationRemoved(AnnotationSetEvent ase)
Description copied from interface: AnnotationSetListener
Called when an Annotation has been removed

Specified by:
annotationRemoved in interface AnnotationSetListener

featureMapUpdated

public void featureMapUpdated()
Called when features are changed outside the co-refEditor

Specified by:
featureMapUpdated in interface FeatureMapListener

actionPerformed

public void actionPerformed(ActionEvent ae)
ActionPerformed Activity

Specified by:
actionPerformed in interface ActionListener
Parameters:
ae -

getString

public String getString(Annotation ann)
Given an annotation, this method returns the string of that annotation


removeChainReference

public void removeChainReference(Annotation annot,
                                 CorefEditor.CorefTreeNode chainHead)
Removes the reference of this annotation from the current chain.

Parameters:
annot - annotation to remove
chainHead - co-reference chain to modify

highlightAnnotations

public void highlightAnnotations()
This methods highlights the annotations


registerHooks

protected void registerHooks()
Description copied from class: AbstractDocumentView
This method will be called whenever the view becomes active. Implementers should use this to add hooks (such as mouse listeners) to the other views as required by their functionality.

Specified by:
registerHooks in class AbstractDocumentView

unregisterHooks

protected void unregisterHooks()
Description copied from class: AbstractDocumentView
This method will be called whenever this view becomes inactive. Implementers should use it to unregister whatever hooks they registered in AbstractDocumentView.registerHooks().

Specified by:
unregisterHooks in class AbstractDocumentView

getGUI

public Component getGUI()
Description copied from interface: DocumentView
Returns the actual UI component this view represents.

Specified by:
getGUI in interface DocumentView
Returns:
a Component value.

getType

public int getType()
Description copied from interface: DocumentView
Returns the type of this view.

Specified by:
getType in interface DocumentView
Returns:
an int value
See Also:
DocumentView.CENTRAL, DocumentView.HORIZONTAL, DocumentView.VERTICAL

mouseClicked

public void mouseClicked(MouseEvent me)

findOutChainNode

public CorefEditor.CorefTreeNode findOutChainNode(String chainNodeString,
                                                  String set)