1 package org.codehaus.mojo.dashboard.report.plugin.chart;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.awt.Paint;
20 import java.util.ResourceBundle;
21
22 import org.codehaus.mojo.dashboard.report.plugin.beans.CheckstyleReportBean;
23 import org.codehaus.mojo.dashboard.report.plugin.beans.IDashBoardReportBean;
24 import org.codehaus.mojo.dashboard.report.plugin.utils.ChartUtils;
25 import org.jfree.chart.ChartColor;
26
27
28
29
30
31
32 public class CheckstylePieChartStrategy extends AbstractPieChartStrategy
33 {
34
35
36
37
38
39
40
41
42 public CheckstylePieChartStrategy( ResourceBundle bundle, String title, IDashBoardReportBean dashboardReport )
43 {
44 super( bundle, title, dashboardReport );
45 }
46
47
48
49
50 public void fillDataset()
51 {
52 if ( mDashboardReport instanceof CheckstyleReportBean )
53 {
54 CheckstyleReportBean checkstyleReportBean = (CheckstyleReportBean) mDashboardReport;
55
56 int info = checkstyleReportBean.getNbInfos();
57 int error = checkstyleReportBean.getNbErrors();
58 int warn = checkstyleReportBean.getNbWarnings();
59
60 this.defaultdataset.setValue( this.bundle.getString( "report.checkstyle.column.infos" ) + " = " + info,
61 info );
62
63 this.defaultdataset.setValue( this.bundle.getString( "report.checkstyle.column.errors" ) + " = " + error,
64 error );
65
66 this.defaultdataset.setValue( this.bundle.getString( "report.checkstyle.column.warnings" ) + " = " + warn,
67 warn );
68 }
69 }
70
71
72
73
74 public Paint[] getPaintColor()
75 {
76 return new Paint[] { ChartUtils.BLUE_LIGHT, ChartColor.RED, ChartUtils.YELLOW_LIGHT };
77 }
78 }