Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/jfree/AnnotationHelper.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | 432addd00687 |
children | c086b06b81e5 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
31 | 31 |
32 import org.apache.log4j.Logger; | 32 import org.apache.log4j.Logger; |
33 | 33 |
34 /** Annotation helper class, handles plotting of annotations. */ | 34 /** Annotation helper class, handles plotting of annotations. */ |
35 public class AnnotationHelper { | 35 public class AnnotationHelper { |
36 private static final Logger logger = Logger.getLogger(AnnotationHelper.class); | 36 private static final Logger log = Logger.getLogger(AnnotationHelper.class); |
37 | 37 |
38 protected static float ANNOTATIONS_AXIS_OFFSET = 0.02f; | 38 protected static float ANNOTATIONS_AXIS_OFFSET = 0.02f; |
39 | 39 |
40 /* arr this would be better in chartsettings */ | 40 /* arr this would be better in chartsettings */ |
41 public static final int DEFAULT_FONT_SIZE = 12; | 41 public static final int DEFAULT_FONT_SIZE = 12; |
47 * @param plot Plot to add annotations to. | 47 * @param plot Plot to add annotations to. |
48 * @param settings ChartSettings object for settings. | 48 * @param settings ChartSettings object for settings. |
49 */ | 49 */ |
50 public static void addAnnotationsToRenderer(List<RiverAnnotation> annotations, | 50 public static void addAnnotationsToRenderer(List<RiverAnnotation> annotations, |
51 XYPlot plot, ChartSettings settings, Map<Integer, AxisDataset> datasets) { | 51 XYPlot plot, ChartSettings settings, Map<Integer, AxisDataset> datasets) { |
52 logger.debug("addAnnotationsToRenderer"); | 52 log.debug("addAnnotationsToRenderer"); |
53 | 53 |
54 if (annotations == null || annotations.isEmpty()) { | 54 if (annotations == null || annotations.isEmpty()) { |
55 logger.debug("addAnnotationsToRenderer: no annotations."); | 55 log.debug("addAnnotationsToRenderer: no annotations."); |
56 return; | 56 return; |
57 } | 57 } |
58 | 58 |
59 // OPTMIMIZE: Pre-calculate positions | 59 // OPTMIMIZE: Pre-calculate positions |
60 ChartArea area = new ChartArea( | 60 ChartArea area = new ChartArea( |
165 else { | 165 else { |
166 // Do the more complicated case where we stick to the Y-Axis. | 166 // Do the more complicated case where we stick to the Y-Axis. |
167 // There is one nasty case (duration curves, where annotations | 167 // There is one nasty case (duration curves, where annotations |
168 // might stick to the second y-axis). | 168 // might stick to the second y-axis). |
169 if (dataset == null) { | 169 if (dataset == null) { |
170 logger.warn("Annotation should stick to unfindable y-axis: " | 170 log.warn("Annotation should stick to unfindable y-axis: " |
171 + annotation.getAxisSymbol()); | 171 + annotation.getAxisSymbol()); |
172 rendererIndex = 0; | 172 rendererIndex = 0; |
173 } | 173 } |
174 else { | 174 else { |
175 rendererIndex = dataset.getPlotAxisIndex(); | 175 rendererIndex = dataset.getPlotAxisIndex(); |