gate.gui
Class GazetteerEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by gate.creole.AbstractVisualResource
                      extended by gate.gui.GazetteerEditor
All Implemented Interfaces:
GazetteerListener, ActionsPublisher, Resource, FeatureBearer, NameBearer, VisualResource, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class GazetteerEditor
extends AbstractVisualResource
implements GazetteerListener, ActionsPublisher

Editor for ANNIE Gazetteer.

 Main features:
- left table with 4 columns (List name, Major, Minor, Language) for the
  definition
- right table with 1+n columns (Value, Feature 1...Feature n) for the lists
- 'Save' on the context menu of the resources tree and tab
- context menu on both tables to delete selected rows
- list name drop down list with .lst files in directory and button [New List]
- value text field and button [New Entry]
- for the second table: [Add Cols]
- a text field case insensitive 'Filter' at the bottom of the right table
- both tables sorted case insensitively on the first column by default
- display in red the list name when the list is modified
- for the separator character test when editing feature columns
- make feature map ordered
- remove feature/value columns when containing only spaces or empty

See Also:
Serialized Form

Nested Class Summary
protected  class GazetteerEditor.ClearSelectionAction
           
protected  class GazetteerEditor.CopySelectionAction
           
protected  class GazetteerEditor.DeleteSelectedGazetteerNodeAction
           
protected  class GazetteerEditor.DeleteSelectedLinearNodeAction
           
protected  class GazetteerEditor.FillDownSelectionAction
           
protected  class GazetteerEditor.ListTableModel
           
protected  class GazetteerEditor.PasteSelectionAction
           
protected  class GazetteerEditor.ReloadGazetteerListAction
           
protected  class GazetteerEditor.SaveAndReinitialiseGazetteerAction
           
protected  class GazetteerEditor.SaveAsGazetteerAction
           
 
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  List<Action> actions
           
protected  JButton addColumnsButton
           
protected  JCheckBox caseInsensitiveCheckBox
           
protected  Collator collator
           
protected  XJTable definitionTable
           
protected  DefaultTableModel definitionTableModel
           
protected  Gazetteer gazetteer
           
protected  LinearDefinition linearDefinition
          the linear definition being displayed
protected  JLabel listCountLabel
           
protected  JTextField listFilterTextField
           
protected  XJTable listTable
           
protected  GazetteerEditor.ListTableModel listTableModel
           
protected  JTextField newEntryTextField
           
protected  JButton newListButton
           
protected  JComboBox newListComboBox
           
protected  JCheckBox onlyValueCheckBox
           
protected  JCheckBox regexCheckBox
           
protected  LinearNode selectedLinearNode
          the linear node currently selected
 
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
GazetteerEditor()
           
 
Method Summary
 List getActions()
          Returns a list of Action objects.
 Resource init()
          Initialise this resource, and return it.
protected  void initGUI()
           
protected  void initListeners()
           
 void processGazetteerEvent(GazetteerEvent e)
          Called when a Gazetteer event has occured
 void setTarget(Object target)
          Called by the GUI when this viewer/editor has to initialise itself for a specific object.
 
Methods inherited from class gate.creole.AbstractVisualResource
cleanup, getFeatures, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValues
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, 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, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, 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, transferFocusUpCycle
 
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

gazetteer

protected Gazetteer gazetteer

linearDefinition

protected LinearDefinition linearDefinition
the linear definition being displayed


selectedLinearNode

protected LinearNode selectedLinearNode
the linear node currently selected


collator

protected Collator collator

actions

protected List<Action> actions

definitionTable

protected XJTable definitionTable

definitionTableModel

protected DefaultTableModel definitionTableModel

listTable

protected XJTable listTable

listTableModel

protected GazetteerEditor.ListTableModel listTableModel

newListComboBox

protected JComboBox newListComboBox

newListButton

protected JButton newListButton

newEntryTextField

protected JTextField newEntryTextField

addColumnsButton

protected JButton addColumnsButton

listFilterTextField

protected JTextField listFilterTextField

regexCheckBox

protected JCheckBox regexCheckBox

caseInsensitiveCheckBox

protected JCheckBox caseInsensitiveCheckBox

onlyValueCheckBox

protected JCheckBox onlyValueCheckBox

listCountLabel

protected JLabel listCountLabel
Constructor Detail

GazetteerEditor

public GazetteerEditor()
Method Detail

init

public Resource init()
              throws ResourceInstantiationException
Description copied from class: AbstractVisualResource
Initialise this resource, and return it.

Specified by:
init in interface Resource
Overrides:
init in class AbstractVisualResource
Throws:
ResourceInstantiationException

initGUI

protected void initGUI()

initListeners

protected void initListeners()

setTarget

public void setTarget(Object target)
Description copied from class: AbstractVisualResource
Called by the GUI when this viewer/editor has to initialise itself for a specific object.

Specified by:
setTarget in interface VisualResource
Overrides:
setTarget in class AbstractVisualResource
Parameters:
target - the object (be it a Resource, DataStore or whatever) this viewer has to display

processGazetteerEvent

public void processGazetteerEvent(GazetteerEvent e)
Description copied from interface: GazetteerListener
Called when a Gazetteer event has occured

Specified by:
processGazetteerEvent in interface GazetteerListener
Parameters:
e - Gazetteer Event

getActions

public List getActions()
Description copied from interface: ActionsPublisher
Returns a list of Action objects. This method will be called everytime a menu for this resource needs to be built, thus allowing for dynamic updates to the list of actions. A null value in this list will cause a separator to be created.

Specified by:
getActions in interface ActionsPublisher
Returns:
a List of Actions.