Mercurial > dive4elements > gnv-client
changeset 333:19571fd1d0e8
Sourced ChartFactory call out to an own method, which is overriden by TimeSeriesChart.
gnv-artifacts/trunk@399 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 07 Dec 2009 10:33:31 +0000 |
parents | f5c25c86a625 |
children | e37930705daa |
files | gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java |
diffstat | 3 files changed, 25 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog Fri Dec 04 15:31:07 2009 +0000 +++ b/gnv-artifacts/ChangeLog Mon Dec 07 10:33:31 2009 +0000 @@ -1,3 +1,14 @@ +2009-12-07 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Changed method + generateChart to initChart, which just created a new timeseries chart. + General chart stuff is done in AbstractXYLineChart. + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Sourced + ChartFactory call out to a new initChart method. This has been done, + because TimeSeriesCharts needs to initiate another type of chart than + horizontal or vertical charts. + 2009-12-04 Ingo Weinzierl <ingo.weinzierl@intevation.de> * src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java:
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java Fri Dec 04 15:31:07 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java Mon Dec 07 10:33:31 2009 +0000 @@ -24,6 +24,7 @@ import de.intevation.gnv.geobackend.base.Result; import de.intevation.gnv.transition.describedata.KeyValueDescibeData; + /** * @author Ingo Weinzierl <ingo.weinzierl@intevation.de> */ @@ -55,6 +56,18 @@ if (chart != null) return chart; + initChart(); + + chart.addSubtitle(new TextTitle(labels.getSubtitle())); + + theme.apply(chart); + initData(); + + return chart; + } + + + protected void initChart() { chart = ChartFactory.createXYLineChart( labels.getTitle(), labels.getDomainAxisLabel(), @@ -65,13 +78,6 @@ false, false ); - - chart.addSubtitle(new TextTitle(labels.getSubtitle())); - - theme.apply(chart); - initData(); - - return chart; }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Fri Dec 04 15:31:07 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Mon Dec 07 10:33:31 2009 +0000 @@ -65,12 +65,7 @@ } - public JFreeChart generateChart() { - log.debug("generate timeseries chart"); - - if (chart != null) - return chart; - + protected void initChart() { chart = ChartFactory.createTimeSeriesChart( labels.getTitle(), labels.getDomainAxisLabel(), @@ -80,11 +75,6 @@ false, false ); - - theme.apply(chart); - initData(); - - return chart; }