From: <ton...@us...> - 2008-02-14 16:47:57
|
Revision: 574 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=574&view=rev Author: tonytacker Date: 2008-02-14 08:47:52 -0800 (Thu, 14 Feb 2008) Log Message: ----------- come more colors for init-buttons Modified Paths: -------------- 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 Modified: trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-14 15:58:45 UTC (rev 573) +++ trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-14 16:47:52 UTC (rev 574) @@ -23,6 +23,7 @@ import java.util.List; import javax.swing.*; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import org.dllearner.core.KnowledgeSource; @@ -81,6 +82,7 @@ choosenClassIndex = cb.getSelectedIndex(); setSource(); + updateInitButtonColor(); } public void actionPerformed(ActionEvent e) { @@ -113,15 +115,12 @@ * after this, next tab can be used */ public void init() { - if (/* - * !config.isInitKnowledgeSource() && - */config.getKnowledgeSource() != null && config.getURI() != null) { + if (config.getKnowledgeSource() != null && config.getURI() != null) { config.getKnowledgeSource().init(); config.setInitKnowledgeSource(true); System.out.println("init KnowledgeSource"); startGUI.updateTabColors(); } - // config.autoInit(); } /** @@ -131,4 +130,14 @@ optionPanel.update(config.getKnowledgeSource(), config .getOldKnowledgeSource(), sources.get(choosenClassIndex)); } + + /** + * make init-button red if you have to click + */ + public void updateInitButtonColor() { + if (!config.isInitKnowledgeSource()) { + 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-02-14 15:58:45 UTC (rev 573) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-14 16:47:52 UTC (rev 574) @@ -22,6 +22,7 @@ import javax.swing.*; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; @@ -81,6 +82,7 @@ add(optionPanel, BorderLayout.CENTER); add(initPanel, BorderLayout.PAGE_END); + updateInitButtonColor(); } public void actionPerformed(ActionEvent e) { @@ -103,10 +105,7 @@ * after this, you can change widgets */ public void setLearningAlgorithm() { - // config.autoInit(); - if (/* - * config.isInitLearningProblem() && - */config.getLearningProblem() != null + if (config.getLearningProblem() != null && config.getReasoningService() != null) { config.setLearningAlgorithm(config.getComponentManager() .learningAlgorithm(learners.get(choosenClassIndex), @@ -120,13 +119,13 @@ * after this, next tab can be used */ public void init() { + setLearningAlgorithm(); if (config.getLearningProblem() != null) { config.getLearningAlgorithm().init(); config.setInitLearningAlgorithm(true); System.out.println("init LearningAlgorithm"); startGUI.updateTabColors(); } - // config.autoInit(); } /** @@ -137,4 +136,14 @@ optionPanel.update(config.getLearningAlgorithm(), config .getOldLearningAlgorithm(), learners.get(choosenClassIndex)); } + + /** + * make init-button red if you have to click + */ + public void updateInitButtonColor() { + if (!config.isInitLearningAlgorithm()) { + 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-02-14 15:58:45 UTC (rev 573) +++ trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-02-14 16:47:52 UTC (rev 574) @@ -21,6 +21,7 @@ */ import java.awt.BorderLayout; +import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; @@ -83,6 +84,7 @@ choosenClassIndex = cb.getSelectedIndex(); // setLearningProblem(); + updateInitButtonColor(); } public void actionPerformed(ActionEvent e) { @@ -117,6 +119,7 @@ * after this, next tab can be used */ private void init() { + setLearningProblem(); if (config.getReasoner() != null && config.getLearningProblem() != null) { config.getLearningProblem().init(); config.setInitLearningProblem(true); @@ -133,4 +136,14 @@ optionPanel.update(config.getLearningProblem(), config .getOldLearningProblem(), problems.get(choosenClassIndex)); } + + /** + * make init-button red if you have to click + */ + public void updateInitButtonColor() { + if (!config.isInitLearningProblem()) { + 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-02-14 15:58:45 UTC (rev 573) +++ trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-02-14 16:47:52 UTC (rev 574) @@ -21,6 +21,7 @@ */ import java.awt.BorderLayout; +import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; @@ -45,7 +46,7 @@ private JPanel choosePanel = new JPanel(); private JPanel initPanel = new JPanel(); private OptionPanel optionPanel; - private JButton initButton, autoInitButton; + private JButton initButton, setButton; private String[] cbItems = {}; private JComboBox cb = new JComboBox(cbItems); private int choosenClassIndex; @@ -61,8 +62,8 @@ initButton.addActionListener(this); initPanel.add(initButton); initButton.setEnabled(true); - autoInitButton = new JButton("Set"); - autoInitButton.addActionListener(this); + setButton = new JButton("Set"); + setButton.addActionListener(this); choosePanel.add(cb); @@ -75,7 +76,7 @@ optionPanel = new OptionPanel(config, config.getReasoner(), config .getOldReasonerSet(), reasoners.get(choosenClassIndex)); - choosePanel.add(autoInitButton); + choosePanel.add(setButton); cb.addActionListener(this); add(choosePanel, BorderLayout.PAGE_START); @@ -84,6 +85,7 @@ choosenClassIndex = cb.getSelectedIndex(); setReasoner(); + updateInitButtonColor(); } public void actionPerformed(ActionEvent e) { @@ -95,7 +97,7 @@ setReasoner(); } - if (e.getSource() == autoInitButton) { + if (e.getSource() == setButton) { config.setInitReasoner(false); setReasoner(); } @@ -108,13 +110,14 @@ * after this, you can change widgets */ public void setReasoner() { - // config.autoInit(); if (config.isInitKnowledgeSource()) { config.setReasoner(config.getComponentManager().reasoner( reasoners.get(choosenClassIndex), config.getKnowledgeSource())); updateOptionPanel(); startGUI.updateTabColors(); + config.setInitReasoner(false); + updateInitButtonColor(); } } @@ -122,8 +125,8 @@ * after this, next tab can be used */ public void init() { - if (config.getKnowledgeSource() != null - && config.getReasoner() != null) { + setReasoner(); + if (config.getKnowledgeSource() != null && config.getReasoner() != null) { config.getReasoner().init(); System.out.println("init Reasoner"); // set ReasoningService @@ -132,9 +135,7 @@ System.out.println("init ReasoningService"); config.setInitReasoner(true); startGUI.updateTabColors(); - } - // config.autoInit(); } /** @@ -145,4 +146,13 @@ reasoners.get(choosenClassIndex)); } + /** + * make init-button red if you have to click + */ + public void updateInitButtonColor() { + if (!config.isInitReasoner()) { + 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-02-14 15:58:45 UTC (rev 573) +++ trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2008-02-14 16:47:52 UTC (rev 574) @@ -138,5 +138,10 @@ tabPane.setForegroundAt(3, Color.RED); tabPane.setForegroundAt(4, Color.RED); } + tab0.updateInitButtonColor(); + tab1.updateInitButtonColor(); + tab2.updateInitButtonColor(); + tab3.updateInitButtonColor(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |