|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gate.creole.AbstractVisualResource
gate.gui.DocumentEditor
public class DocumentEditor
This class implements a viewer/editor for the annotations on a document.
As a viewer, this visual resource will display all the annotations found on
the document. The editor needs to have some data about annotation types in
order to allow the editing of annotations. This data comes from the
AnnotationSchema objects that are loaded in the Gate
system at a given moment. If there are no such objects the editing of
annotations will be restricted to a very crude method allowing the user to
add any type of annotations having any features with any String values.
This class has been deprecated! The document editing functionality is now
provided by the DocumentEditor class.
| Nested Class Summary | |
|---|---|
protected class |
DocumentEditor.AnnotationsTableModel
Deprecated. A custom table model used to render a table containing the annotations from a set of annotation sets. |
protected class |
DocumentEditor.CorefData
Deprecated. |
(package private) class |
DocumentEditor.CorefNodeRenderer
Deprecated. A tree node renderer used by the coref tree |
(package private) class |
DocumentEditor.CorefNodeRenderer1
Deprecated. A tree node renderer used byt the coref tree |
class |
DocumentEditor.CustomLabelView
Deprecated. Fixes the 4406598 bug in swing text components. |
class |
DocumentEditor.CustomStyledEditorKit
Deprecated. Fixes the 4406598 bug in swing text components. |
class |
DocumentEditor.CustomStyledViewFactory
Deprecated. Fixes the 4406598 bug in swing text components. |
protected class |
DocumentEditor.DeleteSelectedAnnotationsAction
Deprecated. |
protected class |
DocumentEditor.EditAnnotationAction
Deprecated. The action that is fired when the user wants to edit an annotation. |
(package private) class |
DocumentEditor.EventsHandler
Deprecated. All the events from the document or its annotation sets are handled by this inner class. |
protected class |
DocumentEditor.HighlightAnnotationMenu
Deprecated. The popup menu items used to select annotations at right click. |
(package private) class |
DocumentEditor.LazyJPanel
Deprecated. Panels used in cell/node renderers |
(package private) class |
DocumentEditor.NewAnnotationAction
Deprecated. The action that is fired when the user wants to create a new annotation. |
(package private) class |
DocumentEditor.NodeRenderer
Deprecated. Displays an entry in the right hand side tree. |
(package private) class |
DocumentEditor.NodeRenderer1
Deprecated. Displays an entry in the right hand side tree. |
protected class |
DocumentEditor.PrintAction
Deprecated. |
(package private) class |
DocumentEditor.Range
Deprecated. Describes a range in the data structure. |
protected class |
DocumentEditor.SearchAction
Deprecated. |
protected class |
DocumentEditor.SearchDialog
Deprecated. |
(package private) class |
DocumentEditor.SelectionBlinker
Deprecated. This class handles the blinking for the selected annotations in the text display. |
(package private) class |
DocumentEditor.SwingDocumentListener
Deprecated. Listens for updates from the text editor and updates the GATE document accordingly |
class |
DocumentEditor.TypeData
Deprecated. Holds the GUI metadata for a given annotation type. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected XJTable |
annotationsTable
Deprecated. The table placed below the text display used for showing annotations |
protected DocumentEditor.AnnotationsTableModel |
annotationsTableModel
Deprecated. Model for the annotations table |
private boolean |
annotationsTableVisible
Deprecated. |
private JToggleButton |
annotationsTableVisibleBtn
Deprecated. |
protected ColorGenerator |
colGenerator
Deprecated. A random colour generator used to generate initial default colours for highlighting various types of annotations. |
private boolean |
coreferenceVisible
Deprecated. |
private JToggleButton |
coreferenceVisibleBtn
Deprecated. |
private boolean |
corefOptionAvailable
Deprecated. |
protected JScrollPane |
corefScroll
Deprecated. The scroller for the coref list |
protected JTree |
corefTree
Deprecated. The Jtree that displays the coreference data |
protected DefaultTreeModel |
corefTreeModel
Deprecated. The model for the coref tree |
protected DefaultMutableTreeNode |
corefTreeRoot
Deprecated. The root for the coref tree |
protected List |
data
Deprecated. holds the data for the annotations table: a list of Annotation objects |
private Document |
document
Deprecated. The Document currently displayed. |
private boolean |
editable
Deprecated. Should this component bahave as an editor as well as an viewer |
protected DocumentEditor.EventsHandler |
eventHandler
Deprecated. The listener for the events coming from the document (annotations and annotation sets added or removed). |
protected Highlighter |
highlighter
Deprecated. The highlighter used to help the user select annotations that overlap and for highligting in the text the annotations selected in the lower table. |
protected JSplitPane |
leftSplit
Deprecated. |
protected Object |
lock
Deprecated. Object used to sychronise all the various threads involved in GUI updating; |
private Vector |
longLinesCorrectionPositions
Deprecated. Keep cut places in very long lines inside document |
protected JSplitPane |
mainSplit
Deprecated. The main horizontal split that contains all the contents of this viewer |
private int |
MAX_LINE_SIZE
Deprecated. Max unbreaked line size |
protected Handle |
myHandle
Deprecated. |
protected JProgressBar |
progressBar
Deprecated. The progress bar used during updating the text |
protected Box |
progressBox
Deprecated. A box containing a JProgressBar used to keep the user
entertained while the text display is being updated |
private PropertyChangeSupport |
propertyChangeListeners
Deprecated. |
protected List |
ranges
Deprecated. a list containing DocumentEditor.Range objects. |
protected JSplitPane |
rightSplit
Deprecated. The split that contains the styles tree and the coreference viewer. |
protected DocumentEditor.SearchDialog |
searchDialog
Deprecated. The dialog used for text search |
protected DocumentEditor.SelectionBlinker |
selectionBlinker
Deprecated. The object responsible with blinking the selected annotations. |
protected Highlighter |
selectionHighlighter
Deprecated. This highlighter is actually used as a data structure. |
protected TextAttributesChooser |
styleChooser
Deprecated. The dialog used for editing the styles used to highlight annotations |
protected JTree |
stylesTree
Deprecated. The right hand side tree with all the annotation sets and types of annotations |
protected DefaultTreeModel |
stylesTreeModel
Deprecated. The model for the styles tree |
protected DefaultMutableTreeNode |
stylesTreeRoot
Deprecated. The root for the styles tree |
protected JScrollPane |
stylesTreeScroll
Deprecated. Scroller for the styles tree |
protected JScrollPane |
tableScroll
Deprecated. Scroller for the annotations table |
protected JTextPane |
textPane
Deprecated. The text display. |
protected JScrollPane |
textScroll
Deprecated. Scroller used for the text diaplay |
private boolean |
textVisible
Deprecated. |
private JToggleButton |
textVisibleBtn
Deprecated. |
protected JToolBar |
toolbar
Deprecated. The toolbar displayed on the top part of the component |
protected Map |
typeDataMap
Deprecated. A composed map used to get the metadata for an annotation type starting from the annotation set name and the type name. |
private boolean |
typesTreeVisible
Deprecated. |
private JToggleButton |
typesTreeVisibleBtn
Deprecated. |
| Fields inherited from class gate.creole.AbstractVisualResource |
|---|
features, handle |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
DocumentEditor()
Deprecated. Default constructor. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Deprecated. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener l)
Deprecated. |
void |
cleanup()
Deprecated. Does nothing now, but meant to clear all internal data |
private Vector |
correctLongLines(StringBuffer buff)
Deprecated. Cut very long lines to pieces not grater than MAX_LINE_SIZE This is a correction of SWING problem with very long lines of text Return positions of new line insertion. |
protected Set |
getAnnotationSchemas()
Deprecated. Gets all the AnnotationSchema objects currently
loaded in the system. |
private Vector |
getBreakPositions(String content)
Deprecated. Get positions of cut points inside a very large text without new line |
Set |
getDisplayedAnnotations()
Deprecated. This method returns a list of annotations which are currently shown in the annotations table or null of the table is empty. |
Document |
getDocument()
Deprecated. Return the current selected document |
protected DocumentEditor.TypeData |
getTypeData(String setName,
String type)
Deprecated. Gets the data related to a given annotation type. |
Resource |
init()
Deprecated. Initialise this resource, and return it. |
protected void |
initGuiComponents()
Deprecated. Builds all the graphical components |
protected void |
initListeners()
Deprecated. Initialises all the listeners that this component has to register with other classes. |
protected void |
initLocalData()
Deprecated. Initialises the local variables to their default values |
boolean |
isAnnotationsTableVisible()
Deprecated. |
boolean |
isCoreferenceVisible()
Deprecated. |
boolean |
isCorefOptionAvailable()
Deprecated. |
boolean |
isEditable()
Deprecated. Is the editor functionality enabled |
private boolean |
isTextSelected()
Deprecated. This method returns true if a text is selected in the textPane |
boolean |
isTextVisible()
Deprecated. |
boolean |
isTypesTreeVisible()
Deprecated. |
protected void |
layoutComponents()
Deprecated. Creates the layout of this component acording to the set of subcomponents (text display, annotations table, etc.) that need to be visible. |
private int |
longLinesCorrection(int position)
Deprecated. Compute correction for additional new line in very long lines of text |
protected void |
paintHighlights(Set annotations,
AttributeSet style)
Deprecated. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Deprecated. |
protected void |
repairHighlights(int start,
int end)
Deprecated. Called whenever a part of the textual display needs to be repainted because, for instance, of an edit operation. |
protected void |
selectAnnotation(String set,
Annotation ann)
Deprecated. Updates the GUI when the user has selected an annotation e.g. by using the right click popup. |
void |
setAnnotationsTableVisible(boolean annotationsTableVisible)
Deprecated. |
void |
setCoreferenceVisible(boolean coreferenceVisible)
Deprecated. |
void |
setCorefOptionAvailable(boolean corefOptionAvailable)
Deprecated. |
void |
setEditable(boolean newEditable)
Deprecated. Should the editor functionality of this component be enabled |
void |
setHandle(Handle handle)
Deprecated. Used by the main GUI to tell this VR what handle created it. |
void |
setTarget(Object target)
Deprecated. Sets the document to be displayed |
void |
setTextVisible(boolean textVisible)
Deprecated. |
void |
setTypesTreeVisible(boolean typesTreeVisible)
Deprecated. |
protected void |
showHighlights(Set annotations,
AttributeSet style)
Deprecated. Repaints the highlighting for annotation types in the text display. |
protected void |
this_documentChanged()
Deprecated. Updates this component when the underlying document is changed. |
protected void |
updateCorefTree()
Deprecated. Updates the coref tree from the coref data on the document's features |
| Methods inherited from class gate.creole.AbstractVisualResource |
|---|
getFeatures, getParameterValue, setFeatures, setParameterValue, setParameterValues |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface gate.util.NameBearer |
|---|
getName, setName |
| Field Detail |
|---|
private transient PropertyChangeSupport propertyChangeListeners
private Document document
Document currently displayed.
protected ColorGenerator colGenerator
protected JTextPane textPane
protected JScrollPane textScroll
protected XJTable annotationsTable
protected DocumentEditor.AnnotationsTableModel annotationsTableModel
protected JScrollPane tableScroll
protected JSplitPane leftSplit
protected JSplitPane rightSplit
protected JSplitPane mainSplit
protected JTree stylesTree
protected JToolBar toolbar
protected JScrollPane stylesTreeScroll
protected DefaultMutableTreeNode stylesTreeRoot
protected DefaultTreeModel stylesTreeModel
protected DocumentEditor.SearchDialog searchDialog
protected TextAttributesChooser styleChooser
protected JTree corefTree
protected DefaultMutableTreeNode corefTreeRoot
protected DefaultTreeModel corefTreeModel
protected JScrollPane corefScroll
protected Box progressBox
JProgressBar used to keep the user
entertained while the text display is being updated
protected JProgressBar progressBar
protected Highlighter highlighter
protected Highlighter selectionHighlighter
highlighter as using two different
highlighters on the same text component is looking for trouble.
protected DocumentEditor.SelectionBlinker selectionBlinker
protected Handle myHandle
protected List data
protected List ranges
DocumentEditor.Range objects. These are the
ranges in the data structure. A range is a bunch
of annotations belonging to the same annotation set that are contiguous
in the data structure.
protected Map typeDataMap
DocumentEditor.TypeData
Maps from String to Map to DocumentEditor.TypeData.
protected DocumentEditor.EventsHandler eventHandler
protected Object lock
private boolean editable
private JToggleButton textVisibleBtn
private JToggleButton typesTreeVisibleBtn
private JToggleButton annotationsTableVisibleBtn
private JToggleButton coreferenceVisibleBtn
private boolean annotationsTableVisible
private boolean coreferenceVisible
private boolean textVisible
private boolean typesTreeVisible
private boolean corefOptionAvailable
private final int MAX_LINE_SIZE
private Vector longLinesCorrectionPositions
| Constructor Detail |
|---|
public DocumentEditor()
| Method Detail |
|---|
public Resource init()
AbstractVisualResource
init in interface Resourceinit in class AbstractVisualResourceprotected void initListeners()
protected void initLocalData()
protected void initGuiComponents()
private boolean isTextSelected()
protected Set getAnnotationSchemas()
AnnotationSchema objects currently
loaded in the system.
public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener in class Componentpublic void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener in class Container
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener l)
addPropertyChangeListener in class Containerpublic Document getDocument()
public void setTarget(Object target)
setTarget in interface VisualResourcesetTarget in class AbstractVisualResourcetarget - the object (be it a Resource,
DataStore or whatever) this viewer has to displaypublic void setHandle(Handle handle)
AbstractVisualResource
setHandle in interface VisualResourcesetHandle in class AbstractVisualResourcepublic void cleanup()
AbstractVisualResource
cleanup in interface Resourcecleanup in class AbstractVisualResourcepublic Set getDisplayedAnnotations()
private Vector getBreakPositions(String content)
private Vector correctLongLines(StringBuffer buff)
private int longLinesCorrection(int position)
protected void this_documentChanged()
protected DocumentEditor.TypeData getTypeData(String setName,
String type)
DocumentEditor.TypeData value has been obtained it can be used to change
the way the respective type of annotations are displayed.
setName - a String, the name of the annotation settype - a String, the name of the type.
DocumentEditor.TypeData value
protected void showHighlights(Set annotations,
AttributeSet style)
protected void paintHighlights(Set annotations,
AttributeSet style)
protected void repairHighlights(int start,
int end)
start - the start offset for the area to be repaintedend - the end offset for the area to be repainted.
protected void selectAnnotation(String set,
Annotation ann)
protected void layoutComponents()
protected void updateCorefTree()
public void setEditable(boolean newEditable)
public boolean isEditable()
public void setAnnotationsTableVisible(boolean annotationsTableVisible)
public boolean isAnnotationsTableVisible()
public void setCoreferenceVisible(boolean coreferenceVisible)
public boolean isCoreferenceVisible()
public void setTextVisible(boolean textVisible)
public boolean isTextVisible()
public void setTypesTreeVisible(boolean typesTreeVisible)
public boolean isTypesTreeVisible()
public void setCorefOptionAvailable(boolean corefOptionAvailable)
public boolean isCorefOptionAvailable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||