Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 2422:44dc117aa2b7
Picked rev 4058,4063,4065,4068,4069 from trunk.
flys-artifacts/tags/2.6.1@4077 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 17 Feb 2012 11:29:41 +0000 |
parents | dce0cc856357 |
children | bece6f604899 |
comparison
equal
deleted
inserted
replaced
2421:59047dfed8be | 2422:44dc117aa2b7 |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import java.awt.BasicStroke; | |
3 import java.awt.Color; | 4 import java.awt.Color; |
4 import java.awt.Font; | 5 import java.awt.Font; |
5 import java.awt.Paint; | 6 import java.awt.Paint; |
7 import java.awt.Stroke; | |
6 import java.awt.TexturePaint; | 8 import java.awt.TexturePaint; |
7 import java.awt.geom.Rectangle2D; | 9 import java.awt.geom.Rectangle2D; |
8 import java.awt.image.BufferedImage; | 10 import java.awt.image.BufferedImage; |
9 | 11 |
10 import java.io.IOException; | 12 import java.io.IOException; |
31 import org.jfree.chart.plot.XYPlot; | 33 import org.jfree.chart.plot.XYPlot; |
32 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; | 34 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; |
33 import org.jfree.data.Range; | 35 import org.jfree.data.Range; |
34 import org.jfree.data.general.Series; | 36 import org.jfree.data.general.Series; |
35 import org.jfree.data.xy.XYDataset; | 37 import org.jfree.data.xy.XYDataset; |
38 import org.jfree.ui.RectangleInsets; | |
36 | 39 |
37 import de.intevation.artifacts.Artifact; | 40 import de.intevation.artifacts.Artifact; |
38 import de.intevation.artifacts.CallContext; | 41 import de.intevation.artifacts.CallContext; |
39 import de.intevation.artifacts.CallMeta; | 42 import de.intevation.artifacts.CallMeta; |
40 import de.intevation.artifacts.PreferredLocale; | 43 import de.intevation.artifacts.PreferredLocale; |
906 return axisDataset; | 909 return axisDataset; |
907 } | 910 } |
908 | 911 |
909 | 912 |
910 /** | 913 /** |
914 * Adjust some Stroke/Grid parameters for <i>plot</i>. The chart | |
915 * <i>Settings</i> are applied in this method. | |
916 * | |
917 * @param plot The XYPlot which is adapted. | |
918 */ | |
919 protected void adjustPlot(XYPlot plot) { | |
920 Stroke gridStroke = new BasicStroke( | |
921 DEFAULT_GRID_LINE_WIDTH, | |
922 BasicStroke.CAP_BUTT, | |
923 BasicStroke.JOIN_MITER, | |
924 3.0f, | |
925 new float[] { 3.0f }, | |
926 0.0f); | |
927 | |
928 ChartSettings cs = getChartSettings(); | |
929 boolean isGridVisible = cs != null ? isGridVisible(cs) : true; | |
930 | |
931 plot.setDomainGridlineStroke(gridStroke); | |
932 plot.setDomainGridlinePaint(DEFAULT_GRID_COLOR); | |
933 plot.setDomainGridlinesVisible(isGridVisible); | |
934 | |
935 plot.setRangeGridlineStroke(gridStroke); | |
936 plot.setRangeGridlinePaint(DEFAULT_GRID_COLOR); | |
937 plot.setRangeGridlinesVisible(isGridVisible); | |
938 | |
939 plot.setAxisOffset(new RectangleInsets(0d, 0d, 0d, 0d)); | |
940 } | |
941 | |
942 | |
943 /** | |
911 * This helper mehtod is used to extract the current locale from instance | 944 * This helper mehtod is used to extract the current locale from instance |
912 * vairable <i>context</i>. | 945 * vairable <i>context</i>. |
913 * | 946 * |
914 * @return the current locale. | 947 * @return the current locale. |
915 */ | 948 */ |