From: <hee...@us...> - 2010-03-01 16:37:56
|
Revision: 2079 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2079&view=rev Author: heeroyuy Date: 2010-03-01 16:37:49 +0000 (Mon, 01 Mar 2010) Log Message: ----------- -added a default profile for learning algorithm Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanelHandler.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2010-03-01 15:41:48 UTC (rev 2078) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2010-03-01 16:37:49 UTC (rev 2079) @@ -50,6 +50,7 @@ private JRadioButton owlRadioButton; private JRadioButton elProfileButton; + private JRadioButton defaultProfileButton; private JCheckBox allBox; private JCheckBox someBox; @@ -109,22 +110,24 @@ nrOfConcepts.setMinorTickSpacing(1); nrOfConcepts.setPaintLabels(true); - owlRadioButton = new JRadioButton("<html>OWL 2</html>", true); + owlRadioButton = new JRadioButton("<html>OWL 2</html>", false); elProfileButton = new JRadioButton("<html>EL Profile</html>", false); + defaultProfileButton = new JRadioButton("<html>Default</html>", true); owlRadioButton.setEnabled(true); - owlRadioButton.addItemListener(optionHandler); - elProfileButton.addItemListener(optionHandler); + owlRadioButton.addActionListener(optionHandler); + elProfileButton.addActionListener(optionHandler); + defaultProfileButton.addActionListener(optionHandler); allBox = new JCheckBox("<html>all</html>", true); - allBox.addItemListener(optionHandler); + //allBox.addItemListener(optionHandler); someBox = new JCheckBox("<html>some</html>", true); - someBox.addItemListener(optionHandler); - notBox = new JCheckBox("<html>not</html>", true); - notBox.addItemListener(optionHandler); - valueBox = new JCheckBox("<html>value</html>", true); - valueBox.addItemListener(optionHandler); + //someBox.addItemListener(optionHandler); + notBox = new JCheckBox("<html>not</html>", false); + //notBox.addItemListener(optionHandler); + valueBox = new JCheckBox("<html>value</html>", false); + //valueBox.addItemListener(optionHandler); moreBox = new JCheckBox("<html> ‹=x, ›=x with max.:</html>", true); - moreBox.addItemListener(optionHandler); + //moreBox.addItemListener(optionHandler); countMoreBox = new JComboBox(); countMoreBox.addItem(1); @@ -192,6 +195,7 @@ radioBoxPanel.add(owlRadioButton); radioBoxPanel.add(elProfileButton); + radioBoxPanel.add(defaultProfileButton); profilePanel.add(radioBoxPanel); profilePanel.add(checkBoxPanel); @@ -250,6 +254,10 @@ public JRadioButton getElProfileButton() { return elProfileButton; } + + public JRadioButton getDefaultProfileButton() { + return defaultProfileButton; + } /** * This methode returns if the allquantor box is selected. @@ -313,6 +321,9 @@ */ public void setToOWLProfile() { allBox.setSelected(true); + owlRadioButton.setSelected(true); + elProfileButton.setSelected(false); + defaultProfileButton.setSelected(false); someBox.setSelected(true); notBox.setSelected(true); valueBox.setSelected(true); @@ -330,9 +341,24 @@ notBox.setSelected(false); valueBox.setSelected(false); moreBox.setSelected(false); + owlRadioButton.setSelected(false); + elProfileButton.setSelected(true); + defaultProfileButton.setSelected(false); this.setCountMoreBoxEnabled(false); } + public void setToDefaultProfile() { + allBox.setSelected(true); + someBox.setSelected(true); + notBox.setSelected(false); + valueBox.setSelected(false); + moreBox.setSelected(true); + owlRadioButton.setSelected(false); + elProfileButton.setSelected(false); + defaultProfileButton.setSelected(true); + this.setCountMoreBoxEnabled(true); + } + /** * This methode sets the combo box for the cardinality restriction * enabled/disabled. Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanelHandler.java 2010-03-01 15:41:48 UTC (rev 2078) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanelHandler.java 2010-03-01 16:37:49 UTC (rev 2079) @@ -19,18 +19,19 @@ */ package org.dllearner.tools.protege; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; /** * This class handles the all actions in the option panel. * @author Christian Koetteritzsch * */ -public class OptionPanelHandler implements ItemListener { +public class OptionPanelHandler implements ActionListener { private static final String OWL_RADIO_STRING = "OWL 2"; private static final String EL_RADIO_STRING = "EL Profile"; + private static final String DEFAULT_RADIO_STRING = "Default"; private static final String VALUE_STRING = "<=x, >=x with max.:"; private OptionPanel option; @@ -43,28 +44,23 @@ this.option = o; } - + @Override /** * This method handles the actions to be taken if a * radio button is selected/deselected. */ - public void itemStateChanged(ItemEvent e) { + public void actionPerformed(ActionEvent e) { if (e.toString().contains(OWL_RADIO_STRING)) { - if (option.getOwlRadioButton().isSelected()) { this.setToOWLProfile(); - } else { + } + if (e.toString().contains(EL_RADIO_STRING)) { this.setToELProfile(); - } - - } else if (e.toString().contains(EL_RADIO_STRING)) { - if (option.getElProfileButton().isSelected()) { - this.setToELProfile(); - } else { - this.setToOWLProfile(); - } - - } else if(e.toString().contains(VALUE_STRING)) { + } + if (e.toString().contains(DEFAULT_RADIO_STRING)) { + this.setToDefaultProfile(); + } + if(e.toString().contains(VALUE_STRING)) { if(option.getMoreBox()) { option.setCountMoreBoxEnabled(true); } else { @@ -74,17 +70,19 @@ } private void setToOWLProfile() { - option.getOwlRadioButton().setSelected(true); - option.getElProfileButton().setSelected(false); option.setToOWLProfile(); } private void setToELProfile() { - option.getOwlRadioButton().setSelected(false); - option.getElProfileButton().setSelected(true); option.setToELProfile(); } + + private void setToDefaultProfile() { + option.setToDefaultProfile(); + } + + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |