public class AnnotationEditor extends AbstractVisualResource implements OwnedAnnotationEditor
| Modifier and Type | Class and Description | 
|---|---|
| protected class  | AnnotationEditor.AnnotationActionBase 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 | 
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description | 
|---|---|
| protected Annotation | annThe annotation being edited. | 
| protected AnnotationEditor | annotationEditorInstanceCurrent instance of this class. | 
| protected static int | CTRL_SHIFT_INCREMENTConstant for the number of characters when changing annotation boundary
 with Ctrl+Shift keys pressed. | 
| protected JButton | delButton | 
| protected JButton | dismissButton | 
| protected JButton | eolButton | 
| protected JButton | eorButton | 
| protected FeaturesSchemaEditor | featuresEditorComponent for features editing. | 
| protected JScrollPane | featuresScroller | 
| protected static int | HIDE_DELAYConstant for delay before hiding the popup window (in milliseconds). | 
| protected Timer | hideTimer | 
| protected JToggleButton | pinnedButtonToggle button used to pin down the dialog. | 
| protected JWindow | popupWindowThe popup window used by the editor. | 
| protected MouseEvent | pressed | 
| protected Map<String,AnnotationSchema> | schemasByTypeStores the Annotation schema objects available in the system. | 
| protected AnnotationSet | setThe parent set of the current annotation. | 
| protected static int | SHIFT_INCREMENTConstant for the number of characters when changing annotation boundary
 with Shift key pressed. | 
| protected JButton | solButton | 
| protected JButton | sorButton | 
| protected JComboBox<String> | typeComboCombobox for annotation type. | 
features, handlelistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description | 
|---|
| AnnotationEditor() | 
| Modifier and Type | Method and Description | 
|---|---|
| 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 | 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. | 
| 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. | 
cleanup, getFeatures, getInitParameterValues, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValues, setTargetgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetHandle, setTarget, targetReinitialisedcleanup, getParameterValue, setParameterValue, setParameterValuesgetFeatures, setFeaturesgetName, setNameprotected JWindow popupWindow
protected JToggleButton pinnedButton
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
protected Annotation ann
protected AnnotationSet set
protected AnnotationEditor annotationEditorInstance
public Resource init() throws ResourceInstantiationException
AbstractVisualResourceinit in interface Resourceinit in class AbstractVisualResourceResourceInstantiationExceptionprotected void initData()
protected void initGUI()
protected void initListeners()
public boolean isActive()
AnnotationVisualResourceisActive in interface AnnotationVisualResourcepublic void editAnnotation(Annotation ann, AnnotationSet set)
AnnotationVisualResourceeditAnnotation in interface AnnotationVisualResourceann - the new annotation.set - the set to which the new annotation belongs.public Annotation getAnnotationCurrentlyEdited()
getAnnotationCurrentlyEdited in interface AnnotationVisualResourcepublic boolean editingFinished()
AnnotationVisualResourceeditingFinished in interface AnnotationVisualResourcepublic void setVisible(boolean setVisible)
setVisible in class JComponentpublic void placeDialog(int start,
                        int end)
placeDialog in interface OwnedAnnotationEditorprotected 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 offsetInvalidOffsetExceptionpublic AnnotationSet getAnnotationSetCurrentlyEdited()
getAnnotationSetCurrentlyEdited in interface AnnotationVisualResourcepublic AnnotationEditorOwner getOwner()
getOwner in interface OwnedAnnotationEditorpublic void setOwner(AnnotationEditorOwner owner)
OwnedAnnotationEditorsetOwner 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)
OwnedAnnotationEditorsetEditingEnabled in interface OwnedAnnotationEditorisEditingEnabled - true to enable the editing, false to disable itpublic void cancelAction()
                  throws GateException
cancelAction in interface AnnotationVisualResourceGateExceptionpublic boolean canDisplayAnnotationType(String annotationType)
canDisplayAnnotationType in interface AnnotationVisualResourcepublic void okAction()
              throws GateException
okAction in interface AnnotationVisualResourceGateExceptionpublic boolean supportsCancel()
supportsCancel in interface AnnotationVisualResourcepublic void changeOrientation(ComponentOrientation orientation)
OwnedAnnotationEditorchangeOrientation in interface OwnedAnnotationEditorCopyright © 2024 GATE. All rights reserved.