From: <hee...@us...> - 2008-11-05 12:51:52
|
Revision: 1492 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1492&view=rev Author: heeroyuy Date: 2008-11-05 12:51:43 +0000 (Wed, 05 Nov 2008) Log Message: ----------- -changes in detail panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2008-11-04 17:02:56 UTC (rev 1491) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2008-11-05 12:51:43 UTC (rev 1492) @@ -198,6 +198,7 @@ // This is a List of evaluated descriptions to get more information of the // suggested concept private List<EvaluatedDescription> evalDescriptions; + private Vector<String> normalIndividuals; /** * This is the constructor for DL-Learner model. @@ -221,6 +222,7 @@ owlDescription = new HashSet<OWLDescription>(); positiv = new Vector<JCheckBox>(); negativ = new Vector<JCheckBox>(); + normalIndividuals = new Vector<String>(); ComponentManager.setComponentClasses(componenten); cm = ComponentManager.getInstance(); ds = new HashSet<OWLDescription>(); @@ -276,11 +278,11 @@ for (int i = 0; i < positiv.size(); i++) { if (positiv.get(i).isSelected()) { - positiveExamples.add(editor.getModelManager().getActiveOntology().getURI().toString()+"#"+positiv.get(i).getText()); + positiveExamples.add(normalIndividuals.get(i)); } if (negativ.get(i).isSelected()) { - negativeExamples.add(editor.getModelManager().getActiveOntology().getURI().toString()+"#"+negativ.get(i).getText()); + negativeExamples.add(normalIndividuals.get(i)); } } } @@ -377,8 +379,6 @@ // TODO Auto-generated catch block e.printStackTrace(); } - cm.applyConfigEntry(la, "numberOfTrees", 100); - cm.applyConfigEntry(la, "maxDepth", 5); cm.applyConfigEntry(la, "maxExecutionTimeInSeconds", view.getPosAndNegSelectPanel().getOptionPanel().getMaxExecutionTime()); try { // initializes the learning algorithm @@ -455,27 +455,27 @@ setPositiveConcept(); for (Iterator<Individual> j = rs.getIndividuals().iterator(); j .hasNext();) { - String ind = j.next().toManchesterSyntaxString(editor.getModelManager() - .getActiveOntology().getURI() - .toString()+"#", null); + Individual ind = j.next(); + normalIndividuals.add(ind.toString()); + String indiv = ind.toString(); // checks if individual belongs to the selected concept - if (setPositivExamplesChecked(ind)) { + if (setPositivExamplesChecked(indiv)) { // when yes then it sets the positive example checked - JCheckBox box = new JCheckBox(ind.toString(), true); + JCheckBox box = new JCheckBox(ind.toManchesterSyntaxString(editor.getModelManager().getActiveOntology().getURI().toString()+"#", null), true); box.setName("Positive"); positiv.add(box); // and ne genative examples unchecked - JCheckBox box2 = new JCheckBox(ind.toString(), false); + JCheckBox box2 = new JCheckBox(ind.toManchesterSyntaxString(editor.getModelManager().getActiveOntology().getURI().toString()+"#", null), false); box.setName("Negative"); negativ.add(box2); } else { // When no it unchecks the positive example - JCheckBox box = new JCheckBox(ind.toString(), false); + JCheckBox box = new JCheckBox(ind.toManchesterSyntaxString(editor.getModelManager().getActiveOntology().getURI().toString()+"#", null), false); box.setName("Positive"); positiv.add(box); // and checks the negative example - JCheckBox box2 = new JCheckBox(ind.toString(), true); + JCheckBox box2 = new JCheckBox(ind.toManchesterSyntaxString(editor.getModelManager().getActiveOntology().getURI().toString()+"#", null), true); box.setName("Negative"); negativ.add(box2); } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2008-11-04 17:02:56 UTC (rev 1491) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2008-11-05 12:51:43 UTC (rev 1492) @@ -22,6 +22,7 @@ import java.awt.GridLayout; import java.util.Iterator; +import javax.swing.Box; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; @@ -116,6 +117,8 @@ */ public MoreDetailForSuggestedConceptsPanel(DLLearnerModel model) { this.model = model; + + } /** * This method returns the Detail Panel. @@ -132,12 +135,25 @@ */ public void renderDetailPanel(EvaluatedDescription desc) { eval = desc; - conceptPanel = new JPanel(new GridLayout(0,2)); - accuracyPanel = new JPanel(new GridLayout(0,2)); - posCoveredPanel = new JPanel(new GridLayout(0,2)); - posNotCoveredPanel = new JPanel(new GridLayout(0,2)); - negCoveredPanel = new JPanel(new GridLayout(0,2)); - negNotCoveredPanel = new JPanel(new GridLayout(0,2)); + JPanel posBox = new JPanel(new GridLayout(0,2)); + JPanel negBox = new JPanel(new GridLayout(0,2)); + Box exampleBox = Box.createVerticalBox(); + concept = new JTextArea("Class Description:"); + concept.setEditable(false); + coveredPositiveExamples = new JLabel("Covered Positive Examples:"); + coveredPositiveExamples.setForeground(colorGreen); + notCoveredPositiveExamples = new JLabel("Not Covered Positive Examples"); + notCoveredPositiveExamples.setForeground(colorRed); + coveredNegativeExamples = new JLabel("Covered Negative Examples:"); + coveredNegativeExamples.setForeground(colorRed); + notCoveredNegativeExamples = new JLabel("Not Covered Negative Examples"); + notCoveredNegativeExamples.setForeground(colorGreen); + conceptPanel = new JPanel(new GridLayout(0,1)); + accuracyPanel = new JPanel(new GridLayout(0,1)); + posCoveredPanel = new JPanel(new GridLayout(0,1)); + posNotCoveredPanel = new JPanel(new GridLayout(0,1)); + negCoveredPanel = new JPanel(new GridLayout(0,1)); + negNotCoveredPanel = new JPanel(new GridLayout(0,1)); accuracy = new JTextArea("Accuracy:"); accuracy.setEditable(false); conceptText = new JTextArea(); @@ -162,51 +178,33 @@ //sets accuracy text area not editable accuracyText.setEditable(false); //panel for the informations of the selected concept - examplePanel = new JPanel(new GridLayout(0,1)); + examplePanel = new JPanel(new GridLayout(0,2)); //this method adds the informations for the selected concept to the panel setInformation(); - concept = new JTextArea("Class Description:"); - concept.setEditable(false); - coveredPositiveExamples = new JLabel("Covered Positive Examples:"); - coveredPositiveExamples.setForeground(colorGreen); - notCoveredPositiveExamples = new JLabel("Not Covered Positive Examples"); - notCoveredPositiveExamples.setForeground(colorRed); - coveredNegativeExamples = new JLabel("Covered Negative Examples:"); - coveredNegativeExamples.setForeground(colorRed); - notCoveredNegativeExamples = new JLabel("Not Covered Negative Examples"); - notCoveredNegativeExamples.setForeground(colorGreen); + detailPopup = new JDialog(); detailPopup.setSize(400, 400); //window will be disposed if the x button is pressed detailPopup.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); detailPopup.setVisible(true); - detailPopup.setResizable(false); + detailPopup.setResizable(true); detailScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //adds all information to the example panel conceptPanel.add(concept); conceptPanel.add(conceptText); + accuracyPanel.add(accuracy); accuracyPanel.add(accuracyText); - //examplePanel.add(concept); - //examplePanel.add(conceptText); - //examplePanel.add(accuracy); - //examplePanel.add(accuracyText); - posCoveredPanel.add(coveredPositiveExamples); - posCoveredPanel.add(posCoveredText); - posNotCoveredPanel.add(notCoveredPositiveExamples); - posNotCoveredPanel.add(posNotCoveredText); - negCoveredPanel.add(coveredNegativeExamples); - negCoveredPanel.add(negCoveredText); - negNotCoveredPanel.add(notCoveredNegativeExamples); - - negNotCoveredPanel.add(negNotCoveredText); - examplePanel.add(conceptPanel); - examplePanel.add(accuracyPanel); - examplePanel.add(posCoveredPanel); - examplePanel.add(posNotCoveredPanel); - examplePanel.add(negCoveredPanel); - examplePanel.add(negNotCoveredPanel); - detailScroll.setViewportView(examplePanel); + + exampleBox.add(conceptPanel); + exampleBox.add(accuracyPanel); + posBox.add(posCoveredPanel); + posBox.add(posNotCoveredPanel); + negBox.add(negCoveredPanel); + negBox.add(negNotCoveredPanel); + exampleBox.add(posBox); + exampleBox.add(negBox); + detailScroll.setViewportView(exampleBox); detailPopup.add(detailScroll); } /** @@ -219,20 +217,36 @@ double acc = (eval.getAccuracy())*100; accuracyText.append(String.valueOf(acc)+"%"); //sets the positive examples that are covered + posCoveredPanel.add(coveredPositiveExamples); + posNotCoveredPanel.add(notCoveredPositiveExamples); + negCoveredPanel.add(coveredNegativeExamples); + negNotCoveredPanel.add(notCoveredNegativeExamples); for(Iterator<Individual> i = eval.getCoveredPositives().iterator(); i.hasNext();) { - posCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); + JLabel posLabel = new JLabel(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)); + posLabel.setForeground(colorGreen); + posCoveredPanel.add(posLabel); + //posCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); } //sets the positive examples that are not covered for(Iterator<Individual> i = eval.getNotCoveredPositives().iterator(); i.hasNext();) { - posNotCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); + JLabel posLabel = new JLabel(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)); + posLabel.setForeground(colorRed); + posNotCoveredPanel.add(posLabel); + //posNotCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); } //sets the negative examples that are covered for(Iterator<Individual> i = eval.getCoveredNegatives().iterator(); i.hasNext();) { - negCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); + JLabel posLabel = new JLabel(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)); + posLabel.setForeground(colorRed); + negCoveredPanel.add(posLabel); + //negCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); } //sets the negative examples that are not covered for(Iterator<Individual> i = eval.getNotCoveredNegatives().iterator(); i.hasNext();) { - negNotCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); + JLabel posLabel = new JLabel(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)); + posLabel.setForeground(colorGreen); + negNotCoveredPanel.add(posLabel); + //negNotCoveredText.append(i.next().toManchesterSyntaxString(model.getURI().toString()+"#", null)+"\n"); } } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2008-11-04 17:02:56 UTC (rev 1491) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2008-11-05 12:51:43 UTC (rev 1492) @@ -36,6 +36,7 @@ import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JComponent; +import javax.swing.JEditorPane; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -355,6 +356,7 @@ // Picture of the advanced button when it is toggled private JPanel addButtonPanel; + private JTextArea wikiPane; private ImageIcon toggledIcon; private JTextArea hint; // This is the Panel for more details of the suggested concept @@ -371,6 +373,8 @@ public DLLearnerView(OWLFrame<OWLClass> current, String label, OWLClassDescriptionEditorWithDLLearnerTab dlLearner) { classSelectorPanel = new OWLClassSelectorPanel(editorKit); mainWindow = dlLearner; + wikiPane = new JTextArea("See http://dl-learner.org/wiki/ProtegePlugin for an introduction."); + wikiPane.setEditable(false); classSelectorPanel.firePropertyChange("test", false, true); URL iconUrl = this.getClass().getResource("arrow.gif"); icon = new ImageIcon(iconUrl); @@ -445,6 +449,7 @@ advanced.setSelected(false); sugPanel.setBounds(10, 35, 490, 110); adv.setBounds(40, 200, 200, 20); + wikiPane.setBounds(220, 10, 350, 30); addButtonPanel.setBounds(510, 40, 80, 110); run.setBounds(10, 0, 200, 30); advanced.setBounds(10, 200, 20, 20); @@ -455,6 +460,7 @@ hint.setBounds(10, 150, 490, 20); errorMessage.setBounds(10, 170, 490, 20); learner.add(run); + learner.add(wikiPane); learner.add(adv); learner.add(advanced); learner.add(sugPanel); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2008-11-04 17:02:56 UTC (rev 1491) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2008-11-05 12:51:43 UTC (rev 1492) @@ -1,5 +1,6 @@ package org.dllearner.tools.protege; +import java.awt.Dimension; import java.awt.GridLayout; import javax.swing.JLabel; @@ -26,7 +27,8 @@ */ public OptionPanel() { - + setPreferredSize(new Dimension(490, 120)); + setLayout(new GridLayout(0,1)); optionPanel = new JPanel(new GridLayout(0,2)); minAccuracyLabel = new JLabel("minimum accuracy"); maxExecutionTimeLabel = new JLabel("maximum execution time"); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java 2008-11-04 17:02:56 UTC (rev 1491) +++ trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java 2008-11-05 12:51:43 UTC (rev 1492) @@ -100,7 +100,9 @@ * ActionHandler */ public PosAndNegSelectPanel(DLLearnerModel model, ActionHandler act) { - super(new GridLayout(0,1)); + super(); + setLayout(new GridLayout(0,1)); + setPreferredSize(new Dimension(490, 250)); optionPanel = new OptionPanel(); pos = new JLabel("Positive Examples"); neg = new JLabel("Negative Examples"); @@ -149,8 +151,8 @@ scrollPanel = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPanel.setViewportView(posAndNegPanel); - optionPanel.setPreferredSize(new Dimension(490, 70)); - scrollPanel.setPreferredSize(new Dimension(490, 180)); + optionPanel.setPreferredSize(new Dimension(490, 100)); + scrollPanel.setPreferredSize(new Dimension(490, 140)); add(optionPanel); add(scrollPanel); addListeners(action); @@ -241,7 +243,7 @@ JOptionPane.showMessageDialog(null, assistance, "Help", - JOptionPane.WARNING_MESSAGE); + JOptionPane.OK_OPTION); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |