public class AnnotationListView extends AbstractDocumentView implements AnnotationListener, AnnotationList, AnnotationEditorOwner
Modifier and Type | Class and Description |
---|---|
protected class |
AnnotationListView.DeleteAction |
protected class |
AnnotationListView.EditAnnotationAction |
Modifier and Type | Field and Description |
---|---|
protected List<AnnotationData> |
annDataList
Stores the
AnnotationData objects representing the annotations
displayed by this view. |
protected Map<String,AnnotationVisualResource> |
editorsCache
A map that stores instantiated annotations editors in order to avoid the
delay of building them at each request;
|
protected JTextField |
filterTextField |
protected boolean |
localSelectionUpdating
Flag used to mark the fact that the table selection is currently being
updated, to synchronise it with the global selection.
|
protected JPanel |
mainPanel |
protected JScrollPane |
scroller |
protected JLabel |
statusLabel |
protected XJTable |
table |
protected gate.gui.docview.AnnotationListView.AnnotationTableModel |
tableModel |
protected TextualDocumentView |
textView |
active, document, guiInitialised, handle, owner
name
features
CENTRAL, HORIZONTAL, VERTICAL
Constructor and Description |
---|
AnnotationListView() |
Modifier and Type | Method and Description |
---|---|
AnnotationDataImpl |
addAnnotation(Annotation ann,
AnnotationSet set)
Adds an annotation to be displayed in the list.
|
List<AnnotationData> |
addAnnotations(List<Annotation> annotations,
AnnotationSet set)
Adds a batch of annotations in one go.
|
void |
annotationChanged(Annotation ann,
AnnotationSet set,
String oldType)
Called by the annotation editor when an annotation has been
changed.
|
void |
annotationUpdated(AnnotationEvent e)
Called when an
Annotation has been updated |
void |
cleanup()
releases the memory allocated to this resource
|
List<AnnotationData> |
getAllAnnotations()
Returns the tags for all the annotations currently displayed
|
AnnotationData |
getAnnotationAtRow(int row)
(non-Javadoc)
|
List<Action> |
getGenericEditorActions(AnnotationSet set,
Annotation annotation) |
Component |
getGUI()
Returns the actual UI component this view represents.
|
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.
|
int |
getRowForAnnotation(AnnotationData data)
Returns the display row for a given annotation.
|
ListSelectionModel |
getSelectionModel()
Obtains the selection model used by this list view.
|
List<Action> |
getSpecificEditorActions(AnnotationSet set,
Annotation annotation) |
JTextComponent |
getTextComponent()
Gets the UI component used to display the document text.
|
int |
getType()
Returns the type of this view.
|
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.
|
void |
removeAnnotation(AnnotationData tag) |
void |
removeAnnotations(Collection<AnnotationData> tags) |
void |
selectAnnotation(AnnotationData data)
Called by the editor when a new annotation needs to be selected.
|
void |
selectAnnotationForTag(Object tag)
Selects the annotation for the given tag.
|
void |
setSelectedAnnotations(List<AnnotationData> selectedAnnots)
Some document views can use the concept of selected annotations.
|
protected void |
unregisterHooks()
This method will be called whenever this view becomes inactive.
|
getActions, getDocument, getHandle, getOwner, isActive, setActive, setHandle, setOwner, setTarget
checkParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toString
getFeatures, setFeatures
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isActive, setActive, setOwner
getActions
setHandle, setTarget, targetReinitialised
getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
getDocument
protected XJTable table
protected gate.gui.docview.AnnotationListView.AnnotationTableModel tableModel
protected JScrollPane scroller
protected List<AnnotationData> annDataList
AnnotationData
objects representing the annotations
displayed by this view.protected volatile boolean localSelectionUpdating
protected JPanel mainPanel
protected JLabel statusLabel
protected JTextField filterTextField
protected TextualDocumentView textView
protected Map<String,AnnotationVisualResource> editorsCache
public AnnotationData getAnnotationAtRow(int row)
getAnnotationAtRow
in interface AnnotationList
AnnotationList.getAnnotationAtRow(int)
public ListSelectionModel getSelectionModel()
AnnotationList
getSelectionModel
in interface AnnotationList
ListSelectionModel
object.public void cleanup()
AbstractResource
cleanup
in interface Resource
cleanup
in class AbstractResource
protected void initGUI()
AbstractDocumentView
initGUI
in class AbstractDocumentView
public Component getGUI()
DocumentView
getGUI
in interface DocumentView
Component
value.protected void initListeners()
public List<Action> getSpecificEditorActions(AnnotationSet set, Annotation annotation)
public List<Action> getGenericEditorActions(AnnotationSet set, Annotation annotation)
protected void registerHooks()
AbstractDocumentView
registerHooks
in class AbstractDocumentView
protected void unregisterHooks()
AbstractDocumentView
AbstractDocumentView.registerHooks()
.unregisterHooks
in class AbstractDocumentView
public int getType()
DocumentView
getType
in interface DocumentView
DocumentView.CENTRAL
,
DocumentView.HORIZONTAL
,
DocumentView.VERTICAL
public AnnotationDataImpl addAnnotation(Annotation ann, AnnotationSet set)
ann
- the annotationset
- the set containing the annotationpublic void removeAnnotation(AnnotationData tag)
public void removeAnnotations(Collection<AnnotationData> tags)
public List<AnnotationData> addAnnotations(List<Annotation> annotations, AnnotationSet set)
annotations
- a collection of annotationsset
- the annotation set to which all the annotations belong.public List<AnnotationData> getAllAnnotations()
AnnotationDataImpl
.public void annotationUpdated(AnnotationEvent e)
AnnotationListener
Annotation
has been updatedannotationUpdated
in interface AnnotationListener
public void setSelectedAnnotations(List<AnnotationData> selectedAnnots)
DocumentView
DocumentEditor.setSelectedAnnotations(List)
method.setSelectedAnnotations
in interface DocumentView
setSelectedAnnotations
in class AbstractDocumentView
public void selectAnnotationForTag(Object tag)
tag
- the tag of the annotation to be selected.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 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 void selectAnnotation(AnnotationData data)
AnnotationEditorOwner
selectAnnotation
in interface AnnotationEditorOwner
public int getRowForAnnotation(AnnotationData data)
AnnotationList
getRowForAnnotation
in interface AnnotationList
data
- the annotation for which the row is requiredCopyright © 2024 GATE. All rights reserved.