gate.gui.docview
Class OntologyInstanceView

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.gui.docview.AbstractDocumentView
              extended by gate.gui.docview.OntologyInstanceView
All Implemented Interfaces:
ActionsPublisher, DocumentView, Resource, FeatureBearer, NameBearer, VisualResource, Serializable

public class OntologyInstanceView
extends AbstractDocumentView

Document view that shows two tables: one instances and one for properties. The instances table is linked with the OntologyClassView class selection and the properties table is linked with the instances view.
Two buttons allow to add a new instance from the text selection in the document or as a new label for the selected instance.
You can filter the instances table, delete instances and set properties that are defined in the ontology as object properties.

See Also:
Serialized Form

Nested Class Summary
protected  class OntologyInstanceView.DeleteSelectedInstanceAction
           
protected  class OntologyInstanceView.DeleteSelectedPropertyAction
           
protected  class OntologyInstanceView.PropertyValueCellEditor
           
protected  class OntologyInstanceView.ShowInstanceInOntologyEditorAction
           
 
Field Summary
protected  JButton addLabelButton
           
protected static String ANNOTATION_TYPE
           
protected static String CLASS
           
protected  Map<String,Set<OClass>> classesByPropertyMap
           
protected  OntologyClassView classView
           
protected  JButton clearFilterButton
           
protected  JTextField filterTextField
           
protected  JLabel hiddenInstancesLabel
           
protected static String INSTANCE
           
protected  Set<OInstance> instances
          Instances in the instance table for the selected class and filter.
protected  XJTable instanceTable
           
protected  JPanel mainPanel
           
protected  JButton newInstanceButton
           
protected static String ONTOLOGY
           
protected  Set<ObjectProperty> properties
          Properties in the instance table for the selected class and filter.
protected  XJTable propertyTable
           
protected  OClass selectedClass
          Class that has the lead selection in the focused tree.
protected  OInstance selectedInstance
          Instance selected in the instance table.
protected  Ontology selectedOntology
           
protected  Set<ObjectProperty> setProperties
          Properties set in the property table for the selected class and filter.
protected  TextualDocumentView textView
           
 
Fields inherited from class gate.gui.docview.AbstractDocumentView
active, document, guiInitialised, handle, owner
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Fields inherited from interface gate.gui.docview.DocumentView
CENTRAL, HORIZONTAL, VERTICAL
 
Constructor Summary
OntologyInstanceView()
           
 
Method Summary
protected  void addSelectionToFilter(String selectedSet, String selectedText, int start, int end)
          Create a new annotation and instance from a text selection.
protected  void createFromSelection(String selectedSet, String selectedText, int start, int end, boolean newInstance)
          Create a new annotation and instance or label from a text selection.
 Component getGUI()
          Returns the actual UI component this view represents.
 int getType()
          Returns the type of this view.
protected  void initGUI()
          Implementers should override this method and use it for populating the GUI.
protected  void initListeners()
           
protected  void registerHooks()
          This method will be called whenever the view becomes active.
 void selectInstance(OInstance oInstance)
          Select an instance in the instance table if it exists..
protected  void unregisterHooks()
          This method will be called whenever this view becomes inactive.
 void updateInstanceTable(OClass selectedClass)
          Update the instance table for the class and ontology selected.
protected  void updatePropertyTable()
           
 
Methods inherited from class gate.gui.docview.AbstractDocumentView
getActions, getDocument, getHandle, getOwner, isActive, setActive, setHandle, setOwner, setSelectedAnnotations, setTarget
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, cleanup, getBeanInfo, getName, getParameterValue, getParameterValue, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

selectedOntology

protected Ontology selectedOntology

textView

protected TextualDocumentView textView

classView

protected OntologyClassView classView

mainPanel

protected JPanel mainPanel

filterTextField

protected JTextField filterTextField

clearFilterButton

protected JButton clearFilterButton

hiddenInstancesLabel

protected JLabel hiddenInstancesLabel

newInstanceButton

protected JButton newInstanceButton

addLabelButton

protected JButton addLabelButton

instanceTable

protected XJTable instanceTable

propertyTable

protected XJTable propertyTable

selectedClass

protected OClass selectedClass
Class that has the lead selection in the focused tree.


selectedInstance

protected OInstance selectedInstance
Instance selected in the instance table.


instances

protected Set<OInstance> instances
Instances in the instance table for the selected class and filter.


setProperties

protected Set<ObjectProperty> setProperties
Properties set in the property table for the selected class and filter.


properties

protected Set<ObjectProperty> properties
Properties in the instance table for the selected class and filter.


classesByPropertyMap

protected Map<String,Set<OClass>> classesByPropertyMap

ONTOLOGY

protected static final String ONTOLOGY
See Also:
Constant Field Values

CLASS

protected static final String CLASS
See Also:
Constant Field Values

INSTANCE

protected static final String INSTANCE
See Also:
Constant Field Values

ANNOTATION_TYPE

protected static final String ANNOTATION_TYPE
See Also:
Constant Field Values
Constructor Detail

OntologyInstanceView

public OntologyInstanceView()
Method Detail

initGUI

protected void initGUI()
Description copied from class: AbstractDocumentView
Implementers should override this method and use it for populating the GUI.

Specified by:
initGUI in class AbstractDocumentView

initListeners

protected void initListeners()

registerHooks

protected void registerHooks()
Description copied from class: AbstractDocumentView
This method will be called whenever the view becomes active. Implementers should use this to add hooks (such as mouse listeners) to the other views as required by their functionality.

Specified by:
registerHooks in class AbstractDocumentView

unregisterHooks

protected void unregisterHooks()
Description copied from class: AbstractDocumentView
This method will be called whenever this view becomes inactive. Implementers should use it to unregister whatever hooks they registered in AbstractDocumentView.registerHooks().

Specified by:
unregisterHooks in class AbstractDocumentView

getGUI

public Component getGUI()
Description copied from interface: DocumentView
Returns the actual UI component this view represents.

Returns:
a Component value.

getType

public int getType()
Description copied from interface: DocumentView
Returns the type of this view.

Returns:
an int value
See Also:
DocumentView.CENTRAL, DocumentView.HORIZONTAL, DocumentView.VERTICAL

updateInstanceTable

public void updateInstanceTable(OClass selectedClass)
Update the instance table for the class and ontology selected.

Parameters:
selectedClass - class selected

updatePropertyTable

protected void updatePropertyTable()

addSelectionToFilter

protected void addSelectionToFilter(String selectedSet,
                                    String selectedText,
                                    int start,
                                    int end)
Create a new annotation and instance from a text selection. Use the text selected as the instance property label.

Parameters:
selectedSet - name of the selected annotation set
selectedText - selection
start - selection start offset
end - selection end offset

createFromSelection

protected void createFromSelection(String selectedSet,
                                   String selectedText,
                                   int start,
                                   int end,
                                   boolean newInstance)
Create a new annotation and instance or label from a text selection. Use the text selected as the instance property label.

Parameters:
selectedSet - name of the selected annotation set
selectedText - selection
start - selection start offset
end - selection end offset
newInstance - true if it will create a new instance otherwise it will add a new label to the selected instance

selectInstance

public void selectInstance(OInstance oInstance)
Select an instance in the instance table if it exists..

Parameters:
oInstance - instance to be selected