001    /**
002     * Copyright (C) 2007-2009, Jens Lehmann
003     *
004     * This file is part of DL-Learner.
005     * 
006     * DL-Learner is free software; you can redistribute it and/or modify
007     * it under the terms of the GNU General Public License as published by
008     * the Free Software Foundation; either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * DL-Learner is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018     *
019     */
020    package org.dllearner.tools.protege;
021    
022    import java.util.Set;
023    
024    import javax.swing.JComponent;
025    
026    import org.protege.editor.core.ui.util.InputVerificationStatusChangedListener;
027    import org.protege.editor.owl.ui.editor.AbstractOWLDescriptionEditor;
028    import org.semanticweb.owl.model.OWLDescription;
029    
030    /**
031     * This is the class that must be implemented to get the plugin integrated in
032     * protege.
033     * 
034     * @author Christian Koetteritzsch
035     * 
036     */
037    public class ProtegePlugin extends AbstractOWLDescriptionEditor {
038            private static final long serialVersionUID = 728362819273927L;
039            private DLLearnerView view;
040    
041            
042            @Override
043            public JComponent getComponent() {
044                    return view.getLearnerView();
045            }
046    
047            @Override
048            public Set<OWLDescription> getDescriptions() {
049                    return view.getSolutions();
050            }
051    
052            @Override
053            public boolean isValidInput() {
054                    view.makeView();
055                    view.getMoreDetailForSuggestedConceptsPanel().unsetPanel();
056                    return true;
057            }
058    
059            @Override
060            public boolean setDescription(OWLDescription arg0) {
061                    return true;
062            }
063    
064            @Override
065            public void initialise() throws Exception {
066                    view = new DLLearnerView("equivalent class", super.getOWLEditorKit());
067                    view.makeView();
068            }
069    
070            @Override
071            public void dispose() throws Exception {
072                    view.dispose();
073                    view = null;
074            }
075    
076            @Override
077            public void addStatusChangedListener(
078                            InputVerificationStatusChangedListener arg0) {
079            }
080    
081            @Override
082            public void removeStatusChangedListener(
083                            InputVerificationStatusChangedListener arg0) {
084            }
085    
086    
087    
088    
089    }