com.ontotext.gate.vr
Class Gaze

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 com.ontotext.gate.vr.Gaze
All Implemented Interfaces:
GazetteerListener, OntologyModificationListener, Resource, FeatureBearer, NameBearer, VisualResource, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class Gaze
extends AbstractVisualResource
implements GazetteerListener, OntologyModificationListener

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
 
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  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
           
protected  GridBagLayout gridBagLayout1
           
protected  GridBagLayout gridBagLayout2
           
protected  GridBagLayout gridBagLayout3
           
protected  GridBagLayout gridBagLayout4
           
protected  JToolBar linearBar
           
protected  JLabel linearLabel
           
protected  JList linearList
           
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
           
protected  JMenuBar mainMenu
           
protected  JToolBar mappingBar
           
protected  JLabel mappingLabel
           
protected  JList mappingList
           
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
           
protected  JToolBar ontologyBar
           
protected  JLabel ontologyLabel
           
protected  JPanel ontologyPanel
           
protected  JScrollPane ontologyScroll
           
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
protected  GridBagLayout thisLayout
           
protected  JMenu viewMenu
           
 
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
Gaze()
           
 
Method Summary
 Resource init()
          Initialise this resource, and return it.
 void ontologyModified(Ontology ontology, OResource resource, int eventType)
           
 void ontologyReset(Ontology ontology)
          This method is called whenever ontology is reset.
 void processGateEvent(GateEvent e)
           
 void processGazetteerEvent(GazetteerEvent e)
          Called when a Gazetteer event has occured
 void resourceAdded(Ontology ontology, OResource resource)
          This method is invoked whenever a resource (class/property/instance) is added to the ontology.
 void resourcePropertyValueChanged(Ontology ontology, OResource resource, RDFProperty property, Object value, int eventType)
          This method should be invoked when a property value is added or removed (specified by the event type).
 void resourceRelationChanged(Ontology ontology, OResource resource1, OResource resouce2, int eventType)
          This method is invoked whenever a relation between two objects of the same class (e.g.
 void resourcesRemoved(Ontology ontology, String[] resourcesURIs)
          This method is invoked whenever a resource (class/property/instance) is removed from the ontology.
 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.
static void synchronizeTreeExpansion(JTree orig, JTree mirror)
          Synchronizes the expansion of the given trees.
 
Methods inherited from class gate.creole.AbstractVisualResource
cleanup, getFeatures, getInitParameterValues, 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

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

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

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)

resourceAdded

public void resourceAdded(Ontology ontology,
                          OResource resource)
Description copied from interface: OntologyModificationListener
This method is invoked whenever a resource (class/property/instance) is added to the ontology.

Specified by:
resourceAdded in interface OntologyModificationListener
Parameters:
ontology - the source of the event
resource - an instance of OResource, which was created as a result of addition of a resource.

resourcesRemoved

public void resourcesRemoved(Ontology ontology,
                             String[] resourcesURIs)
Description copied from interface: OntologyModificationListener
This method is invoked whenever a resource (class/property/instance) is removed from the ontology.

Specified by:
resourcesRemoved in interface OntologyModificationListener
Parameters:
ontology - the source of the event
resourcesURIs - an array of URIs of resources which were deleted (including the resource which was asked to be deleted).

ontologyReset

public void ontologyReset(Ontology ontology)
Description copied from interface: OntologyModificationListener
This method is called whenever ontology is reset. In other words when all resources of the ontology are deleted using the ontology.cleanup method.

Specified by:
ontologyReset in interface OntologyModificationListener

resourceRelationChanged

public void resourceRelationChanged(Ontology ontology,
                                    OResource resource1,
                                    OResource resouce2,
                                    int eventType)
Description copied from interface: OntologyModificationListener
This method is invoked whenever a relation between two objects of the same class (e.g. OClass and OClass, RDFPRoeprty and RDFProeprty etc) is changed.

Specified by:
resourceRelationChanged in interface OntologyModificationListener
Parameters:
ontology - the source of the event
resource1 - the affected OResource
resouce2 - the affected OResource
eventType - the type of an event (@see OConstants) for more details

resourcePropertyValueChanged

public void resourcePropertyValueChanged(Ontology ontology,
                                         OResource resource,
                                         RDFProperty property,
                                         Object value,
                                         int eventType)
Description copied from interface: OntologyModificationListener
This method should be invoked when a property value is added or removed (specified by the event type).

Specified by:
resourcePropertyValueChanged in interface OntologyModificationListener
Parameters:
ontology - the source of the event
resource - the affected resource whose property value is added or removed
property - the property whose value has been added or removed
value - the actual value that is added or removed. If the value is null - it indicates all the values related to the property are deleted.
eventType - type of the event (@see OConstants) for more details

ontologyModified

public void ontologyModified(Ontology ontology,
                             OResource resource,
                             int eventType)

synchronizeTreeExpansion

public static void synchronizeTreeExpansion(JTree orig,
                                            JTree mirror)
Synchronizes the expansion of the given trees.

Parameters:
orig - the original tree
mirror - the tree to mimic the expansion of the original