From: <hee...@us...> - 2008-12-17 15:05:38
|
Revision: 1557 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1557&view=rev Author: heeroyuy Date: 2008-12-17 15:05:28 +0000 (Wed, 17 Dec 2008) Log Message: ----------- -code cleanup -added accuracy in suggest list Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL 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/SuggestListCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2008-12-16 16:24:53 UTC (rev 1556) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2008-12-17 15:05:28 UTC (rev 1557) @@ -26,8 +26,8 @@ import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.util.Iterator; import java.util.List; +import java.util.Set; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.ExecutionException; @@ -44,9 +44,6 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.owl.Description; -import org.protege.editor.owl.OWLEditorKit; -import org.semanticweb.owl.model.OWLOntology; - /** * This class processes input from the user. * @@ -61,7 +58,6 @@ private static Logger logger = Logger.getLogger(ActionHandler.class); private DLLearnerModel model; - private OWLEditorKit editorKit; // This is the id that checks if the equivalent class or subclass button is // pressed in protege @@ -93,8 +89,7 @@ */ public ActionHandler(ActionHandler a, DLLearnerModel m, OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view, - String i, OWLEditorKit editor) { - this.editorKit = editor; + String i) { this.view = view; this.id = i; this.model = m; @@ -212,36 +207,22 @@ * MouseEvent */ public void mouseClicked(MouseEvent m) { - EvaluatedDescription eDescription = null; + //EvaluatedDescription eDescription = null; if (view.getSuggestClassPanel().getSuggestList().getSelectedValue() != null) { SuggestListItem item = (SuggestListItem) view .getSuggestClassPanel().getSuggestList().getSelectedValue(); String desc = item.getValue(); if (model.getEvaluatedDescriptionList() != null) { - for (Iterator<EvaluatedDescription> i = model - .getEvaluatedDescriptionList().iterator(); i.hasNext();) { - eDescription = i.next(); - if(eDescription.getDescription().toString().contains("#")) { + List<EvaluatedDescription> evalList = model.getEvaluatedDescriptionList(); + Set<String> onto = model.getOntologyURIString(); + for(EvaluatedDescription eDescription : evalList) { + for(String ont : onto) { if (desc.equals(eDescription.getDescription() - .toManchesterSyntaxString( - editorKit.getModelManager() - .getActiveOntology().getURI().toString() + "#" - , null))) { + .toManchesterSyntaxString(ont, null))) { evaluatedDescription = eDescription; - break; } - } else { - if (desc.equals(eDescription.getDescription() - .toManchesterSyntaxString( - editorKit.getModelManager() - .getActiveOntology().getURI().toString() - , null))) { - evaluatedDescription = eDescription; - - break; - } } } } @@ -403,36 +384,20 @@ public void run() { model.setSuggestList(result); - // learnPanel.getListModel().clear(); dm.clear(); - Iterator<EvaluatedDescription> it = result.iterator(); int i = 0; - while (it.hasNext()) { - Iterator<OWLOntology> ont = model.getOWLEditorKit().getModelManager().getActiveOntologies().iterator(); - EvaluatedDescription eval = it.next(); - while(ont.hasNext()) { - String onto = ont.next().getURI().toString(); - if(eval.getDescription().toString().contains(onto)) { - if(eval.getDescription().toString().contains("#")) { - if(model.isConsistent(eval)) { - dm.add(i, new SuggestListItem(colorGreen, eval.getDescription().toManchesterSyntaxString(onto+"#", null))); - i++; - break; - } else { - dm.add(i, new SuggestListItem(colorRed, eval.getDescription().toManchesterSyntaxString(onto+"#", null))); - i++; - break; - } + for(EvaluatedDescription eval : result) { + Set<String> ont = model.getOntologyURIString(); + for(String ontology : ont) { + if(eval.getDescription().toString().contains(ontology)) { + if(model.isConsistent(eval)) { + dm.add(i, new SuggestListItem(colorGreen, eval.getDescription().toManchesterSyntaxString(ontology, null),eval.getAccuracy()*100)); + i++; + break; } else { - if(model.isConsistent(eval)) { - dm.add(i, new SuggestListItem(colorGreen, eval.getDescription().toManchesterSyntaxString(onto, null))); - i++; - break; - } else { - dm.add(i, new SuggestListItem(colorRed, eval.getDescription().toManchesterSyntaxString(onto, null))); - i++; - break; - } + dm.add(i, new SuggestListItem(colorRed, eval.getDescription().toManchesterSyntaxString(ontology, null),eval.getAccuracy()*100)); + i++; + break; } } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2008-12-16 16:24:53 UTC (rev 1556) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2008-12-17 15:05:28 UTC (rev 1557) @@ -22,7 +22,6 @@ import java.net.URI; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.SortedSet; @@ -43,6 +42,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Thing; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.learningproblems.PosNegDefinitionLP; import org.dllearner.learningproblems.PosNegInclusionLP; @@ -185,10 +185,10 @@ private DefaultListModel posListModel; private DefaultListModel negListModel; private Set<KnowledgeSource> sources; - // private KnowledgeSource source; private boolean hasIndividuals; private NamedClass currentConcept; private Vector<IndividualObject> individualVector; + private Set<String> ontologieURI; // This is a List of evaluated descriptions to get more information of the // suggested concept @@ -221,10 +221,10 @@ cm = ComponentManager.getInstance(); ds = new HashSet<OWLDescription>(); suggestModel = new DefaultListModel(); + ontologieURI = new HashSet<String>(); detailPane = new JXTaskPane(); detailPane.setTitle("Details"); sources = new HashSet<KnowledgeSource>(); - } /** @@ -289,12 +289,9 @@ * OWLAPIOntology will be available. */ public void setKnowledgeSource() { - // source = new - // OWLAPIOntology(editor.getModelManager().getActiveOntology()); - Iterator<OWLOntology> it = editor.getModelManager() - .getActiveOntologies().iterator(); - while (it.hasNext()) { - sources.add(new OWLAPIOntology(it.next())); + Set<OWLOntology> ontologies = editor.getModelManager().getActiveOntologies(); + for(OWLOntology onto : ontologies) { + sources.add(new OWLAPIOntology(onto)); } } @@ -333,7 +330,7 @@ } // adds the positive examples cm.applyConfigEntry(lp, "positiveExamples", positiveExamples); - // adds the neagtive examples + // adds the negative examples cm.applyConfigEntry(lp, "negativeExamples", negativeExamples); try { lp.init(); @@ -358,14 +355,13 @@ ignore.add(currentConcept.toString()); if(id.equals(SUPER_CLASS_AXIOM_STRING)) { Description currentClass = (Description)currentConcept; - String currentClassString = currentConcept.toString(); - while(!currentClassString.contains("TOP")) { - Iterator<Description> it = reasoner.getSuperClasses(currentClass).iterator(); - while(it.hasNext()) { - Description ignoredClass = it.next(); - if(!ignoredClass.toString().equals("TOP")) { + while(!(currentClass instanceof Thing)) { + SortedSet<Description> superClasses = reasoner.getSuperClasses(currentClass); + for(Description ignoredClass : superClasses) { + if(!(ignoredClass instanceof Thing)) { ignore.add(ignoredClass.toString()); } + currentClass = ignoredClass; } } } @@ -406,61 +402,31 @@ public void setPosVector() { setPositiveConcept(); SortedSet<Individual> reasonerIndi = reasoner.getIndividuals(); - Iterator<Individual> reasonerIt = reasonerIndi.iterator(); - while (reasonerIt.hasNext()) { - Individual ind = reasonerIt.next(); - Iterator<OWLOntology> onto = editor.getModelManager() - .getActiveOntologies().iterator(); - while (onto.hasNext()) { - OWLOntology ont = onto.next(); + for(Individual ind : reasonerIndi) { + Set<String> onto = ontologieURI; + for(String ont : onto) { String indiv = ind.toString(); // checks if individual belongs to the selected concept - if(ind.toString().contains("#")) { if (setPositivExamplesChecked(indiv)) { - if (indiv.contains(ont.getURI().toString())) { + if (indiv.contains(ont)) { // when yes then it sets the positive example checked // OWLExpressionCheckerFactory - posListModel.add(0, ind.toManchesterSyntaxString(ont - .getURI().toString()+"#", null)); + posListModel.add(0, ind.toManchesterSyntaxString(ont, null)); individualVector.add(new IndividualObject(indiv, true)); break; } } else { // When no it unchecks the positive example - if (indiv.contains(ont.getURI().toString())) { + if (indiv.contains(ont)) { individualVector .add(new IndividualObject(indiv, false)); - negListModel.add(0, ind.toManchesterSyntaxString(ont - .getURI().toString()+"#", null)); + negListModel.add(0, ind.toManchesterSyntaxString(ont, null)); break; } } - } else { - if (setPositivExamplesChecked(indiv)) { - if (indiv.contains(ont.getURI().toString())) { - // when yes then it sets the positive example checked - - // OWLExpressionCheckerFactory - posListModel.add(0, ind.toManchesterSyntaxString(ont - .getURI().toString(), null)); - individualVector.add(new IndividualObject(indiv, true)); - break; - } - - } else { - // When no it unchecks the positive example - if (indiv.contains(ont.getURI().toString())) { - individualVector - .add(new IndividualObject(indiv, false)); - negListModel.add(0, ind.toManchesterSyntaxString(ont - .getURI().toString(), null)); - break; - } - } } - } } } @@ -469,9 +435,8 @@ * This method resets the Concepts that are learned. */ public void unsetNewConcepts() { - while (owlDescription.iterator().hasNext()) { - owlDescription.remove(owlDescription.iterator().next()); - + for(OWLDescription o : owlDescription) { + owlDescription.remove(o); } } @@ -493,17 +458,16 @@ hasIndividuals = false; // checks if selected concept is thing when yes then it selects all // individuals - if (!current.getRootObject().toString().equals("Thing")) { - - for (Iterator<NamedClass> i = reasoner.getAtomicConceptsList() - .iterator(); i.hasNext();) { + if (!(current.getRootObject() instanceof Thing)) { + List<NamedClass> classList = reasoner.getAtomicConceptsList(); + for(NamedClass concept : classList) { // if individuals is null if (individuals == null) { - NamedClass concept = i.next(); // checks if the concept is the selected concept in protege - if (concept.toString().contains("#")) { - if (concept.toString().endsWith( - "#" + current.getRootObject().toString())) { + for(String onto : ontologieURI) { + if (concept.toString().contains(onto)) { + if (concept.toString().equals( + onto + current.getRootObject().toString())) { // if individuals is not null it gets all // individuals of // the concept @@ -516,24 +480,10 @@ break; } } - } else { - if (concept.toString().endsWith( - current.getRootObject().toString())) { - // if individuals is not null it gets all - // individuals of - // the concept - currentConcept = concept; - if (reasoner.getIndividuals(concept) != null) { - if (reasoner.getIndividuals(concept).size() > 0) { - hasIndividuals = true; - } - individual = reasoner.getIndividuals(concept); - break; - } - } } } } + } } else { if (reasoner.getIndividuals().size() > 0) { hasIndividuals = true; @@ -719,25 +669,6 @@ return suggestModel; } - /* - * This method gets the old concept from checking the positive examples. - * - * private void setOldConceptOWLAPI() { // gets all individuals - * SortedSet<Individual> indi = reasoner.getIndividuals(); // Iterator of - * Individuals for (Iterator<Individual> i = indi.iterator(); i.hasNext();) - * { Individual indi2 = i.next(); // checks if the current individual - * belongs to positive examples if (positiveExamples != null) { if - * (positiveExamples.toString().contains(indi2.toString())) { // if yes then - * get the concepts of this individuals Set<NamedClass> concept = - * reasoner.getTypes(indi2); // adds all concepts to old concept OWLAPI for - * (Iterator<NamedClass> k = concept.iterator(); k .hasNext();) { - * OWLDescription oldOWLAPI = OWLAPIDescriptionConvertVisitor - * .getOWLDescription(k.next()); oldConceptOWLAPI = oldOWLAPI; - * ds.add(oldOWLAPI); } - * - * } } } } - */ - /** * This method stores the new concept learned by the DL-Learner in the * Ontology. @@ -748,7 +679,6 @@ public void changeDLLearnerDescriptionsToOWLDescriptions( Description descript) { setNewConceptOWLAPI(descript); - // setOldConceptOWLAPI(); oldConceptOWLAPI = OWLAPIDescriptionConvertVisitor .getOWLDescription(currentConcept); ds.add(oldConceptOWLAPI); @@ -853,47 +783,36 @@ public Set<KnowledgeSource> getKnowledgeSources() { return sources; } - - /*public void updateSuggestListItems() { - evalDescriptions = la.getCurrentlyBestEvaluatedDescriptions(view - .getPosAndNegSelectPanel().getOptionPanel().getNrOfConcepts(), - view.getPosAndNegSelectPanel().getOptionPanel() - .getMinAccuracy(), true); - // learnPanel.getListModel().clear(); - DefaultListModel dm = new DefaultListModel(); - Iterator<EvaluatedDescription> it = evalDescriptions.iterator(); - int i = 0; - while (it.hasNext()) { - Iterator<OWLOntology> ont = editor.getModelManager() - .getActiveOntologies().iterator(); - EvaluatedDescription eval = it.next(); - while (ont.hasNext()) { - String onto = ont.next().getURI().toString(); - if (eval.getDescription().toString().contains(onto)) { - if (isConsistent(eval)) { - dm.add(i, new SuggestListItem(Color.GREEN, eval - .getDescription().toManchesterSyntaxString( - onto, null))); - i++; + + /** + * Checks the URI if a "#" is in it. + */ + public void checkURI() { + Set<OWLOntology> ont = editor.getModelManager().getActiveOntologies(); + Set<Individual> indi = reasoner.getIndividuals(); + for(OWLOntology onto : ont) { + String ontURI = onto.getURI().toString(); + for(Individual ind : indi) { + if(ind.toString().contains(ontURI)) { + if(ind.toString().contains("#")) { + ontologieURI.add(onto.getURI().toString()+"#"); break; } else { - dm.add(i, new SuggestListItem(Color.RED, eval - .getDescription().toManchesterSyntaxString( - onto, null))); - i++; + ontologieURI.add(onto.getURI().toString()); break; } } } - } - view.getSuggestClassPanel().setSuggestList(dm); + } } - public void algorithmTerminated() { - error = "learning succesful"; - String message = "To view details about why a class description was suggested, please doubleclick on it."; - // start the algorithm and print the best concept found - view.renderErrorMessage(error); - view.setHintMessage(message); - }*/ + /** + * This method returns the Strings of the Ontology uri's that are currently used. + * @return ontologieURI + */ + public Set<String> getOntologyURIString() { + return ontologieURI; + } + + } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL 2008-12-16 16:24:53 UTC (rev 1556) +++ trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL 2008-12-17 15:05:28 UTC (rev 1557) @@ -11,6 +11,6 @@ To use the plugin go to view --> class views and click on class descriptions (including DL-Learner plugin). Put the new frame somewhere in the classes tab in Protégé and close the old class description view. All features are included in the plugin. -If you have problems look at the screen cast: http://dl-learner.org/files/screencast/protege/prot.htm +If you have problems look at the screen cast: http://dl-learner.org/wiki/ProtegePlugin. Modified: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2008-12-16 16:24:53 UTC (rev 1556) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2008-12-17 15:05:28 UTC (rev 1557) @@ -21,7 +21,7 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; -import java.util.Iterator; +import java.util.Set; import javax.swing.JDialog; import javax.swing.JLabel; @@ -32,7 +32,6 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.owl.Individual; -import org.semanticweb.owl.model.OWLOntology; @@ -110,6 +109,7 @@ private JPanel negNotCoveredPanel; private EvaluatedDescription eval; private JTextArea concept; + private Set<String> ontologiesStrings; private JTextArea conceptText; private final Color colorRed = new Color(139, 0, 0); private final Color colorGreen = new Color(0, 139, 0); @@ -237,120 +237,74 @@ * This method sets the Informations of the selected description. */ private void setInformation() { + ontologiesStrings = model.getOntologyURIString(); if(eval!=null) { //sets the accuracy of the selected concept - System.out.println("EVAL: " + eval.getDescription()); - if(eval.getDescription().toString().contains("#")) { - conceptText.setText(eval.getDescription().toManchesterSyntaxString(model.getURI().toString() + "#", null)); - } else { - conceptText.setText(eval.getDescription().toManchesterSyntaxString(model.getURI().toString(), null)); + for(String ontoString : ontologiesStrings) { + if(eval.getDescription().toString().contains(ontoString)) { + conceptText.setText(eval.getDescription().toManchesterSyntaxString(ontoString, null)); + break; + } } + + //sets the accuracy of the concept double acc = (eval.getAccuracy())*100; accuracyText.setText(String.valueOf(acc)+"%"); - Iterator<Individual> i = eval.getCoveredPositives().iterator(); - while (i.hasNext()) { - Iterator<OWLOntology> onto = model.getOWLEditorKit().getModelManager().getActiveOntologies().iterator(); - Individual ind = i.next(); - while (onto.hasNext()) { - String uri = onto.next().getURI().toString(); - if(ind.toString().contains("#")) { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); - posLabel.setForeground(colorGreen); - posCoveredPanel.add(posLabel); - break; - } - } else { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorGreen); - posCoveredPanel.add(posLabel); - break; - } - } + + //Sets positive Covered Examples for the detail panel + Set<Individual> indi = eval.getCoveredPositives(); + for(Individual ind : indi) { + for(String ontology : ontologiesStrings) { + if(ind.toString().contains(ontology)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(ontology, null)); + posLabel.setForeground(colorGreen); + posCoveredPanel.add(posLabel); + break; + } } + } - } + //sets the positive examples that are not covered - Iterator<Individual> a = eval.getNotCoveredPositives().iterator(); - while (a.hasNext()) { - Iterator<OWLOntology> onto = model.getOWLEditorKit().getModelManager().getActiveOntologies().iterator(); - Individual ind = a.next(); - while (onto.hasNext()) { - String uri = onto.next().getURI().toString(); - if(ind.toString().contains("#")) { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); - posLabel.setForeground(colorRed); - posNotCoveredPanel.add(posLabel); - break; - } - } else { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorRed); - posNotCoveredPanel.add(posLabel); - break; - } + Set<Individual> individuals = eval.getNotCoveredPositives(); + for(Individual ind : individuals) { + for(String onto : ontologiesStrings) { + if(ind.toString().contains(onto)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(onto, null)); + posLabel.setForeground(colorRed); + posNotCoveredPanel.add(posLabel); + break; } } - - } //sets the negative examples that are covered - Iterator<Individual> b = eval.getCoveredNegatives().iterator(); - while (b.hasNext()) { - Iterator<OWLOntology> onto = model.getOWLEditorKit().getModelManager().getActiveOntologies().iterator(); - Individual ind = b.next(); - while (onto.hasNext()) { - String uri = onto.next().getURI().toString(); - if(ind.toString().contains("#")) { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); - posLabel.setForeground(colorRed); - negCoveredPanel.add(posLabel); - break; - } - } else { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorRed); - negCoveredPanel.add(posLabel); - break; - } + Set<Individual> negCoveredIndi = eval.getCoveredNegatives(); + for(Individual negIndi : negCoveredIndi) { + for(String ont : ontologiesStrings) { + if(negIndi.toString().contains(ont)) { + JLabel posLabel = new JLabel(negIndi.toManchesterSyntaxString(ont, null)); + posLabel.setForeground(colorRed); + negCoveredPanel.add(posLabel); + break; } } - - - } + } //sets the negative examples that are not covered - Iterator<Individual> c = eval.getNotCoveredNegatives().iterator(); - while (c.hasNext()) { - Iterator<OWLOntology> onto = model.getOWLEditorKit().getModelManager().getActiveOntologies().iterator(); - Individual ind = c.next(); - while (onto.hasNext()) { - String uri = onto.next().getURI().toString(); - if(ind.toString().contains("#")) { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); - posLabel.setForeground(colorGreen); - negNotCoveredPanel.add(posLabel); - } - } else { - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorGreen); - negNotCoveredPanel.add(posLabel); - } + Set<Individual> negNotCoveredIndi = eval.getNotCoveredNegatives(); + for(Individual negNotIndi : negNotCoveredIndi) { + for(String ontol : ontologiesStrings) { + if(negNotIndi.toString().contains(ontol)) { + JLabel posLabel = new JLabel(negNotIndi.toManchesterSyntaxString(ontol, null)); + posLabel.setForeground(colorGreen); + negNotCoveredPanel.add(posLabel); + break; } - } - - + } } } + } } -} Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2008-12-16 16:24:53 UTC (rev 1556) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2008-12-17 15:05:28 UTC (rev 1557) @@ -119,8 +119,7 @@ editor = new ExpressionEditor<OWLDescription>(editorKit, editorKit.getModelManager().getOWLExpressionCheckerFactory().getOWLDescriptionChecker()); editor.setExpressionObject(description); - action = new ActionHandler(this.action, null, dllearner, null, - editorKit); + action = new ActionHandler(this.action, null, dllearner, null); tabbedPane = new JTabbedPane(); tabbedPane.setFocusable(false); editingComponent = new JPanel(new BorderLayout()); @@ -381,8 +380,7 @@ toggledIcon = new ImageIcon(toggledIconUrl); model = new DLLearnerModel(editorKit, current, label, this); sugPanel = new SuggestClassPanel(); - action = new ActionHandler(this.action, model, this, label, - editorKit); + action = new ActionHandler(this.action, model, this, label); adv = new JLabel("Advanced Settings"); advanced = new JToggleButton(icon); advanced.setVisible(true); @@ -438,6 +436,7 @@ model.clearVector(); model.unsetListModel(); model.initReasoner(); + model.checkURI(); model.setPosVector(); hint.setVisible(true); if (model.hasIndividuals()) { Modified: trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListCellRenderer.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListCellRenderer.java 2008-12-16 16:24:53 UTC (rev 1556) +++ trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListCellRenderer.java 2008-12-17 15:05:28 UTC (rev 1557) @@ -36,7 +36,7 @@ private static final long serialVersionUID = 8040385703448641356L; /** - * Construktor for the Cell Renderer for the Suggest List. + * Constructor for the Cell Renderer for the Suggest List. */ public SuggestListCellRenderer() { setOpaque(true); @@ -55,7 +55,7 @@ int arg2, boolean iss, boolean arg4) { // Set the text and // background color for rendering - setText(((SuggestListItem) value).getValue()); + setText(((SuggestListItem) value).getValue() + " " + "Accuracy: " + ((SuggestListItem) value).getAccuracy()+"%"); setBackground(Color.WHITE); setForeground(((SuggestListItem) value).getColor()); // Set a border if the list Modified: trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java 2008-12-16 16:24:53 UTC (rev 1556) +++ trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java 2008-12-17 15:05:28 UTC (rev 1557) @@ -29,15 +29,18 @@ private Color color; private String value; + private double accuracy; /** * Constructor for the SuggestListItem. * @param c Color Color in which the text is painted. * @param s String text that is shown. */ public SuggestListItem( - Color c, String s) { - color = c; - value = s; + Color c, String s, double acc) { + this.color = c; + this.value = s; + this.accuracy = acc; + } /** @@ -55,5 +58,13 @@ public String getValue() { return value; } + + /** + * This method returns the accuracy of the current list item. + * @return accuracy + */ + public double getAccuracy() { + return accuracy; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |