GATE
Version 3.1-2270

gate.gui.docview
Class AnnotationListView

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.gui.docview.AbstractDocumentView
              extended by gate.gui.docview.AnnotationListView
All Implemented Interfaces:
AnnotationListener, ActionsPublisher, DocumentView, Resource, FeatureBearer, NameBearer, VisualResource, Serializable, EventListener

public class AnnotationListView
extends AbstractDocumentView
implements AnnotationListener

A tabular view for a list of annotations. Used as part of the document viewer to display all the annotation currently highlighted.

See Also:
Serialized Form

Nested Class Summary
protected static class AnnotationListView.AnnotationHandler
           
protected  class AnnotationListView.EditAnnotationAction
           
 
Field Summary
protected  Map annotationHandlerByTag
           
protected  Map editorsCache
          A map that stores instantiated annotations editors in order to avoid the delay of building them at each request;
protected  JPanel mainPanel
           
protected  JScrollPane scroller
           
protected  JLabel statusLabel
           
protected  XJTable table
           
protected  gate.gui.docview.AnnotationListView.AnnotationTableModel tableModel
           
protected  List tagList
           
protected  TextualDocumentView textView
           
 
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
AnnotationListView()
           
 
Method Summary
 void addAnnotation(Object tag, Annotation ann, AnnotationSet set)
           
 void addAnnotations(Collection tags, Collection annotations, AnnotationSet set)
          Adds a batch of annotations in one go.
 void annotationUpdated(AnnotationEvent e)
          Called when an Annotation has been updated
 Component getGUI()
          Returns the actual UI component this view represents.
 int getType()
          Returns the type of this view.
protected  void guiShown()
           
protected  void initGUI()
          Implementers should override this method and use it for populating the GUI.
protected  void initListeners()
           
protected  void registerHooks()
          This method will be called whenever the view becomes active.
 void removeAnnotation(Object tag)
           
 void removeAnnotations(Collection tags)
           
 void selectAnnotationForTag(Object tag)
          Selects the annotation for the given tag.
protected  void showHighlights()
           
protected  void unregisterHooks()
          This method will be called whenever this view becomes inactive.
 
Methods inherited from class gate.gui.docview.AbstractDocumentView
getActions, getDocument, isActive, setActive, setHandle, setOwner, setTarget
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, cleanup, getBeanInfo, getName, getParameterValue, getParameterValue, 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
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

table

protected XJTable table

tableModel

protected gate.gui.docview.AnnotationListView.AnnotationTableModel tableModel

scroller

protected JScrollPane scroller

annotationHandlerByTag

protected Map annotationHandlerByTag

tagList

protected List tagList

mainPanel

protected JPanel mainPanel

statusLabel

protected JLabel statusLabel

textView

protected TextualDocumentView textView

editorsCache

protected Map editorsCache
A map that stores instantiated annotations editors in order to avoid the delay of building them at each request;

Constructor Detail

AnnotationListView

public AnnotationListView()
Method Detail

initGUI

protected void initGUI()
Description copied from class: AbstractDocumentView
Implementers should override this method and use it for populating the GUI.

Specified by:
initGUI 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.

initListeners

protected void initListeners()

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

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

guiShown

protected void guiShown()

showHighlights

protected void showHighlights()

addAnnotation

public void addAnnotation(Object tag,
                          Annotation ann,
                          AnnotationSet set)

removeAnnotation

public void removeAnnotation(Object tag)

addAnnotations

public void addAnnotations(Collection tags,
                           Collection annotations,
                           AnnotationSet set)
Adds a batch of annotations in one go. The tags and annotations collections are accessed through their iterators which are expected to return the corresponding tag for the right annotation. This method does not assume it was called from the UI Thread.

Parameters:
tags - a collection of tags
annotations - a collection of annotations
set - the annotation set to which all the annotations belong.

removeAnnotations

public void removeAnnotations(Collection tags)

annotationUpdated

public void annotationUpdated(AnnotationEvent e)
Description copied from interface: AnnotationListener
Called when an Annotation has been updated

Specified by:
annotationUpdated in interface AnnotationListener

selectAnnotationForTag

public void selectAnnotationForTag(Object tag)
Selects the annotation for the given tag.

Parameters:
tag - the tag of the annotation to be selected.

GATE
Version 3.1-2270