From: <ton...@us...> - 2008-01-19 18:39:31
|
Revision: 404 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=404&view=rev Author: tonytacker Date: 2008-01-19 10:39:28 -0800 (Sat, 19 Jan 2008) Log Message: ----------- fixed warning Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-19 17:43:46 UTC (rev 403) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-19 18:39:28 UTC (rev 404) @@ -29,6 +29,7 @@ import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.config.ConfigOption; +import org.dllearner.core.ComponentManager; @@ -86,11 +87,13 @@ if (e.getSource() == testButton) { // TEST - optionList = config.getComponentManager().getConfigOptions(learners.get(cb.getSelectedIndex())); - //System.out.println("optionName: " + optionList); - System.out.println("option 0:\n" + optionList.get(0)); - + //available options for selected class + optionList = ComponentManager.getConfigOptions(learners.get(cb.getSelectedIndex())); + System.out.println(optionList); + //System.out.println("option 0:\n" + optionList.get(0)); + System.out.println("size: " + optionList.size()); + } if (e.getSource() == initButton) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ton...@us...> - 2008-01-21 02:10:49
|
Revision: 405 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=405&view=rev Author: tonytacker Date: 2008-01-20 18:10:46 -0800 (Sun, 20 Jan 2008) Log Message: ----------- - add showing options for LearningAlgorithm over a "Test"-button in a JTable problems: - i used the first line in table, couldn't find a method to enable the header - can't stretch the table at moment - layout: can i do it like this? Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-19 18:39:28 UTC (rev 404) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-21 02:10:46 UTC (rev 405) @@ -21,6 +21,8 @@ */ import javax.swing.*; +import javax.swing.JTable; +import javax.swing.table.DefaultTableModel; import java.awt.BorderLayout; import java.awt.event.ActionEvent; @@ -33,7 +35,6 @@ - /** * LearningAlgorithmPanel * @@ -47,14 +48,18 @@ private Config config; private List<Class<? extends LearningAlgorithm>> learners; private JPanel choosePanel = new JPanel(); + private JPanel centerPanel = new JPanel(); private JPanel initPanel = new JPanel(); private JButton initButton, testButton; private String[] cbItems = {}; private JComboBox cb = new JComboBox(cbItems); private int choosenClassIndex; private List<ConfigOption<?>> optionList; - - + private DefaultTableModel optionModel = new DefaultTableModel(); + private JTable optionTable = new JTable(optionModel); + + + LearningAlgorithmPanel(Config config) { super(new BorderLayout()); @@ -67,9 +72,13 @@ initPanel.add(initButton); initPanel.add(testButton); + choosePanel.add(cb); - add(choosePanel, BorderLayout.PAGE_START); + centerPanel.add(optionTable); + + add(choosePanel, BorderLayout.PAGE_START); + add(centerPanel, BorderLayout.CENTER); add(initPanel, BorderLayout.PAGE_END); // add into comboBox @@ -79,6 +88,18 @@ //System.out.println(learners.get(i).getSimpleName()); cb.addItem(config.getComponentManager().getComponentName(learners.get(i))); } + + // set JTable + optionModel.addColumn("name"); + optionModel.addColumn("default"); + optionModel.addColumn("class"); + + // first row - where is header? + optionModel.addRow(new Object[] {"name","default","class"}); + + //optionTable.setSize(400, 400); + //System.out.println("optionModel.getSize(): " + optionTable.getSize()); + optionTable.updateUI(); } public void actionPerformed(ActionEvent e) { @@ -89,13 +110,38 @@ // TEST //available options for selected class optionList = ComponentManager.getConfigOptions(learners.get(cb.getSelectedIndex())); - System.out.println(optionList); + //System.out.println(optionList + "\n"); //System.out.println("option 0:\n" + optionList.get(0)); - System.out.println("size: " + optionList.size()); + //System.out.println("size: " + optionList.size() + "\n"); // size +/* for (int i=0; i<optionList.size(); i++) { + System.out.println("name: " + optionList.get(i).getName()); // name + System.out.println("default value: " + optionList.get(i).getDefaultValue()); // default value + System.out.println("class: " + optionList.get(i).getClass()); // class + System.out.println("description: " + optionList.get(i).getDescription()); // description + System.out.println("allowed value description: " + optionList.get(i).getAllowedValuesDescription()); // allowed value description + System.out.println(); + } +*/ + // show Options + // clear JTable + for (int i=optionModel.getRowCount()-1; i>0; i--) { + // from last to first + optionModel.removeRow(i); + } + // new JTable + for (int i=0; i<optionList.size(); i++) { + optionModel.addRow(new Object[] {optionList.get(i).getName(), optionList.get(i).getDefaultValue(), + optionList.get(i).getClass().getSimpleName()}); + // System.out.println("v2 name: " + optionList.get(i).getName()); // name + } + // update graphic + centerPanel.updateUI(); + } - + + // init if (e.getSource() == initButton) { if (config.getStatus(6)) { config.setLearningAlgorithm(config.getComponentManager().learningAlgorithm(learners.get(choosenClassIndex), config.getLearningProblem(), config.getReasoningService())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ton...@us...> - 2008-01-28 03:09:13
|
Revision: 431 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=431&view=rev Author: tonytacker Date: 2008-01-27 19:09:12 -0800 (Sun, 27 Jan 2008) Log Message: ----------- without the twice-clicking bug - but I saw, options will not work after press on init - I have to change it next time and will hold these possible options at org.dllearner.gui.Config.java Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-28 02:38:38 UTC (rev 430) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-01-28 03:09:12 UTC (rev 431) @@ -21,7 +21,6 @@ */ import javax.swing.*; -//import javax.swing.table.DefaultTableModel; import java.awt.BorderLayout; import java.awt.event.ActionEvent; @@ -29,8 +28,6 @@ import java.util.List; import org.dllearner.core.LearningAlgorithm; -//import org.dllearner.core.config.ConfigOption; -//import org.dllearner.core.ComponentManager; @@ -97,8 +94,8 @@ // init if (e.getSource() == initButton) { if (config.getStatus(6)) { - updateOptionPanel(); config.setLearningAlgorithm(config.getComponentManager().learningAlgorithm(learners.get(choosenClassIndex), config.getLearningProblem(), config.getReasoningService())); + updateOptionPanel(); config.getLearningAlgorithm().init(); } if (config.getStatus(5)) { // examples are set This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ton...@us...> - 2008-02-09 10:10:27
|
Revision: 532 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=532&view=rev Author: tonytacker Date: 2008-02-09 02:10:22 -0800 (Sat, 09 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-09 09:50:41 UTC (rev 531) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-09 10:10:22 UTC (rev 532) @@ -87,7 +87,7 @@ // choosenClassIndex = cb.getSelectedIndex(); if (choosenClassIndex != cb.getSelectedIndex()) { choosenClassIndex = cb.getSelectedIndex(); - config.setInitLearningProblem(false); + config.setInitLearningAlgorithm(false); setLearningAlgorithm(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |