From: <jen...@us...> - 2008-09-08 15:43:43
|
Revision: 1177 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1177&view=rev Author: jenslehmann Date: 2008-09-08 15:43:39 +0000 (Mon, 08 Sep 2008) Log Message: ----------- more GUI errors fixed Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/AbstractWidgetPanel.java 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 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/ReasonerPanel.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java trunk/src/dl-learner/org/dllearner/gui/WidgetPanelStringSet.java Modified: trunk/src/dl-learner/org/dllearner/gui/AbstractWidgetPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/AbstractWidgetPanel.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/AbstractWidgetPanel.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -23,7 +23,9 @@ import javax.swing.JPanel; import org.dllearner.core.Component; +import org.dllearner.core.config.ConfigEntry; import org.dllearner.core.config.ConfigOption; +import org.dllearner.core.config.InvalidConfigOptionValueException; /** * Abstract superclass of all widgets. Each widget has an associated component and configuration option, @@ -65,9 +67,16 @@ // subclasses should call this method if a configuration option has changed public void fireValueChanged(T value) { - // TODO notify config that an option has changed - // (component manager should be accessed in config only, such that we can intelligently decide which - // panels to initialise) + ConfigEntry<T> entry = null; + try { + entry = new ConfigEntry<T>(configOption, value); + } catch (InvalidConfigOptionValueException e) { + // TODO display a message on the status bar (where the init + // has been before) + e.printStackTrace(); + } + // notify config that a value has changed -> it decides what to do + config.applyConfigEntry(component, entry); } // subclasses should use this method to build the graphical representation of the widgets Modified: trunk/src/dl-learner/org/dllearner/gui/Config.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -21,6 +21,7 @@ package org.dllearner.gui; import org.dllearner.core.Component; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningProblem; @@ -38,6 +39,7 @@ * Reasoner, ReasoningService, LearningProblem, LearningAlgorithm; also inits of * these components. * + * @author Jens Lehmann * @author Tilo Hielscher */ public class Config { @@ -51,15 +53,26 @@ private LearningProblem lp; private LearningAlgorithm la; - private boolean[] isInit = new boolean[4]; - // stores whether a component needs to be initialised ("previous" components have changed configuration values) -// private boolean[] needsInit = new boolean[4]; + // stores which components need to be initialised (either + // because they have not been initialiased or previous components + // have changed configuration options, which require initialisation) + private boolean[] needsInit = new boolean[4]; // learning algorithm status - private Boolean threadIsRunning = false; + private boolean threadIsRunning = false; private Long algorithmRunStartTime = null; private Long algorithmRunStopTime = null; + private StartGUI gui; + + public Config(StartGUI gui) { + this.gui = gui; + // none of the components is initialised + for(int i=0; i<4; i++) { + needsInit[i] = true; + } + } + /** * Get ComponentManager. * @@ -74,7 +87,7 @@ * * @return true, if url was set otherwise false */ - public Boolean isSetURL() { + public boolean isSetURL() { if (cm.getConfigOptionValue(source, "url") != null || cm.getConfigOptionValue(source, "filename") != null) return true; @@ -97,7 +110,7 @@ * @return KnowledgeSource */ public KnowledgeSource getKnowledgeSource() { - return this.source; + return source; } /** @@ -199,78 +212,82 @@ return la; } + public boolean tabNeedsInit(int tabIndex) { + return needsInit[tabIndex]; + } + /** * KnowledgeSource.init has run? * * @return true, if init was made, false if not */ - public boolean isInitKnowledgeSource() { - return isInit[0]; + public boolean needsInitKnowledgeSource() { + return needsInit[0]; } /** * Set true if you run KnowwledgeSource.init. The inits from other tabs * behind will automatic set to false. */ - public void setInitKnowledgeSource(Boolean is) { - isInit[0] = is; - for (int i = 1; i < 4; i++) - isInit[i] = false; - } +// public void setInitKnowledgeSource(Boolean is) { +// needsInit[0] = is; +// for (int i = 1; i < 4; i++) +// needsInit[i] = false; +// } /** * Reasoner.init has run? * * @return true, if init was made, false if not */ - public boolean isInitReasoner() { - return isInit[1]; + public boolean needsInitReasoner() { + return needsInit[1]; } /** * Set true if you run Reasoner.init. The inits from other tabs behind will * automatic set to false. */ - public void setInitReasoner(Boolean is) { - isInit[1] = is; - for (int i = 2; i < 4; i++) - isInit[i] = false; - } +// public void setInitReasoner(Boolean is) { +// needsInit[1] = is; +// for (int i = 2; i < 4; i++) +// needsInit[i] = false; +// } /** * LearningProblem.init has run? * * @return true, if init was made, false if not */ - public boolean isInitLearningProblem() { - return isInit[2]; + public boolean needsInitLearningProblem() { + return needsInit[2]; } /** * Set true if you run LearningProblem.init. The inits from other tabs * behind will automatic set to false. */ - public void setInitLearningProblem(Boolean is) { - isInit[2] = is; - for (int i = 3; i < 4; i++) - isInit[i] = false; - } +// public void setInitLearningProblem(Boolean is) { +// needsInit[2] = is; +// for (int i = 3; i < 4; i++) +// needsInit[i] = false; +// } /** * LearningAlgorithm.init() has run? * * @return true, if init was made, false if not */ - public boolean isInitLearningAlgorithm() { - return isInit[3]; + public boolean needsInitLearningAlgorithm() { + return needsInit[3]; } /** * set true if you run LearningAlgorithm.init */ - public void setInitLearningAlgorithm(Boolean is) { - isInit[3] = is; - } +// public void setInitLearningAlgorithm(Boolean is) { +// needsInit[3] = is; +// } /** * Set true if you start the algorithm. @@ -333,19 +350,56 @@ rs = null; lp = null; la = null; - isInit = new boolean[4]; + needsInit = new boolean[4]; threadIsRunning = false; algorithmRunStartTime = null; algorithmRunStopTime = null; } + // init the specified component and record which ones where initialised + public void init(int tabIndex) { + try { + if(tabIndex==0) { + source.init(); + } else if(tabIndex==1) { + reasoner.init(); + } else if(tabIndex==2) { + lp.init(); + } else if(tabIndex == 3) { + la.init(); + } + } catch (ComponentInitException e) { + // TODO display message in status bar + e.printStackTrace(); + } + + needsInit[tabIndex] = false; + System.out.println("component " + tabIndex + " initialised."); + } + // applies a configuration option - used as delegate method, which invalidates components public <T> void applyConfigEntry(Component component, ConfigEntry<T> entry) { cm.applyConfigEntry(component, entry); // invalidate components + if(component instanceof KnowledgeSource) { + needsInit[0] = true; + needsInit[1] = true; + needsInit[2] = true; + needsInit[3] = true; + } else if(component instanceof ReasonerComponent) { + needsInit[1] = true; + needsInit[2] = true; + needsInit[3] = true; + } else if(component instanceof LearningProblem) { + needsInit[2] = true; + needsInit[3] = true; + } else if(component instanceof LearningAlgorithm) { + needsInit[3] = true; + } + gui.updateTabColors(); } - // delegate method for getting + // delegate method for getting config option values public <T> T getConfigOptionValue(Component component, ConfigOption<T> option) { return cm.getConfigOptionValue(component, option); } Modified: trunk/src/dl-learner/org/dllearner/gui/ConfigLoad.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ConfigLoad.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/ConfigLoad.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -99,7 +99,7 @@ if (config.getKnowledgeSource() != null && config.isSetURL()) { try { config.getKnowledgeSource().init(); - config.setInitKnowledgeSource(true); +// config.setInitKnowledgeSource(true); System.out.println("init KnowledgeSource"); } catch (ComponentInitException e) { e.printStackTrace(); @@ -121,7 +121,7 @@ config.setReasoningService(config.getComponentManager().reasoningService( config.getReasoner())); System.out.println("init ReasoningService"); - config.setInitReasoner(true); +// config.setInitReasoner(true); startGUI.updateTabColors(); } catch (ComponentInitException e) { e.printStackTrace(); @@ -144,7 +144,7 @@ if (config.getReasoner() != null && config.getLearningProblem() != null) { try { config.getLearningProblem().init(); - config.setInitLearningProblem(true); +// config.setInitLearningProblem(true); System.out.println("init LearningProblem"); startGUI.updateTabColors(); } catch (ComponentInitException e) { @@ -168,7 +168,7 @@ if (config.getLearningProblem() != null) { try { config.getLearningAlgorithm().init(); - config.setInitLearningAlgorithm(true); +// config.setInitLearningAlgorithm(true); System.out.println("init LearningAlgorithm"); startGUI.updateTabColors(); } catch (ComponentInitException e) { Modified: trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -125,7 +125,7 @@ public void setSource() { config.setKnowledgeSource(config.getComponentManager().knowledgeSource( selectableSources.get(choosenClassIndex))); - config.setInitKnowledgeSource(false); +// config.setInitKnowledgeSource(false); updateAll(); } @@ -137,7 +137,7 @@ if (config.getKnowledgeSource() != null && config.isSetURL()) { try { config.getKnowledgeSource().init(); - config.setInitKnowledgeSource(true); +// config.setInitKnowledgeSource(true); System.out.println("init KnowledgeSource"); startGUI.updateTabColors(); } catch (ComponentInitException e) { @@ -179,7 +179,7 @@ * make init-button red if you have to click */ public void updateInitButtonColor() { - if (!config.isInitKnowledgeSource()) { + if (!config.needsInitKnowledgeSource()) { initButton.setForeground(Color.RED); } else initButton.setForeground(Color.BLACK); Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -106,15 +106,15 @@ // read selected Class if (choosenClassIndex != cb.getSelectedIndex()) { choosenClassIndex = cb.getSelectedIndex(); - config.setInitLearningAlgorithm(false); - init(); +// config.setInitLearningAlgorithm(false); +// init(); } if (e.getSource() == autoInitButton) setLearningAlgorithm(); - if (e.getSource() == initButton) - init(); +// if (e.getSource() == initButton) +// init(); } /** @@ -136,6 +136,7 @@ /** * after this, next tab can be used */ + /* public void init() { setLearningAlgorithm(); if (config.getLearningProblem() != null) { @@ -148,7 +149,7 @@ System.out.println("init LearningAlgorithm"); startGUI.updateTabColors(); } - } + }*/ /** * updateAll @@ -176,16 +177,14 @@ * update OptionPanel with new selection */ public void updateOptionPanel() { - // update OptionPanel - // TODO implement properly !! -// optionPanel.update(config.getLearningAlgorithm(), learner.get(choosenClassIndex)); + optionPanel.update(config.getLearningAlgorithm()); } /** * make init-button red if you have to click */ public void updateInitButtonColor() { - if (!config.isInitLearningAlgorithm()) { + if (!config.needsInitLearningAlgorithm()) { initButton.setForeground(Color.RED); } else initButton.setForeground(Color.BLACK); Modified: trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -25,9 +25,11 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; -import javax.swing.*; -import org.dllearner.core.ComponentInitException; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JPanel; + import org.dllearner.core.LearningProblem; /** @@ -42,7 +44,7 @@ private Config config; private StartGUI startGUI; - private List<Class<? extends LearningProblem>> problem; + private List<Class<? extends LearningProblem>> lpClasses; private String[] lpBoxItems = {}; private JComboBox cb = new JComboBox(lpBoxItems); private JPanel choosePanel = new JPanel(); @@ -56,12 +58,8 @@ this.config = config; this.startGUI = startGUI; - problem = config.getComponentManager().getLearningProblems(); + lpClasses = config.getComponentManager().getLearningProblems(); - initButton = new JButton("Init LearningProblem"); - initButton.addActionListener(this); - // initPanel.add(initButton); - initButton.setEnabled(true); setButton = new JButton("Set"); setButton.addActionListener(this); choosePanel.add(cb); @@ -69,14 +67,14 @@ cb.addActionListener(this); // add into comboBox - for (int i = 0; i < problem.size(); i++) { - cb.addItem(config.getComponentManager().getComponentName(problem.get(i))); + for (int i = 0; i < lpClasses.size(); i++) { + cb.addItem(config.getComponentManager().getComponentName(lpClasses.get(i))); } // read choosen LearningProblem choosenClassIndex = cb.getSelectedIndex(); - LearningProblem lp = config.newLearningProblem(problem.get(choosenClassIndex)); + LearningProblem lp = config.newLearningProblem(lpClasses.get(choosenClassIndex)); optionPanel = new OptionPanel(config, lp); add(choosePanel, BorderLayout.PAGE_START); @@ -85,31 +83,31 @@ choosenClassIndex = cb.getSelectedIndex(); // setLearningProblem(); - updateInitButtonColor(); +// updateInitButtonColor(); } public void actionPerformed(ActionEvent e) { // read selected LearningProblemClass if (choosenClassIndex != cb.getSelectedIndex()) { this.choosenClassIndex = cb.getSelectedIndex(); - config.setInitLearningProblem(false); - init(); +// config.setInitLearningProblem(false); +// init(); } if (e.getSource() == setButton) setLearningProblem(); - if (e.getSource() == initButton) - init(); +// if (e.getSource() == initButton) +// init(); } /** * after this, you can change widgets */ private void setLearningProblem() { - if (config.isInitReasoner()) { + if (config.needsInitReasoner()) { config.setLearningProblem(config.getComponentManager().learningProblem( - problem.get(choosenClassIndex), config.getReasoningService())); + lpClasses.get(choosenClassIndex), config.getReasoningService())); startGUI.updateTabColors(); updateOptionPanel(); } @@ -118,6 +116,7 @@ /** * after this, next tab can be used */ + /* public void init() { setLearningProblem(); if (config.getReasoner() != null && config.getLearningProblem() != null @@ -131,7 +130,7 @@ e.printStackTrace(); } } - } + }*/ /** * updateAll @@ -139,7 +138,7 @@ public void updateAll() { updateComboBox(); updateOptionPanel(); - updateInitButtonColor(); +// updateInitButtonColor(); } /** @@ -147,7 +146,7 @@ */ public void updateComboBox() { if (config.getLearningProblem() != null) - for (int i = 0; i < problem.size(); i++) + for (int i = 0; i < lpClasses.size(); i++) if (config.getLearningProblem().getClass().equals( config.getComponentManager().getLearningProblems().get(i))) { cb.setSelectedIndex(i); @@ -159,18 +158,17 @@ * update OptionPanel with new selection */ private void updateOptionPanel() { - // update OptionPanel -// TODO: implement properly !! -// optionPanel.update(config.getLearningProblem(), problem.get(choosenClassIndex)); + optionPanel.update(config.getLearningProblem()); } /** * make init-button red if you have to click */ + /* public void updateInitButtonColor() { - if (!config.isInitLearningProblem()) { + if (!config.needsInitLearningProblem()) { initButton.setForeground(Color.RED); } else initButton.setForeground(Color.BLACK); - } + }*/ } Modified: trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -99,36 +99,37 @@ // choosenClassIndex = cb.getSelectedIndex(); if (choosenClassIndex != cb.getSelectedIndex()) { choosenClassIndex = cb.getSelectedIndex(); - config.setInitReasoner(false); - init(); +// config.setInitReasoner(false); +// init(); } if (e.getSource() == setButton) { - config.setInitReasoner(false); +// config.setInitReasoner(false); setReasoner(); } - if (e.getSource() == initButton) - init(); +// if (e.getSource() == initButton) +// init(); } /** * after this, you can change widgets */ public void setReasoner() { - if (config.isInitKnowledgeSource()) { + if (config.needsInitKnowledgeSource()) { config.setReasoner(config.getComponentManager().reasoner( reasoner.get(choosenClassIndex), config.getKnowledgeSource())); updateOptionPanel(); - startGUI.updateTabColors(); - config.setInitReasoner(false); - updateInitButtonColor(); +// startGUI.updateTabColors(); +// config.setInitReasoner(false); +// updateInitButtonColor(); } } /** * after this, next tab can be used */ + /* public void init() { setReasoner(); if (config.getKnowledgeSource() != null && config.getReasoner() != null) { @@ -146,7 +147,7 @@ } } - } + }*/ /** * updateAll @@ -174,15 +175,14 @@ * update OptionPanel with new selection */ public void updateOptionPanel() { -// TODO: implement properly !! -// optionPanel.update(config.getReasoner(), reasoner.get(choosenClassIndex)); + optionPanel.update(config.getReasoner()); } /** * make init-button red if you have to click */ public void updateInitButtonColor() { - if (!config.isInitReasoner()) { + if (!config.needsInitReasoner()) { initButton.setForeground(Color.RED); } else initButton.setForeground(Color.BLACK); Modified: trunk/src/dl-learner/org/dllearner/gui/StartGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -23,6 +23,7 @@ import javax.swing.event.*; import java.awt.Color; +import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -30,6 +31,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; +import org.dllearner.core.ComponentInitException; import java.io.File; import java.io.PrintWriter; @@ -37,7 +39,8 @@ import javax.swing.filechooser.FileFilter; /** - * This class builds the basic GUI elements and is used to start the DL-Learner GUI. + * This class builds the basic GUI elements and is used to start the DL-Learner + * GUI. * * @author Tilo Hielscher * @author Jens Lehmann @@ -48,7 +51,7 @@ private JTabbedPane tabPane = new JTabbedPane(); - private Config config = new Config(); + private Config config = new Config(this); private ConfigLoad configLoad = new ConfigLoad(config, this); private ConfigSave configSave = new ConfigSave(config, this); @@ -77,7 +80,7 @@ this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationByPlatform(true); this.setSize(800, 600); - + // set icon if (this.getClass().getResource("icon.gif") != null) setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage( @@ -116,13 +119,30 @@ tabPane.addChangeListener(new ChangeListener() { // This method is called whenever the selected tab changes public void stateChanged(ChangeEvent evt) { - System.out.println(evt.getSource()); - if(evt.getSource().equals(tabPane)) { -// tabPane.get -// System.out.println("Tab 2 clicked"); -// System.exit(0); + if (evt.getSource().equals(tabPane)) { + + int index = tabPane.getSelectedIndex(); +// System.out.println(index); + + // check whether we need to initialise components + if (index != 0 && config.tabNeedsInit(index - 1)) { + for (int i = 0; i < index; i++) { + config.init(i); + } + } + + updateTabColors(); + + // TODO: handle init code here => whenever a tab + // is selected, we have to determine whether it + // and the tabs before need to be initialised + + Component c = tabPane.getSelectedComponent(); + if (c == tab0) { + // System.out.println(tab0); + } } -// init(); + // init(); } }); @@ -132,13 +152,14 @@ } } + /* public void init() { tab0.init(); tab1.init(); tab2.init(); tab3.init(); updateTabColors(); - } + }*/ public static void main(String[] args) { // create GUI logger @@ -156,8 +177,8 @@ // force platform look and feel try { UIManager.setLookAndFeel( -// "com.sun.java.swing.plaf.motif.MotifLookAndFeel"); - UIManager.getSystemLookAndFeelClassName()); + // "com.sun.java.swing.plaf.motif.MotifLookAndFeel"); + UIManager.getSystemLookAndFeelClassName()); // TODO: currently everything is in bold on Linux (and Win?) } catch (ClassNotFoundException e) { e.printStackTrace(); @@ -168,7 +189,7 @@ } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } - + new StartGUI(file); } @@ -196,7 +217,7 @@ configLoad.openFile(fc.getSelectedFile()); configLoad.startParser(); } - // save as config file + // save as config file } else if (e.getSource() == saveItem) { JFileChooser fc = new JFileChooser(new File("examples/")); // FileFilter only *.conf @@ -227,13 +248,13 @@ } } System.out.println("config file saved"); - // exit + // exit } else if (e.getSource() == exitItem) { dispose(); - // tutorial + // tutorial } else if (e.getSource() == tutorialItem) { new TutorialWindow(); - // about + // about } else if (e.getSource() == aboutItem) { new AboutWindow(); } @@ -243,32 +264,34 @@ * Update colors of tabulators; red should be clicked, black for OK. */ public void updateTabColors() { - if (config.isInitKnowledgeSource()) + if (config.needsInitKnowledgeSource()) + tabPane.setForegroundAt(0, Color.RED); + else tabPane.setForegroundAt(0, Color.BLACK); + if (config.needsInitReasoner()) + tabPane.setForegroundAt(1, Color.RED); else - tabPane.setForegroundAt(0, Color.RED); - if (config.isInitReasoner()) tabPane.setForegroundAt(1, Color.BLACK); + if (config.needsInitLearningProblem()) + tabPane.setForegroundAt(2, Color.RED); else - tabPane.setForegroundAt(1, Color.RED); - if (config.isInitLearningProblem()) tabPane.setForegroundAt(2, Color.BLACK); - else - tabPane.setForegroundAt(2, Color.RED); - if (config.isInitLearningAlgorithm()) { + if (config.needsInitLearningAlgorithm()) { + tabPane.setForegroundAt(3, Color.RED); + tabPane.setForegroundAt(4, Color.RED); + } else { tabPane.setForegroundAt(3, Color.BLACK); tabPane.setForegroundAt(4, Color.BLACK); - } else { - tabPane.setForegroundAt(3, Color.RED); - tabPane.setForegroundAt(4, Color.RED); } - - // commented out as I do not see any reason why the method should update everything - // (it costs performance to update everything when the user only sees one panel) -// tab0.updateAll(); -// tab1.updateAll(); -// tab2.updateAll(); -// tab3.updateAll(); + // commented out as I do not see any reason why the method should update + // everything + // (it costs performance to update everything when the user only sees + // one panel) + // tab0.updateAll(); + // tab1.updateAll(); + // tab2.updateAll(); + // tab3.updateAll(); + } } Modified: trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/WidgetPanelString.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -28,8 +28,6 @@ import javax.swing.JTextField; import org.dllearner.core.Component; -import org.dllearner.core.config.ConfigEntry; -import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; /** @@ -47,8 +45,6 @@ // private JPanel widgetPanel = new JPanel(); private JButton setButton; // = new JButton("Set"); - private Class<? extends Component> componentOption; - private String value; private JTextField stringField; // = new JTextField(35); @@ -67,7 +63,9 @@ stringField.setText(value); } } - setEntry(); + value = stringField.getText(); + fireValueChanged(value); +// setEntry(); // if url and value not "" // necessary for init knowledge source if (configOption.getName().equalsIgnoreCase("url") && !value.equalsIgnoreCase("")) { @@ -75,6 +73,7 @@ } } + /* public void setEntry() { StringConfigOption specialOption; value = stringField.getText(); // get from input @@ -91,7 +90,7 @@ } } else System.out.println("String: not valid value"); - } + }*/ /** * Widget filename getName() == filename you should open a file dialog in Modified: trunk/src/dl-learner/org/dllearner/gui/WidgetPanelStringSet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/WidgetPanelStringSet.java 2008-09-08 15:41:10 UTC (rev 1176) +++ trunk/src/dl-learner/org/dllearner/gui/WidgetPanelStringSet.java 2008-09-08 15:43:39 UTC (rev 1177) @@ -223,6 +223,8 @@ gridbag.setConstraints(clearButton, constraints); widgetPanel.add(clearButton, constraints); } else { + System.out.println("SPECIAL OPTION " + configOption.getName()); + // SPECIAL LAYOUT // ComboBoxList buildConstraints(constraints, 0, 1, 1, 1, 100, 100); @@ -238,6 +240,7 @@ LinkedList<Individual> individuals = new LinkedList<Individual>( individualsSet); for (Individual ind : individuals) { + System.out.println(ind.getName()); cBL.add(ind.getName()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |