Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 2321:991e4a5df323
Enabled styling in timeseries charts.
flys-artifacts/trunk@4003 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 09 Feb 2012 14:27:47 +0000 |
parents | 6aeb71517136 |
children | 594885703687 cd4fb19ab892 |
comparison
equal
deleted
inserted
replaced
2320:bb04f958b7aa | 2321:991e4a5df323 |
---|---|
50 import de.intevation.flys.artifacts.FLYSArtifact; | 50 import de.intevation.flys.artifacts.FLYSArtifact; |
51 import de.intevation.flys.artifacts.resources.Resources; | 51 import de.intevation.flys.artifacts.resources.Resources; |
52 import de.intevation.flys.jfree.EnhancedLineAndShapeRenderer; | 52 import de.intevation.flys.jfree.EnhancedLineAndShapeRenderer; |
53 import de.intevation.flys.jfree.StableXYDifferenceRenderer; | 53 import de.intevation.flys.jfree.StableXYDifferenceRenderer; |
54 import de.intevation.flys.jfree.StyledAreaSeriesCollection; | 54 import de.intevation.flys.jfree.StyledAreaSeriesCollection; |
55 import de.intevation.flys.jfree.StyledXYSeries; | 55 import de.intevation.flys.jfree.Style; |
56 import de.intevation.flys.jfree.StyledSeries; | |
56 import de.intevation.flys.utils.FLYSUtils; | 57 import de.intevation.flys.utils.FLYSUtils; |
57 import de.intevation.flys.utils.ThemeAccess; | 58 import de.intevation.flys.utils.ThemeAccess; |
58 | 59 |
59 | 60 |
60 /** | 61 /** |
1175 * @param plot The plot. | 1176 * @param plot The plot. |
1176 * @param dataset The XYDataset which needs to support Series objects. | 1177 * @param dataset The XYDataset which needs to support Series objects. |
1177 * @param idx The index of the renderer / dataset. | 1178 * @param idx The index of the renderer / dataset. |
1178 */ | 1179 */ |
1179 protected void applyLineTheme(XYPlot plot, XYDataset dataset, int idx) { | 1180 protected void applyLineTheme(XYPlot plot, XYDataset dataset, int idx) { |
1181 logger.debug("Apply LineTheme for dataset at index: " + idx); | |
1182 | |
1180 LegendItemCollection lic = new LegendItemCollection(); | 1183 LegendItemCollection lic = new LegendItemCollection(); |
1181 LegendItemCollection anno = plot.getFixedLegendItems(); | 1184 LegendItemCollection anno = plot.getFixedLegendItems(); |
1182 | 1185 |
1183 Font legendFont = createLegendLabelFont(); | 1186 Font legendFont = createLegendLabelFont(); |
1184 | 1187 |
1185 XYLineAndShapeRenderer renderer = createRenderer(plot, idx); | 1188 XYLineAndShapeRenderer renderer = createRenderer(plot, idx); |
1186 | 1189 |
1187 for (int s = 0, num = dataset.getSeriesCount(); s < num; s++) { | 1190 for (int s = 0, num = dataset.getSeriesCount(); s < num; s++) { |
1188 Series series = getSeriesOf(dataset, s); | 1191 Series series = getSeriesOf(dataset, s); |
1189 | 1192 |
1190 if (series instanceof StyledXYSeries) { | 1193 if (series instanceof StyledSeries) { |
1191 ((StyledXYSeries) series).applyTheme(renderer, s); | 1194 Style style = ((StyledSeries) series).getStyle(); |
1195 style.applyTheme(renderer, s); | |
1192 } | 1196 } |
1193 | 1197 |
1194 // special case: if there is just one single item, we need to enable | 1198 // special case: if there is just one single item, we need to enable |
1195 // points for this series, otherwise we would not see anything in | 1199 // points for this series, otherwise we would not see anything in |
1196 // the chart area. | 1200 // the chart area. |