From: <hee...@us...> - 2009-11-04 09:02:19
|
Revision: 1902 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1902&view=rev Author: heeroyuy Date: 2009-11-04 09:02:11 +0000 (Wed, 04 Nov 2009) Log Message: ----------- -code cleanup Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanelHandler.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-01 22:53:41 UTC (rev 1901) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-04 09:02:11 UTC (rev 1902) @@ -87,7 +87,6 @@ private final Color darkGreen; private final Color darkRed; private int notCoveredInd; - private final MoreDetailForSuggestedConceptsPanel panel; /** * @@ -97,24 +96,23 @@ * EvaluatedDescription * @param m * DLLearnerModel - * @param concept - * String - * @param p - * MoreDetailForSuggestedConceptsPanel */ - public GraphicalCoveragePanel(EvaluatedDescription desc, DLLearnerModel m, - String concept, MoreDetailForSuggestedConceptsPanel p) { + public GraphicalCoveragePanel(EvaluatedDescription desc, DLLearnerModel m) { this.setVisible(false); this.setForeground(Color.GREEN); this.setPreferredSize(new Dimension(540, 230)); eval = desc; model = m; - panel = p; id = model.getID(); darkGreen = new Color(0, 100, 0); darkRed = new Color(205, 0, 0); random = new Random(); - conceptNew = concept; + for(String uri : model.getOntologyURIString()) { + if(eval.getDescription().toString().contains(uri)) { + conceptNew = eval.getDescription().toManchesterSyntaxString(uri, null); + } + } + conceptVector = new Vector<String>(); posCovIndVector = new Vector<IndividualPoint>(); posNotCovIndVector = new Vector<IndividualPoint>(); @@ -638,15 +636,6 @@ } /** - * This method returns the MoreDetailForSuggestedConceptsPanel. - * - * @return MoreDetailForSuggestedConceptsPanel - */ - public MoreDetailForSuggestedConceptsPanel getMoreDetailForSuggestedConceptsPanel() { - return panel; - } - - /** * Returns the min. x value of the plus. * * @return int min X Value Modified: trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-11-01 22:53:41 UTC (rev 1901) +++ trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-11-04 09:02:11 UTC (rev 1902) @@ -56,7 +56,7 @@ } /** - * This is the second Construktor of the class. This should be used if more + * This is the second Constructor of the class. This should be used if more * details for the shown Individuals should be displayed. * @param p display String * @param x coordinate on the x axis @@ -76,14 +76,6 @@ } /** - * This method sets the display string of the individual. - * @param point the point to set - */ - public void setPoint(String point) { - this.point = point; - } - - /** * This method returns the display string of the individual. * @return the point */ @@ -92,14 +84,6 @@ } /** - * This method sets the x axis coordinate. - * @param xAxis the xAxis to set - */ - public void setXAxis(int xAxis) { - this.xAxis = xAxis; - } - - /** * This method returns the x axis coordinate. * @return the xAxis */ @@ -108,14 +92,6 @@ } /** - * This method sets the y axis coordinate. - * @param yAxis the yAxis to set - */ - public void setYAxis(int yAxis) { - this.yAxis = yAxis; - } - - /** * This method returns the y axis coordinate. * @return the yAxis */ Modified: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-11-01 22:53:41 UTC (rev 1901) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-11-04 09:02:11 UTC (rev 1902) @@ -19,14 +19,10 @@ */ package org.dllearner.tools.protege; import java.awt.Dimension; -import java.awt.GridLayout; -import java.util.Set; import javax.swing.JPanel; -import javax.swing.JTextArea; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.learningproblems.EvaluatedDescriptionClass; @@ -45,24 +41,11 @@ // Model of the dllearner private final DLLearnerModel model; - - // Textarea to render the accuracy of the concept - - private final JTextArea accuracy; - - - private final JTextArea accuracyText; - // Evaluated description of the selected concept - private final JPanel conceptPanel; - private EvaluatedDescription eval; - private final JTextArea concept; - private Set<String> ontologiesStrings; - private final JTextArea conceptText; + //private final JTextArea concept; private static final int HEIGHT = 230; private static final int WIDTH = 540; private GraphicalCoveragePanel p; - private final MoreDetailForSuggestedConceptsPanelHandler handler; /** * This is the constructor for the Panel. @@ -73,28 +56,6 @@ setLayout(null); setPreferredSize(new Dimension(WIDTH, HEIGHT)); this.model = model; - handler = new MoreDetailForSuggestedConceptsPanelHandler(this); - concept = new JTextArea("Class Description:"); - - concept.setEditable(false); - - - conceptPanel = new JPanel(new GridLayout(0, 2)); - conceptPanel.setBounds(5, 0, 800, 50); - - accuracy = new JTextArea("Accuracy:"); - accuracy.setEditable(false); - conceptText = new JTextArea(); - conceptText.setEditable(false); - - accuracyText = new JTextArea(); - //sets accuracy text area not editable - accuracyText.setEditable(false); - accuracy.setVisible(false); - accuracyText.setVisible(false); - concept.setVisible(false); - conceptText.setVisible(false); - } /** @@ -102,55 +63,20 @@ * @param desc selected description */ public void renderDetailPanel(EvaluatedDescription desc) { - accuracy.setVisible(false); - accuracyText.setVisible(false); - concept.setVisible(false); - conceptText.setVisible(false); eval = desc; //panel for the informations of the selected concept //this method adds the informations for the selected concept to the panel - this.setInformation(); - p = new GraphicalCoveragePanel(eval, model, conceptText.getText(), this); + p = new GraphicalCoveragePanel(eval, model); p.setBounds(5, 0, 600, 700); //adds all information to the example panel unsetEverything(); - conceptPanel.removeAll(); - conceptPanel.add(concept); - conceptPanel.add(accuracy); - conceptPanel.add(conceptText); - conceptPanel.add(accuracyText); - conceptPanel.setVisible(true); this.add(p); - this.addPropertyChangeListener(handler); } private void unsetEverything() { removeAll(); } - /** - * This method sets the Informations of the selected description. - */ - public void setInformation() { - ontologiesStrings = model.getOntologyURIString(); - if(eval!=null) { - //sets the accuracy of the selected concept - 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 = ((EvaluatedDescriptionClass) eval).getAccuracy()*100; - accuracyText.setText(String.valueOf(acc)+"%"); - } - accuracy.setVisible(true); - accuracyText.setVisible(true); - concept.setVisible(true); - conceptText.setVisible(true); - } /** @@ -162,31 +88,12 @@ } /** - * Returns the concept panel. - * @return concept panel - */ - public JPanel getConceptPanel() { - return conceptPanel; - } - - /** * Unsets the panel after plugin is closed. */ public void unsetPanel() { unsetEverything(); - conceptPanel.removeAll(); - accuracy.setVisible(false); - accuracyText.setVisible(false); - concept.setVisible(false); - conceptText.setVisible(false); if(p != null) { p.unsetPanel(); } - conceptPanel.add(concept); - conceptPanel.add(accuracy); - conceptPanel.add(conceptText); - conceptPanel.add(accuracyText); - conceptPanel.setVisible(false); - this.add(conceptPanel); } } Deleted: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanelHandler.java 2009-11-01 22:53:41 UTC (rev 1901) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanelHandler.java 2009-11-04 09:02:11 UTC (rev 1902) @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2007-2009, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.dllearner.tools.protege; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - -/** - * This is the Listener for the MoreDetailForSuggestedConceptsPanel. - * @author Christian Koetteritzsch - * - */ -public class MoreDetailForSuggestedConceptsPanelHandler implements PropertyChangeListener{ -private final MoreDetailForSuggestedConceptsPanel panel; - - /** - * This is the constructor of the class. - * @param m MoreDetailForSuggestedConceptsPanel - */ - public MoreDetailForSuggestedConceptsPanelHandler(MoreDetailForSuggestedConceptsPanel m) { - panel = m; - } - @Override - /** - * This methode sets the Informations on the panel where the - * graphic is shown. - */ - public void propertyChange(PropertyChangeEvent arg0) { - panel.setInformation(); - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |