|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.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.
Field Summary | |
---|---|
protected List |
actions
|
protected static ColorGenerator |
colourGenerator
|
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. |
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 |
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). |
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, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, 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 |
---|
protected 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 List actions
protected static final ColorGenerator colourGenerator
Constructor Detail |
---|
public AnnotationSetsView()
Method Detail |
---|
public void annotationChanged(Annotation ann, AnnotationSet set, String oldType)
AnnotationEditorOwner
annotationChanged
in interface AnnotationEditorOwner
ann
- 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 AnnotationEditorOwner
public Annotation getNextAnnotation()
AnnotationEditorOwner
getNextAnnotation
in interface AnnotationEditorOwner
Annotation
value.public Annotation getPreviousAnnotation()
AnnotationEditorOwner
getPreviousAnnotation
in interface AnnotationEditorOwner
Annotation
value.public JTextComponent getTextComponent()
AnnotationEditorOwner
getTextComponent
in interface AnnotationEditorOwner
JTextComponent
object.public AnnotationList getListComponent()
public List getActions()
ActionsPublisher
getActions
in interface ActionsPublisher
getActions
in class AbstractDocumentView
List
of Action
s.public int getType()
DocumentView
getType
in interface DocumentView
DocumentView.CENTRAL
,
DocumentView.HORIZONTAL
,
DocumentView.VERTICAL
protected void initGUI()
AbstractDocumentView
initGUI
in class AbstractDocumentView
protected OwnedAnnotationEditor createAnnotationEditor(TextualDocumentView textView, AnnotationSetsView asView) throws ResourceInstantiationException
ResourceInstantiationException
- if an error occursprotected void populateUI()
public Component getGUI()
DocumentView
getGUI
in interface DocumentView
Component
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 AbstractDocumentView
protected void unregisterHooks()
registerHooks()
.
unregisterHooks
in class AbstractDocumentView
protected 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 Resource
cleanup
in class AbstractResource
public void annotationSetAdded(DocumentEvent e)
DocumentListener
AnnotationSet
has been added
annotationSetAdded
in interface DocumentListener
public void annotationSetRemoved(DocumentEvent e)
DocumentListener
AnnotationSet
has been removed
annotationSetRemoved
in interface DocumentListener
public void contentEdited(DocumentEvent e)
contentEdited
in interface DocumentListener
public void annotationAdded(AnnotationSetEvent e)
AnnotationSetListener
Annotation
has been added
annotationAdded
in interface AnnotationSetListener
public void annotationRemoved(AnnotationSetEvent e)
AnnotationSetListener
Annotation
has been removed
annotationRemoved
in interface AnnotationSetListener
protected 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)
DocumentView
DocumentEditor.setSelectedAnnotations(List)
method.
setSelectedAnnotations
in interface DocumentView
setSelectedAnnotations
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 |