From: <lor...@us...> - 2009-08-04 20:07:58
|
Revision: 1818 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1818&view=rev Author: lorenz_b Date: 2009-08-04 20:07:44 +0000 (Tue, 04 Aug 2009) Log Message: ----------- refactored package structure, since developing and maintaining became to ineffective Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java trunk/src/dl-learner/org/dllearner/tools/ore/Main.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/ore/SPARQLTest.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomSelector.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/LaconicTest.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionParseTest.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairManagerListener.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/BaseDescriptionGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/Beta.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/BottomTester.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/LaconicExplanationGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/OPlus.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/Tau.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/TopTester.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/relevance/ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/relevance/HittingSet.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/relevance/SyntacticRelevanceBasedExplanationGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/MouseOverHintDemo.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/MouseOverHintManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatusBar.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatusBarSimulator.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatusManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatusManagerListener.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/tools/ore/ChangePanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ChangesPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparql.java trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparqlDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java trunk/src/dl-learner/org/dllearner/tools/ore/ColorListCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionLabel.java trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionMenuItem.java trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationTableModel.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationTablePanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ImpactTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ImpactTableModel.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/IntroductionPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/IntroductionPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanel.java trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/LeftPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/OWLSyntaxTableCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairDialog.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairPlanPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairTable.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairTableModel.java trunk/src/dl-learner/org/dllearner/tools/ore/SavePanel.java trunk/src/dl-learner/org/dllearner/tools/ore/SavePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/UndoLabel.java trunk/src/dl-learner/org/dllearner/tools/ore/UnsatClassesListCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/Wizard.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardModel.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardPanelNotFoundException.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/BaseDescriptionGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Beta.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/BottomTester.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/LaconicExplanationGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/OPlus.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Tau.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/TopTester.java Modified: trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -290,7 +290,7 @@ manager = OWLManager.createOWLOntologyManager(); factory = manager.getOWLDataFactory(); //set classification output to "none", while default is "console" - PelletOptions.USE_CLASSIFICATION_MONITOR = PelletOptions.MonitorType.NONE; + PelletOptions.USE_CLASSIFICATION_MONITOR = PelletOptions.MonitorType.CONSOLE; // change log level to WARN for Pellet, because otherwise log // output will be very large Logger pelletLogger = Logger.getLogger("org.mindswap.pellet"); Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ChangePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ChangePanel.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ChangePanel.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,58 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - - -import java.awt.Color; -import java.awt.event.MouseListener; -import java.util.List; - -import javax.swing.JLabel; -import javax.swing.JPanel; - -import org.semanticweb.owl.model.OWLOntologyChange; -/** - * JPanel where an ontology change and his undo function is listed. - * @author Lorenz Buehmann - * - */ -public class ChangePanel extends JPanel{ - - /** - * - */ - private static final long serialVersionUID = -934113184795465461L; - - /** - * Constructor. - * @param label labelname - * @param changes ontology changes - * @param mL mouse listener - */ - public ChangePanel(String label, List<OWLOntologyChange> changes, MouseListener mL){ - super(); - add(new JLabel(label)); - add(new UndoLabel(changes, mL)); - setBackground(Color.WHITE); - - } - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ChangesPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ChangesPanel.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ChangesPanel.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,62 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import java.awt.Color; -import java.awt.Container; -import java.awt.GridLayout; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.border.BevelBorder; -/** - * JPanel where all ontology changes are shown. - * @author Lorenz Buehmann - * - */ -public class ChangesPanel extends JPanel{ - - private static final long serialVersionUID = -7538532926820669891L; - - /** - * Constructor. - */ - public ChangesPanel(){ - super(); - setLayout(new GridLayout(0, 1)); - setBackground(Color.WHITE); - setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); - - } - - - /** - * Refresh the actual panel. - * @param cont gui container for changes - */ - public void updatePanel(Container cont){ - remove(cont); - SwingUtilities.updateComponentTreeUI(this); - } - - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,170 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.geom.Ellipse2D; -import java.awt.geom.RoundRectangle2D; - -import javax.swing.DefaultListModel; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.event.ListSelectionListener; - -import org.jdesktop.swingx.JXBusyLabel; -import org.jdesktop.swingx.JXList; -import org.jdesktop.swingx.decorator.ColorHighlighter; -import org.jdesktop.swingx.decorator.FilterPipeline; -import org.jdesktop.swingx.decorator.HighlightPredicate; -import org.jdesktop.swingx.decorator.HighlighterFactory; -import org.jdesktop.swingx.decorator.ShuttleSorter; -import org.jdesktop.swingx.icon.EmptyIcon; -import org.jdesktop.swingx.painter.BusyPainter; - -/** - * Wizard panel where atomic classes are shown in list. - * @author Lorenz Buehmann - * - */ -public class ClassPanelOWL extends JPanel{ - - private static final long serialVersionUID = 3026319637264844550L; - - private JXList conceptList; - - private JPanel contentPanel; - - private DefaultListModel model; - private JXBusyLabel loadingLabel; - private JLabel statusLabel; - - /** - * Constructor. - */ - @SuppressWarnings("unchecked") - public ClassPanelOWL() { - - super(); - - model = new DefaultListModel(); - loadingLabel = new JXBusyLabel(new Dimension(15, 15)); - statusLabel = new JLabel(); - - - BusyPainter painter = new BusyPainter( - new RoundRectangle2D.Float(0, 0, 6.0f, 2.6f, 10.0f, 10.0f), - new Ellipse2D.Float(2.0f, 2.0f, 11.0f, 11.0f)); - painter.setTrailLength(2); - painter.setPoints(7); - painter.setFrame(-1); - loadingLabel.setPreferredSize(new Dimension(15, 15)); - loadingLabel.setIcon(new EmptyIcon(15, 15)); - loadingLabel.setBusyPainter(painter); - - - - JPanel labelPanel = new JPanel(); - labelPanel.add(loadingLabel); - labelPanel.add(statusLabel); - - - contentPanel = getContentPanel(); - setLayout(new java.awt.BorderLayout()); - add(contentPanel, BorderLayout.CENTER); - add(labelPanel, BorderLayout.SOUTH); - } - - private JPanel getContentPanel() { - - JPanel contentPanel1 = new JPanel(); - JScrollPane scroll = new JScrollPane(); - - - - conceptList = new JXList(model); - conceptList.setFilterEnabled(true); - conceptList.setFilters(new FilterPipeline(new ShuttleSorter(0, true))); - conceptList.setHighlighters(HighlighterFactory.createSimpleStriping(HighlighterFactory.CLASSIC_LINE_PRINTER)); - conceptList.addHighlighter(new ColorHighlighter( HighlightPredicate.ROLLOVER_ROW)); - conceptList.setRolloverEnabled(true); -// conceptList.setSearchable(new ListsSearchPredicate.MATCH_ALL); -// conceptList.setHighlighters(HighlighterFactory.createAlternateStriping()); - - scroll.setPreferredSize(new Dimension(400, 400)); - scroll.setViewportView(conceptList); - contentPanel1.add(scroll); - - - - return contentPanel1; - } - - /** - * Returns list model for owl-classes. - * @return the list model - */ - public DefaultListModel getModel(){ - return model; - } - - - /** - * Adds list selection listener to atomic classes list. - * @param l the default list selection listener - */ - public void addSelectionListener(ListSelectionListener l){ - conceptList.addListSelectionListener(l); - } - - /** - * Returns the list where atomic owl classes are the list elements. - * @return instance of JList - */ - public JList getList(){ - return conceptList; - } - - /** - * Returns the label which reports the loading status. - * @return instance of JLabel - */ - public JLabel getStatusLabel() { - return statusLabel; - } - - /** - * Returns the animated label for loading action. - * @return instance of JXBusyLabel - */ - public JXBusyLabel getLoadingLabel() { - return loadingLabel; - } - - - - - - - -} \ No newline at end of file Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,114 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import javax.swing.event.ListSelectionEvent; - -import org.dllearner.core.owl.NamedClass; - - - -/** - * Wizard panel descriptor for selecting one of the atomic classes in OWL-ontology that - * has to be (re)learned. - * @author Lorenz Buehmann - * - */ -public class ClassPanelOWLDescriptor extends WizardPanelDescriptor implements javax.swing.event.ListSelectionListener{ - - /** - * Identification string for class choose panel. - */ - public static final String IDENTIFIER = "CLASS_CHOOSE_OWL_PANEL"; - /** - * Information string for class choose panel. - */ - public static final String INFORMATION = "In this panel all atomic classes in the ontology are shown in the list above. " - + "Select one of them which should be (re)learned from, then press \"Next-Button\""; - - private ClassPanelOWL owlClassPanel; - - /** - * Constructor creates new panel and adds listener to list. - */ - public ClassPanelOWLDescriptor() { - owlClassPanel = new ClassPanelOWL(); - owlClassPanel.addSelectionListener(this); - - setPanelDescriptorIdentifier(IDENTIFIER); - setPanelComponent(owlClassPanel); - - } - - @Override - public Object getNextPanelDescriptor() { - return LearningPanelDescriptor.IDENTIFIER; - } - - @Override - public Object getBackPanelDescriptor() { - return KnowledgeSourcePanelDescriptor.IDENTIFIER; - } - - @Override - public void aboutToDisplayPanel() { - getWizard().getInformationField().setText(INFORMATION); - setNextButtonAccordingToConceptSelected(); - } - - /** - * Method is called when other element in list is selected, and sets next button enabled. - * @param e ListSelectionEvent - */ - public void valueChanged(ListSelectionEvent e) { - setNextButtonAccordingToConceptSelected(); - if (!e.getValueIsAdjusting()) { - getWizardModel().getOre().setClassToLearn((NamedClass) owlClassPanel.getList().getSelectedValue()); - } - } - - private void setNextButtonAccordingToConceptSelected() { - - if (owlClassPanel.getList().getSelectedValue()!= null){ - getWizard().setNextFinishButtonEnabled(true); - }else{ - getWizard().setNextFinishButtonEnabled(false); - } - - } - - /** - * Returns the JPanel with the GUI elements. - * @return extended JPanel - */ - public ClassPanelOWL getOwlClassPanel() { - return owlClassPanel; - } - - - - - - - - - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparql.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparql.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparql.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,112 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.geom.Ellipse2D; -import java.awt.geom.RoundRectangle2D; - -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextField; - -import org.jdesktop.swingx.JXBusyLabel; -import org.jdesktop.swingx.icon.EmptyIcon; -import org.jdesktop.swingx.painter.BusyPainter; - -/** - * Wizard Panel for SPARQL-Mode. - * @author Lorenz Buehmann - * - */ -public class ClassPanelSparql extends JPanel{ - - private static final long serialVersionUID = 3026319637264844550L; - - private JTextField classField; - - private JPanel contentPanel; - - private JXBusyLabel loadingLabel; - private JLabel statusLabel; - - @SuppressWarnings("unchecked") - public ClassPanelSparql() { - - super(); - - statusLabel = new JLabel(); - - loadingLabel = new JXBusyLabel(new Dimension(15, 15)); - BusyPainter painter = new BusyPainter( - new RoundRectangle2D.Float(0, 0, 6.0f, 2.6f, 10.0f, 10.0f), - new Ellipse2D.Float(2.0f, 2.0f, 11.0f, 11.0f)); - painter.setTrailLength(2); - painter.setPoints(7); - painter.setFrame(-1); - loadingLabel.setPreferredSize(new Dimension(15, 15)); - loadingLabel.setIcon(new EmptyIcon(15, 15)); - loadingLabel.setBusyPainter(painter); - - - JPanel labelPanel = new JPanel(); - labelPanel.add(loadingLabel); - labelPanel.add(statusLabel); - - contentPanel = getContentPanel(); - setLayout(new java.awt.BorderLayout()); - add(contentPanel, BorderLayout.CENTER); - add(labelPanel, BorderLayout.SOUTH); - } - - private JPanel getContentPanel() { - - JPanel contentPanel = new JPanel(); - - classField = new JTextField(); - - contentPanel.add(classField); - - return contentPanel; - } - - - public JTextField getClassField(){ - return classField; - } - - - public JLabel getStatusLabel() { - return statusLabel; - } - - public JXBusyLabel getLoadingLabel() { - return loadingLabel; - } - - - - - - - -} \ No newline at end of file Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparqlDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparqlDescriptor.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelSparqlDescriptor.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,72 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -/** - * Class for SPARQL-Mode - * @author Lorenz Buehmann - * - */ -public class ClassPanelSparqlDescriptor extends WizardPanelDescriptor{ - - public static final String IDENTIFIER = "CLASS_CHOOSE_SPARQL_PANEL"; - public static final String INFORMATION = "In this panel all atomic classes in the ontology are shown in the list above. " + - "Select one of them which should be (re)learned from then press \"Next-Button\""; - - ClassPanelSparql panel3; - - public ClassPanelSparqlDescriptor() { - panel3 = new ClassPanelSparql(); - - - setPanelDescriptorIdentifier(IDENTIFIER); - setPanelComponent(panel3); - - } - - @Override - public Object getNextPanelDescriptor() { - return LearningPanelDescriptor.IDENTIFIER; - } - - @Override - public Object getBackPanelDescriptor() { - return KnowledgeSourcePanelDescriptor.IDENTIFIER; - } - - @Override - public void aboutToDisplayPanel() { - getWizard().getInformationField().setText(INFORMATION); - - } - - - - - - - - - - - - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,117 +0,0 @@ -package org.dllearner.tools.ore; - -import java.awt.Cursor; -import java.awt.Dimension; - -import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.SwingUtilities; - -import org.mindswap.pellet.utils.progress.ProgressMonitor; - -public class ClassificationProgressMonitor extends JPanel implements ProgressMonitor{ - - /** - * - */ - private static final long serialVersionUID = -4913267621100462227L; - private javax.swing.ProgressMonitor monitor; - private JProgressBar progressBar; - private String progressMessage = ""; - private String progressTitle = ""; - private int progress = 0; - private int progressLength = 0; - private int progressPercent = -1; - private long startTime = -1; - private boolean canceled = false; - - - public ClassificationProgressMonitor(){ - super(); - monitor = new javax.swing.ProgressMonitor(this, progressTitle, progressMessage, 0 ,progressLength); - progressBar = new JProgressBar(0, progressLength); - progressBar.setValue(progress); - progressBar.setStringPainted(true); - add(progressBar); - setSize(new Dimension(200, 200)); - - } - - @Override - public int getProgress() { - return progress; - } - - @Override - public int getProgressPercent() { - return progressPercent; - } - - @Override - public void incrementProgress() { - setProgress(progress + 1); - - } - - @Override - public boolean isCanceled() { - return monitor.isCanceled(); - } - - @Override - public void setProgress(int progress) { - this.progress = progress; - updateProgress(); - - } - - @Override - public void setProgressLength(int length) { - progressLength = length; - monitor.setMaximum(length); - progressBar.setMaximum(length); - - } - - @Override - public void setProgressMessage(String message) { - progressMessage = message; - monitor.setNote(message); - - } - - @Override - public void setProgressTitle(String title) { - progressTitle = title; - - } - - @Override - public void taskFinished() { - monitor.close(); - setCursor(null); - - } - - @Override - public void taskStarted() { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - } - - private void updateProgress(){ - SwingUtilities.invokeLater(new Runnable(){ - - @Override - public void run() { - monitor.setProgress(progress); - progressBar.setValue(progress); - - } - - }); - } - - - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ColorListCellRenderer.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ColorListCellRenderer.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ColorListCellRenderer.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,78 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import java.awt.Color; -import java.awt.Component; - -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.ListCellRenderer; - -import org.dllearner.core.owl.Individual; -import org.dllearner.core.owl.NamedClass; - -/** - * List cell renderer for colored lines to provide better view on list values. - * @author Lorenz Buehmann - * - */ -public class ColorListCellRenderer extends JLabel implements ListCellRenderer { - - private static final long serialVersionUID = -7592805113197759247L; - private ORE ore; - - public ColorListCellRenderer(ORE ore) { - setOpaque(true); - this.ore = ore; - } - - public Component getListCellRendererComponent(JList list, Object value, - int index, boolean isSelected, boolean cellHasFocus) { - - if(value instanceof NamedClass){ - setText(((NamedClass) value).toManchesterSyntaxString(ore.getBaseURI(), ore.getPrefixes())); - } else if(value instanceof Individual){ - setText(((Individual) value).toManchesterSyntaxString(ore.getBaseURI(), ore.getPrefixes())); - } - Color background; - Color foreground; - - if (index % 2 == 0 && !isSelected) { - background = new Color(242, 242, 242); - foreground = Color.BLACK; - - } else if(isSelected){ - - background = Color.LIGHT_GRAY; - foreground = Color.BLACK; - }else{ - background = Color.WHITE; - foreground = Color.BLACK; - } - - setForeground(foreground); - setBackground(background); - - return this; - } - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,93 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import java.awt.Color; -import java.awt.Component; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.math.BigDecimal; - -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.ListCellRenderer; - -import org.dllearner.learningproblems.EvaluatedDescriptionClass; - -/** - * List cell renderer for 2 columns. - * @author Lorenz Buehmann - * - */ -public class ColumnListCellRenderer extends JPanel implements ListCellRenderer { - - private static final long serialVersionUID = 3024913291199515567L; - private ORE ore; - - - public ColumnListCellRenderer(ORE ore) { - this.ore = ore; - setOpaque(true); - } - - public Component getListCellRendererComponent(JList list, Object value, - int index, boolean isSelected, boolean cellHasFocus) { - - removeAll(); - - JLabel cor = new JLabel(); - JLabel desc = new JLabel(); - setLayout(new GridBagLayout()); - desc.setText(((EvaluatedDescriptionClass) value).getDescription().toManchesterSyntaxString(ore.getBaseURI(), ore.getPrefixes())); - //round accuracy to 2 digits - double accuracy = ((EvaluatedDescriptionClass) value).getAccuracy(); - - BigDecimal roundedAccuracy = new BigDecimal(accuracy * 100); - roundedAccuracy = roundedAccuracy.setScale(2, BigDecimal.ROUND_HALF_UP); - cor.setText(String.valueOf(roundedAccuracy)); - add(cor, new GridBagConstraints(0, 0, 1, 1, 0.1, 0.0, GridBagConstraints.LINE_END, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));//, BorderLayout.WEST); - add(desc, new GridBagConstraints(1, 0, 1, 1, 0.8, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));//, BorderLayout.EAST); - - Color background; - Color foreground; - - if (index % 2 == 0 && !isSelected) { - background = new Color(242, 242, 242); - foreground = Color.BLACK; - - } else if(isSelected){ - - background = Color.LIGHT_GRAY; - foreground = Color.WHITE; - }else{ - background = Color.WHITE; - foreground = Color.BLACK; - } - - setForeground(foreground); - setBackground(background); - - return this; - } - -} \ No newline at end of file Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionLabel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionLabel.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionLabel.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,315 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.util.Map; -import java.util.Set; - -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JPopupMenu; -import javax.swing.ToolTipManager; - -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Negation; -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.ObjectCardinalityRestriction; -import org.dllearner.core.owl.ObjectSomeRestriction; -import org.dllearner.core.owl.Thing; - -/** - * Label that might have menu items when clicked on it. - * @author Lorenz Buehmann - * - */ -public class DescriptionLabel extends JLabel implements MouseListener{ - /** - * - */ - private static final long serialVersionUID = 1L; - - private static final int MOVE_TO_CLASS = 0; - private static final int MOVE_FROM_CLASS = 1; - private static final int ADD_CLASS = 2; - private static final int REMOVE_CLASS = 3; - private static final int ADD_PROPERTY = 4; - private static final int REMOVE_RANGE_PROPERTY = 5; - private static final int DELETE_PROPERTY = 6; - private static final int REMOVE_NOT_RANGE_PROPERTY = 7; - - private final Description desc; - private Individual ind; - private ORE ore; - private JPopupMenu menu; - private String mode; - private String descriptionLabel; - - private String baseURI; - private Map<String, String> prefixes; - - /** - * constructor. - * - * @param d - * @param mode - */ - public DescriptionLabel(Description d, String mode) { - super(); - this.desc = d; - this.mode = mode; - setForeground(Color.red); - addMouseListener(this); - - } - - /** - * initialize description label with solution. - */ - public void init(){ - baseURI = ore.getBaseURI(); - prefixes = ore.getPrefixes(); - - setText(((Description) desc).toManchesterSyntaxString(ore.getBaseURI(), ore.getPrefixes())); - menu = new JPopupMenu(); - ToolTipManager.sharedInstance().setDismissDelay(7000); - //negative example solutions - if(mode.equals("neg")){ - if(!(desc instanceof Negation)){ - if(desc instanceof NamedClass){ //1. description is a named class - descriptionLabel = desc.toManchesterSyntaxString(baseURI, prefixes); - menu.add(new DescriptionMenuItem(REMOVE_CLASS, descriptionLabel, desc)); //1.a remove class assertion - - JMenu dme = new JMenu("move class assertion " + descriptionLabel + " to ..."); //1.b move individual - for(NamedClass nc : ore.getpossibleClassesMoveTo(ind)){ - DescriptionMenuItem move = new DescriptionMenuItem(MOVE_TO_CLASS, nc.toManchesterSyntaxString(baseURI, prefixes), (NamedClass) desc); - move.setName(nc.toString()); - dme.add(move); - Set<NamedClass> complements = ore.getComplements(nc, ind); //check for complement error - if(!(complements.isEmpty() || (complements.size() == 1 && complements.toArray()[0].toString().equals(desc.toString())))){ - move.setEnabled(false); - StringBuffer strBuf = new StringBuffer(); - strBuf.append("<html>class assertion not possible because individual<br> " - + "is still asserted to its complements:<br><BLOCKQUOTE>"); - - for(NamedClass n: complements){ - strBuf.append("<br><b>" + n + "</b>"); - } - strBuf.append("</BLOCKQUOTE></html>"); - - - move.setToolTipText(strBuf.toString()); - } - } - menu.add(dme); - } else if(desc instanceof ObjectSomeRestriction){ //2. description is a object some restriction - String propertyName = ((ObjectSomeRestriction) desc).getRole().toString(baseURI, prefixes); - String propertyRange = ((ObjectSomeRestriction) desc).getChild(0).toManchesterSyntaxString(baseURI, prefixes); - menu.add(new DescriptionMenuItem(DELETE_PROPERTY, propertyName , desc)); //2.a remove all property assertions - if (!(desc.getChild(0) instanceof Thing)){ - menu.add(new DescriptionMenuItem(REMOVE_RANGE_PROPERTY, propertyRange, desc)); //2.b remove property assertions with objects in range - } - } else if(desc instanceof ObjectAllRestriction){ //3. description is a object all restriction - if (!(desc.getChild(0) instanceof Thing)) { - JMenu dme = new JMenu("add property assertion " + ((ObjectAllRestriction) desc).getRole().toKBSyntaxString(baseURI, prefixes) //3.a add property assertion with object not in range - + " with object ..."); - for (Individual i : ore.getIndividualsNotInPropertyRange((ObjectAllRestriction) desc, ind)){ - dme.add(new DescriptionMenuItem(ADD_PROPERTY, i.toManchesterSyntaxString(baseURI, prefixes), desc)); - } - menu.add(dme); - } - } - - } else if(desc instanceof Negation){ - if(desc.getChild(0) instanceof NamedClass){ //4. description is a negated named class - DescriptionMenuItem addItem = new DescriptionMenuItem(ADD_CLASS, desc.getChild(0).toManchesterSyntaxString(baseURI, prefixes), desc.getChild(0)); - menu.add(addItem); //4.a add class assertion - Set<NamedClass> complements = ore.getComplements(desc.getChild(0), ind); //check for complement errors - if(!complements.isEmpty()){ - addItem.setEnabled(false); - StringBuffer strBuf = new StringBuffer(); - strBuf.append("<html>class assertion not possible because individual<br> " - + "is still asserted to its complements:<br><BLOCKQUOTE>"); - - for(NamedClass n: complements){ - strBuf.append("<br><b>" + n + "</b>"); - } - strBuf.append("</BLOCKQUOTE></html>"); - - - addItem.setToolTipText(strBuf.toString()); - } - } - } - } else if(mode.equals("pos")){//positive example solutions - if(!(desc instanceof Negation)){ - if(desc instanceof NamedClass){ - DescriptionMenuItem add = new DescriptionMenuItem(ADD_CLASS, desc.toManchesterSyntaxString(baseURI, prefixes), desc); - Set<NamedClass> complements = ore.getComplements(desc, ind); - if(!(complements.isEmpty())){ - add.setEnabled(false); - StringBuffer strBuf = new StringBuffer(); - strBuf.append("<html>class assertion not possible because individual<br> " - + "is still asserted to its complements:<br><BLOCKQUOTE>"); - - for(NamedClass n: complements){ - strBuf.append("<br><b>" + n + "</b>"); - } - strBuf.append("</BLOCKQUOTE></html>"); - - - add.setToolTipText(strBuf.toString()); - } - menu.add(add); - - Set<NamedClass> moveClasses = ore.getpossibleClassesMoveFrom(ind); - if(moveClasses.size() > 0){ - JMenu move = new JMenu("move to " + desc.toManchesterSyntaxString(baseURI, prefixes) + " from ..."); - for (NamedClass m : moveClasses){System.out.println("hier" + m); - DescriptionMenuItem item = new DescriptionMenuItem(MOVE_FROM_CLASS, m.toManchesterSyntaxString(baseURI, prefixes), desc); - item.setName(m.toString()); - move.add(item); - - if(!(complements.isEmpty() || (complements.size() == 1 && complements.toArray()[0].toString().equals(m.toString())))){ - move.setEnabled(false); - StringBuffer strBuf = new StringBuffer(); - strBuf.append("<html>moving class is not possible because individual<br> " - + "is still asserted to its complements:<br><BLOCKQUOTE>"); - - for(NamedClass n: complements){ - strBuf.append("<br><b>" + n + "</b>"); - } - strBuf.append("</BLOCKQUOTE></html>"); - - - move.setToolTipText(strBuf.toString()); - } - } - menu.add(move); - - } - - - } else if(desc instanceof ObjectSomeRestriction){ - JMenu dme = new JMenu("add property assertion " + ((ObjectSomeRestriction) desc).getRole() - + " with object ..."); - for (Individual i : ore.getIndividualsInPropertyRange((ObjectSomeRestriction) desc, ind)){ - dme.add(new DescriptionMenuItem(ADD_PROPERTY, i.toManchesterSyntaxString(baseURI, prefixes), desc)); - } - menu.add(dme); - - } else if(desc instanceof ObjectAllRestriction){ - if (!(desc.getChild(0) instanceof Thing)) { - menu.add(new DescriptionMenuItem(REMOVE_NOT_RANGE_PROPERTY, ((ObjectAllRestriction) desc).getChild(0).toString(baseURI, prefixes), desc)); - menu.add(new DescriptionMenuItem(DELETE_PROPERTY, ((ObjectAllRestriction) desc).getRole().toString(baseURI, prefixes), desc)); - } - } - - - } - - } else if(desc instanceof Negation){ - if(desc.getChild(0) instanceof NamedClass){ - descriptionLabel = desc.toManchesterSyntaxString(baseURI, prefixes); - menu.add(new DescriptionMenuItem(REMOVE_CLASS, descriptionLabel, desc)); - } - } - } - - - /** - * returns actual description. - * @return desc Description - */ - public Description getDescription(){ - return desc; - } - - /** - * adds action listeners to menu items. - * @param aL ActionListener - */ - public void addActionListeners(ActionListener aL){ - for(Component c : menu.getComponents()){ - if(c instanceof DescriptionMenuItem){ - ((DescriptionMenuItem) c).addActionListener(aL); - } else if(c instanceof JMenu){ - for(int i = 0; i < ((JMenu) c).getItemCount(); i++){ - ((JMenu) c).getItem(i).addActionListener(aL); - } - } - - - } - - - } - - public void setIndOre(ORE ore, Individual ind) { - this.ore = ore; - this.ind = ind; - } - - public void mouseClicked(MouseEvent e) { - menu.show(this.getParent(), getLocation().x, getLocation().y + 50); - - } - - /** - * Underlining label when mouse over. - */ - public void mouseEntered(MouseEvent e) { - setText("<html><u>" - + ((Description) desc).toManchesterSyntaxString(ore - .getBaseURI(), ore.getPrefixes()) + "</u></html>"); - setCursor(new Cursor(Cursor.HAND_CURSOR)); - if(desc instanceof ObjectCardinalityRestriction){ - setToolTipText("ObjectCardinality repair not available at present"); - } - - } - - /** - * Removing underlining when mosue relased. - */ - public void mouseExited(MouseEvent e) { - setText(((Description) desc).toManchesterSyntaxString(ore.getBaseURI(), - ore.getPrefixes())); - setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); - } - - public void mousePressed(MouseEvent e) { - // TODO Auto-generated method stub - - } - - public void mouseReleased(MouseEvent e) { - // TODO Auto-generated method stub - - } -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionMenuItem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionMenuItem.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionMenuItem.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,84 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import javax.swing.JMenuItem; - -import org.dllearner.core.owl.Description; - -/** - * Item for possible repair action. - * @author Lorenz Buehmann - * - */ -public class DescriptionMenuItem extends JMenuItem { - - /** - * - */ - private static final long serialVersionUID = 6784086889435854440L; - - private Description desc; - private int action; - - public DescriptionMenuItem(int action, String text, Description d){ - super(); - if(action == 3){ - setText("remove class assertion to " + text); - } else if(action == 0){ - setText(text); - } else if(action == 2){ - setText("add class assertion to " + text); - } else if(action == 4){ - setText(text); - } else if(action == 6){ - setText("delete complete property " + text); - }else if(action == 5){ - setText("remove all property assertions to " + text); - } else if(action == 7){ - setText("remove all property assertions with range not in " + text); - } else if(action == 1){ - setText(text); - } - - this.desc = d; - this.action = action; - } - - /** - * Returns the description part where item is asserted to. - * @return description - */ - public Description getDescription(){ - return desc; - } - - /** - * Returns action type represented as number.. - * @return number - */ - public int getActionID(){ - return action; - } - - - -} Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,136 +0,0 @@ -/** - * Copyright (C) 2007-2008, 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.ore; - -import java.awt.Color; -import java.awt.Component; -import java.awt.event.ActionListener; - -import javax.swing.BorderFactory; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.border.BevelBorder; - -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; - -/** - * Panel where learned class description is shown, and parts that might occur errors are red colored. - * @author Lorenz Buehmann - * - */ -public class DescriptionPanel extends JPanel{ - - /** - * - */ - private static final long serialVersionUID = -3684937339236885595L; - - private ORE ore; - private Individual ind; - private ActionListener aL; - private String mode; - private boolean correct = false; - private Description newClassDescription; - - public DescriptionPanel(ORE ore, Individual ind, ActionListener aL, String mode){ - super(); - setBackground(Color.WHITE); - setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); - this.ore = ore; - this.newClassDescription = ore.getNewClassDescription().getDescription(); - this.ind = ind; - this.aL = aL; - this.mode = mode; - if(mode.equals("neg")){ - for(JLabel jL : ore.descriptionToJLabelNeg(ind, newClassDescription)){ - add(jL); - if(jL instanceof DescriptionLabel){ - - ((DescriptionLabel) jL).setIndOre(ore, ind); - ((DescriptionLabel) jL).init(); - ((DescriptionLabel) jL).addActionListeners(aL); - - } - - } - } else if(mode.equals("pos")){ - for(JLabel jL : ore.descriptionToJLabelPos(ind, newClassDescription)){ - add(jL); - if(jL instanceof DescriptionLabel){ - - ((DescriptionLabel) jL).setIndOre(ore, ind); - ((DescriptionLabel) jL).init(); - ((DescriptionLabel) jL).addActionListeners(aL); - - } - - } - } - } - - /** - * Updates the panel. - */ - public void updatePanel(){ - for(Component c : getComponents()){ - if(c instanceof JLabel){ - remove(c); - } - } -// ore.updateReasoner(); - correct = true; - if (mode.equals("neg")) { - for (JLabel jL : ore.descriptionToJLabelNeg(ind, newClassDescription)) { - add(jL); - if (jL instanceof DescriptionLabel) { - ((DescriptionLabel) jL).setIndOre(ore, ind); - ((DescriptionLabel) jL).init(); - ((DescriptionLabel) jL).addActionListeners(aL); - correct = false; - - } - } - } else if(mode.equals("pos")){ - for (JLabel jL : ore.descriptionToJLabelPos(ind, newClassDescription)) { - add(jL); - if (jL instanceof DescriptionLabel) { - ((DescriptionLabel) jL).setIndOre(ore, ind); - ((DescriptionLabel) jL).init(); - ((DescriptionLabel) jL).addActionListeners(aL); - correct = false; - - } - } - } - SwingUtilities.updateComponentTreeUI(this); - - - } - /** - * Checks whether description is covered by positive example, or not covered by negative example. - * @return true if description is covered by positive example, or not covered by negative example, otherwise false is returned - */ - public boolean isCorrect(){ - return correct; - } -} \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionParseTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionParseTest.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionParseTest.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -0,0 +1,59 @@ +package org.dllearner.tools.ore; + +import java.io.StringWriter; +import java.net.URI; +import java.util.Collections; +import java.util.Set; + +import org.coode.manchesterowlsyntax.ManchesterOWLSyntaxClassFrameParser; +import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.expression.ParserException; +import org.semanticweb.owl.expression.ShortFormEntityChecker; +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLDataFactory; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLOntologyChangeException; +import org.semanticweb.owl.model.OWLOntologyCreationException; +import org.semanticweb.owl.model.OWLOntologyManager; +import org.semanticweb.owl.util.BidirectionalShortFormProviderAdapter; +import org.semanticweb.owl.util.SimpleShortFormProvider; + +import com.clarkparsia.explanation.io.manchester.BlockWriter; +import com.clarkparsia.explanation.io.manchester.ManchesterSyntaxObjectRenderer; +import com.clarkparsia.explanation.io.manchester.TextBlockWriter; + +public class DescriptionParseTest { + + public static void main(String[] args) throws OWLOntologyChangeException, OWLOntologyCreationException, ParserException { + + System.out.println(System.getProperty("os.name")); + System.out.println(System.getProperty("os.version")); + System.out.println(System.getProperty("os.arch")); + + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + OWLDataFactory factory = manager.getOWLDataFactory(); + + OWLClass class1 = factory.getOWLClass(URI.create("Class1")); + OWLClass class2 = factory.getOWLClass(URI.create("Class2")); + OWLAxiom axiom = factory.getOWLSubClassAxiom(class1, class2); + OWLOntology ontology = manager.createOntology(Collections.singleton(axiom)); + + //rendering + StringWriter buffer = new StringWriter(); + BlockWriter writer = new TextBlockWriter(buffer); + ManchesterSyntaxObjectRenderer renderer = new ManchesterSyntaxObjectRenderer(writer); + axiom.accept(renderer); + String manSyntaxString = buffer.toString(); + System.out.println(manSyntaxString); + + //parsing + ManchesterOWLSyntaxClassFrameParser parser = new ManchesterOWLSyntaxClassFrameParser( + manager.getOWLDataFactory(), new ShortFormEntityChecker( + new BidirectionalShortFormProviderAdapter(manager, Collections + .singleton(ontology), new SimpleShortFormProvider()))); + Set<OWLAxiom> axioms = parser.parse(manSyntaxString); + + System.out.println(axioms); + } +} Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -1,7 +1,6 @@ package org.dllearner.tools.ore; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -9,8 +8,8 @@ import java.util.Set; import org.dllearner.tools.ore.explanation.ExplanationException; -import org.dllearner.tools.ore.explanation.LaconicExplanationGenerator; import org.dllearner.tools.ore.explanation.RootFinder; +import org.dllearner.tools.ore.explanation.laconic.LaconicExplanationGenerator; import org.mindswap.pellet.owlapi.PelletReasonerFactory; import org.mindswap.pellet.owlapi.Reasoner; import org.semanticweb.owl.model.OWLAxiom; @@ -29,7 +28,7 @@ import com.clarkparsia.explanation.PelletExplanation; -public class ExplanationManager implements OWLOntologyChangeListener, ImpactManagerListener{ +public class ExplanationManager implements OWLOntologyChangeListener, RepairManagerListener{ private static ExplanationManager instance; @@ -61,7 +60,7 @@ manager.addOntologyChangeListener(this); // manager.addOntologyChangeListener(reasoner); dataFactory = manager.getOWLDataFactory(); - ImpactManager.getImpactManager(reasoner).addListener(this); + RepairManager.getRepairManager(reasoner).addListener(this); reasonerFactory = new PelletReasonerFactory(); rootFinder = new RootFinder(manager, reasoner, reasonerFactory); @@ -270,11 +269,6 @@ } - @Override - public void axiomForImpactChanged() { - // TODO Auto-generated method stub - - } @Override public void repairPlanExecuted() { @@ -286,6 +280,12 @@ regularExplanationCache.clear(); laconicExplanationCache.clear(); } + + @Override + public void repairPlanChanged() { + // TODO Auto-generated method stub + + } } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-08-04 20:02:34 UTC (rev 1817) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-08-04 20:07:44 UTC (rev 1818) @@ -30,6 +30,12 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import org.dllearner.tools.ore.ui.ClassificationProgressMonitor; +import org.dllearner.tools.ore.ui.ExplanationTable; +import org.dllearner.tools.ore.ui.ImpactTable; +import org.dllearner.tools.ore.ui.UnsatClassesListCellRenderer; +import org.dllearner.tools.ore.ui.wizard.panels.ExplanationTablePanel; +import org.dllearner.tools.ore.ui.wizard.panels.RepairPlanPanel; import org.jdesktop.swingx.JXList; import org.mindswap.pellet.PelletOptions; import org.mindswap.pellet.owlapi.PelletReasonerFactory; @@ -61,7 +67,7 @@ private ExplanationManager expManager; private ImpactManager impManager; - + private RepairManager repManager; private OWLClass unsatClass; @@ -70,11 +76,12 @@ */ private static final long serialVersionUID = 2213073383532597460L; - public ExplanationPanel(ExplanationManager expMan, ImpactManager impMan) { + public ExplanationPanel(ExplanationManager expMan, ImpactManager impMan, RepairManager repMan) { this.expManager = expMan; this.impManager = impMan; + this.repManager = repMan; impManager.addListener(this); setLayout(new BorderLayout()); @@ -141,7 +148,7 @@ impactPanel.add(impScr); impRepSplit.setRightComponent(impactPanel); - RepairPlanPanel repairPanel = new RepairPlanPanel(impManager); + RepairPlanPanel repairPanel = new RepairPlanPanel(repManager); impRepSplit.setLeftComponent(repairPanel); @@ -185,7 +192,7 @@ // t.add(r.render(ax)); // model.addColumn("axiom", t); - ExplanationTable expTable = new ExplanationTable(explanation, impManager, expManager, unsatClass); + ExplanationTable expTable = new ExplanationTable(explanation, repManager, impManager, expManager, unsatClass); explanationsPanel.add(new ExplanationTablePanel(expTable, number)); } @@ -340,8 +347,9 @@ .getExplanationManager(reasoner); Impact... [truncated message content] |