All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.protege.editor.owl.ui.editor.OWLObjectPropertySetEditor Maven / Gradle / Ivy

Go to download

OWL ontology editing infrastructure used by the Protege desktop application.

The newest version!
package org.protege.editor.owl.ui.editor;

import org.protege.editor.core.ui.util.InputVerificationStatusChangedListener;
import org.protege.editor.core.ui.util.VerifiedInputEditor;
import org.protege.editor.owl.OWLEditorKit;
import org.protege.editor.owl.ui.clsdescriptioneditor.ExpressionEditor;
import org.protege.editor.owl.ui.clsdescriptioneditor.OWLExpressionChecker;
import org.semanticweb.owlapi.model.OWLException;
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
import org.semanticweb.owlapi.model.OWLPropertyExpression;
import org.semanticweb.owlapi.model.OWLRuntimeException;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.*;
import java.awt.*;
import java.util.Set;

/**
 * Author: drummond
* http://www.cs.man.ac.uk/~drummond/

* The University Of Manchester
* Bio Health Informatics Group
* Date: Jun 4, 2009

*/ public class OWLObjectPropertySetEditor extends AbstractOWLObjectEditor> implements VerifiedInputEditor { private ExpressionEditor> editor; public OWLObjectPropertySetEditor(OWLEditorKit eKit) { OWLExpressionChecker> checker = eKit.getModelManager().getOWLExpressionCheckerFactory().getObjectPropertySetChecker(); editor = new ExpressionEditor<>(eKit, checker); editor.setPreferredSize(new Dimension(300, 200)); } @Nonnull public String getEditorTypeName() { return "Set of properties"; } public boolean canEdit(Object object) { return checkSet(object, OWLPropertyExpression.class); } @Nonnull public JComponent getEditorComponent() { return editor; } @Nullable public Set getEditedObject() { try { return editor.createObject(); } catch (OWLException e) { throw new OWLRuntimeException(e); } } public boolean setEditedObject(Set editedObject) { editor.setExpressionObject(editedObject); return true; } public void dispose() { } public void addStatusChangedListener(InputVerificationStatusChangedListener listener) { editor.addStatusChangedListener(listener); } public void removeStatusChangedListener(InputVerificationStatusChangedListener listener) { editor.removeStatusChangedListener(listener); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy