|
||||||||||
| 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.TextualDocumentView
public class TextualDocumentView
This class provides a central view for a textual document.
| Nested Class Summary | |
|---|---|
protected class |
TextualDocumentView.GateDocumentListener
|
private class |
TextualDocumentView.HighlightData
|
class |
TextualDocumentView.PermanentSelectionCaret
|
protected class |
TextualDocumentView.SwingDocumentListener
|
protected class |
TextualDocumentView.UpdateHighlightsAction
Blinks the blinking highlights if any. |
| Field Summary | |
|---|---|
protected static int |
BLINK_DELAY
The delay used by the blinker. |
protected List<AnnotationData> |
blinkingHighlightsToAdd
Used internally to store the annotations for which blinking highlights need to be added. |
protected Set<AnnotationData> |
blinkingHighlightsToRemove
Used internally to store the annotations for which blinking highlights need to be removed. |
protected Map<AnnotationData,TextualDocumentView.HighlightData> |
blinkingTagsForAnnotations
The annotations used for blinking highlights and their tags. |
protected TextualDocumentView.GateDocumentListener |
gateDocListener
|
protected static int |
HIGHLIGHT_DELAY
The delay used by the highlights minder. |
protected Timer |
highlightsMinder
|
protected List<TextualDocumentView.HighlightData> |
highlightsToAdd
This list stores the TextualDocumentView.HighlightData values for annotations pending
highlighting |
protected List<TextualDocumentView.HighlightData> |
highlightsToRemove
This list stores the TextualDocumentView.HighlightData values for highlights that need
to be removed |
protected JScrollPane |
scroller
The scroll pane holding the text |
protected JTextArea |
textView
|
| 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 | |
|---|---|
TextualDocumentView()
|
|
| Method Summary | |
|---|---|
Object |
addHighlight(AnnotationData aData,
Color colour)
|
List |
addHighlights(Collection<AnnotationData> annotations,
Color colour)
Adds several highlights in one go. |
void |
addHighlights(List<TextualDocumentView.HighlightData> list)
Same as addHighlights(java.util.Collection, java.awt.Color) but
without the intermediate creation of HighlightData objects. |
void |
cleanup()
releases the memory allocated to this resource |
Component |
getGUI()
Returns the actual UI component this view represents. |
JTextArea |
getTextView()
|
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()
|
void |
moveHighlight(Object tag,
int newStart,
int newEnd)
Gives access to the highliter's change highlight operation. |
protected void |
registerHooks()
This method will be called whenever the view becomes active. |
void |
removeHighlight(Object tag)
|
void |
removeHighlights(Collection tags)
Removes several highlights in one go. |
void |
scrollAnnotationToVisible(Annotation ann)
|
void |
setEditable(boolean editable)
|
void |
setSelectedAnnotations(List<AnnotationData> selectedAnnots)
Removes all blinking highlights and shows the new ones, corresponding to the new set of selected annotations |
void |
setTarget(Object target)
Stores the target (which should always be a Document) into the
AbstractDocumentView.document field. |
protected void |
unregisterHooks()
This method will be called whenever this view becomes inactive. |
| Methods inherited from class gate.gui.docview.AbstractDocumentView |
|---|
getActions, getDocument, getHandle, getOwner, isActive, setActive, setHandle, setOwner |
| 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 |
|---|
protected JScrollPane scroller
protected TextualDocumentView.GateDocumentListener gateDocListener
protected Map<AnnotationData,TextualDocumentView.HighlightData> blinkingTagsForAnnotations
AnnotationData to tag(i.e. Object).
protected List<TextualDocumentView.HighlightData> highlightsToAdd
TextualDocumentView.HighlightData values for annotations pending
highlighting
protected List<TextualDocumentView.HighlightData> highlightsToRemove
TextualDocumentView.HighlightData values for highlights that need
to be removed
protected Set<AnnotationData> blinkingHighlightsToRemove
protected List<AnnotationData> blinkingHighlightsToAdd
protected Timer highlightsMinder
protected JTextArea textView
protected static final int BLINK_DELAY
protected static final int HIGHLIGHT_DELAY
| Constructor Detail |
|---|
public TextualDocumentView()
| Method Detail |
|---|
public void cleanup()
AbstractResource
cleanup in interface Resourcecleanup in class AbstractResource
public Object addHighlight(AnnotationData aData,
Color colour)
public List addHighlights(Collection<AnnotationData> annotations,
Color colour)
annotations - the collection of annotations for which highlights
are to be added.colour - the colour for the highlights.
public void removeHighlight(Object tag)
public void addHighlights(List<TextualDocumentView.HighlightData> list)
addHighlights(java.util.Collection, java.awt.Color) but
without the intermediate creation of HighlightData objects.
list - list of HighlightDatapublic void removeHighlights(Collection tags)
tags - the tags for the highlights to be removedpublic void scrollAnnotationToVisible(Annotation ann)
public void moveHighlight(Object tag,
int newStart,
int newEnd)
throws BadLocationException
tag - the tag for the highlightnewStart - new start offset.newEnd - new end offset.
BadLocationExceptionpublic void setSelectedAnnotations(List<AnnotationData> selectedAnnots)
setSelectedAnnotations in interface DocumentViewsetSelectedAnnotations in class AbstractDocumentViewpublic int getType()
DocumentView
DocumentView.CENTRAL,
DocumentView.HORIZONTAL,
DocumentView.VERTICALpublic void setTarget(Object target)
Document) into the
AbstractDocumentView.document field.
setTarget in interface VisualResourcesetTarget in class AbstractDocumentViewtarget - the object (be it a Resource,
DataStore or whatever) this viewer has to displaypublic void setEditable(boolean editable)
protected void initGUI()
AbstractDocumentView
initGUI in class AbstractDocumentViewpublic Component getGUI()
DocumentView
Component value.protected void initListeners()
protected void unregisterHooks()
AbstractDocumentViewAbstractDocumentView.registerHooks().
unregisterHooks in class AbstractDocumentViewprotected void registerHooks()
AbstractDocumentView
registerHooks in class AbstractDocumentViewpublic JTextArea getTextView()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||