GATE
Version 3.1-2270

gate.gui.docview
Class AnnotationSetsView

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

public class AnnotationSetsView
extends AbstractDocumentView
implements DocumentListener, AnnotationSetListener

Author:
valyt To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments
See Also:
Serialized Form

Nested Class Summary
protected static class AnnotationSetsView.AnnotationHandler
           
protected  class AnnotationSetsView.DeleteSelectedAnnotationGroupAction
           
protected  class AnnotationSetsView.EditAnnotationAction
           
protected  class AnnotationSetsView.HighlightMenuItem
          The popup menu items used to select annotations Apart from the normal JMenuItem behaviour, this menu item also highlights the annotation which it would select if pressed.
protected  class AnnotationSetsView.MouseStoppedMovingAction
          Used to select an annotation for editing.
protected  class AnnotationSetsView.NewAnnotationAction
           
protected  class AnnotationSetsView.NewAnnotationSetAction
           
protected  class AnnotationSetsView.SavePreserveFormatAction
           
protected  class AnnotationSetsView.SetHandler
          Stores the data related to an annotation set
protected  class AnnotationSetsView.SetsTableCellEditor
           
protected  class AnnotationSetsView.SetsTableCellRenderer
           
protected  class AnnotationSetsView.SetsTableModel
           
protected  class AnnotationSetsView.TextMouseListener
          A mouse listener used for events in the text view.
protected  class AnnotationSetsView.TypeHandler
           
 
Field Summary
protected  List actions
           
protected  ColorGenerator colourGenerator
           
protected  String lastAnnotationType
           
protected  Timer mouseMovementTimer
           
protected  AnnotationSetsView.MouseStoppedMovingAction mouseStoppedMovingAction
           
protected  AncestorListener textAncestorListener
           
protected  AnnotationSetsView.TextMouseListener textMouseListener
          The listener for mouse and mouse motion events in the text view.
 
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
AnnotationSetsView()
           
 
Method Summary
 void annotationAdded(AnnotationSetEvent e)
          Called when a new Annotation has been added
 void annotationRemoved(AnnotationSetEvent e)
          Called when an Annotation has been removed
 void annotationSetAdded(DocumentEvent e)
          Called when a new AnnotationSet has been added
 void annotationSetRemoved(DocumentEvent e)
          Called when an AnnotationSet has been removed
 void cleanup()
          releases the memory allocated to this resource
 void contentEdited(DocumentEvent e)
          Called when the content of the document has changed through an edit operation.
 List getActions()
          Returns a list of Action objects.
protected  Color getColor(String annotationType)
           
 Component getGUI()
          Returns the actual UI component this view represents.
protected  AnnotationSetsView.SetHandler getSetHandler(String name)
           
 int getType()
          Returns the type of this view.
protected  AnnotationSetsView.TypeHandler getTypeHandler(String set, String type)
           
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.
protected  void saveColor(String annotationType, Color colour)
           
 void setTypeSelected(String setName, String typeName, boolean selected)
           
protected  void unregisterHooks()
          This method will be called whenever this view becomes inactive.
 
Methods inherited from class gate.gui.docview.AbstractDocumentView
getDocument, isActive, setActive, setHandle, setOwner, setTarget
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, 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
getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

textMouseListener

protected AnnotationSetsView.TextMouseListener textMouseListener
The listener for mouse and mouse motion events in the text view.


mouseMovementTimer

protected Timer mouseMovementTimer

textAncestorListener

protected AncestorListener textAncestorListener

mouseStoppedMovingAction

protected AnnotationSetsView.MouseStoppedMovingAction mouseStoppedMovingAction

lastAnnotationType

protected String lastAnnotationType

actions

protected List actions

colourGenerator

protected ColorGenerator colourGenerator
Constructor Detail

AnnotationSetsView

public AnnotationSetsView()
Method Detail

getActions

public List getActions()
Description copied from interface: ActionsPublisher
Returns a list of Action objects. This method will be called everytime a menu for this resource needs to be built, thus allowing for dynamic updates to the list of actions. A null value in this list will cause a separator to be created.

Specified by:
getActions in interface ActionsPublisher
Overrides:
getActions in class AbstractDocumentView
Returns:
a List of Actions.

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

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.

getColor

protected Color getColor(String annotationType)

saveColor

protected void saveColor(String annotationType,
                         Color colour)

registerHooks

protected void registerHooks()
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()
This method will be called whenever this view becomes inactive. Implementers should use it to unregister whatever hooks they registered in registerHooks().

Specified by:
unregisterHooks in class AbstractDocumentView

initListeners

protected void initListeners()

cleanup

public void cleanup()
Description copied from class: AbstractResource
releases the memory allocated to this resource

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

annotationSetAdded

public void annotationSetAdded(DocumentEvent e)
Description copied from interface: DocumentListener
Called when a new AnnotationSet has been added

Specified by:
annotationSetAdded in interface DocumentListener

annotationSetRemoved

public void annotationSetRemoved(DocumentEvent e)
Description copied from interface: DocumentListener
Called when an AnnotationSet has been removed

Specified by:
annotationSetRemoved in interface DocumentListener

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 e)
Description copied from interface: AnnotationSetListener
Called when a new Annotation has been added

Specified by:
annotationAdded in interface AnnotationSetListener

annotationRemoved

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

Specified by:
annotationRemoved in interface AnnotationSetListener

getSetHandler

protected AnnotationSetsView.SetHandler getSetHandler(String name)

getTypeHandler

protected AnnotationSetsView.TypeHandler getTypeHandler(String set,
                                                        String type)

setTypeSelected

public void setTypeSelected(String setName,
                            String typeName,
                            boolean selected)

GATE
Version 3.1-2270