%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
com.wikihouse.wildcats0201.jdbcchart.dto.ChartFile |
|
|
1 | package com.wikihouse.wildcats0201.jdbcchart.dto; |
|
2 | ||
3 | import org.jfree.chart.JFreeChart; |
|
4 | ||
5 | import com.wikihouse.wildcats0201.jdbcchart.fsutil.Directory; |
|
6 | import com.wikihouse.wildcats0201.jdbcchart.fsutil.DirectoryFactory; |
|
7 | ||
8 | /** |
|
9 | * <B>ChartFile </B>. |
|
10 | * |
|
11 | * @author $Author: wildcats $ |
|
12 | * @version $Revision: 5 $ |
|
13 | */ |
|
14 | public class ChartFile { |
|
15 | ||
16 | private final String path; |
|
17 | ||
18 | private final String name; |
|
19 | ||
20 | private final FileType type; |
|
21 | ||
22 | /** |
|
23 | * 生成. |
|
24 | * |
|
25 | * @param path |
|
26 | * 生成パス |
|
27 | * @param name |
|
28 | * 生成ファイル名 |
|
29 | * @param type |
|
30 | * ファイルタイプ |
|
31 | * @param width |
|
32 | * グラフの横幅 |
|
33 | * @param height |
|
34 | * グラフの縦幅 |
|
35 | * @see FileTypeFactory#create(String,int,int) |
|
36 | */ |
|
37 | public ChartFile(String path, String name, String type, int width, |
|
38 | 2 | int height) { |
39 | 3 | this.path = path; |
40 | 3 | this.name = name; |
41 | 3 | this.type = FileTypeFactory.create(type, width, height); |
42 | 3 | } |
43 | 1 | |
44 | public String getName() { |
|
45 | 2 | return this.name; |
46 | 1 | } |
47 | ||
48 | public String getPath() { |
|
49 | 2 | return this.path; |
50 | 1 | } |
51 | ||
52 | private FileType getType() { |
|
53 | 0 | return this.type; |
54 | } |
|
55 | ||
56 | public void saveChart(JFreeChart myChart) { |
|
57 | 0 | String path = this.getPath(); |
58 | 0 | String createFileName = path + "/" + this.getName(); |
59 | 0 | Directory directory = DirectoryFactory.create(path); |
60 | 0 | directory.make(); |
61 | 0 | this.getType().saveChart(createFileName, myChart); |
62 | 0 | } |
63 | ||
64 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |