public class AnnotationSetsView extends AbstractDocumentView implements DocumentListener, AnnotationSetListener, AnnotationEditorOwner
| Modifier and Type | Class and Description |
|---|---|
protected class |
AnnotationSetsView.DeleteSelectedAnnotationsAction |
protected class |
AnnotationSetsView.EditAnnotationAction |
protected class |
AnnotationSetsView.HandleDocumentEventsAction |
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 |
class |
AnnotationSetsView.SetHandler
Stores the data related to an annotation set
|
protected class |
AnnotationSetsView.SetSelectedAnnotationsAction |
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.
|
class |
AnnotationSetsView.TypeHandler |
| Modifier and Type | Field and Description |
|---|---|
protected static ColorGenerator |
colourGenerator |
protected ComponentOrientation |
currentOrientation |
protected Timer |
eventMinder
Timer used to handle events coming from the document
|
protected String |
lastAnnotationType |
protected Timer |
mouseMovementTimer |
protected AnnotationSetsView.MouseStoppedMovingAction |
mouseStoppedMovingAction |
protected BlockingQueue<GateEvent> |
pendingEvents |
protected PropertyChangeListener |
textChangeListener
Listener for property changes on the text pane.
|
protected AnnotationSetsView.TextMouseListener |
textMouseListener
The listener for mouse and mouse motion events in the text view.
|
protected BlockingQueue<gate.gui.docview.AnnotationSetsView.TypeSpec> |
visibleAnnotationTypes
Stores the list of visible annotation types when the view is inactivated
so that the selection can be restored when the view is made active again.
|
active, document, guiInitialised, handle, ownernamefeaturesCENTRAL, HORIZONTAL, VERTICAL| Constructor and Description |
|---|
AnnotationSetsView() |
| Modifier and Type | Method and Description |
|---|---|
void |
annotationAdded(AnnotationSetEvent e)
Called when a new
Annotation has been added |
void |
annotationChanged(Annotation ann,
AnnotationSet set,
String oldType)
Called by the annotation editor when an annotation has been
changed.
|
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 |
changeOrientation(ComponentOrientation orientation)
changes the orientation of the annotation editor component only
|
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.
|
protected OwnedAnnotationEditor |
createAnnotationEditor(TextualDocumentView textView,
AnnotationSetsView asView)
Create the annotation editor (responsible for creating the window
used to edit individual annotations).
|
static Color |
getColor(String annotationSet,
String annotationType)
Get the saved colour for this annotation type or create a new one
and save it.
|
Component |
getGUI()
Returns the actual UI component this view represents.
|
AnnotationList |
getListComponent() |
Annotation |
getNextAnnotation()
Called by the editor for obtaining the next annotation to be edited.
|
Annotation |
getPreviousAnnotation()
Called by the editor for obtaining the previous annotation to be edited.
|
protected AnnotationSetsView.SetHandler |
getSetHandler(String name)
Get an annotation set handler in this annotation set view.
|
JTextComponent |
getTextComponent()
Gets the UI component used to display the document text.
|
int |
getType()
Returns the type of this view.
|
AnnotationSetsView.TypeHandler |
getTypeHandler(String set,
String type)
Get an annotation type handler in this annotation set view.
|
protected void |
initGUI()
Implementers should override this method and use it for populating the GUI.
|
protected void |
initListeners() |
protected void |
populateUI() |
protected void |
registerHooks()
This method will be called whenever the view becomes active.
|
void |
restoreSavedSelectedTypes()
Restore previously selected types from the preferences.
|
protected void |
restoreSelectedTypes()
Restores the selected types based on the state saved in the
visibleAnnotationTypes data structure. |
protected void |
saveColor(String annotationSet,
String annotationType,
Color colour) |
void |
saveType(String setName,
String typeName,
boolean selected)
Save type or remove unselected type in the preferences.
|
void |
selectAnnotation(Annotation ann,
AnnotationSet annSet)
Sets a particular annotation as selected.
|
void |
selectAnnotation(AnnotationData aData)
Queues an an action for selecting the provided annotation
|
void |
setNewAnnSetCreationEnabled(boolean b)
Enables or disables creation of the new annotation set.
|
void |
setSelectedAnnotations(List<AnnotationData> selectedAnnots)
Some document views can use the concept of selected annotations.
|
void |
setTypeSelected(String setName,
String typeName,
boolean selected)
Un/select an annotation type in this annotation set view
and indirectly highlight it in the document view.
|
protected void |
storeSelectedTypes()
Populates the
visibleAnnotationTypes structure based on the
current selection |
protected void |
unregisterHooks()
This method will be called whenever this view becomes inactive.
|
getActions, getDocument, getHandle, getOwner, isActive, setActive, setHandle, setOwner, setTargetcheckParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toStringgetFeatures, setFeaturesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDocumenttargetReinitialisedgetParameterValue, init, setParameterValue, setParameterValuesgetFeatures, setFeaturesgetName, setNameprotected AnnotationSetsView.TextMouseListener textMouseListener
protected PropertyChangeListener textChangeListener
protected BlockingQueue<gate.gui.docview.AnnotationSetsView.TypeSpec> visibleAnnotationTypes
protected Timer mouseMovementTimer
protected Timer eventMinder
protected BlockingQueue<GateEvent> pendingEvents
protected AnnotationSetsView.MouseStoppedMovingAction mouseStoppedMovingAction
protected String lastAnnotationType
protected ComponentOrientation currentOrientation
protected static final ColorGenerator colourGenerator
public void annotationChanged(Annotation ann, AnnotationSet set, String oldType)
AnnotationEditorOwnerannotationChanged in interface AnnotationEditorOwnerann - the annotation modified (after the modification occurred).set - the parent annotation set for the annotationoldType - the old type of the annotation. This value is only set if
the annotation modification included a change of type.public void changeOrientation(ComponentOrientation orientation)
orientation - public void selectAnnotation(AnnotationData aData)
selectAnnotation in interface AnnotationEditorOwnerpublic Annotation getNextAnnotation()
AnnotationEditorOwnergetNextAnnotation in interface AnnotationEditorOwnerAnnotation value.public Annotation getPreviousAnnotation()
AnnotationEditorOwnergetPreviousAnnotation in interface AnnotationEditorOwnerAnnotation value.public JTextComponent getTextComponent()
AnnotationEditorOwnergetTextComponent in interface AnnotationEditorOwnerJTextComponent object.public AnnotationList getListComponent()
public int getType()
DocumentViewgetType in interface DocumentViewDocumentView.CENTRAL,
DocumentView.HORIZONTAL,
DocumentView.VERTICALprotected void initGUI()
AbstractDocumentViewinitGUI in class AbstractDocumentViewprotected OwnedAnnotationEditor createAnnotationEditor(TextualDocumentView textView, AnnotationSetsView asView) throws ResourceInstantiationException
ResourceInstantiationException - if an error occursprotected void populateUI()
public Component getGUI()
DocumentViewgetGUI in interface DocumentViewComponent value.public static Color getColor(String annotationSet, String annotationType)
annotationType - type to get a colour forpublic void saveType(String setName, String typeName, boolean selected)
setName - set name to save/remove or null for the default settypeName - type name to save/removeselected - state of the selectionpublic void restoreSavedSelectedTypes()
public void setNewAnnSetCreationEnabled(boolean b)
protected void registerHooks()
registerHooks in class AbstractDocumentViewprotected void unregisterHooks()
registerHooks().unregisterHooks in class AbstractDocumentViewprotected void storeSelectedTypes()
visibleAnnotationTypes structure based on the
current selectionprotected void restoreSelectedTypes()
visibleAnnotationTypes data structure.protected void initListeners()
public void cleanup()
AbstractResourcecleanup in interface Resourcecleanup in class AbstractResourcepublic void annotationSetAdded(DocumentEvent e)
DocumentListenerAnnotationSet has been addedannotationSetAdded in interface DocumentListenerpublic void annotationSetRemoved(DocumentEvent e)
DocumentListenerAnnotationSet has been removedannotationSetRemoved in interface DocumentListenerpublic void contentEdited(DocumentEvent e)
contentEdited in interface DocumentListenerpublic void annotationAdded(AnnotationSetEvent e)
AnnotationSetListenerAnnotation has been addedannotationAdded in interface AnnotationSetListenerpublic void annotationRemoved(AnnotationSetEvent e)
AnnotationSetListenerAnnotation has been removedannotationRemoved in interface AnnotationSetListenerprotected AnnotationSetsView.SetHandler getSetHandler(String name)
name - name of the annotation set or null for the default setpublic AnnotationSetsView.TypeHandler getTypeHandler(String set, String type)
set - name of the annotation set or null for the default settype - type of the annotationpublic void setTypeSelected(String setName, String typeName, boolean selected)
setName - name of the annotation set or null for the default settypeName - type of the annotationselected - state of the selectionpublic void setSelectedAnnotations(List<AnnotationData> selectedAnnots)
DocumentViewDocumentEditor.setSelectedAnnotations(List) method.setSelectedAnnotations in interface DocumentViewsetSelectedAnnotations in class AbstractDocumentViewpublic void selectAnnotation(Annotation ann, AnnotationSet annSet)
ann - the annotationannSet - the parent setCopyright © 2024 GATE. All rights reserved.