Mercurial > dive4elements > river
changeset 1997:210020108ca4
Implemented the buildAxisSections() method in XYChartGenerator to include an AxisSection for the X axis.
flys-artifacts/trunk@3434 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 16 Dec 2011 10:35:08 +0000 |
parents | c6432e8ea31e |
children | 3862c50d1cf3 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java |
diffstat | 3 files changed, 31 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Fri Dec 16 10:25:55 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Dec 16 10:35:08 2011 +0000 @@ -1,3 +1,12 @@ +2011-12-16 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java: + Calls super.buildAxisSections(). + + * src/main/java/de/intevation/flys/exports/XYChartGenerator.java: + Implemented the method buildAxisSections(). The result list will contain + an AxisSection for the X axis. + 2011-12-16 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/collections/AttributeWriter.java: Bugfix:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Fri Dec 16 10:25:55 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Fri Dec 16 10:35:08 2011 +0000 @@ -467,7 +467,7 @@ @Override protected List<Section> buildAxisSections() { - List<Section> axisSections = new ArrayList<Section>(); + List<Section> axisSections = super.buildAxisSections(); for (YAXIS axis: YAXIS.values()) { String identifier = axis.toString();
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Fri Dec 16 10:25:55 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Fri Dec 16 10:35:08 2011 +0000 @@ -923,13 +923,30 @@ /** * Creates new Sections for chart axes. Subclasses of this ChartGenerator - * should override this method to include all necessary axes in that - * concrete chart. + * should override this method to include all necessary Y axes in that + * concrete chart. The only Section contained in the list is the X axis. * - * @return an empty list. + * @return a List that contains a Section for the X axis. */ protected List<Section> buildAxisSections() { - return new ArrayList<Section>(); + List<Section> axisSections = new ArrayList<Section>(); + + String identifier = "X"; + + AxisSection axisSection = new AxisSection(); + axisSection.setIdentifier(identifier); + axisSection.setLabel(getXAxisLabel()); + axisSection.setFontSize(14); + axisSection.setFixed(false); + + // XXX We are able to find better default ranges that [0,0], but the Y + // axes currently have no better ranges set. + axisSection.setUpperRange(0d); + axisSection.setLowerRange(0d); + + axisSections.add(axisSection); + + return axisSections; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :