gate.gui
Class AnnotationEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--gate.creole.AbstractVisualResource
                                |
                                +--gate.gui.AnnotationEditor
All Implemented Interfaces:
Accessible, FeatureBearer, ImageObserver, MenuContainer, Resource, Serializable, VisualResource

public class AnnotationEditor
extends AbstractVisualResource

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.

See Also:
Serialized Form

Inner Class Summary
 class AnnotationEditor.CustomLabelView
          Fixes the 4406598 bug in swing text components.
 class AnnotationEditor.CustomStyledEditorKit
          Fixes the 4406598 bug in swing text components.
 class AnnotationEditor.CustomStyledViewFactory
          Fixes the 4406598 bug in swing text components.
 class AnnotationEditor.TypeData
          Holds the GUI metadata for a given annotation type.
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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()
          Default constructor.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener l)
           
 Document getDocument()
          Gets the currently displayed document
 boolean isEditable()
          Is the editor functionality enabled
 boolean isFiltersVisible()
          Is the right hand side tree shown?
 boolean isTableVisible()
          Is the annotations table shown?
 boolean isTextVisible()
          Is the text display shown?
static void main(String[] args)
          Test code
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void setDocument(Document newDocument)
          Sets the document to be displayed
 void setEditable(boolean newEditable)
          Should the editor functionality of this component be enabled
 void setFiltersVisible(boolean newFiltersVisible)
          If set to true the right hand side tree will be displayed.
 void setTableVisible(boolean newTableVisible)
          If set to true the annotations table will be shown.
 void setTextVisible(boolean newTextVisible)
          If set to true the text display will be shown.
 
Methods inherited from class gate.creole.AbstractVisualResource
getFeatures, init, setFeatures
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, contains, createImage, createImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.util.FeatureBearer
getName, setName
 

Constructor Detail

AnnotationEditor

public AnnotationEditor()
Default constructor. Creats all the components and initialises all the internal data to default values where possible.
Method Detail

main

public static void main(String[] args)
Test code

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Overrides:
removePropertyChangeListener in class JComponent

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Overrides:
addPropertyChangeListener in class JComponent

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener l)
Overrides:
addPropertyChangeListener in class JComponent

setDocument

public void setDocument(Document newDocument)
Sets the document to be displayed
Parameters:
newDocument - a Document

getDocument

public Document getDocument()
Gets the currently displayed document
Returns:
a Document

setTableVisible

public void setTableVisible(boolean newTableVisible)
If set to true the annotations table will be shown. The default value is true

isTableVisible

public boolean isTableVisible()
Is the annotations table shown?

setTextVisible

public void setTextVisible(boolean newTextVisible)
If set to true the text display will be shown. Default value is true

isTextVisible

public boolean isTextVisible()
Is the text display shown?

setFiltersVisible

public void setFiltersVisible(boolean newFiltersVisible)
If set to true the right hand side tree will be displayed. Default value is true

isFiltersVisible

public boolean isFiltersVisible()
Is the right hand side tree shown?

setEditable

public void setEditable(boolean newEditable)
Should the editor functionality of this component be enabled

isEditable

public boolean isEditable()
Is the editor functionality enabled