From: <hee...@us...> - 2009-02-26 19:03:43
|
Revision: 1636 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1636&view=rev Author: heeroyuy Date: 2009-02-26 19:03:36 +0000 (Thu, 26 Feb 2009) Log Message: ----------- -some bugfixes -simple test class for the new plugin version -removed duplicated protege code Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/plugin.xml trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/tools/protege/ButtonList.java trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java trunk/src/dl-learner/org/dllearner/tools/protege/OWLSubClassAxiomFrameSection.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -65,7 +65,6 @@ // This is the Tread of the DL-Learner private EvaluatedDescription evaluatedDescription; // This is the view of the DL-Learner tab. - //private final OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view; private Timer timer; private LearningAlgorithm la; private SuggestionRetriever retriever; @@ -85,14 +84,6 @@ * id if it is a subclass or an equivalent class * */ - public ActionHandler(ActionHandler a, DLLearnerModel m, OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view, String i) { - this.view = null; - this.id = i; - this.model = m; - toggled = false; - - } - public ActionHandler(ActionHandler a, DLLearnerModel m, DLLearnerView view, String i) { this.view = view; this.id = i; Deleted: trunk/src/dl-learner/org/dllearner/tools/protege/ButtonList.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ButtonList.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ButtonList.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -1,77 +0,0 @@ -/** - * Copyright (C) 2007-2009, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.dllearner.tools.protege; - -import org.protege.editor.owl.OWLEditorKit; -import org.protege.editor.owl.ui.editor.OWLClassDescriptionEditor; -import org.protege.editor.owl.ui.frame.AbstractOWLFrame; -import org.protege.editor.owl.ui.frame.InheritedAnonymousClassesFrameSection; -import org.protege.editor.owl.ui.frame.OWLClassAssertionAxiomIndividualSection; -import org.protege.editor.owl.ui.frame.OWLDisjointClassesAxiomFrameSection; -import org.protege.editor.owl.ui.frame.OWLEquivalentClassesAxiomFrameSection; -import org.protege.editor.owl.ui.frame.OWLFrameSectionRowObjectEditor; -import org.protege.editor.owl.ui.frame.OWLSubClassAxiomFrameSection; -import org.semanticweb.owl.model.OWLClass; -import org.semanticweb.owl.model.OWLDescription; - -/** - * This class manages the list of the lists for equivalent classes and so on. - * This is necessary to implement the dllearner plugin in the - * OWLClassDescriptionEditor. - * - * @author Christian Koetteritzsch - * - */ -public class ButtonList extends AbstractOWLFrame<OWLClass> { - private final OWLEquivalentClassesAxiomFrameSection equi; - private final OWLSubClassAxiomFrameSection sub; - private final DLLearnerView view; - /** - * Constructor of the Buttonlist. - * - * @param editorKit EditorKit from Protege - */ - public ButtonList(OWLEditorKit editorKit) { - - super(editorKit.getModelManager().getOWLOntologyManager()); - equi = new OWLEquivalentClassesAxiomFrameSection(editorKit, this); - view = new DLLearnerView(equi.getName(), editorKit); - OWLFrameSectionRowObjectEditor<OWLDescription> edit = equi.getObjectEditor(); - OWLClassDescriptionEditor ed = (OWLClassDescriptionEditor)edit; - ed.addPanel(view); - //equi.getEditor().getEditorComponent().validate(); - sub = new OWLSubClassAxiomFrameSection(editorKit, this); - OWLFrameSectionRowObjectEditor<OWLDescription> editor = sub.getObjectEditor(); - System.out.println("test"); - OWLClassDescriptionEditor edi = (OWLClassDescriptionEditor)editor; - edi.addPanel(view); - // own OWLEquivalentClassesAxiomFrameSection to add the dllearner plugin - // to the - // OWLClassDescritpionEditor - addSection(equi); - // own OWLEquivalentClassesAxiomFrameSection to add the dllearner plugin - // to the - // OWLClassDescritpionEditor - addSection(sub); - addSection(new InheritedAnonymousClassesFrameSection(editorKit, this)); - addSection(new OWLClassAssertionAxiomIndividualSection(editorKit, this)); - addSection(new OWLDisjointClassesAxiomFrameSection(editorKit, this)); - } -} Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -87,7 +87,6 @@ // The View of the DL-Learner Plugin - //private final OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view; // The Learning problem that is used to learn new concepts @@ -176,24 +175,6 @@ * @param view * current view of the DL-Learner tab */ - public DLLearnerModel(OWLEditorKit editorKit, String id, OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view) { - editor = editorKit; - this.id = id; - this.view = null; - ontologyConsistent = true; - instancesCount = 0; - owlDescription = new HashSet<OWLDescription>(); - posListModel = new DefaultListModel(); - negListModel = new DefaultListModel(); - ComponentManager.setComponentClasses(componenten); - individualVector = new Vector<IndividualObject>(); - cm = ComponentManager.getInstance(); - ds = new HashSet<OWLDescription>(); - suggestModel = new DefaultListModel(); - ontologieURI = new HashSet<String>(); - sources = new HashSet<KnowledgeSource>(); - } - public DLLearnerModel(OWLEditorKit editorKit, String id, DLLearnerView view) { editor = editorKit; this.id = id; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -45,7 +45,7 @@ * @author Christian Koetteritzsch * */ -public class DLLearnerView extends JPanel implements OWLDescriptionEditor{ +public class DLLearnerView implements OWLDescriptionEditor{ private static final long serialVersionUID = 624829578325729385L; @@ -212,7 +212,7 @@ learner.add(errorMessage); learner.add(posPanel); detail = new MoreDetailForSuggestedConceptsPanel(model); - add(learner); + //add(learner); } /** @@ -410,5 +410,15 @@ // TODO Auto-generated method stub } + @Override + public void setup(String arg0, String arg1, OWLEditorKit arg2) { + // TODO Auto-generated method stub + + } + @Override + public void initialise() throws Exception { + // TODO Auto-generated method stub + + } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -159,6 +159,7 @@ if(y >= newConcept.getMaxY()) { y = (int) newConcept.getMinY(); + break; } while(x < newConcept.getMaxX()) { @@ -192,6 +193,7 @@ if(y >= newConcept.getMaxY()) { y = (int) oldConcept.getMinY(); + break; } while(x < newConcept.getMaxX()) { @@ -226,6 +228,7 @@ if(y >= oldConcept.getMaxY()) { y = (int) oldConcept.getMinY(); + break; } while(x < oldConcept.getMaxX()) { Modified: trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/plugin.xml =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/plugin.xml 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/plugin.xml 2009-02-26 19:03:36 UTC (rev 1636) @@ -1,10 +1,9 @@ <?xml version="1.0" ?> <plugin> - <extension id="org.dllearner.tools.protege.ProtegePlugin" - point="org.protege.editor.core.application.ViewComponent"> - <label value="Class Descriptions (including DL-Learner plugin)"/> - <class value="org.dllearner.tools.protege.ProtegePlugin"/> - <headerColor value="@org.protege.classcolor"/> - <category value="@org.protege.classcategory"/> - </extension> + <extension id="org.dllearner.tools.protege.ProtegePlugin" + point="org.protege.editor.owl.ui.editor"> + <label value="DL-Learner"/> + <class value="org.dllearner.tools.protege.ProtegePlugin"/> + </extension> + </plugin> \ No newline at end of file Deleted: trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -1,842 +0,0 @@ -/** - * Copyright (C) 2007-2009, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.dllearner.tools.protege; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JSpinner; -import javax.swing.JSplitPane; -import javax.swing.JTabbedPane; -import javax.swing.JTextArea; -import javax.swing.JToggleButton; -import javax.swing.SpinnerNumberModel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -import org.protege.editor.core.ui.util.ComponentFactory; -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.model.cache.OWLExpressionUserCache; -import org.protege.editor.owl.ui.clsdescriptioneditor.ExpressionEditor; -import org.protege.editor.owl.ui.frame.AbstractOWLFrameSectionRowObjectEditor; -import org.protege.editor.owl.ui.frame.OWLFrame; -import org.protege.editor.owl.ui.selector.OWLClassSelectorPanel; -import org.protege.editor.owl.ui.selector.OWLObjectPropertySelectorPanel; -import org.semanticweb.owl.model.OWLClass; -import org.semanticweb.owl.model.OWLDataFactory; -import org.semanticweb.owl.model.OWLDescription; -import org.semanticweb.owl.model.OWLException; -import org.semanticweb.owl.model.OWLObjectProperty; - -/** - * Added a new Tab for the DL-Learner GUI. - * - * @author Matthew Horridge - * @author Christian Koetteritzsch - */ -public class OWLClassDescriptionEditorWithDLLearnerTab extends - AbstractOWLFrameSectionRowObjectEditor<OWLDescription> implements - VerifiedInputEditor { - - private static final String CLASS_EXPRESSION_EDITOR_LABEL = "Class expression editor"; - private static final String CLASS_TREE_LABEL = "Class tree"; - private static final String RESTRICTION_CREATOR_LABEL = "Restriction creator"; - private static final String SUGGEST_EQUIVALENT_CLASS_LABEL = "Suggest equivalent class"; - private static final String SUGGEST_SUBCLASS_LABEL = "Suggest super class"; - - private final OWLEditorKit editorKit; - - private final ExpressionEditor<OWLDescription> editor; - - private final JComponent editingComponent; - - private final JTabbedPane tabbedPane; - - private DLLearnerView dllearner; - private final ActionHandler action; - - private OWLClassSelectorPanel classSelectorPanel; - - private ObjectRestrictionCreatorPanel restrictionCreatorPanel; - - //private final OWLDescription initialDescription; - - private final Set<InputVerificationStatusChangedListener> listeners = new HashSet<InputVerificationStatusChangedListener>(); - - private final ChangeListener changeListener = new ChangeListener() { - public void stateChanged(ChangeEvent changeEvent) { - handleVerifyEditorContents(); - } - }; - /** - * Konstruktor of the Class Description Editor with integrated DL-Learner Tab. - * @param editorKit OWLEditorKit - * @param description OWLDescription - * @param frame OWLFrame - * @param label String - */ - public OWLClassDescriptionEditorWithDLLearnerTab(OWLEditorKit editorKit, - OWLDescription description, OWLFrame<OWLClass> frame, String label) { - this.editorKit = editorKit; - //this.initialDescription = description; - //checker = new OWLDescriptionChecker(editorKit.getModelManager()); - editor = new ExpressionEditor<OWLDescription>(editorKit, editorKit.getModelManager().getOWLExpressionCheckerFactory().getOWLDescriptionChecker()); - editor.setExpressionObject(description); - - action = new ActionHandler(this.action, null, dllearner, label); - tabbedPane = new JTabbedPane(); - tabbedPane.setFocusable(false); - editingComponent = new JPanel(new BorderLayout()); - editingComponent.add(tabbedPane); - editingComponent.setPreferredSize(new Dimension(600, 520)); - if (label.equals("equivalent classes")) { - dllearner = new DLLearnerView(frame, SUGGEST_EQUIVALENT_CLASS_LABEL, this); - tabbedPane.add(SUGGEST_EQUIVALENT_CLASS_LABEL, dllearner); - } - if (label.equals("super classes")) { - dllearner = new DLLearnerView(frame, SUGGEST_SUBCLASS_LABEL, this); - tabbedPane.add(SUGGEST_SUBCLASS_LABEL, dllearner); - } - - // - tabbedPane.add(CLASS_EXPRESSION_EDITOR_LABEL, new JScrollPane(editor)); - if (description == null || !description.isAnonymous()) { - classSelectorPanel = new OWLClassSelectorPanel(editorKit); - tabbedPane.add(CLASS_TREE_LABEL, classSelectorPanel); - if (description != null) { - classSelectorPanel.setSelection(description.asOWLClass()); - } - classSelectorPanel.addSelectionListener(changeListener); - - restrictionCreatorPanel = new ObjectRestrictionCreatorPanel(); - tabbedPane.add(RESTRICTION_CREATOR_LABEL, restrictionCreatorPanel); - restrictionCreatorPanel.classSelectorPanel - .addSelectionListener(changeListener); - restrictionCreatorPanel.objectPropertySelectorPanel - .addSelectionListener(changeListener); - - tabbedPane.addChangeListener(changeListener); - } - - } - - private void handleVerifyEditorContents() { - for (InputVerificationStatusChangedListener l : listeners) { - l.verifiedStatusChanged(isValidated()); - } - } - - private boolean isValidated() { - boolean validated = false; - final String selectedTabTitle = tabbedPane.getTitleAt(tabbedPane - .getSelectedIndex()); - if (selectedTabTitle.equals(CLASS_EXPRESSION_EDITOR_LABEL)) { - validated = editor.isWellFormed(); - } else if (selectedTabTitle.equals(CLASS_TREE_LABEL)) { - validated = classSelectorPanel.getSelectedObject() != null; - } else if (selectedTabTitle.equals(RESTRICTION_CREATOR_LABEL)) { - validated = restrictionCreatorPanel.classSelectorPanel - .getSelectedObject() != null - && restrictionCreatorPanel.objectPropertySelectorPanel - .getSelectedObject() != null; - } else if (selectedTabTitle.equals(SUGGEST_EQUIVALENT_CLASS_LABEL)) { - validated = true; - } else if (selectedTabTitle.equals(SUGGEST_SUBCLASS_LABEL)) { - validated = true; - } - return validated; - } - /** - * Returns Editor Component. - * @return JComponent - */ - public JComponent getInlineEditorComponent() { - // Same as general editor component - return editingComponent; - } - - /** - * Gets a component that will be used to edit the specified object. - * - * @return The component that will be used to edit the object - */ - public JComponent getEditorComponent() { - return editingComponent; - } - /** - * Removes everything after closing the Class Description Editor. - */ - public void clear() { - dllearner.unsetEverything(); - dllearner.makeView(); - - handleVerifyEditorContents(); - // initialDescription = null; - editor.setText(""); - } - /** - * returns the edited Components. - * @return Set of OWLDescriptions - */ - @Override - public Set<OWLDescription> getEditedObjects() { - if (tabbedPane.getSelectedComponent() == classSelectorPanel) { - return new HashSet<OWLDescription>(classSelectorPanel - .getSelectedObjects()); - } else if (tabbedPane.getSelectedComponent() == restrictionCreatorPanel) { - return restrictionCreatorPanel.createRestrictions(); - } else if (tabbedPane.getSelectedComponent() == dllearner) { - return dllearner.getSollutions(); - } - return super.getEditedObjects(); - } - - /** - * Gets the object that has been edited. - * - * @return The edited object - */ - public OWLDescription getEditedObject() { - try { - - if (editor.isWellFormed()) { - OWLDescription owlDescription = editor.createObject(); - OWLExpressionUserCache.getInstance(editorKit.getModelManager()).add(owlDescription, editor.getText()); - return owlDescription; - } - if (!dllearner.getSollutions().isEmpty()) { - return dllearner.getSollution(); - } else { - return null; - } - } catch (OWLException e) { - return null; - } - - } - /** - * Removes everything after protege is closed. - */ - public void dispose() { - if (classSelectorPanel != null) { - classSelectorPanel.dispose(); - } - if (restrictionCreatorPanel != null) { - restrictionCreatorPanel.dispose(); - } - if (dllearner != null) { - dllearner.dispose(); - } - } - - private OWLDataFactory getDataFactory() { - return editorKit.getModelManager().getOWLDataFactory(); - } - /** - * Adds a Status Changed Listener to all components of the - * class description editor. - * @param listener InputVerificationStatusChangedListener - */ - public void addStatusChangedListener( - InputVerificationStatusChangedListener listener) { - listeners.add(listener); - editor.addStatusChangedListener(listener); - listener.verifiedStatusChanged(isValidated()); - } - /** - * Removes the Status Changed Listener from all components of the - * class description editor. - * @param listener InputVerificationStatusChangedListener - */ - public void removeStatusChangedListener( - InputVerificationStatusChangedListener listener) { - listeners.remove(listener); - editor.removeStatusChangedListener(listener); - } - - /** - * This class is responsible for the view of the dllearner. It renders the - * output for the user and is the graphical component of the plugin. - * - * @author Christian Koetteritzsch - * - */ - public class DLLearnerView extends JPanel { - - private static final long serialVersionUID = 624829578325729385L; - private final OWLClassDescriptionEditorWithDLLearnerTab mainWindow; - // this is the Component which shows the view of the dllearner - - private final JComponent learner; - - // Accept button to add the learned concept to the owl - - private final JButton accept; - - // Runbutton to start the learning algorithm - - private final JButton run; - - // This is the label for the advanced button. - - private final JLabel adv; - - // This is the color for the error message. It is red. - - private final Color colorRed = Color.red; - - // This is the text area for the error message when an error occurred - - private final JTextArea errorMessage; - - // Advanced Button to activate/deactivate the example select panel - - private final JToggleButton advanced; - - // Action Handler that manages the Button actions - - private final ActionHandler action; - - // This is the model of the dllearner plugin which includes all data - - private final DLLearnerModel model; - - // Panel for the suggested concepts - - private SuggestClassPanel sugPanel; - - // Selection panel for the positive and negative examples - - private final PosAndNegSelectPanel posPanel; - - // Picture for the advanced button when it is not toggled - - private final ImageIcon icon; - - // Picture of the advanced button when it is toggled - private final JPanel addButtonPanel; - private final JLabel wikiPane; - private final ImageIcon toggledIcon; - private final JTextArea hint; - private boolean isInconsistent; - // This is the Panel for more details of the suggested concept - private MoreDetailForSuggestedConceptsPanel detail; - private final OWLFrame<OWLClass> frame; - private ReadingOntologyThread readThread; - - /** - * The constructor for the DL-Learner tab in the class description - * editor. - * - * @param current OWLFrame - * @param label String - * @param dlLearner OWLClassDescriptionEditorWithDLLearnerTab - */ - public DLLearnerView(OWLFrame<OWLClass> current, String label, OWLClassDescriptionEditorWithDLLearnerTab dlLearner) { - classSelectorPanel = new OWLClassSelectorPanel(editorKit); - mainWindow = dlLearner; - frame = current; - wikiPane = new JLabel("<html>See <a href=\"http://dl-learner.org/wiki/ProtegePlugin\">http://dl-learner.org/wiki/ProtegePlugin</a> for an introduction.</html>"); - classSelectorPanel.firePropertyChange("test", false, true); - URL iconUrl = this.getClass().getResource("arrow.gif"); - icon = new ImageIcon(iconUrl); - URL toggledIconUrl = this.getClass().getResource("arrow2.gif"); - toggledIcon = new ImageIcon(toggledIconUrl); - model = new DLLearnerModel(editorKit, label, this); - sugPanel = new SuggestClassPanel(); - action = new ActionHandler(this.action, model, this, label); - adv = new JLabel("Advanced Settings"); - advanced = new JToggleButton(icon); - advanced.setVisible(true); - run = new JButton(label); - accept = new JButton("ADD"); - addButtonPanel = new JPanel(new BorderLayout()); - sugPanel.addSuggestPanelMouseListener(action); - errorMessage = new JTextArea(); - errorMessage.setEditable(false); - hint = new JTextArea(); - hint.setEditable(false); - hint.setText("To get suggestions for class descriptions, please click the button above."); - learner = new JPanel(); - advanced.setSize(20, 20); - learner.setLayout(null); - learner.setPreferredSize(new Dimension(600, 520)); - accept.setPreferredSize(new Dimension(290, 50)); - advanced.setName("Advanced"); - posPanel = new PosAndNegSelectPanel(model, action); - addAcceptButtonListener(this.action); - addRunButtonListener(this.action); - addAdvancedButtonListener(this.action); - - - } - /** - * This method returns the SuggestClassPanel. - * @return SuggestClassPanel - */ - public SuggestClassPanel getSuggestClassPanel() { - return sugPanel; - } - /** - * This method returns the PosAndNegSelectPanel. - * @return PosAndNegSelectPanel - */ - public PosAndNegSelectPanel getPosAndNegSelectPanel() { - return posPanel; - } - - /** - * Returns the Mainwindow where the Plugin is integratet. - * @return OWLClassDescriptionWithDLLearnerTab MainWindow - */ - /*public OWLClassDescriptionEditorWithDLLearnerTab getMainWindow() { - return mainWindow; - }*/ - /** - * This Method renders the view of the plugin. - */ - public void makeView() { - run.setEnabled(false); - model.clearVector(); - hint.setText("To get suggestions for class descriptions, please click the button above."); - isInconsistent = false; - readThread = new ReadingOntologyThread(editorKit, frame, this, model); - readThread.start(); - //TODO: runbutton wird auf enable gesetzt obwohl keine instanzdaten vorhanden sind. - - hint.setVisible(true); - advanced.setIcon(icon); - accept.setEnabled(false); - action.resetToggled(); - addButtonPanel.add("North", accept); - sugPanel.setSuggestList(model.getSuggestList()); - sugPanel = sugPanel.updateSuggestClassList(); - advanced.setSelected(false); - sugPanel.setBounds(10, 35, 490, 110); - adv.setBounds(40, 200, 200, 20); - wikiPane.setBounds(220, 0, 350, 30); - addButtonPanel.setBounds(510, 40, 80, 110); - run.setBounds(10, 0, 200, 30); - advanced.setBounds(10, 200, 20, 20); - sugPanel.setVisible(true); - posPanel.setVisible(false); - posPanel.setBounds(10, 230, 490, 250); - accept.setBounds(510, 40, 80, 110); - hint.setBounds(10, 150, 490, 35); - errorMessage.setBounds(10, 180, 490, 20); - learner.add(run); - learner.add(wikiPane); - learner.add(adv); - learner.add(advanced); - learner.add(sugPanel); - learner.add(addButtonPanel); - learner.add(hint); - learner.add(errorMessage); - learner.add(posPanel); - detail = new MoreDetailForSuggestedConceptsPanel(model); - add(learner); - - } - /** - * This method sets the right icon for the advanced Panel. - * @param toggled boolean - */ - public void setIconToggled(boolean toggled) { - if (toggled) { - advanced.setIcon(toggledIcon); - } - if (!toggled) { - advanced.setIcon(icon); - } - } - - /** - * This Method changes the hint message. - * @param message String hintmessage - */ - public void setHintMessage(String message) { - hint.setText(message); - } - - /** - * This method returns the hint panel. - * @return hint panel - */ - public JTextArea getHintPanel() { - return hint; - } - - /** - * Sets the panel to select/deselect the examples visible/invisible. - * @param visible boolean - */ - public void setExamplePanelVisible(boolean visible) { - posPanel.setVisible(visible); - } - - - /** - * Returns the AddButton. - * @return JButton - */ - public JButton getAddButton() { - return accept; - } - /** - * This Method updates the the view of protege after - * adding a new concept. - */ - public void updateWindow() { - mainWindow.getHandler().handleEditingFinished(mainWindow.getEditedObjects()); - } - /** - * Returns all added descriptions. - * @return Set(OWLDescription) - */ - public Set<OWLDescription> getSollutions() { - - return model.getNewOWLDescription(); - } - - /** - * Returns the last added description. - * @return OWLDescription - */ - public OWLDescription getSollution() { - return model.getSolution(); - } - - /** - * Destroys everything in the view after the plugin is closed. - */ - public void unsetEverything() { - run.setEnabled(true); - model.unsetNewConcepts(); - action.destroyDLLearnerThread(); - errorMessage.setText(""); - //posPanel.unsetPosAndNegPanel(); - learner.removeAll(); - } - - /** - * Renders the error message when an error occured. - * @param s String - */ - public void renderErrorMessage(String s) { - errorMessage.setForeground(colorRed); - errorMessage.setText(s); - } - /** - * This Method returns the panel for more details for the chosen concept. - * @return MoreDetailForSuggestedConceptsPanel - */ - public MoreDetailForSuggestedConceptsPanel getMoreDetailForSuggestedConceptsPanel() { - return detail; - } - - /** - * This Method returns the run button. - * @return JButton - */ - public JButton getRunButton() { - return run; - } - - /** - * This method sets if ontology is inconsistent or not. - * @param isIncon boolean if ontology is consisten - */ - public void setIsInconsistent(boolean isIncon) { - this.isInconsistent = isIncon; - } - /** - * Destroys the view after the plugin is closed. - */ - public void dispose() { - run.removeActionListener(action); - accept.removeActionListener(action); - advanced.removeActionListener(action); - //posPanel.removeListeners(action); - //posPanel.removeHelpButtonListener(action); - } - - /** - * Adds Actionlistener to the run button. - * @param a ActionListener - */ - public void addRunButtonListener(ActionListener a) { - run.addActionListener(a); - } - - /** - * Adds Actionlistener to the add button. - * @param a ActionListener - */ - public void addAcceptButtonListener(ActionListener a) { - accept.addActionListener(a); - } - - /** - * Adds Actionlistener to the advanced button. - * @param a ActionListener - */ - public void addAdvancedButtonListener(ActionListener a) { - advanced.addActionListener(a); - } - - /** - * This method sets the run button enable after learning. - */ - public void algorithmTerminated() { - String error = "learning succesful"; - String message = ""; - if(isInconsistent) { - message = "Class descriptions marked red will lead to an inconsistent ontology. \nPlease double click on them to view detail information."; - } else { - message = "To view details about why a class description was suggested, please doubleclick on it."; - } - run.setEnabled(true); - // start the algorithm and print the best concept found - renderErrorMessage(error); - setHintMessage(message); - } - - } - /** - * This is the class for the object restriktion creator panel. - * - * - */ - private class ObjectRestrictionCreatorPanel extends JPanel { - - - private static final long serialVersionUID = 1695484991927845068L; - - private final OWLObjectPropertySelectorPanel objectPropertySelectorPanel; - - private final OWLClassSelectorPanel classSelectorPanel; - - private final JSpinner cardinalitySpinner; - - private final JComboBox typeCombo; - - public ObjectRestrictionCreatorPanel() { - objectPropertySelectorPanel = new OWLObjectPropertySelectorPanel( - editorKit); - objectPropertySelectorPanel.setBorder(ComponentFactory - .createTitledBorder("Restricted properties")); - cardinalitySpinner = new JSpinner(new SpinnerNumberModel(1, 0, - Integer.MAX_VALUE, 1)); - JComponent cardinalitySpinnerEditor = cardinalitySpinner - .getEditor(); - Dimension prefSize = cardinalitySpinnerEditor.getPreferredSize(); - cardinalitySpinnerEditor.setPreferredSize(new Dimension(50, - prefSize.height)); - classSelectorPanel = new OWLClassSelectorPanel(editorKit); - classSelectorPanel.setBorder(ComponentFactory - .createTitledBorder("Restriction fillers")); - setLayout(new BorderLayout()); - JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, - false); - splitPane.setResizeWeight(0.5); - splitPane.setLeftComponent(objectPropertySelectorPanel); - splitPane.setRightComponent(classSelectorPanel); - add(splitPane); - splitPane.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - List<RestrictionCreator> types = new ArrayList<RestrictionCreator>(); - types.add(new RestrictionCreator("Some (existential)") { - @Override - public void createRestrictions( - Set<OWLObjectProperty> properties, - Set<OWLDescription> fillers, Set<OWLDescription> result) { - for (OWLObjectProperty prop : properties) { - for (OWLDescription filler : fillers) { - result.add(getDataFactory() - .getOWLObjectSomeRestriction(prop, filler)); - } - } - } - }); - types.add(new RestrictionCreator("Only (universal)") { - @Override - public void createRestrictions( - Set<OWLObjectProperty> properties, - Set<OWLDescription> fillers, Set<OWLDescription> result) { - for (OWLObjectProperty prop : properties) { - if (fillers.isEmpty()) { - return; - } - OWLDescription filler; - if (fillers.size() > 1) { - filler = getDataFactory().getOWLObjectUnionOf( - fillers); - } else { - filler = fillers.iterator().next(); - } - result.add(getDataFactory().getOWLObjectAllRestriction( - prop, filler)); - } - } - }); - types.add(new CardinalityRestrictionCreator( - "Min (min cardinality)", cardinalitySpinner) { - @Override - public OWLDescription createRestriction(OWLObjectProperty prop, - OWLDescription filler, int card) { - return getDataFactory() - .getOWLObjectMinCardinalityRestriction(prop, card, - filler); - } - }); - types.add(new CardinalityRestrictionCreator( - "Exactly (exact cardinality)", cardinalitySpinner) { - @Override - public OWLDescription createRestriction(OWLObjectProperty prop, - OWLDescription filler, int card) { - return getDataFactory() - .getOWLObjectExactCardinalityRestriction(prop, - card, filler); - } - }); - types.add(new CardinalityRestrictionCreator( - "Max (max cardinality)", cardinalitySpinner) { - @Override - public OWLDescription createRestriction(OWLObjectProperty prop, - OWLDescription filler, int card) { - return getDataFactory() - .getOWLObjectMaxCardinalityRestriction(prop, card, - filler); - } - }); - typeCombo = new JComboBox(types.toArray()); - - final JPanel typePanel = new JPanel(); - typePanel.setBorder(ComponentFactory - .createTitledBorder("Restriction type")); - add(typePanel, BorderLayout.SOUTH); - typePanel.add(typeCombo); - typeCombo.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - cardinalitySpinner - .setEnabled(typeCombo.getSelectedItem() instanceof CardinalityRestrictionCreator); - } - }); - JPanel spinnerHolder = new JPanel(new BorderLayout(4, 4)); - spinnerHolder.setBorder(BorderFactory - .createEmptyBorder(0, 10, 0, 0)); - spinnerHolder.add(new JLabel("Cardinality"), BorderLayout.WEST); - spinnerHolder.add(cardinalitySpinner, BorderLayout.EAST); - JPanel spinnerAlignmentPanel = new JPanel(new BorderLayout()); - spinnerAlignmentPanel.add(spinnerHolder, BorderLayout.WEST); - typePanel.add(spinnerAlignmentPanel); - cardinalitySpinner - .setEnabled(typeCombo.getSelectedItem() instanceof CardinalityRestrictionCreator); - } - - public Set<OWLDescription> createRestrictions() { - Set<OWLDescription> result = new HashSet<OWLDescription>(); - RestrictionCreator creator = (RestrictionCreator) typeCombo - .getSelectedItem(); - if (creator == null) { - return Collections.emptySet(); - } - creator.createRestrictions(objectPropertySelectorPanel - .getSelectedObjects(), new HashSet<OWLDescription>( - classSelectorPanel.getSelectedObjects()), result); - return result; - } - - public void dispose() { - objectPropertySelectorPanel.dispose(); - classSelectorPanel.dispose(); - } - } - /** - * This is the abstract class of the restriction creator. - * - * - */ - private abstract class RestrictionCreator { - - private final String name; - - protected RestrictionCreator(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - - abstract void createRestrictions(Set<OWLObjectProperty> properties, - Set<OWLDescription> fillers, Set<OWLDescription> result); - } - /** - * This is the abstract class for the cardinality restriction creator. - * - * - */ - private abstract class CardinalityRestrictionCreator extends - RestrictionCreator { - - private final JSpinner cardinalitySpinner; - - protected CardinalityRestrictionCreator(String name, - JSpinner cardinalitySpinner) { - super(name); - this.cardinalitySpinner = cardinalitySpinner; - } - - @Override - public void createRestrictions(Set<OWLObjectProperty> properties, - Set<OWLDescription> fillers, Set<OWLDescription> result) { - for (OWLObjectProperty prop : properties) { - for (OWLDescription desc : fillers) { - result.add(createRestriction(prop, desc, - (Integer) cardinalitySpinner.getValue())); - } - } - } - - public abstract OWLDescription createRestriction( - OWLObjectProperty prop, OWLDescription filler, int card); - } - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/protege/OWLSubClassAxiomFrameSection.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OWLSubClassAxiomFrameSection.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OWLSubClassAxiomFrameSection.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -1,219 +0,0 @@ -/** - * Copyright (C) 2007-2009, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.dllearner.tools.protege; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.protege.editor.owl.OWLEditorKit; -import org.protege.editor.owl.ui.frame.OWLFrame; -import org.protege.editor.owl.ui.frame.OWLFrameSectionRow; -import org.protege.editor.owl.ui.frame.OWLFrameSectionRowObjectEditor; -import org.protege.editor.owl.ui.frame.OWLSubClassAxiomFrameSectionRow; -import org.protege.editor.owl.ui.frame.cls.AbstractOWLClassAxiomFrameSection; -import org.semanticweb.owl.inference.OWLReasonerException; -import org.semanticweb.owl.model.AddAxiom; -import org.semanticweb.owl.model.OWLAxiom; -import org.semanticweb.owl.model.OWLClass; -import org.semanticweb.owl.model.OWLDescription; -import org.semanticweb.owl.model.OWLObject; -import org.semanticweb.owl.model.OWLObjectProperty; -import org.semanticweb.owl.model.OWLOntology; -import org.semanticweb.owl.model.OWLOntologyChange; -import org.semanticweb.owl.model.OWLSubClassAxiom; - -/** - * Here a only caged in the method getObjectEditor() the call for the - * OWLClassDescriptionEditor to OWLClassDescriptionEditorWithDLLearnerTab. - * @author Matthew Horridge and Christian Koetteritzsch<br> - * The University Of Manchester<br> - * Bio-Health Informatics Group<br> - * Date: 19-Jan-2007<br> - * <br> - */ -public class OWLSubClassAxiomFrameSection extends AbstractOWLClassAxiomFrameSection<OWLSubClassAxiom, OWLDescription> { - - private static final String LABEL = "super classes"; - - private final Set<OWLDescription> added = new HashSet<OWLDescription>(); - private final OWLFrame<OWLClass> frame; - - /** - * Constructor. - * @param editorKit editorKit - * @param frame OWLFrame - */ - public OWLSubClassAxiomFrameSection(OWLEditorKit editorKit, OWLFrame<OWLClass> frame) { - super(editorKit, LABEL, "Superclass", frame); - this.frame = frame; - } - - - @Override - protected void clear() { - added.clear(); - } - - - @Override - protected void addAxiom(OWLSubClassAxiom ax, OWLOntology ont) { - addRow(new OWLSubClassAxiomFrameSectionRow(getOWLEditorKit(), this, ont, getRootObject(), ax)); - added.add(ax.getSuperClass()); - } - - - @Override - protected Set<OWLSubClassAxiom> getClassAxioms(OWLDescription descr, OWLOntology ont) { - if (!descr.isAnonymous()){ - return ont.getSubClassAxiomsForLHS(descr.asOWLClass()); - }else{ - Set<OWLSubClassAxiom> axioms = new HashSet<OWLSubClassAxiom>(); - for (OWLAxiom ax : ont.getGeneralClassAxioms()){ - if (ax instanceof OWLSubClassAxiom && ((OWLSubClassAxiom) ax).getSubClass().equals(descr)){ - axioms.add((OWLSubClassAxiom) ax); - } - } - return axioms; - } - } - - - @Override - protected void refillInferred() { - try { - if (getOWLModelManager().getReasoner().isSatisfiable(getRootObject())) { - - for (Set<OWLClass> descs : getOWLModelManager().getReasoner().getSuperClasses(getRootObject())) { - for (OWLDescription desc : descs) { - if (!added.contains(desc) && !getRootObject().equals(desc)) { - addRow(new OWLSubClassAxiomFrameSectionRow(getOWLEditorKit(), - this, - null, - getRootObject(), - getOWLModelManager().getOWLDataFactory().getOWLSubClassAxiom( - getRootObject(), - desc))); - added.add(desc); - } - } - } - } - }catch (OWLReasonerException e) { - throw new RuntimeException(e); - } - } - - - @Override - protected OWLSubClassAxiom createAxiom(OWLDescription object) { - return getOWLDataFactory().getOWLSubClassAxiom(getRootObject(), object); - } - - - @Override - public OWLFrameSectionRowObjectEditor<OWLDescription> getObjectEditor() { - return new OWLClassDescriptionEditorWithDLLearnerTab(getOWLEditorKit(), null, frame, LABEL); - } - - - @Override - public boolean canAcceptDrop(List<OWLObject> objects) { - for (OWLObject obj : objects) { - if (!(obj instanceof OWLDescription)) { - return false; - } - } - return true; - } - - - private OWLObjectProperty prop; - - - @Override - public boolean dropObjects(List<OWLObject> objects) { - List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); - for (OWLObject obj : objects) { - if (obj instanceof OWLDescription) { - OWLDescription desc; - if (prop != null) { - desc = getOWLDataFactory().getOWLObjectSomeRestriction(prop, (OWLDescription) obj); - }else { - desc = (OWLDescription) obj; - } - OWLAxiom ax = getOWLDataFactory().getOWLSubClassAxiom(getRootObject(), desc); - changes.add(new AddAxiom(getOWLModelManager().getActiveOntology(), ax)); - } else if (obj instanceof OWLObjectProperty) { - // Prime - prop = (OWLObjectProperty) obj; - }else { - return false; - } - } - getOWLModelManager().applyChanges(changes); - return true; - } - - - @Override - public void visit(OWLSubClassAxiom axiom) { - if (axiom.getSubClass().equals(getRootObject())) { - reset(); - } - } - - - /** - * Obtains a comparator which can be used to sort the rows - * in this section. - * @return A comparator if to sort the rows in this section, - * or <code>null</code> if the rows shouldn't be sorted. - */ - public Comparator<OWLFrameSectionRow<OWLDescription, OWLSubClassAxiom, OWLDescription>> getRowComparator() { - return new Comparator<OWLFrameSectionRow<OWLDescription, OWLSubClassAxiom, OWLDescription>>() { - - - public int compare(OWLFrameSectionRow<OWLDescription, OWLSubClassAxiom, OWLDescription> o1, - OWLFrameSectionRow<OWLDescription, OWLSubClassAxiom, OWLDescription> o2) { - if (o1.isInferred()) { - if (!o2.isInferred()) { - return 1; - } - }else { - if (o2.isInferred()) { - return -1; - } - } -// int val = o1.getAxiom().getSuperClass().compareTo(o2.getAxiom().getSuperClass()); - int val = getOWLModelManager().getOWLObjectComparator().compare(o1.getAxiom(), o2.getAxiom()); - - if(val == 0) { - return o1.getOntology().getURI().compareTo(o2.getOntology().getURI()); - }else { - return val; - } - - } - }; - } -} Modified: trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -48,7 +48,7 @@ * @param p * PosAndNegSelectPanel */ -public PosAndNegSelectPanelHandler(DLLearnerModel m, OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView v, PosAndNegSelectPanel p) { +public PosAndNegSelectPanelHandler(DLLearnerModel m, DLLearnerView v, PosAndNegSelectPanel p) { //model = m; //panel = p; //view = v; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -19,63 +19,90 @@ */ package org.dllearner.tools.protege; -import java.awt.BorderLayout; +import java.util.Set; -import javax.swing.JScrollPane; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; -import org.protege.editor.owl.ui.framelist.OWLFrameList2; -import org.protege.editor.owl.ui.view.AbstractOWLClassViewComponent; -import org.semanticweb.owl.model.OWLClass; +import org.protege.editor.core.ui.util.InputVerificationStatusChangedListener; +import org.protege.editor.owl.ui.editor.AbstractOWLDescriptionEditor; +import org.semanticweb.owl.model.OWLDescription; /** - * This is the class that must be implemented to get the plugin integrated - * in protege. + * This is the class that must be implemented to get the plugin integrated in + * protege. + * * @author Christian Koetteritzsch - * + * */ -public class ProtegePlugin extends AbstractOWLClassViewComponent { -private static final long serialVersionUID = 728362819273927L; -/** - * List of the lists for equivalent classes and so on. - */ -private OWLFrameList2<OWLClass> list; +public class ProtegePlugin extends AbstractOWLDescriptionEditor { + private static final long serialVersionUID = 728362819273927L; + private JPanel test; + private SimpleViewTest tes; + + @Override + public JComponent getComponent() { + System.out.println("1"); + // TODO Auto-generated method stub + return test; + } @Override - /** - * This method initializes the view of the plugin. - */ - public void initialiseClassView() throws Exception { - list = new OWLFrameList2<OWLClass>(getOWLEditorKit(), new ButtonList(getOWLEditorKit())); - setLayout(new BorderLayout()); - JScrollPane dlLearner = new JScrollPane(list); - add(dlLearner); - // add file logger (comment out if not needed) - //boolean useAdditionalLogger = true; - //if(useAdditionalLogger) { - // Layout layout = new HTMLLayout(); - // String fileName = "logs/dllearner_log.html"; - // FileAppender fileAppender = new FileAppender(layout, fileName, true); - // only add log statements in protege package to log file - // Logger protegeLogger = Logger.getLogger("org.dllearner.tools.protege"); - // protegeLogger.addAppender(fileAppender); - // protegeLogger.setLevel(Level.DEBUG); - //} + public Set<OWLDescription> getDescriptions() { + System.out.println("2"); + // TODO Auto-generated method stub + return null; } - + @Override - /** - * updates the view if something changes - */ - protected OWLClass updateView(OWLClass selectedClass) { - list.setRootObject(selectedClass); - return selectedClass; - } + public boolean isValidInput() { + System.out.println("3"); + // TODO Auto-generated method stub + return true; + } @Override - /** - * destroys every listener when protege is closed - */ - public void disposeView() { - list.dispose(); - } -} + public boolean setDescription(OWLDescription arg0) { + System.out.println("4"); + // TODO Auto-generated method stub + return true; + } + + @Override + public void initialise() throws Exception { + System.out.println("5"); + tes = new SimpleViewTest(); + this.getOWLEditorKit().getOWLWorkspace().getOWLComponentFactory().getOWLClassDescriptionEditor(null).addPanel(tes); + test = new JPanel(); + test.add(new JLabel("TEST")); + + } + + @Override + public void dispose() throws Exception { + System.out.println("6"); + // TODO Auto-generated method stub + + } + + @Override + public void addStatusChangedListener( + InputVerificationStatusChangedListener arg0) { + System.out.println("7"); + // TODO Auto-generated method stub + + } + + @Override + public void removeStatusChangedListener( + InputVerificationStatusChangedListener arg0) { + System.out.println("8"); + // TODO Auto-generated method stub + + } + + + + +} \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-02-26 16:24:18 UTC (rev 1635) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-02-26 19:03:36 UTC (rev 1636) @@ -35,7 +35,7 @@ import org.semanticweb.owl.model.OWLOntology; /** - * This class reads the ontologie in a seperate thread. + * This class reads the ontologie in a separate thread. * @author Christian Koetteritzsch * */ @@ -50,7 +50,6 @@ private final OWLEditorKit editor; private final DLLearnerModel model; private boolean isInconsistent; - //private final OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view; private final OWLFrame<OWLClass> current; private final DLLearnerView view; @@ -61,15 +60,6 @@ * @param v DL-Learner view * @param m DL-Learner model */ - public ReadingOntologyThread(OWLEditorKit editorKit, OWLFrame<OWLClass> frame, OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView v, DLLearnerModel m) { - ontologieURI = new HashSet<String>(); - this.editor = editorKit; - current = frame; - this.view = null; - this.model = m; - - } - public ReadingOntologyThread(OWLEditorKit editorKit, OWLFrame<OWLClass> frame, DLLearnerView v, DLLearnerModel m) { ontologieURI = new HashSet<String>(); this.editor = editorKit; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |