com.ontotext.gate.vr
Class Gaze

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bygate.creole.AbstractVisualResource
                      extended bycom.ontotext.gate.vr.Gaze
All Implemented Interfaces:
Accessible, EventListener, FeatureBearer, GateListener, GazetteerListener, ImageObserver, MenuContainer, NameBearer, ObjectModificationListener, Resource, Serializable, VisualResource

public class Gaze
extends AbstractVisualResource
implements GazetteerListener, ObjectModificationListener

Gaze is a Gazetteer VR capable of viewing and editing gazetteer lists, linear definitions (lists.def files), and mapping definitions (mappings between ontology classes and gazetteer lists). I.e. capable of visualizing and editing both linear and ontology-aware gazetteers.

See Also:
Serialized Form

Nested Class Summary
(package private)  class Gaze.GazListDL
          Gazetteer List Document Listener is used to monitor the gaz list changes and alter the isModified flag of the current list.
(package private)  class Gaze.LinearCR
          Creates a list cell renderer for the Linear Definition list.
(package private)  class Gaze.LinearLoadListener
          Reacts on all Load Linear Definition actions performed either through the menu, wither through the load buton.
(package private)  class Gaze.LinearNewListener
          Reacts on all New Linear Definition actions performed either through the menu, wither through the new buton.
(package private)  class Gaze.LinearNodeInput
          A dialog for input of a LinearNode.
(package private)  class Gaze.LinearPopupEditListener
          Listener for the Edit action of the LinearDefinition popup
(package private)  class Gaze.LinearPopupInsertListener
          Listener for the Insert action of the LinearDefinition popup
(package private)  class Gaze.LinearPopupListener
          Listener for right click on the Linear Definition list
(package private)  class Gaze.LinearPopupRemoveListener
          Listener for the Remove action of the LinearDefinition popup
(package private)  class Gaze.LinearSaveAsListener
          Reacts on all Save As Linear Definition actions.
(package private)  class Gaze.LinearSaveListener
          Reacts on all Linear Definition Save As events
(package private)  class Gaze.ListLoadListener
          Reacts on all Gaz List Load Events
(package private)  class Gaze.ListNewListener
          Reacts on all Create New Gaz List Events
(package private)  class Gaze.ListSaveAllListener
          Gaz List Save All Action Listener
(package private)  class Gaze.ListSaveAsListener
          Gazetteer list Save As action listener
(package private)  class Gaze.ListSaveListener
          Gaz List Save Action Listener
(package private)  class Gaze.MappingLoadListener
          Reacts on all Load Mapping actions performed either through the menu, wither through the load buton.
(package private)  class Gaze.MappingNewListener
          Reacts on all Create New Mapping actions performed either through the menu, either through the new buton.
(package private)  class Gaze.MappingSaveAsListener
          Reacts on all Save As Mapping Definition actions.
(package private)  class Gaze.MappingSaveListener
          Reacts on all Mapping Definition Save As events
(package private)  class Gaze.OntologyLoadListener
          Reacts on all Load Ontology actions performed either through the menu, wither through the load buton.
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JSplitPane baseSplit
           
protected  JButton btnLinearLoad
           
protected  JButton btnLinearNew
           
protected  JButton btnLinearSave
           
protected  JButton btnLinearSaveAs
           
protected  JButton btnListLoad
           
protected  JButton btnListNew
           
protected  JButton btnListSave
           
protected  JButton btnListSaveAll
           
protected  JButton btnListSaveAs
           
protected  JButton btnMappingLoad
           
protected  JButton btnMappingNew
           
protected  JButton btnMappingSave
           
protected  JButton btnMappingSaveAs
           
protected  JButton btnOntologyLoad
           
protected  JMenu fileMenu
           
private  GazetteerList gazList
          the gazetteer list currently selected
protected  GridBagLayout gridBagLayout1
           
protected  GridBagLayout gridBagLayout2
           
protected  GridBagLayout gridBagLayout3
           
protected  GridBagLayout gridBagLayout4
           
private  boolean isOntoGaz
          is the target resource ontology-aware gazetteer
private static int LDA_EDIT
          Edit Linear Node
private static int LDA_INSERT
          Insert Linear Node
private static int LDA_REMOVE
          Remove Linear Node
private  LinearDefinition linear
          the linear definition being displayed
protected  JToolBar linearBar
           
protected  JLabel linearLabel
           
protected  JList linearList
           
private  LinearNode linearNode
          the linear node currently selected
protected  JPanel linearPanel
           
protected  JPopupMenu linearPopup
          Linear Definition Popup menu
protected  JMenuItem linearPopupEdit
          Linear Definition Edit Popup Item
protected  JMenuItem linearPopupInsert
          Linear Definition Insert Popup Item
protected  JMenuItem linearPopupRemove
          Linear Definition Remove Popup Item
protected  JScrollPane linearScroll
           
protected  JSplitPane linearSplit
           
protected  JTextArea listArea
           
protected  JToolBar listBar
           
protected  JLabel listLabel
           
protected  JPanel listPanel
           
protected  JScrollPane listScroll
           
private  Set listSet
          Set of all lists, both in the linear definition and explicitly loaded ones.
protected  JMenuBar mainMenu
           
private  MappingDefinition mapping
          the mapping definition being displayed
protected  JToolBar mappingBar
           
protected  JLabel mappingLabel
           
protected  JList mappingList
           
private  MappingNode mappingNode
          the mapping node currently selected
protected  JPanel mappingPanel
           
protected  JScrollPane mappingScroll
           
protected  JSplitPane mappingSplit
           
protected  JMenuItem menuAbout
           
protected  JMenu menuHelp
           
protected  JMenu menuLinear
           
protected  JMenuItem menuLinearLoad
           
protected  JMenuItem menuLinearNew
           
protected  JMenuItem menuLinearSave
           
protected  JMenuItem menuLinearSaveAs
           
protected  JMenu menuList
           
protected  JMenuItem menuListLoad
           
protected  JMenuItem menuListNew
           
protected  JMenuItem menuListSave
           
protected  JMenuItem menuListSaveAll
           
protected  JMenuItem menuListSaveAs
           
protected  JMenu menuMapping
           
protected  JMenuItem menuMappingLoad
           
protected  JMenuItem menuMappingNew
           
protected  JMenuItem menuMappingSave
           
protected  JMenuItem menuMappingSaveAs
           
protected  JMenu menuOntology
           
protected  JMenuItem menuOntologyLoad
           
protected  JMenuItem menuRefresh
           
private  Taxonomy ontology
          the ontology that is currently displayed
protected  JToolBar ontologyBar
           
protected  JLabel ontologyLabel
           
protected  JPanel ontologyPanel
           
protected  JScrollPane ontologyScroll
           
private  Map ontologyTrees
          map of ontologies vs trees
protected  JTree oTree
           
static int POSITION_X
          positin x when running from the tools menu
static int POSITION_Y
          positin y when running from the tools menu
static int SIZE_X
          size x when running from the tools menu
static int SIZE_Y
          size y when running from the tools menu
private  Gazetteer target
          the target to be displayed
protected  GridBagLayout thisLayout
           
protected  JMenu viewMenu
           
 
Fields inherited from class gate.creole.AbstractVisualResource
features, handle
 
Fields inherited from class javax.swing.JPanel
 
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.Container
 
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
Gaze()
           
 
Method Summary
private  void createGazListBtnListeners()
          Sets the listeners for the load,save and save as buttons in the gazetteer list pane
private  void createLinearDefBtnListeners()
          Sets the listeners for the load,save and save as buttons in the linear definition pane
private  void createLinearListeneres()
          Creates and associates listeners for the linear gui components
private  void createMappingDefBtnListeners()
          Sets the listeners for the load,save and save as buttons in the mapping pane
private  void createNonLinearListeners()
          Creates and asssociates listeners for the non linear (mapping,ontology) gui components
private  void displayLinear(Gazetteer g)
          Displays linear definition
(package private)  void displayList(String listName)
          Displays the specified list in the most right pane of Gaze
private  void displayMapping(Gazetteer g)
          Displays mapping
(package private)  List getClasses()
          Gets all classes.
(package private)  List getLists()
          Gets the lists
 Resource init()
          Initialise this resource, and return it.
private  void jbInit()
          Init of the gui components
 void objectCreated(ObjectModificationEvent e)
           
 void objectDeleted(ObjectModificationEvent e)
           
 void objectModified(ObjectModificationEvent e)
           
private  void performLinearAction(int action, int index, LinearNode node)
          Performs an action over the Linear Definition.
 void processGateEvent(GateEvent e)
          Called when a Gate event has occured
 void processGazetteerEvent(GazetteerEvent e)
          Called when a Gazetteer event has occured
private  void reinitializeGazetteer()
          Reinitializes the edited gazetteer
 void setTarget(Object targeta)
          Called by the GUI when this viewer/editor has to initialise itself for a specific object. this is an AbstractVisualResource overriden method.
(package private)  void updateMappingUI()
          updates the mapping list's ui
 
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, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

SIZE_X

public static final int SIZE_X
size x when running from the tools menu

See Also:
Constant Field Values

SIZE_Y

public static final int SIZE_Y
size y when running from the tools menu

See Also:
Constant Field Values

POSITION_X

public static final int POSITION_X
positin x when running from the tools menu

See Also:
Constant Field Values

POSITION_Y

public static final int POSITION_Y
positin y when running from the tools menu

See Also:
Constant Field Values

LDA_EDIT

private static final int LDA_EDIT
Edit Linear Node

See Also:
Constant Field Values

LDA_INSERT

private static final int LDA_INSERT
Insert Linear Node

See Also:
Constant Field Values

LDA_REMOVE

private static final int LDA_REMOVE
Remove Linear Node

See Also:
Constant Field Values

target

private Gazetteer target
the target to be displayed


isOntoGaz

private boolean isOntoGaz
is the target resource ontology-aware gazetteer


linear

private LinearDefinition linear
the linear definition being displayed


linearNode

private LinearNode linearNode
the linear node currently selected


gazList

private GazetteerList gazList
the gazetteer list currently selected


listSet

private Set listSet
Set of all lists, both in the linear definition and explicitly loaded ones.


mapping

private MappingDefinition mapping
the mapping definition being displayed


mappingNode

private MappingNode mappingNode
the mapping node currently selected


ontology

private Taxonomy ontology
the ontology that is currently displayed


ontologyTrees

private Map ontologyTrees
map of ontologies vs trees


linearPopup

protected JPopupMenu linearPopup
Linear Definition Popup menu


linearPopupEdit

protected JMenuItem linearPopupEdit
Linear Definition Edit Popup Item


linearPopupInsert

protected JMenuItem linearPopupInsert
Linear Definition Insert Popup Item


linearPopupRemove

protected JMenuItem linearPopupRemove
Linear Definition Remove Popup Item


mainMenu

protected JMenuBar mainMenu

fileMenu

protected JMenu fileMenu

viewMenu

protected JMenu viewMenu

baseSplit

protected JSplitPane baseSplit

mappingSplit

protected JSplitPane mappingSplit

linearSplit

protected JSplitPane linearSplit

linearPanel

protected JPanel linearPanel

listPanel

protected JPanel listPanel

mappingPanel

protected JPanel mappingPanel

ontologyPanel

protected JPanel ontologyPanel

linearLabel

protected JLabel linearLabel

gridBagLayout1

protected GridBagLayout gridBagLayout1

linearScroll

protected JScrollPane linearScroll

linearBar

protected JToolBar linearBar

btnLinearLoad

protected JButton btnLinearLoad

linearList

protected JList linearList

btnLinearSave

protected JButton btnLinearSave

btnLinearSaveAs

protected JButton btnLinearSaveAs

listLabel

protected JLabel listLabel

gridBagLayout2

protected GridBagLayout gridBagLayout2

listBar

protected JToolBar listBar

btnListLoad

protected JButton btnListLoad

listScroll

protected JScrollPane listScroll

btnListSave

protected JButton btnListSave

btnListSaveAs

protected JButton btnListSaveAs

gridBagLayout3

protected GridBagLayout gridBagLayout3

mappingLabel

protected JLabel mappingLabel

mappingBar

protected JToolBar mappingBar

btnMappingLoad

protected JButton btnMappingLoad

mappingScroll

protected JScrollPane mappingScroll

mappingList

protected JList mappingList

btnMappingSave

protected JButton btnMappingSave

btnMappingSaveAs

protected JButton btnMappingSaveAs

ontologyLabel

protected JLabel ontologyLabel

ontologyBar

protected JToolBar ontologyBar

btnOntologyLoad

protected JButton btnOntologyLoad

ontologyScroll

protected JScrollPane ontologyScroll

gridBagLayout4

protected GridBagLayout gridBagLayout4

menuHelp

protected JMenu menuHelp

menuAbout

protected JMenuItem menuAbout

thisLayout

protected GridBagLayout thisLayout

menuLinear

protected JMenu menuLinear

menuLinearLoad

protected JMenuItem menuLinearLoad

menuLinearSave

protected JMenuItem menuLinearSave

menuLinearSaveAs

protected JMenuItem menuLinearSaveAs

menuList

protected JMenu menuList

menuListLoad

protected JMenuItem menuListLoad

menuListSave

protected JMenuItem menuListSave

menuListSaveAs

protected JMenuItem menuListSaveAs

menuMapping

protected JMenu menuMapping

menuMappingLoad

protected JMenuItem menuMappingLoad

menuMappingSave

protected JMenuItem menuMappingSave

menuMappingSaveAs

protected JMenuItem menuMappingSaveAs

menuOntology

protected JMenu menuOntology

menuOntologyLoad

protected JMenuItem menuOntologyLoad

menuRefresh

protected JMenuItem menuRefresh

oTree

protected JTree oTree

listArea

protected JTextArea listArea

btnMappingNew

protected JButton btnMappingNew

btnLinearNew

protected JButton btnLinearNew

btnListNew

protected JButton btnListNew

menuLinearNew

protected JMenuItem menuLinearNew

menuListNew

protected JMenuItem menuListNew

menuMappingNew

protected JMenuItem menuMappingNew

btnListSaveAll

protected JButton btnListSaveAll

menuListSaveAll

protected JMenuItem menuListSaveAll
Constructor Detail

Gaze

public Gaze()
Method Detail

setTarget

public void setTarget(Object targeta)
Called by the GUI when this viewer/editor has to initialise itself for a specific object. this is an AbstractVisualResource overriden method.

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

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

updateMappingUI

void updateMappingUI()
updates the mapping list's ui


displayList

void displayList(String listName)
Displays the specified list in the most right pane of Gaze

Parameters:
listName - the name of the list

getLists

List getLists()
Gets the lists

Returns:
a list of all the gaz lists known to this VR

getClasses

List getClasses()
Gets all classes.

Returns:
a list of all the classes from all the ontologies known to this VR

displayLinear

private void displayLinear(Gazetteer g)
Displays linear definition

Parameters:
g - the gazetteer to take the definition from

displayMapping

private void displayMapping(Gazetteer g)
Displays mapping

Parameters:
g - the gazetteer to take the mapping from

createLinearListeneres

private void createLinearListeneres()
Creates and associates listeners for the linear gui components


createNonLinearListeners

private void createNonLinearListeners()
Creates and asssociates listeners for the non linear (mapping,ontology) gui components


createLinearDefBtnListeners

private void createLinearDefBtnListeners()
Sets the listeners for the load,save and save as buttons in the linear definition pane


createGazListBtnListeners

private void createGazListBtnListeners()
Sets the listeners for the load,save and save as buttons in the gazetteer list pane


createMappingDefBtnListeners

private void createMappingDefBtnListeners()
Sets the listeners for the load,save and save as buttons in the mapping pane


performLinearAction

private void performLinearAction(int action,
                                 int index,
                                 LinearNode node)
Performs an action over the Linear Definition. e.g. edit,insert,remove Linear Node.

Parameters:
action - the action to be performed
index - index of the place where this action took place(e.g. where to insert)
node - the Linear Node to be used in the action

reinitializeGazetteer

private void reinitializeGazetteer()
Reinitializes the edited gazetteer


jbInit

private void jbInit()
             throws Exception
Init of the gui components

Throws:
Exception

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

processGateEvent

public void processGateEvent(GateEvent e)
Description copied from interface: GateListener
Called when a Gate event has occured

Specified by:
processGateEvent in interface GateListener

objectCreated

public void objectCreated(ObjectModificationEvent e)
Specified by:
objectCreated in interface ObjectModificationListener

objectDeleted

public void objectDeleted(ObjectModificationEvent e)
Specified by:
objectDeleted in interface ObjectModificationListener

objectModified

public void objectModified(ObjectModificationEvent e)
Specified by:
objectModified in interface ObjectModificationListener