Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 2574:3598690dc9e2
Fix flys/issue501 (manual points have two legend entries).
flys-artifacts/trunk@4105 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 01 Mar 2012 14:52:15 +0000 |
parents | c7b0dfa6a52c |
children | 5d5457a1bd5f |
comparison
equal
deleted
inserted
replaced
2573:39145db61317 | 2574:3598690dc9e2 |
---|---|
135 | 135 |
136 public void addArea(StyledAreaSeriesCollection series) { | 136 public void addArea(StyledAreaSeriesCollection series) { |
137 this.datasets.add(series); | 137 this.datasets.add(series); |
138 } | 138 } |
139 | 139 |
140 /** True if to be renedered as area. */ | 140 // TODO obsolete? |
141 /** True if to be rendered as area. */ | |
141 @Override | 142 @Override |
142 public boolean isArea(XYDataset series) { | 143 public boolean isArea(XYDataset series) { |
143 return (series instanceof StyledAreaSeriesCollection); | 144 return (series instanceof StyledAreaSeriesCollection); |
144 } | 145 } |
145 | 146 |
665 } | 666 } |
666 | 667 |
667 | 668 |
668 /** | 669 /** |
669 * Add a text and a line annotation. | 670 * Add a text and a line annotation. |
671 * @area convenience to determine positions in plot. | |
670 */ | 672 */ |
671 public void addStickyAnnotation( | 673 public void addStickyAnnotation( |
672 StickyAxisAnnotation annotation, | 674 StickyAxisAnnotation annotation, |
673 XYPlot plot, | 675 XYPlot plot, |
674 Area area, | 676 Area area, |
956 Document theme, | 958 Document theme, |
957 boolean visible | 959 boolean visible |
958 ){ | 960 ){ |
959 // Running into trouble here. | 961 // Running into trouble here. |
960 logger.debug("doAnnotations"); | 962 logger.debug("doAnnotations"); |
961 if (aandf == null) { | |
962 logger.warn( | |
963 "Facet for Annotations is null. " + | |
964 "This should never happen!"); | |
965 return; | |
966 } | |
967 | |
968 Facet facet = aandf.getFacet(); | |
969 | 963 |
970 // Add all annotations to our annotation pool. | 964 // Add all annotations to our annotation pool. |
971 annotations.setTheme(theme); | 965 annotations.setTheme(theme); |
972 if (facet != null) | 966 if (aandf != null) { |
967 Facet facet = aandf.getFacet(); | |
973 annotations.setLabel(aandf.getFacetDescription()); | 968 annotations.setLabel(aandf.getFacetDescription()); |
969 } | |
970 else { | |
971 logger.debug( | |
972 "Art/Facet for Annotations is null. " + | |
973 "This should never happen!"); | |
974 } | |
975 | |
974 addAnnotations(annotations, visible); | 976 addAnnotations(annotations, visible); |
975 } | 977 } |
976 | 978 |
977 | 979 |
978 /** | 980 /** |
1012 } | 1014 } |
1013 | 1015 |
1014 FLYSAnnotation annotations = new FLYSAnnotation(null, null, null, theme); | 1016 FLYSAnnotation annotations = new FLYSAnnotation(null, null, null, theme); |
1015 annotations.setTextAnnotations(xy); | 1017 annotations.setTextAnnotations(xy); |
1016 | 1018 |
1017 doAnnotations(annotations, aandf, theme, visible); | 1019 // Do not generate second legend entry. (null was passed for the aand before). |
1020 doAnnotations(annotations, null, theme, visible); | |
1018 addAxisSeries(series, axisIndex, visible); | 1021 addAxisSeries(series, axisIndex, visible); |
1019 } | 1022 } |
1020 | 1023 |
1021 | 1024 |
1022 /** Two Ranges that span a rectangular area. */ | 1025 /** Two Ranges that span a rectangular area. */ |