Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/ChartInfoGenerator.java @ 9123:1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
author | gernotbelger |
---|---|
date | Tue, 05 Jun 2018 19:21:16 +0200 |
parents | 5e38e2924c07 |
children |
comparison
equal
deleted
inserted
replaced
9122:b8e7f6becf78 | 9123:1cc7653ca84f |
---|---|
67 | 67 |
68 public ChartInfoGenerator(ChartGenerator generator) { | 68 public ChartInfoGenerator(ChartGenerator generator) { |
69 this.generator = generator; | 69 this.generator = generator; |
70 } | 70 } |
71 | 71 |
72 @Override | |
72 public void setup(Object config) { | 73 public void setup(Object config) { |
73 log.debug("ChartInfoGenerator.setup"); | 74 log.debug("ChartInfoGenerator.setup"); |
74 } | 75 } |
75 | 76 |
76 | 77 |
79 * | 80 * |
80 * @param request | 81 * @param request |
81 * @param out | 82 * @param out |
82 * @param context | 83 * @param context |
83 */ | 84 */ |
85 @Override | |
84 public void init( | 86 public void init( |
85 String outName, | 87 String outName, |
86 Document request, | 88 Document request, |
87 OutputStream out, | 89 OutputStream out, |
88 CallContext context | 90 CallContext context |
96 /** | 98 /** |
97 * Dispatches the operation to the instantiated generator. | 99 * Dispatches the operation to the instantiated generator. |
98 * | 100 * |
99 * @param master The master artifact | 101 * @param master The master artifact |
100 */ | 102 */ |
103 @Override | |
101 public void setMasterArtifact(Artifact master) { | 104 public void setMasterArtifact(Artifact master) { |
102 generator.setMasterArtifact(master); | 105 generator.setMasterArtifact(master); |
103 } | 106 } |
104 | 107 |
105 | |
106 /** | 108 /** |
107 * Dispatches the operation to the instantiated generator. | 109 * Dispatches the operation to the instantiated generator. |
108 * | 110 * |
109 * @param collection The collection. | 111 * @param collection The collection. |
110 */ | 112 */ |
113 @Override | |
111 public void setCollection(D4EArtifactCollection collection) { | 114 public void setCollection(D4EArtifactCollection collection) { |
112 generator.setCollection(collection); | 115 generator.setCollection(collection); |
113 } | 116 } |
114 | 117 |
115 | |
116 /** | 118 /** |
117 * Dispatches the operation to the instantiated generator. | 119 * Dispatches the operation to the instantiated generator. |
118 */ | 120 */ |
119 @Override | 121 @Override |
120 public void doOut( | 122 public void doOut( |
135 public void generate() | 137 public void generate() |
136 throws IOException | 138 throws IOException |
137 { | 139 { |
138 log.debug("ChartInfoGenerator.generate"); | 140 log.debug("ChartInfoGenerator.generate"); |
139 | 141 |
140 JFreeChart chart = generator.generateChart(); | 142 JFreeChart chart = generator.generateChart(generator.getContext()); |
141 | 143 |
142 int[] size = generator.getSize(); | 144 int[] size = generator.getSize(); |
143 if (size == null) { | 145 if (size == null) { |
144 size = generator.getDefaultSize(); | 146 size = generator.getDefaultSize(); |
145 } | 147 } |