|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.gui.docview.AbstractDocumentView
gate.gui.docview.AnnotationSetsView
public class AnnotationSetsView
Display document annotation sets and types in a tree view like with a table. Allow the selection of annotation type and modification of their color.
| Nested Class Summary | |
|---|---|
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
|
private class |
AnnotationSetsView.PerformActionEvent
A fake GATE Event used to wrap a Runnable value. |
protected class |
AnnotationSetsView.SavePreserveFormatAction
The beginning is the same as NameBearerHandle.SaveAsXmlAction. |
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
|
private static class |
AnnotationSetsView.TypeSpec
A class storing the identifying information for an annotation type (i.e. |
| Field Summary | |
|---|---|
protected List |
actions
|
(package private) OwnedAnnotationEditor |
annotationEditor
|
protected static ColorGenerator |
colourGenerator
|
private static GateEvent |
END_OF_LIST
A special GateEvent used as a flag. |
protected Timer |
eventMinder
Timer used to handle events coming from the document |
private static int |
EVENTS_HANDLE_DELAY
|
protected String |
lastAnnotationType
|
(package private) AnnotationListView |
listView
|
(package private) JPanel |
mainPanel
|
(package private) XJTable |
mainTable
|
private static int |
MOUSE_MOVEMENT_TIMER_DELAY
|
protected Timer |
mouseMovementTimer
|
protected AnnotationSetsView.MouseStoppedMovingAction |
mouseStoppedMovingAction
|
private static int |
NAME_COL
|
(package private) AnnotationSetsView.NewAnnotationSetAction |
newSetAction
|
(package private) JTextField |
newSetNameTextField
|
protected BlockingQueue<GateEvent> |
pendingEvents
|
(package private) JScrollPane |
scroller
|
private static int |
SELECTED_COL
|
(package private) List<AnnotationSetsView.SetHandler> |
setHandlers
|
(package private) AnnotationStackView |
stackView
|
(package private) AnnotationSetsView.SetsTableModel |
tableModel
|
(package private) List |
tableRows
Contains the data of the main table. |
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. |
(package private) JTextArea |
textPane
|
(package private) TextualDocumentView |
textView
|
protected BlockingQueue<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. |
| 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 |
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 |
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). |
List |
getActions()
Returns a list of Action objects. |
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. |
| Methods inherited from class gate.gui.docview.AbstractDocumentView |
|---|
getDocument, getHandle, getOwner, 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.gui.annedit.AnnotationEditorOwner |
|---|
getDocument |
| 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 |
|---|
List<AnnotationSetsView.SetHandler> setHandlers
List tableRows
XJTable mainTable
AnnotationSetsView.SetsTableModel tableModel
JScrollPane scroller
JPanel mainPanel
JTextField newSetNameTextField
TextualDocumentView textView
AnnotationListView listView
AnnotationStackView stackView
JTextArea textPane
OwnedAnnotationEditor annotationEditor
AnnotationSetsView.NewAnnotationSetAction newSetAction
protected AnnotationSetsView.TextMouseListener textMouseListener
protected PropertyChangeListener textChangeListener
protected BlockingQueue<AnnotationSetsView.TypeSpec> visibleAnnotationTypes
protected Timer mouseMovementTimer
protected Timer eventMinder
protected BlockingQueue<GateEvent> pendingEvents
private static final int MOUSE_MOVEMENT_TIMER_DELAY
protected AnnotationSetsView.MouseStoppedMovingAction mouseStoppedMovingAction
protected String lastAnnotationType
protected List actions
protected static final ColorGenerator colourGenerator
private static final int NAME_COL
private static final int SELECTED_COL
private static final GateEvent END_OF_LIST
private static final int EVENTS_HANDLE_DELAY
| Constructor Detail |
|---|
public AnnotationSetsView()
| Method Detail |
|---|
public void annotationChanged(Annotation ann,
AnnotationSet set,
String oldType)
AnnotationEditorOwner
annotationChanged 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 selectAnnotation(AnnotationData aData)
selectAnnotation in interface AnnotationEditorOwnerpublic Annotation getNextAnnotation()
AnnotationEditorOwner
getNextAnnotation in interface AnnotationEditorOwnerAnnotation value.public Annotation getPreviousAnnotation()
AnnotationEditorOwner
getPreviousAnnotation in interface AnnotationEditorOwnerAnnotation value.public JTextComponent getTextComponent()
AnnotationEditorOwner
getTextComponent in interface AnnotationEditorOwnerJTextComponent object.public AnnotationList getListComponent()
public List getActions()
ActionsPublisher
getActions in interface ActionsPublishergetActions in class AbstractDocumentViewList of Actions.public int getType()
DocumentView
getType in interface DocumentViewDocumentView.CENTRAL,
DocumentView.HORIZONTAL,
DocumentView.VERTICALprotected void initGUI()
AbstractDocumentView
initGUI in class AbstractDocumentView
protected OwnedAnnotationEditor createAnnotationEditor(TextualDocumentView textView,
AnnotationSetsView asView)
throws ResourceInstantiationException
textView - asView -
ResourceInstantiationExceptionprotected void populateUI()
public Component getGUI()
DocumentView
getGUI in interface DocumentViewComponent value.
public static Color getColor(String annotationSet,
String annotationType)
annotationType - type to get a colour for
protected void saveColor(String annotationSet,
String annotationType,
Color colour)
public 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 selection
protected void restoreSelectedTypes()
visibleAnnotationTypes data structure.
protected void initListeners()
public void cleanup()
AbstractResource
cleanup in interface Resourcecleanup in class AbstractResourcepublic void annotationSetAdded(DocumentEvent e)
DocumentListenerAnnotationSet has been added
annotationSetAdded in interface DocumentListenerpublic void annotationSetRemoved(DocumentEvent e)
DocumentListenerAnnotationSet has been removed
annotationSetRemoved in interface DocumentListenerpublic void contentEdited(DocumentEvent e)
contentEdited in interface DocumentListenerpublic void annotationAdded(AnnotationSetEvent e)
AnnotationSetListenerAnnotation has been added
annotationAdded in interface AnnotationSetListenerpublic void annotationRemoved(AnnotationSetEvent e)
AnnotationSetListenerAnnotation has been removed
annotationRemoved in interface AnnotationSetListenerprotected AnnotationSetsView.SetHandler getSetHandler(String name)
name - name of the annotation set or null for the default set
public AnnotationSetsView.TypeHandler getTypeHandler(String set,
String type)
set - name of the annotation set or null for the default settype - type of the annotation
public 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 AbstractDocumentView
public void selectAnnotation(Annotation ann,
AnnotationSet annSet)
ann - the annotationannSet - the parent set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||