org.annotation.wordfreak
Class AnnotationManager

java.lang.Object
  extended byorg.annotation.wordfreak.AnnotationManager
All Implemented Interfaces:
AnnotationFilterListener, AnnotatorListener, javax.swing.event.ChangeListener, EventListener, java.util.EventListener, FilterCriteriaManager, SettingsListener, java.awt.event.WindowListener, WordFreakKeyboardFocusManager.KeyBufferListener

public class AnnotationManager
extends java.lang.Object
implements EventListener, java.awt.event.WindowListener, SettingsListener, AnnotatorListener, FilterCriteriaManager, AnnotationFilterListener, WordFreakKeyboardFocusManager.KeyBufferListener, javax.swing.event.ChangeListener

This class keeps track of the plugin components such as schemes, viewers, and annotators as well as which of these plugins are currently in use and disbatchs events. Event disbatching includes sending filter change events to the components which care about them.

Author:
Tom Morton, Jeremy Laivita

Field Summary
protected  java.lang.String expression
           
protected  int findDir
           
 
Constructor Summary
AnnotationManager()
           
 
Method Summary
 void addAnnotatorNames(java.util.List names)
          Advises the manager that the specified annotator names should be available for filtering.
 void addFilterCriteriaListener(FilterCriteriaListener listener)
          Adds the specified listener the list of listeners notified of filter criteria changes.
 void addMatchCriteria(java.util.List criteria)
          Advises the manager that the specified criteria names should be available for filtering.
 void addViewer(java.lang.String name)
          Indicates that a viewer with the specified name has been added to wordfreak's UI.
 void adjudicate()
          Indicates that the user has requested to switch into adjudication mode.
 void annotate()
          Indicates that the user has requested to switch into annotation mode.
 void annotationComplete()
          Notifies listeners that automatic annotation is complete.
 boolean eventTranspired(java.lang.String eventType, java.lang.Object source)
           
 void filter()
          Indicates that the annotation filter should be applied.
 void filterChanged()
          Notifes a listening object that the filter has changed.
static java.lang.String getAnnotatorName()
           
 java.lang.Object[] getAnnotators()
           
 java.lang.Object[] getSchemes()
           
 java.lang.Object[] getViewers()
           
 void removeAnnotatorName(java.util.List names)
          Advises the manager that the specified annotator names should be available for filtering unless requested by another source.
 void removeFilterCriteriaListener(FilterCriteriaListener listener)
          Removes the specified listener the list of listeners notified of filter criteria changes.
 void removeMatchCriteria(java.util.List criteria)
          Advises the manager that the specified criteria names should be not available for filtering unless requested by another source.
 void removeViewer(java.lang.String name)
           
 void setAnnotationFilter(AnnotationFilter af)
          Indicates that the specified filter should be applied to annotations being displayed.
 void setAnnotationScheme(java.lang.String as)
          Indicates that a scheme with the specified name has been selected.
 void setAnnotator(java.lang.String a)
          Indicates that the annotator with the specified name has been selected.
 void setAnnotatorClasses(java.lang.String[] classes)
           
 void setAnnotatorName(java.lang.String name)
           
 void setDataDirectory(java.lang.String dir)
          Indicates that the data directory has been set to the specified value.
 void setFileRequestListener(FileRequestListener frl)
           
 void setGuiListener(GuiListener gl)
           
 void setProject(Project p)
          Indicates that the specified project is being used.
 void setSavingFilter(AnnotationFilter af)
          Indicates that the specified filter should be applied to annotations being used saved.
 void setSchemeClasses(java.lang.String[] classes)
           
 void setTaggingFilter(AnnotationFilter af)
          Indicates that the specified filter should be applied to annotations being automatically annotated (tagged).
 void setTagSet(java.lang.String ts)
           
 void setTagSetClasses(java.lang.String[] classes)
           
 void setTrainingFilter(AnnotationFilter af)
          Indicates that the specified filter should be applied to annotations being used for training.
 void setViewerClasses(java.lang.String[] classes)
           
 void setXMLPlugins(java.util.Map[] xml)
           
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 void updateKeyBuffer(java.lang.String buffer)
          indicates that the key buffer has changed and now contains the specified buffer contents.
 void viewAnnotatedFile(AnnotationFile af)
          Indicates that the user wants the specified file to be displayed.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expression

protected java.lang.String expression

findDir

protected int findDir
Constructor Detail

AnnotationManager

public AnnotationManager()
Method Detail

getViewers

public java.lang.Object[] getViewers()

getSchemes

public java.lang.Object[] getSchemes()

getAnnotatorName

public static java.lang.String getAnnotatorName()

getAnnotators

public java.lang.Object[] getAnnotators()

setViewerClasses

public void setViewerClasses(java.lang.String[] classes)

setSchemeClasses

public void setSchemeClasses(java.lang.String[] classes)

setAnnotatorClasses

public void setAnnotatorClasses(java.lang.String[] classes)

setTagSetClasses

public void setTagSetClasses(java.lang.String[] classes)

setXMLPlugins

public void setXMLPlugins(java.util.Map[] xml)

setFileRequestListener

public void setFileRequestListener(FileRequestListener frl)

setGuiListener

public void setGuiListener(GuiListener gl)

updateKeyBuffer

public void updateKeyBuffer(java.lang.String buffer)
Description copied from interface: WordFreakKeyboardFocusManager.KeyBufferListener
indicates that the key buffer has changed and now contains the specified buffer contents.

Specified by:
updateKeyBuffer in interface WordFreakKeyboardFocusManager.KeyBufferListener
Parameters:
buffer - The contents of the key buffer.

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

setAnnotationFilter

public void setAnnotationFilter(AnnotationFilter af)
Description copied from interface: SettingsListener
Indicates that the specified filter should be applied to annotations being displayed. Only annotations which meet the specified filter criteria will be displayed.

Specified by:
setAnnotationFilter in interface SettingsListener
Parameters:
af - The filter to apply to loaded annotations.

setTaggingFilter

public void setTaggingFilter(AnnotationFilter af)
Description copied from interface: SettingsListener
Indicates that the specified filter should be applied to annotations being automatically annotated (tagged). Only annotations which meet the specified filter criteria will be tagged.

Specified by:
setTaggingFilter in interface SettingsListener
Parameters:
af - The filter to apply to tagged annotations.

setTrainingFilter

public void setTrainingFilter(AnnotationFilter af)
Description copied from interface: SettingsListener
Indicates that the specified filter should be applied to annotations being used for training. Only annotations which meet the specified filter criteria will be used for training.

Specified by:
setTrainingFilter in interface SettingsListener
Parameters:
af - The filter to apply to annotations being used for training.

setSavingFilter

public void setSavingFilter(AnnotationFilter af)
Description copied from interface: SettingsListener
Indicates that the specified filter should be applied to annotations being used saved. Only annotations which meet the specified filter criteria will be saved.

Specified by:
setSavingFilter in interface SettingsListener
Parameters:
af - The filter to apply to annotations being saved.

filterChanged

public void filterChanged()
Description copied from interface: AnnotationFilterListener
Notifes a listening object that the filter has changed.

Specified by:
filterChanged in interface AnnotationFilterListener

filter

public void filter()
Description copied from interface: SettingsListener
Indicates that the annotation filter should be applied.

Specified by:
filter in interface SettingsListener

setAnnotatorName

public void setAnnotatorName(java.lang.String name)

annotate

public void annotate()
Description copied from interface: SettingsListener
Indicates that the user has requested to switch into annotation mode. This is the default.

Specified by:
annotate in interface SettingsListener

adjudicate

public void adjudicate()
Description copied from interface: SettingsListener
Indicates that the user has requested to switch into adjudication mode.

Specified by:
adjudicate in interface SettingsListener

setAnnotationScheme

public void setAnnotationScheme(java.lang.String as)
Description copied from interface: SettingsListener
Indicates that a scheme with the specified name has been selected.

Specified by:
setAnnotationScheme in interface SettingsListener
Parameters:
as - The name of the scheme being used.

addViewer

public void addViewer(java.lang.String name)
Description copied from interface: SettingsListener
Indicates that a viewer with the specified name has been added to wordfreak's UI.

Specified by:
addViewer in interface SettingsListener
Parameters:
name - The name of a viewer being used.

removeViewer

public void removeViewer(java.lang.String name)

viewAnnotatedFile

public void viewAnnotatedFile(AnnotationFile af)
Description copied from interface: SettingsListener
Indicates that the user wants the specified file to be displayed.

Specified by:
viewAnnotatedFile in interface SettingsListener
Parameters:
af - The annotation file to be displayed.

setDataDirectory

public void setDataDirectory(java.lang.String dir)
Description copied from interface: SettingsListener
Indicates that the data directory has been set to the specified value. The data directory is typically used to specify the location of models for annotators.

Specified by:
setDataDirectory in interface SettingsListener
Parameters:
dir - The path of the data directory.

setAnnotator

public void setAnnotator(java.lang.String a)
Description copied from interface: SettingsListener
Indicates that the annotator with the specified name has been selected.

Specified by:
setAnnotator in interface SettingsListener
Parameters:
a - The name of the annotator being used.

setTagSet

public void setTagSet(java.lang.String ts)

setProject

public void setProject(Project p)
Description copied from interface: SettingsListener
Indicates that the specified project is being used.

Specified by:
setProject in interface SettingsListener
Parameters:
p - The project that is currently being used.

annotationComplete

public void annotationComplete()
Description copied from interface: AnnotatorListener
Notifies listeners that automatic annotation is complete.

Specified by:
annotationComplete in interface AnnotatorListener

eventTranspired

public boolean eventTranspired(java.lang.String eventType,
                               java.lang.Object source)
Specified by:
eventTranspired in interface EventListener

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

addAnnotatorNames

public void addAnnotatorNames(java.util.List names)
Description copied from interface: FilterCriteriaManager
Advises the manager that the specified annotator names should be available for filtering. This method should only be called once by the source of these names.

Specified by:
addAnnotatorNames in interface FilterCriteriaManager
Parameters:
names - The names of the annotators.

addFilterCriteriaListener

public void addFilterCriteriaListener(FilterCriteriaListener listener)
Description copied from interface: FilterCriteriaManager
Adds the specified listener the list of listeners notified of filter criteria changes.

Specified by:
addFilterCriteriaListener in interface FilterCriteriaManager
Parameters:
listener -

addMatchCriteria

public void addMatchCriteria(java.util.List criteria)
Description copied from interface: FilterCriteriaManager
Advises the manager that the specified criteria names should be available for filtering. This method should only be called once by the source of these names.

Specified by:
addMatchCriteria in interface FilterCriteriaManager
Parameters:
criteria - The criteria on which filters are based.

removeAnnotatorName

public void removeAnnotatorName(java.util.List names)
Description copied from interface: FilterCriteriaManager
Advises the manager that the specified annotator names should be available for filtering unless requested by another source. This method should only be called once by the source of these names.

Specified by:
removeAnnotatorName in interface FilterCriteriaManager
Parameters:
names - The names of the annotators.

removeFilterCriteriaListener

public void removeFilterCriteriaListener(FilterCriteriaListener listener)
Description copied from interface: FilterCriteriaManager
Removes the specified listener the list of listeners notified of filter criteria changes.

Specified by:
removeFilterCriteriaListener in interface FilterCriteriaManager
Parameters:
listener -

removeMatchCriteria

public void removeMatchCriteria(java.util.List criteria)
Description copied from interface: FilterCriteriaManager
Advises the manager that the specified criteria names should be not available for filtering unless requested by another source. This method should only be called once by the source of these names.

Specified by:
removeMatchCriteria in interface FilterCriteriaManager
Parameters:
criteria - The criteria on which filters are based.


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