|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.util.AbstractFeatureBearer gate.creole.AbstractResource gate.gui.docview.AbstractDocumentView gate.gui.docview.OntologyClassView
public class OntologyClassView
Document view that displays an ontology class tree to annotate a document. tick the checkbox of a class to show the instances highlighted in the text selected class will be used when creating a new annotation from a text selection in the document take only the first 20 characters of the selection for the instance name and add a number if already existing allow multiple ontologies to be used at the same time put each ontology in a JPanel with triangle icons to hide/show the panel, hidden by default open only first level of classes when opening an ontology load lazily the ontology trees context menu for classes to hide/show them, saved in user configuration
Nested Class Summary | |
---|---|
protected class |
OntologyClassView.ClassTreeCellEditor
|
protected class |
OntologyClassView.ClassTreeCellRenderer
|
protected class |
OntologyClassView.MouseStoppedMovingAction
Add the text selection to the filter instance table to enable creating a new instance from the selection or adding it as a new label to an existing instance. |
protected class |
OntologyClassView.TextMouseListener
A mouse listener used for events in the text view. |
Field Summary | |
---|---|
protected static String |
ANNOTATION_TYPE
|
protected static String |
CLASS
|
protected Map<OClass,Color> |
colorByClassMap
Colors for class and their instances only if the latter exist. |
protected LinkedHashSet<String> |
hiddenClassesSet
Classes to hide in the trees. |
protected Set<OClass> |
highlightedClasses
Classes highlighted in the document with their checkboxes ticked in the class tree. |
protected Map<OClass,List> |
highlightsDataByClassMap
HighlightData list for each class. |
protected static String |
INSTANCE
|
protected OntologyInstanceView |
instanceView
|
protected OntologyItemComparator |
itemComparator
|
protected JPanel |
mainPanel
|
protected JLabel |
messageLabel
|
protected static int |
MOUSE_MOVEMENT_TIMER_DELAY
|
protected Timer |
mouseMovementTimer
|
protected OntologyClassView.MouseStoppedMovingAction |
mouseStoppedMovingAction
|
protected static String |
ONTOLOGY
|
protected OClass |
selectedClass
Class that has the lead selection in the focused ontology tree. |
protected String |
selectedSet
Annotation set name where to read/save the instance annotations. |
protected JComboBox |
setComboBox
|
protected JTextArea |
textArea
|
protected OntologyClassView.TextMouseListener |
textMouseListener
|
protected TextualDocumentView |
textView
|
protected Map<Ontology,JTree> |
treeByOntologyMap
Link trees with their ontologies. |
protected JPanel |
treesPanel
|
protected OptionsMap |
userConfig
|
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 | |
---|---|
OntologyClassView()
|
Method Summary | |
---|---|
protected void |
addNodes(JTree tree,
DefaultMutableTreeNode parent,
Set<OClass> newChildren,
boolean filterClasses)
Add children nodes to the parent node in the tree. |
protected void |
buildClassTree(JTree tree,
Ontology ontology)
Build the class tree from the ontology. |
void |
cleanup()
releases the memory allocated to this resource |
void |
datastoreClosed(CreoleEvent e)
Called when a DataStore has been closed |
void |
datastoreCreated(CreoleEvent e)
Called when a DataStore has been created |
void |
datastoreOpened(CreoleEvent e)
Called when a DataStore has been opened |
Component |
getGUI()
Returns the actual UI component this view represents. |
String |
getSelectedSet()
|
int |
getType()
Returns the type of this view. |
void |
highlightInstance(AnnotationSet set,
Annotation annotation,
OClass oClass,
JTree tree)
To see if it's worth using it to optimise highlights display. |
protected void |
initGUI()
Implementers should override this method and use it for populating the GUI. |
protected void |
initListeners()
|
protected void |
loadOntology(Ontology ontology)
Add the ontology in a disclosure panel, closed at start. |
void |
ontologyReset(Ontology ontology)
This method is called whenever ontology is reset. |
protected void |
registerHooks()
This method will be called whenever the view becomes active. |
void |
resourceAdded(Ontology ontology,
OResource resource)
This method is invoked whenever a resource (class/property/instance) is added to the ontology. |
void |
resourceLoaded(CreoleEvent e)
Called when a new Resource has been loaded into the system |
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 resource2,
int eventType)
This method is invoked whenever a relation between two objects of the same class (e.g. |
void |
resourceRenamed(Resource resource,
String oldName,
String newName)
Called when the creole register has renamed a resource.1 |
void |
resourcesRemoved(Ontology ontology,
String[] resources)
This method is invoked whenever a resource (class/property/instance) is removed from the ontology. |
void |
resourceUnloaded(CreoleEvent e)
Called when a Resource has been removed from the system |
void |
setClassHighlighted(OClass oClass,
boolean isHighlighted)
|
protected boolean |
setColorTreeNodesWhenInstancesFound(String setName)
Extract annotations that have been created by this view and colored the corresponding tree class node if found. |
protected void |
unregisterHooks()
This method will be called whenever this view becomes inactive. |
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, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, 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 |
---|
getParameterValue, init, setParameterValue, setParameterValues |
Methods inherited from interface gate.util.FeatureBearer |
---|
getFeatures, setFeatures |
Methods inherited from interface gate.util.NameBearer |
---|
getName, setName |
Field Detail |
---|
protected TextualDocumentView textView
protected JTextArea textArea
protected OntologyInstanceView instanceView
protected JPanel mainPanel
protected JLabel messageLabel
protected JPanel treesPanel
protected JComboBox setComboBox
protected OClass selectedClass
protected Set<OClass> highlightedClasses
protected Map<OClass,Color> colorByClassMap
protected Map<OClass,List> highlightsDataByClassMap
protected Map<Ontology,JTree> treeByOntologyMap
protected LinkedHashSet<String> hiddenClassesSet
protected String selectedSet
protected OntologyItemComparator itemComparator
protected OntologyClassView.MouseStoppedMovingAction mouseStoppedMovingAction
protected OntologyClassView.TextMouseListener textMouseListener
protected Timer mouseMovementTimer
protected static final int MOUSE_MOVEMENT_TIMER_DELAY
protected OptionsMap userConfig
protected static final String ONTOLOGY
protected static final String CLASS
protected static final String INSTANCE
protected static final String ANNOTATION_TYPE
Constructor Detail |
---|
public OntologyClassView()
Method Detail |
---|
protected void initGUI()
AbstractDocumentView
initGUI
in class AbstractDocumentView
protected void initListeners()
protected void registerHooks()
AbstractDocumentView
registerHooks
in class AbstractDocumentView
protected void unregisterHooks()
AbstractDocumentView
AbstractDocumentView.registerHooks()
.
unregisterHooks
in class AbstractDocumentView
public void cleanup()
AbstractResource
cleanup
in interface Resource
cleanup
in class AbstractResource
public Component getGUI()
DocumentView
getGUI
in interface DocumentView
Component
value.public int getType()
DocumentView
getType
in interface DocumentView
DocumentView.CENTRAL
,
DocumentView.HORIZONTAL
,
DocumentView.VERTICAL
public void resourceLoaded(CreoleEvent e)
CreoleListener
Resource
has been loaded into the system
resourceLoaded
in interface CreoleListener
public void resourceUnloaded(CreoleEvent e)
CreoleListener
Resource
has been removed from the system
resourceUnloaded
in interface CreoleListener
public void datastoreOpened(CreoleEvent e)
CreoleListener
DataStore
has been opened
datastoreOpened
in interface CreoleListener
public void datastoreCreated(CreoleEvent e)
CreoleListener
DataStore
has been created
datastoreCreated
in interface CreoleListener
public void datastoreClosed(CreoleEvent e)
CreoleListener
DataStore
has been closed
datastoreClosed
in interface CreoleListener
public void resourceRenamed(Resource resource, String oldName, String newName)
CreoleListener
resourceRenamed
in interface CreoleListener
public void resourceRelationChanged(Ontology ontology, OResource resource1, OResource resource2, int eventType)
OntologyModificationListener
resourceRelationChanged
in interface OntologyModificationListener
ontology
- the source of the eventresource1
- the affected OResourceresource2
- the affected OResourceeventType
- the type of an event (@see OConstants) for more
detailspublic void resourcePropertyValueChanged(Ontology ontology, OResource resource, RDFProperty property, Object value, int eventType)
OntologyModificationListener
resourcePropertyValueChanged
in interface OntologyModificationListener
ontology
- the source of the eventresource
- the affected resource whose property value is added or removedproperty
- the property whose value has been added or removedvalue
- 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 detailspublic void resourcesRemoved(Ontology ontology, String[] resources)
OntologyModificationListener
resourcesRemoved
in interface OntologyModificationListener
ontology
- the source of the eventresources
- an array of URIs of resources which were deleted
(including the resource which was asked to be deleted).public void resourceAdded(Ontology ontology, OResource resource)
OntologyModificationListener
resourceAdded
in interface OntologyModificationListener
ontology
- the source of the eventresource
- an instance of OResource, which was created as a
result of addition of a resource.public void ontologyReset(Ontology ontology)
OntologyModificationListener
ontologyReset
in interface OntologyModificationListener
protected boolean setColorTreeNodesWhenInstancesFound(String setName)
setName
- the annotation set name to search
protected void loadOntology(Ontology ontology)
ontology
- ontology to displayprotected void buildClassTree(JTree tree, Ontology ontology)
OntologyEditor.rebuildModel()
.
tree
- tree to buildontology
- ontology to useprotected void addNodes(JTree tree, DefaultMutableTreeNode parent, Set<OClass> newChildren, boolean filterClasses)
tree
- tree to updateparent
- parent nodenewChildren
- children classes to addfilterClasses
- if children nodes contain hidden classes
then don't add them.public void setClassHighlighted(OClass oClass, boolean isHighlighted)
public void highlightInstance(AnnotationSet set, Annotation annotation, OClass oClass, JTree tree)
set
- setannotation
- annotationoClass
- classtree
- treepublic String getSelectedSet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |