|
||||||||||
| 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.docview.AnnotationEditor
public class AnnotationEditor
A generic annotation editor, which uses the known annotation schemas to help speed up the annotation process (e.g. by pre-populating sets of choices) but does not enforce the schemas, allowing the user full control.
| Nested Class Summary | |
|---|---|
protected class |
AnnotationEditor.AnnotationAction
Base class for actions on annotations. |
protected class |
AnnotationEditor.ApplyAction
|
protected class |
AnnotationEditor.DeleteAnnotationAction
|
protected class |
AnnotationEditor.DismissAction
|
protected class |
AnnotationEditor.EndOffsetLeftAction
|
protected class |
AnnotationEditor.EndOffsetRightAction
|
protected class |
AnnotationEditor.StartOffsetLeftAction
|
protected class |
AnnotationEditor.StartOffsetRightAction
|
| 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 | |
|---|---|
private ActionMap |
actionMap
Action bindings for the popup window. |
protected Annotation |
ann
The annotation being edited. |
protected AnnotationEditor |
annotationEditorInstance
Current instance of this class. |
protected static int |
CTRL_SHIFT_INCREMENT
Constant for the number of characters when changing annotation boundary with Ctrl+Shift keys pressed. |
private AnnotationEditor.DeleteAnnotationAction |
delAction
|
protected JButton |
delButton
|
protected JButton |
dismissButton
|
private AnnotationEditor.EndOffsetLeftAction |
eolAction
|
protected JButton |
eolButton
|
private AnnotationEditor.EndOffsetRightAction |
eorAction
|
protected JButton |
eorButton
|
protected FeaturesSchemaEditor |
featuresEditor
Component for features editing. |
protected JScrollPane |
featuresScroller
|
protected static int |
HIDE_DELAY
Constant for delay before hiding the popup window (in milliseconds). |
protected Timer |
hideTimer
|
private AnnotationEditorOwner |
owner
The controlling object for this editor. |
protected JToggleButton |
pinnedButton
Toggle button used to pin down the dialog. |
protected JWindow |
popupWindow
The popup window used by the editor. |
protected MouseEvent |
pressed
|
protected Map<String,AnnotationSchema> |
schemasByType
Stores the Annotation schema objects available in the system. |
private static long |
serialVersionUID
|
protected AnnotationSet |
set
The parent set of the current annotation. |
protected static int |
SHIFT_INCREMENT
Constant for the number of characters when changing annotation boundary with Shift key pressed. |
private AnnotationEditor.StartOffsetLeftAction |
solAction
|
protected JButton |
solButton
|
private AnnotationEditor.StartOffsetRightAction |
sorAction
|
protected JButton |
sorButton
|
protected JComboBox |
typeCombo
Combobox for annotation type. |
| 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 | |
|---|---|
AnnotationEditor()
|
|
| Method Summary | |
|---|---|
void |
cancelAction()
Does nothing, as this editor does not support cancelling and rollbacks. |
boolean |
canDisplayAnnotationType(String annotationType)
Returns true always as this editor is generic and can edit any annotation type. |
void |
editAnnotation(Annotation ann,
AnnotationSet set)
Changes the annotation currently being edited. |
boolean |
editingFinished()
Checks whether the annotation currently being edited can be considered complete. |
Annotation |
getAnnotationCurrentlyEdited()
|
AnnotationSet |
getAnnotationSetCurrentlyEdited()
|
AnnotationEditorOwner |
getOwner()
|
Resource |
init()
Initialise this resource, and return it. |
protected void |
initData()
|
protected void |
initGUI()
|
protected void |
initListeners()
|
boolean |
isActive()
Checks whether the annotation editor is active (shown on screen and ready to edit annotations. |
boolean |
isShowing()
|
protected void |
moveAnnotation(AnnotationSet set,
Annotation oldAnnotation,
Long newStartOffset,
Long newEndOffset)
Changes the span of an existing annotation by creating a new annotation with the same ID, type and features but with the new start and end offsets. |
void |
okAction()
Does nothing as this editor works in auto-commit mode (changes are implemented immediately). |
void |
placeDialog(int start,
int end)
Finds the best location for the editor dialog for a given span of text. |
void |
setEditingEnabled(boolean isEditingEnabled)
Enable or disable the editing GUI components. |
void |
setOwner(AnnotationEditorOwner owner)
Sets the owner (i.e. controller) for this editor. |
void |
setPinnedMode(boolean pinned)
|
void |
setVisible(boolean setVisible)
Shows/Hides the UI(s) involved in annotation editing. |
boolean |
supportsCancel()
Returns false, as this editor does not support cancel operations. |
| Methods inherited from class gate.creole.AbstractVisualResource |
|---|
cleanup, getFeatures, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValues, setTarget |
| 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.VisualResource |
|---|
setHandle, setTarget |
| Methods inherited from interface gate.Resource |
|---|
cleanup, getParameterValue, setParameterValue, setParameterValues |
| Methods inherited from interface gate.util.FeatureBearer |
|---|
getFeatures, setFeatures |
| Methods inherited from interface gate.util.NameBearer |
|---|
getName, setName |
| Field Detail |
|---|
private static final long serialVersionUID
protected JWindow popupWindow
protected JToggleButton pinnedButton
protected JComboBox typeCombo
protected FeaturesSchemaEditor featuresEditor
protected JScrollPane featuresScroller
protected JButton solButton
protected JButton sorButton
protected JButton delButton
protected JButton eolButton
protected JButton eorButton
protected JButton dismissButton
protected Timer hideTimer
protected MouseEvent pressed
protected static final int HIDE_DELAY
protected static final int SHIFT_INCREMENT
protected static final int CTRL_SHIFT_INCREMENT
protected Map<String,AnnotationSchema> schemasByType
private AnnotationEditorOwner owner
protected Annotation ann
protected AnnotationSet set
protected AnnotationEditor annotationEditorInstance
private ActionMap actionMap
private AnnotationEditor.StartOffsetLeftAction solAction
private AnnotationEditor.StartOffsetRightAction sorAction
private AnnotationEditor.DeleteAnnotationAction delAction
private AnnotationEditor.EndOffsetLeftAction eolAction
private AnnotationEditor.EndOffsetRightAction eorAction
| Constructor Detail |
|---|
public AnnotationEditor()
| Method Detail |
|---|
public Resource init()
throws ResourceInstantiationException
AbstractVisualResource
init in interface Resourceinit in class AbstractVisualResourceResourceInstantiationExceptionprotected void initData()
protected void initGUI()
protected void initListeners()
public boolean isActive()
AnnotationVisualResource
isActive in interface AnnotationVisualResource
public void editAnnotation(Annotation ann,
AnnotationSet set)
AnnotationVisualResource
editAnnotation in interface AnnotationVisualResourceann - the new annotation.set - the set to which the new annotation belongs.public Annotation getAnnotationCurrentlyEdited()
getAnnotationCurrentlyEdited in interface AnnotationVisualResourcepublic boolean editingFinished()
AnnotationVisualResource
editingFinished in interface AnnotationVisualResourcepublic boolean isShowing()
isShowing in class Componentpublic void setVisible(boolean setVisible)
setVisible in class JComponent
public void placeDialog(int start,
int end)
placeDialog in interface OwnedAnnotationEditor
protected void moveAnnotation(AnnotationSet set,
Annotation oldAnnotation,
Long newStartOffset,
Long newEndOffset)
throws InvalidOffsetException
set - the annotation setoldAnnotation - the annotation to be movednewStartOffset - the new start offsetnewEndOffset - the new end offset
InvalidOffsetExceptionpublic AnnotationSet getAnnotationSetCurrentlyEdited()
getAnnotationSetCurrentlyEdited in interface AnnotationVisualResourcepublic AnnotationEditorOwner getOwner()
getOwner in interface OwnedAnnotationEditorpublic void setOwner(AnnotationEditorOwner owner)
OwnedAnnotationEditor
setOwner in interface OwnedAnnotationEditorowner - the owner to setpublic void setPinnedMode(boolean pinned)
setPinnedMode in interface OwnedAnnotationEditorpinned - true if the window should not move
when an annotation is selected.public void setEditingEnabled(boolean isEditingEnabled)
OwnedAnnotationEditor
setEditingEnabled in interface OwnedAnnotationEditorisEditingEnabled - true to enable the editing,
false to disable it
public void cancelAction()
throws GateException
cancelAction in interface AnnotationVisualResourceGateExceptionpublic boolean canDisplayAnnotationType(String annotationType)
canDisplayAnnotationType in interface AnnotationVisualResource
public void okAction()
throws GateException
okAction in interface AnnotationVisualResourceGateExceptionpublic boolean supportsCancel()
supportsCancel in interface AnnotationVisualResource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||