View Javadoc

1   package net.sf.statcvs.pages;
2   
3   import net.sf.statcvs.Messages;
4   import net.sf.statcvs.charts.ChartImage;
5   import net.sf.statcvs.charts.LOCChartMaker.MainLOCChartMaker;
6   import net.sf.statcvs.output.ReportConfig;
7   
8   public class LOCPageMaker {
9       private final ReportConfig config;
10  
11      public LOCPageMaker(final ReportConfig config) {
12          this.config = config;
13      }
14  
15      public NavigationNode toFile() {
16          final ChartImage chart = new MainLOCChartMaker("loc", this.config, "loc.png", this.config.getLargeChartSize()).toFile();
17  
18          final Page result = config.createPage("loc", Messages.getString("LOC_TITLE"), Messages.getString("LOC_TITLE"));
19          result.addAttribute(Messages.getString("TOTAL_LOC_TITLE"), this.config.getRepository().getCurrentLOC());
20          result.addAttribute(Messages.getString("MOST_RECENT_COMMIT"), this.config.getRepository().getLastDate());
21          result.add(chart);
22          return result;
23      }
24  }