From: <ton...@us...> - 2008-01-28 22:16:28
|
Revision: 444 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=444&view=rev Author: tonytacker Date: 2008-01-28 14:16:24 -0800 (Mon, 28 Jan 2008) Log Message: ----------- changed copyright, add check for init in KnowledgeSourcePanel, switched option and init-button in LearningAlgorithmPanel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/Config.java trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java trunk/src/dl-learner/org/dllearner/gui/OutputPanel.java trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/WidgetPanelDefault.java trunk/src/dl-learner/org/dllearner/gui/WidgetPanelInteger.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java Deleted: trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,60 +0,0 @@ -/** - * Copyright (C) 2007, 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.gui; - -import java.util.List; - -import org.dllearner.core.ComponentManager; -import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.config.ConfigEntry; -import org.dllearner.core.config.InvalidConfigOptionValueException; -import org.dllearner.core.config.StringConfigOption; -import org.dllearner.kb.OWLFile; - -/** - * @author Jens Lehmann - * - */ -public class ComponentRetrievalTest { - - /** - * @param args - */ - public static void main(String[] args) { - // example 1: getting all components of a given type - ComponentManager cm = ComponentManager.getInstance(); - List<Class<? extends KnowledgeSource>> sources = cm.getKnowledgeSources(); - cm.knowledgeSource(sources.get(0)); - System.out.println(sources.get(1).toString()); - - // example 2: setting a config value using a ConfigEntry object - KnowledgeSource owlFile = cm.knowledgeSource(OWLFile.class); - StringConfigOption urlOption = (StringConfigOption) cm.getConfigOption(OWLFile.class, "url"); - ConfigEntry<String> urlEntry; - try { - urlEntry = new ConfigEntry<String>(urlOption, "http://example.com"); - cm.applyConfigEntry(owlFile, urlEntry); - } catch (InvalidConfigOptionValueException e) { - e.printStackTrace(); - } - - } - -} Modified: trunk/src/dl-learner/org/dllearner/gui/Config.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -21,8 +21,8 @@ */ import java.util.HashSet; +import java.util.List; import java.util.Set; -//import java.io.File; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; @@ -30,7 +30,9 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningService; +import org.dllearner.core.config.ConfigOption; + /** * config * @@ -51,6 +53,8 @@ private LearningProblem lp; private LearningAlgorithm la; + private List<ConfigOption<?>> optionLearningAlgorithm ; + /** * status should show witch variables are set * status[0] ... cm Modified: trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -41,7 +41,6 @@ * @author Tilo Hielscher * */ - public class KnowledgeSourcePanel extends JPanel implements ActionListener { private static final long serialVersionUID = -7678275020058043937L; @@ -129,24 +128,24 @@ } public void actionPerformed(ActionEvent e) { - // read selected KnowledgeSourceClass - choosenClassIndex = cb.getSelectedIndex(); - checkIfSparql(); + // read selected KnowledgeSourceClass + choosenClassIndex = cb.getSelectedIndex(); + checkIfSparql(); - // open File - if (e.getSource() == openButton) { - int returnVal = fc.showOpenDialog(KnowledgeSourcePanel.this); - if (returnVal == JFileChooser.APPROVE_OPTION) { - String URI = "file://"; - URI = URI.concat(fc.getSelectedFile().toString()); // make "file://" before local URI - config.setURI(URI); //save variable - fileDisplay.setText(URI); - } - return; + // open File + if (e.getSource() == openButton) { + int returnVal = fc.showOpenDialog(KnowledgeSourcePanel.this); + if (returnVal == JFileChooser.APPROVE_OPTION) { + String URI = "file://"; + URI = URI.concat(fc.getSelectedFile().toString()); // make "file://" before local URI + config.setURI(URI); //save variable + fileDisplay.setText(URI); } + return; + } // init - if (e.getSource() == initButton) { + if (e.getSource() == initButton && config.getStatus(2)) { config.setKnowledgeSource(config.getComponentManager().knowledgeSource(sources.get(choosenClassIndex))); config.getComponentManager().applyConfigEntry(config.getKnowledgeSource(), "url", config.getURI()); config.getKnowledgeSource().init(); Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ - import javax.swing.*; import java.awt.BorderLayout; @@ -29,15 +28,12 @@ import org.dllearner.core.LearningAlgorithm; - - /** * LearningAlgorithmPanel * * @author Tilo Hielscher * */ - public class LearningAlgorithmPanel extends JPanel implements ActionListener { private static final long serialVersionUID = 8721490771860452959L; @@ -50,9 +46,8 @@ private String[] cbItems = {}; private JComboBox cb = new JComboBox(cbItems); private int choosenClassIndex; + - - LearningAlgorithmPanel(Config config) { super(new BorderLayout()); @@ -68,8 +63,6 @@ // add into comboBox learners = config.getComponentManager().getLearningAlgorithms(); for (int i=0; i<learners.size(); i++) { - //cb.addItem(learners.get(i).getSimpleName()); - //System.out.println(learners.get(i).getSimpleName()); cb.addItem(config.getComponentManager().getComponentName(learners.get(i))); } @@ -80,8 +73,9 @@ add(choosePanel, BorderLayout.PAGE_START); - add(optionPanel, BorderLayout.CENTER); - add(initPanel, BorderLayout.PAGE_END); + add(initPanel, BorderLayout.CENTER); + add(optionPanel, BorderLayout.PAGE_END); + } Modified: trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/OptionPanel.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -72,6 +72,9 @@ add(centerScroller, BorderLayout.CENTER); showWidgets(); + + System.out.println("AAA: " + ComponentManager.getConfigOptions(componentOption)); + } public void setComponent (Component component) { Modified: trunk/src/dl-learner/org/dllearner/gui/OutputPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/OutputPanel.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/OutputPanel.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -34,7 +34,6 @@ * @author Tilo Hielscher * */ - public class OutputPanel extends JPanel implements ActionListener { private static final long serialVersionUID = 1643304576470046636L; Modified: trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/gui/StartGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/gui/WidgetPanelDefault.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/WidgetPanelDefault.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/WidgetPanelDefault.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * Modified: trunk/src/dl-learner/org/dllearner/gui/WidgetPanelInteger.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/WidgetPanelInteger.java 2008-01-28 19:15:03 UTC (rev 443) +++ trunk/src/dl-learner/org/dllearner/gui/WidgetPanelInteger.java 2008-01-28 22:16:24 UTC (rev 444) @@ -1,7 +1,7 @@ package org.dllearner.gui; /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -140,7 +140,7 @@ try { ConfigEntry<Integer> specialEntry = new ConfigEntry<Integer>(specialOption, value); //System.out.println("set Integer specialEntry: " + specialEntry); - //System.out.println("set Integer component: " + component); + System.out.println("set Integer component: " + component); //System.out.println("set Integer componentOption: " + componentOption); //System.out.println("set Integer config.getComponentManager().getConfigOptionValue(component, name): " + config.getComponentManager().getConfigOptionValue(component, name)); config.getComponentManager().applyConfigEntry(component, specialEntry); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |