geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r508660 - in /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report: ChartHelper.groovy model/IterationModel.groovy model/TestModel.groovy
Date Fri, 16 Feb 2007 23:55:55 GMT
Author: jdillon
Date: Fri Feb 16 15:55:55 2007
New Revision: 508660

URL: http://svn.apache.org/viewvc?view=rev&rev=508660
Log:
Hooked up linking from charts

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ChartHelper.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ChartHelper.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ChartHelper.groovy?view=diff&rev=508660&r1=508659&r2=508660
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ChartHelper.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/ChartHelper.groovy
Fri Feb 16 15:55:55 2007
@@ -31,10 +31,16 @@
 import org.jfree.chart.ChartFactory
 import org.jfree.chart.ChartUtilities
 import org.jfree.chart.ChartRenderingInfo
+
 import org.jfree.chart.entity.StandardEntityCollection
+
 import org.jfree.chart.plot.PiePlot
+
 import org.jfree.chart.imagemap.ImageMapUtilities
 
+import org.jfree.chart.urls.PieURLGenerator
+
+import org.jfree.data.general.PieDataset
 import org.jfree.data.general.DefaultPieDataset
 
 /**
@@ -122,11 +128,13 @@
         def dataset = new DefaultPieDataset()
         
         group.sort().each {
-            dataset.setValue(it.displayName, it.count)
+            dataset.setValue(it, it.count)
         }
         
         //
         // TODO: Add url handling, to allow imagemap to link to iteration detail pages
+        //       See org.jfree.chart.urls.PieURLGenerator, probably have to install a
+        //       PieSectionLabelGenerator and PieToolTipGenerator, since we will need
         //
         
         def chart = ChartFactory.createPieChart('TestCase Distribution', dataset, false,
true, false)
@@ -135,7 +143,22 @@
         // Disable labels, tool-tip used to see details
         chart.plot.labelGenerator = null
         
+        // Allow linking
+        chart.plot.setURLGenerator(new ModelPieURLGenerator(baseURI))
+        
         return render(chart, 500, 300)
     }
 }
 
+class ModelPieURLGenerator implements PieURLGenerator
+{
+    def baseURI
+    
+    def ModelPieURLGenerator(baseURI) {
+        this.baseURI = baseURI
+    }
+    
+    String generateURL(PieDataset dataset, Comparable model, int pieIndex) {
+        return "$baseURI/${model.href}"
+    }
+}

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy?view=diff&rev=508660&r1=508659&r2=508660
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/IterationModel.groovy
Fri Feb 16 15:55:55 2007
@@ -124,5 +124,9 @@
     String getFrameHref() {
         return "iteration-${iterationIndex}-frame.html"
     }
+    
+    String toString() {
+        return "$iterationIndex :: $displayName"
+    }
 }
 

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy?view=diff&rev=508660&r1=508659&r2=508660
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/config/projects/Geronimo_CTS/report/model/TestModel.groovy
Fri Feb 16 15:55:55 2007
@@ -80,5 +80,9 @@
     String getDisplayName() {
         return name
     }
+    
+    String toString() {
+        return displayName
+    }
 }
 



Mime
View raw message