public class OntologyEditor extends AbstractVisualResource implements ResizableVisualResource, OntologyModificationListener
Modifier and Type | Class and Description |
---|---|
protected class |
OntologyEditor.AnnotationPropertyValueAction |
protected class |
OntologyEditor.DatatypePropertyValueAction |
protected class |
OntologyEditor.ObjectPropertyValueAction |
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
features, handle
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
OntologyEditor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addChidrenRec(DefaultMutableTreeNode parent,
List<OResource> children,
Comparator<OResource> comparator)
Adds the children nodes to a node using values from a list of
classes and instances.
|
protected void |
addPropertyChidrenRec(DefaultMutableTreeNode parent,
List<RDFProperty> children,
Comparator<OResource> comparator)
Adds the children nodes to a node using values from a list of
classes and instances.
|
void |
addTreeNodeSelectionListener(TreeNodeSelectionListener listener) |
protected void |
classIsAdded(OClass aClass)
Update the class tree model.
|
protected void |
expandNode(JTree tree) |
Resource |
init()
Init method, that creates this object and returns this object as a
resource
|
protected void |
initGUIComponents()
Initialize the GUI Components
|
protected void |
initListeners()
Initializes various listeners
|
protected void |
initLocalData()
Initialize the local data
|
protected void |
instanceIsAdded(OInstance anInstance)
Update the class tree model.
|
void |
ontologyModified(Ontology ontology,
OResource resource,
int eventType)
This method is invoked from ontology whenever it is modified
|
void |
ontologyReset(Ontology ontology)
This method is called whenever ontology is reset.
|
void |
processGateEvent(GateEvent e) |
protected void |
propertyIsAdded(RDFProperty p)
Update the property tree model.
|
protected void |
rebuildModel()
Called when the target of this editor has changed
|
void |
removeTreeNodeSelectionListener(TreeNodeSelectionListener listener) |
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[] resources)
This method is invoked whenever a resource
(class/property/instance) is removed from the ontology.
|
void |
selectResourceInClassTree(OResource resource) |
void |
setTarget(Object target)
Called by the GUI when this viewer/editor has to initialise itself for a
specific object.
|
protected void |
subClassIsAdded(OClass c)
Update the class tree model.
|
protected void |
subClassIsDeleted(OClass c)
Update the class tree model.
|
protected void |
subPropertyIsAdded(RDFProperty p)
Update the property tree model.
|
protected void |
subPropertyIsDeleted(RDFProperty p)
Update the property tree model.
|
cleanup, getFeatures, getInitParameterValues, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValues
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setHandle
cleanup, getParameterValue, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
protected OntologyItemComparator itemComparator
protected JTree propertyTree
protected DefaultTreeModel treeModel
protected DefaultTreeModel propertyTreeModel
protected JTable detailsTable
protected JTable propertyDetailsTable
protected DetailsTableModel detailsTableModel
protected PropertyDetailsTableModel propertyDetailsTableModel
protected JSplitPane mainSplit
protected DefaultMutableTreeNode rootNode
protected DefaultMutableTreeNode propertyRootNode
protected JScrollPane detailsTableScroller
protected JScrollPane propertyDetailsTableScroller
protected JButton refreshOntologyBtn
protected JButton restriction
protected JButton annotationProperty
protected JButton datatypeProperty
protected JButton objectProperty
protected JButton symmetricProperty
protected JButton transitiveProperty
protected ArrayList<DefaultMutableTreeNode> selectedNodes
protected ArrayList<String> ontologyClassesURIs
protected SearchAction searchAction
protected TopClassAction topClassAction
protected SubClassAction subClassAction
protected InstanceAction instanceAction
protected AnnotationPropertyAction annotationPropertyAction
protected DatatypePropertyAction datatypePropertyAction
protected ObjectPropertyAction objectPropertyAction
protected SymmetricPropertyAction symmetricPropertyAction
protected TransitivePropertyAction transitivePropertyAction
protected DeleteOntologyResourceAction deleteOntoResourceAction
protected RestrictionAction restrictionAction
protected ArrayList<TreeNodeSelectionListener> listeners
protected HashMap<String,ArrayList<DefaultMutableTreeNode>> uri2TreeNodesListMap
protected HashMap<DefaultMutableTreeNode,ONodeID> reverseMap
protected JScrollPane propertyScroller
protected JScrollPane scroller
protected JTabbedPane tabbedPane
public OntologyEditor()
public void setTarget(Object target)
AbstractVisualResource
setTarget
in interface VisualResource
setTarget
in class AbstractVisualResource
target
- the object (be it a Resource
,
DataStore
or whatever) this viewer has to displaypublic Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractVisualResource
ResourceInstantiationException
protected void initLocalData()
protected void initGUIComponents()
protected void initListeners()
protected void expandNode(JTree tree)
protected void rebuildModel()
protected void addChidrenRec(DefaultMutableTreeNode parent, List<OResource> children, Comparator<OResource> comparator)
parent
- the parent node.children
- the Listcomparator
- the Comparator used to sort the children.protected void addPropertyChidrenRec(DefaultMutableTreeNode parent, List<RDFProperty> children, Comparator<OResource> comparator)
parent
- the parent node.children
- the lsit of children objects.comparator
- the Comparator used to sort the children.public void processGateEvent(GateEvent e)
protected void classIsAdded(OClass aClass)
aClass
- class to addprotected void propertyIsAdded(RDFProperty p)
p
- property to addprotected void instanceIsAdded(OInstance anInstance)
anInstance
- instance to addprotected void subPropertyIsAdded(RDFProperty p)
p
- subproperty to addprotected void subPropertyIsDeleted(RDFProperty p)
p
- subproperty to deleteprotected void subClassIsAdded(OClass c)
c
- subclass to addprotected void subClassIsDeleted(OClass c)
c
- subclass to deletepublic 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 resourceRelationChanged(Ontology ontology, OResource resource1, OResource resouce2, int eventType)
OntologyModificationListener
resourceRelationChanged
in interface OntologyModificationListener
ontology
- the source of the eventresource1
- the affected OResourceresouce2
- 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 ontologyModified(Ontology ontology, OResource resource, int eventType)
public void ontologyReset(Ontology ontology)
ontologyReset
in interface OntologyModificationListener
ontology
- public void addTreeNodeSelectionListener(TreeNodeSelectionListener listener)
public void removeTreeNodeSelectionListener(TreeNodeSelectionListener listener)
public void selectResourceInClassTree(OResource resource)