From: <hee...@us...> - 2009-03-24 15:55:26
|
Revision: 1663 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1663&view=rev Author: heeroyuy Date: 2009-03-24 15:55:16 +0000 (Tue, 24 Mar 2009) Log Message: ----------- -small changes in option panel and graphical panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-03-24 13:59:23 UTC (rev 1662) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-03-24 15:55:16 UTC (rev 1663) @@ -57,7 +57,7 @@ private int shiftXAxis; private int distortionOld; private final Ellipse2D oldConcept; - private Ellipse2D newConcept; + private final Ellipse2D newConcept; private EvaluatedDescription eval; private final DLLearnerModel model; @@ -120,9 +120,9 @@ points = new Vector<IndividualPoint>(); this.computeGraphics(); handler = new GraphicalCoveragePanelHandler(this, desc, model); - oldConcept = new Ellipse2D.Float(ELLIPSE_X_AXIS + (2 * adjustment), + oldConcept = new Ellipse2D.Double(ELLIPSE_X_AXIS + (2 * adjustment), ELLIPSE_Y_AXIS, WIDTH, HEIGHT); - newConcept = new Ellipse2D.Float(ELLIPSE_X_AXIS + shiftXAxis + newConcept = new Ellipse2D.Double(ELLIPSE_X_AXIS + shiftXAxis + adjustment, ELLIPSE_Y_AXIS, WIDTH + distortionOld, HEIGHT + distortionOld); this.computeIndividualPoints(); @@ -148,7 +148,15 @@ g2D.drawString(conceptVector.get(i), 320, p); p = p + 20; } - + g2D.setColor(darkGreen); + g2D.drawString("*", 310, p+3); + g2D.setColor(Color.BLACK); + g2D.drawString("positive Example", 320, p); + p = p + 20; + g2D.setColor(darkRed); + g2D.drawString("*", 310, p+3); + g2D.setColor(Color.BLACK); + g2D.drawString("negative Example", 320, p); g2D.setColor(Color.YELLOW); g2D.fill(oldConcept); g2D.fillOval(310, 0, 9, 9); @@ -301,7 +309,7 @@ .getAdditionalInstances().size(); distortionOld = 0; adjustment = 0; - Ellipse2D old = new Ellipse2D.Float(ELLIPSE_X_AXIS, ELLIPSE_Y_AXIS, + Ellipse2D old = new Ellipse2D.Double(ELLIPSE_X_AXIS, ELLIPSE_Y_AXIS, WIDTH, HEIGHT); x1 = (int) old.getCenterX() - PLUS_SIZE; x2 = (int) old.getCenterX() + PLUS_SIZE; @@ -313,9 +321,9 @@ shiftXAxis = (int) Math.round(WIDTH * (1 - coverage)); if (additionalIndividualSize != 0) { distortionOld = (int) Math.round(WIDTH * 0.3); - newConcept = new Ellipse2D.Float(ELLIPSE_X_AXIS + shiftXAxis, + Ellipse2D newer = new Ellipse2D.Double(ELLIPSE_X_AXIS + shiftXAxis, ELLIPSE_Y_AXIS, WIDTH, HEIGHT); - adjustment = (int) Math.round(newConcept.getCenterY() / 4); + adjustment = (int) Math.round(newer.getCenterY() / 4); } this.renderPlus(); } @@ -353,24 +361,27 @@ while (i > 0) { int sub = conceptNew.indexOf(" "); String subString = conceptNew.substring(0, sub) + " "; - conceptNew = conceptNew.replace(conceptNew.substring(0, sub+1), ""); - while(sub < SUBSTRING_SIZE) { - if(conceptNew.length() > 0 && conceptNew.contains(" ")) { - sub = conceptNew.indexOf(" "); - if(subString.length() + sub < SUBSTRING_SIZE) { - subString = subString + conceptNew.substring(0, sub) + " "; - conceptNew = conceptNew.replace(conceptNew.substring(0, sub+1), ""); - System.out.println("string: " + subString + " lenght: " + subString.length()); - sub = subString.length(); + conceptNew = conceptNew.replace(conceptNew.substring(0, sub + 1), + ""); + while (sub < SUBSTRING_SIZE) { + if (conceptNew.length() > 0 && conceptNew.contains(" ")) { + sub = conceptNew.indexOf(" "); + if (subString.length() + sub < SUBSTRING_SIZE) { + subString = subString + conceptNew.substring(0, sub) + + " "; + conceptNew = conceptNew.replace(conceptNew.substring(0, + sub + 1), ""); + sub = subString.length(); + } else { + break; + } } else { - break; - } - } else { - if(subString.length() + conceptNew.length() > SUBSTRING_SIZE + SPACE_SIZE) { - conceptVector.add(subString); - subString = conceptNew; - conceptNew = ""; - break; + if (subString.length() + conceptNew.length() > SUBSTRING_SIZE + + SPACE_SIZE) { + conceptVector.add(subString); + subString = conceptNew; + conceptNew = ""; + break; } else { subString = subString + conceptNew; conceptNew = ""; @@ -395,16 +406,20 @@ flag = true; if (i < MAX_NUMBER_OF_INDIVIDUAL_POINTS) { while (flag) { - if (this.isInCircle(x, y, newConcept) - && this.isInCircle(x, y, oldConcept) + if (newConcept.contains(x, y) + && oldConcept.contains(x, y) && !(x >= this.getX1() + this.getShiftCovered() - - 5 && x <= this.getX2() - + this.getShiftCovered() + 5 - && y >= this.getY1() - 5 && y <= this - .getY2() + 5)) { - posCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toString())); + + this.getShiftCovered() + && y >= this.getY1() && y <= this + .getY2())) { + Set<String> uriString = model.getOntologyURIString(); + for(String uri : uriString) { + if(ind.toString().contains(uri)) { + posCovIndVector.add(new IndividualPoint("*", + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null))); + } + } i++; flag = false; @@ -429,29 +444,38 @@ flag = true; if (j < MAX_NUMBER_OF_INDIVIDUAL_POINTS) { while (flag) { - if (!this.isInCircle(x, y, oldConcept) - && this.isInCircle(x, y, newConcept) + if (!oldConcept.contains(x, y) + && newConcept.contains(x, y) && !(x >= this.getX1() - + this.getShiftNewConcept() - 5 + + this.getShiftNewConcept() && x <= this.getX2() - + this.getShiftNewConcept() + 5 - && y >= this.getY1() - 5 && y <= this - .getY2() + 5) + + this.getShiftNewConcept() + && y >= this.getY1() && y <= this + .getY2()) && !(x >= this.getX1() - + this.getShiftNewConceptX() - 5 + + this.getShiftNewConceptX() && x <= this.getX2() + this.getShiftNewConceptX() - + 5 && y >= this.getY1() - + this.getShiftNewConcept() - 5 && y <= this + + this.getShiftNewConcept() && y <= this .getY2() - + 5 + this.getShiftNewConcept())) { + + this.getShiftNewConcept())) { if (id.equals(EQUI_STRING)) { - posNotCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toString())); + Set<String> uriString = model.getOntologyURIString(); + for(String uri : uriString) { + if(ind.toString().contains(uri)) { + posNotCovIndVector.add(new IndividualPoint("*", + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null))); + } + } } else { - additionalIndividuals.add(new IndividualPoint( - "*", (int) x, (int) y, ind.toString())); + Set<String> uriString = model.getOntologyURIString(); + for(String uri : uriString) { + if(ind.toString().contains(uri)) { + additionalIndividuals.add(new IndividualPoint("*", + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null))); + } + } } j++; flag = false; @@ -477,16 +501,21 @@ flag = true; if (k < MAX_NUMBER_OF_INDIVIDUAL_POINTS) { while (flag) { - if (this.isInCircle(x, y, oldConcept) - && !this.isInCircle(x, y, newConcept) - && !(x >= this.getX1() - 5 + if (oldConcept.contains(x, y) + && !newConcept.contains(x, y) + && !(x >= this.getX1() - this.getShiftOldConcept() - && x <= this.getX2() + 5 + && x <= this.getX2() - this.getShiftOldConcept() - && y >= this.getY1() - 5 && y <= this - .getY2() + 5)) { - posNotCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toString())); + && y >= this.getY1() && y <= this + .getY2())) { + Set<String> uriString = model.getOntologyURIString(); + for(String uri : uriString) { + if(ind.toString().contains(uri)) { + posNotCovIndVector.add(new IndividualPoint("*", + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null))); + } + } k++; flag = false; x = random.nextInt(300); @@ -622,7 +651,7 @@ public boolean isInCircle(double x, double y, Ellipse2D ell) { int r = (WIDTH / 2) * (WIDTH / 2); int n = (int) ((x - ell.getCenterX()) * (x - ell.getCenterX())) - + (int) ((y - ell.getCenterY()) * (y - ell.getCenterY())); + + (int) ((y - ell.getCenterY()-5) * (y - ell.getCenterY()-5)); if (n <= r) { return true; } else { Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java 2009-03-24 13:59:23 UTC (rev 1662) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java 2009-03-24 15:55:16 UTC (rev 1663) @@ -93,8 +93,6 @@ && m.getY() >= panel.getY1() && m.getY() <= panel.getY2()) { panel.getGraphicalCoveragePanel().setToolTipText( "To view all Individuals please click on the plus"); - } else { - panel.getGraphicalCoveragePanel().setToolTipText(null); } Vector<IndividualPoint> v = panel.getIndividualVector(); @@ -131,7 +129,12 @@ int i = covInd.size(); if (i > 0) { for (Individual ind : covInd) { - individualComboBox.add(ind.toString()); + Set<String> uriString = model.getOntologyURIString(); + for(String uri : uriString) { + if(ind.toString().contains(uri)) { + individualComboBox.add(ind.toManchesterSyntaxString(uri, null)); + } + } } indiBox = new JComboBox(individualComboBox); scrollPopup = new BasicComboPopup(indiBox); @@ -162,7 +165,12 @@ int i = addInd.size(); if (i > 0) { for (Individual ind : addInd) { - individualComboBox.add(ind.toString()); + Set<String> uriString = model.getOntologyURIString(); + for(String uri : uriString) { + if(ind.toString().contains(uri)) { + individualComboBox.add(ind.toManchesterSyntaxString(uri, null)); + } + } } indiBox = new JComboBox(individualComboBox); scrollPopup = new BasicComboPopup(indiBox); @@ -187,7 +195,12 @@ int i = notCovInd.size(); if (i > 0) { for (Individual ind : notCovInd) { - individualComboBox.add(ind.toString()); + Set<String> uriString = model.getOntologyURIString(); + for(String uri : uriString) { + if(ind.toString().contains(uri)) { + individualComboBox.add(ind.toManchesterSyntaxString(uri, null)); + } + } } indiBox = new JComboBox(individualComboBox); scrollPopup = new BasicComboPopup(indiBox); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2009-03-24 13:59:23 UTC (rev 1662) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2009-03-24 15:55:16 UTC (rev 1663) @@ -50,7 +50,7 @@ minAccuracyLabel.setBounds(5, 0, 150, 40); maxExecutionTimeLabel = new JLabel("maximum execution time"); maxExecutionTimeLabel.setBounds(5, 40, 150, 40); - nrOfConceptsLabel = new JLabel("maximum number of results"); + nrOfConceptsLabel = new JLabel("max. number of results"); nrOfConceptsLabel.setBounds(5, 80, 150, 40); minAccuracy = new JSlider(0, 50, 5); @@ -61,9 +61,9 @@ minAccuracy.setBounds(200, 0, 200, 40); - maxExecutionTime = new JSlider(2, 20, 8); + maxExecutionTime = new JSlider(0, 40, 8); maxExecutionTime.setPaintTicks(true); - maxExecutionTime.setMajorTickSpacing(5); + maxExecutionTime.setMajorTickSpacing(10); maxExecutionTime.setMinorTickSpacing(1); maxExecutionTime.setPaintLabels(true); maxExecutionTime.setBounds(200, 40, 200, 40); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |