From: <ton...@us...> - 2008-02-21 16:21:16
|
Revision: 619 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=619&view=rev Author: tonytacker Date: 2008-02-21 08:21:05 -0800 (Thu, 21 Feb 2008) Log Message: ----------- fixed bug on loading *.kb file Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/Config.java trunk/src/dl-learner/org/dllearner/gui/ConfigLoad.java trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java Modified: trunk/src/dl-learner/org/dllearner/gui/Config.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-02-21 15:42:21 UTC (rev 618) +++ trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-02-21 16:21:05 UTC (rev 619) @@ -64,9 +64,8 @@ * @return true, if url was set otherwise false */ public Boolean isSetURL() { - // return this.isURL; - // String value = (String) cm.getConfigOptionValue(source, "url"); - if (cm.getConfigOptionValue(source, "url") != null) + if (cm.getConfigOptionValue(source, "url") != null + || cm.getConfigOptionValue(source, "filename") != null) return true; else return false; Modified: trunk/src/dl-learner/org/dllearner/gui/ConfigLoad.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ConfigLoad.java 2008-02-21 15:42:21 UTC (rev 618) +++ trunk/src/dl-learner/org/dllearner/gui/ConfigLoad.java 2008-02-21 16:21:05 UTC (rev 619) @@ -94,12 +94,11 @@ componentOption = SparqlKnowledgeSource.class; } } - // check if class was set + // check if class was set and set knwoledgeSource if (componentOption != null) config.setKnowledgeSource(config.getComponentManager().knowledgeSource( componentOption)); // set url - // value = parser.getFunctionCalls().get("import").get(0).get(0); value = makeURL(value); Component component = config.getKnowledgeSource(); StringConfigOption specialOption = (StringConfigOption) config.getComponentManager() @@ -111,6 +110,9 @@ } catch (InvalidConfigOptionValueException s) { s.printStackTrace(); } + // widgets + + // startGUI.updateTabColors(); // init if (config.getKnowledgeSource() != null && config.isSetURL()) { Modified: trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-21 15:42:21 UTC (rev 618) +++ trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-21 16:21:05 UTC (rev 619) @@ -61,8 +61,6 @@ this.startGUI = startGUI; sources = config.getComponentManager().getKnowledgeSources(); - System.out.println("SOURCES: " + sources); - setButton = new JButton("Set"); setButton.addActionListener(this); initButton = new JButton("Init KnowledgeSource"); @@ -87,7 +85,7 @@ add(optionPanel, BorderLayout.CENTER); add(initPanel, BorderLayout.PAGE_END); - // setSource(); + setSource(); updateAll(); } @@ -112,17 +110,8 @@ * after this, you can change widgets */ public void setSource() { - System.out.println("cm: " + config.getComponentManager()); - System.out.println("setSOURCE :" + sources.get(choosenClassIndex)); - config.setKnowledgeSource(config.getComponentManager().knowledgeSource( sources.get(choosenClassIndex))); - // KBFile.class doesn't work - // config.setKnowledgeSource(config.getComponentManager().knowledgeSource(KBFile.class)); - - System.out.println("KNOWLEDGE_SOURCE: " + config.getKnowledgeSource()); - System.out.println("ABC: " + config.getComponentManager().getComponentName(sources.get(0))); - config.setInitKnowledgeSource(false); updateAll(); } @@ -131,8 +120,6 @@ * after this, next tab can be used */ public void init() { - System.out.println("KNOWLEDGE_SOURCE: " + config.getKnowledgeSource()); - System.out.println("isSetURL: " + config.isSetURL()); if (config.getKnowledgeSource() != null && config.isSetURL()) { try { config.getKnowledgeSource().init(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |