|
||||||||||
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.TextualDocumentView
public class TextualDocumentView
This class provides a central view for a textual document.
Nested Class Summary | |
---|---|
protected class |
TextualDocumentView.GateDocumentListener
|
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,gate.gui.docview.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<gate.gui.docview.TextualDocumentView.HighlightData> |
highlightsToAdd
This list stores the TextualDocumentView.HighlightData values for annotations pending
highlighting |
protected List<gate.gui.docview.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<gate.gui.docview.TextualDocumentView.HighlightData> list)
Same as addHighlights(java.util.Collection, java.awt.Color) but
without the intermediate creation of HighlightData objects. |
void |
changeOrientation(ComponentOrientation orientation)
Set the text orientation in the document. |
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, 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.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,gate.gui.docview.TextualDocumentView.HighlightData> blinkingTagsForAnnotations
AnnotationData
to tag(i.e. Object
).
protected List<gate.gui.docview.TextualDocumentView.HighlightData> highlightsToAdd
TextualDocumentView.HighlightData
values for annotations pending
highlighting
protected List<gate.gui.docview.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 Resource
cleanup
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<gate.gui.docview.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 changeOrientation(ComponentOrientation orientation)
orientation
- either left to right or right to leftpublic 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.
BadLocationException
public void setSelectedAnnotations(List<AnnotationData> selectedAnnots)
setSelectedAnnotations
in interface DocumentView
setSelectedAnnotations
in class AbstractDocumentView
public int getType()
DocumentView
DocumentView.CENTRAL
,
DocumentView.HORIZONTAL
,
DocumentView.VERTICAL
public void setTarget(Object target)
Document
) into the
AbstractDocumentView.document
field.
setTarget
in interface VisualResource
setTarget
in class AbstractDocumentView
target
- 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 AbstractDocumentView
public Component getGUI()
DocumentView
Component
value.protected void initListeners()
protected void unregisterHooks()
AbstractDocumentView
AbstractDocumentView.registerHooks()
.
unregisterHooks
in class AbstractDocumentView
protected void registerHooks()
AbstractDocumentView
registerHooks
in class AbstractDocumentView
public JTextArea getTextView()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |