|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel gate.creole.AbstractVisualResource gate.gui.annedit.SchemaAnnotationEditor
public class SchemaAnnotationEditor
An annotation editor that enforces the annotation schemas currently loaded in the system. Once the editing of an annotation is started, it cannot be completed until the annotation complies with the schema for that annotation type.
Nested Class Summary | |
---|---|
protected class |
SchemaAnnotationEditor.AnnotationAction
Base class for actions on annotations. |
protected class |
SchemaAnnotationEditor.DeleteAnnotationAction
|
protected class |
SchemaAnnotationEditor.EndOffsetLeftAction
|
protected class |
SchemaAnnotationEditor.EndOffsetRightAction
|
protected class |
SchemaAnnotationEditor.IconOnlyButton
|
protected class |
SchemaAnnotationEditor.SmallButton
A JButton with content are not filled and border not painted (in order to save screen real estate) |
protected class |
SchemaAnnotationEditor.StartOffsetLeftAction
|
protected class |
SchemaAnnotationEditor.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 | |
---|---|
protected Annotation |
annotation
The annotation currently being edited. |
protected AnnotationSet |
annSet
The annotation set containing the currently edited annotation. |
protected CreoleListener |
creoleListener
|
protected static int |
CTRL_SHIFT_INCREMENT
|
protected SchemaAnnotationEditor.SmallButton |
delButton
|
protected JDialog |
dialog
The dialog used to show this annotation editor. |
protected SchemaAnnotationEditor.IconOnlyButton |
eolButton
|
protected SchemaAnnotationEditor.IconOnlyButton |
eorButton
|
protected Map<String,SchemaFeaturesEditor> |
featureEditorsByType
Caches the features editor for each annotation type. |
protected Box |
featuresBox
The box used to host the features editor pane. |
protected SchemaFeaturesEditor |
featuresEditor
The current features editor, one of the ones stored in featureEditorsByType . |
protected static int |
HIDE_DELAY
|
protected JPanel |
mainPane
|
protected JToggleButton |
pinnedButton
Toggle button used to pin down the dialog. |
protected MouseEvent |
pressed
|
protected Map<String,AnnotationSchema> |
schemasByType
Stores the Annotation schema objects available in the system. |
protected static int |
SHIFT_INCREMENT
|
protected SchemaAnnotationEditor.IconOnlyButton |
solButton
|
protected SchemaAnnotationEditor.IconOnlyButton |
sorButton
|
protected AncestorListener |
textAncestorListener
Listener used to hide the editing window when the text is hidden. |
protected Border |
typeDefaultBorder
The default border for the types choice |
protected Border |
typeHighlightBorder
The highlight border for the types choice |
protected JChoice |
typesChoice
JChoice used for selecting the 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 | |
---|---|
SchemaAnnotationEditor()
|
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 |
changeOrientation(ComponentOrientation orientation)
Changes the orientation of components |
void |
cleanup()
Does nothing now, but meant to clear all internal data |
void |
editAnnotation(Annotation ann,
AnnotationSet set)
Changes the annotation currently being edited. |
boolean |
editingFinished()
This editor implementation is designed to enforce schema compliance. |
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. |
static void |
main(String[] args)
|
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)
|
boolean |
supportsCancel()
Returns false, as this editor does not support cancel operations. |
protected void |
updateListeners()
|
Methods inherited from class gate.creole.AbstractVisualResource |
---|
getFeatures, getInitParameterValues, 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 |
---|
getParameterValue, setParameterValue, setParameterValues |
Methods inherited from interface gate.util.FeatureBearer |
---|
getFeatures, setFeatures |
Methods inherited from interface gate.util.NameBearer |
---|
getName, setName |
Field Detail |
---|
protected static final int HIDE_DELAY
protected static final int SHIFT_INCREMENT
protected static final int CTRL_SHIFT_INCREMENT
protected Annotation annotation
protected AnnotationSet annSet
protected JChoice typesChoice
protected Border typeDefaultBorder
protected Border typeHighlightBorder
protected JDialog dialog
protected CreoleListener creoleListener
protected AncestorListener textAncestorListener
protected Map<String,AnnotationSchema> schemasByType
protected Map<String,SchemaFeaturesEditor> featureEditorsByType
protected Box featuresBox
protected JToggleButton pinnedButton
protected SchemaFeaturesEditor featuresEditor
featureEditorsByType
.
protected MouseEvent pressed
protected SchemaAnnotationEditor.IconOnlyButton solButton
protected SchemaAnnotationEditor.IconOnlyButton sorButton
protected SchemaAnnotationEditor.SmallButton delButton
protected SchemaAnnotationEditor.IconOnlyButton eolButton
protected SchemaAnnotationEditor.IconOnlyButton eorButton
protected JPanel mainPane
Constructor Detail |
---|
public SchemaAnnotationEditor()
Method Detail |
---|
public void editAnnotation(Annotation ann, AnnotationSet set)
AnnotationVisualResource
editAnnotation
in interface AnnotationVisualResource
ann
- the new annotation.set
- the set to which the new annotation belongs.public boolean editingFinished()
editingFinished
in interface AnnotationVisualResource
AnnotationVisualResource.editingFinished()
public void cancelAction() throws GateException
cancelAction
in interface AnnotationVisualResource
GateException
public boolean canDisplayAnnotationType(String annotationType)
canDisplayAnnotationType
in interface AnnotationVisualResource
public void okAction() throws GateException
okAction
in interface AnnotationVisualResource
GateException
public boolean supportsCancel()
supportsCancel
in interface AnnotationVisualResource
public boolean isActive()
AnnotationVisualResource
isActive
in interface AnnotationVisualResource
public void placeDialog(int start, int end)
placeDialog
in interface OwnedAnnotationEditor
public Resource init() throws ResourceInstantiationException
AbstractVisualResource
init
in interface Resource
init
in class AbstractVisualResource
ResourceInstantiationException
protected void updateListeners()
protected void initData()
public void cleanup()
AbstractVisualResource
cleanup
in interface Resource
cleanup
in class AbstractVisualResource
protected void initGui()
protected void initListeners()
public static void main(String[] args)
args
- 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
InvalidOffsetException
public AnnotationEditorOwner getOwner()
getOwner
in interface OwnedAnnotationEditor
public void setOwner(AnnotationEditorOwner owner)
OwnedAnnotationEditor
setOwner
in interface OwnedAnnotationEditor
owner
- the owner to setpublic AnnotationSet getAnnotationSetCurrentlyEdited()
getAnnotationSetCurrentlyEdited
in interface AnnotationVisualResource
public Annotation getAnnotationCurrentlyEdited()
getAnnotationCurrentlyEdited
in interface AnnotationVisualResource
public void setPinnedMode(boolean pinned)
setPinnedMode
in interface OwnedAnnotationEditor
pinned
- true if the window should not move when an annotation is selected.public void setEditingEnabled(boolean isEditingEnabled)
OwnedAnnotationEditor
setEditingEnabled
in interface OwnedAnnotationEditor
isEditingEnabled
- true to enable the editing, false to disable itpublic void changeOrientation(ComponentOrientation orientation)
OwnedAnnotationEditor
changeOrientation
in interface OwnedAnnotationEditor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |