Mercurial > dive4elements > river
changeset 3032:8a24c1a7ae40
FixWQChartGenerator
flys-artifacts/trunk@4601 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 06 Jun 2012 09:21:24 +0000 |
parents | b3a6b8cefa6f |
children | aba4104f41c9 |
files | flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQChartGenerator.java |
diffstat | 1 files changed, 56 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQChartGenerator.java Wed Jun 06 08:48:15 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQChartGenerator.java Wed Jun 06 09:21:24 2012 +0000 @@ -1,35 +1,85 @@ package de.intevation.flys.exports.fixings; import de.intevation.artifactdatabase.state.ArtifactAndFacet; +import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.exports.ChartGenerator; import de.intevation.flys.exports.XYChartGenerator; +import org.apache.log4j.Logger; + import org.w3c.dom.Document; -public class FixWQChartGenerator extends XYChartGenerator { +public class FixWQChartGenerator +extends XYChartGenerator +implements FacetTypes +{ + private static Logger logger = + Logger.getLogger(FixWQChartGenerator.class); + + public static final String I18N_CHART_TITLE = + "chart.fixings.wq.title"; + + public static final String I18N_CHART_SUBTITLE = + "chart.fixings.wq.subtitle"; + + public static final String I18N_XAXIS_LABEL = + "chart.fixings.wq.xaxis.label"; + + public static final String I18N_YAXIS_LABEL = + "chart.fixings.wq.yaxis.label"; + + public static final String I18N_CHART_TITLE_DEFAULT = + "Fixierungsanalyse"; + + public static final String I18N_XAXIS_LABEL_DEFAULT = + "Q [m\u00B3/s]"; + + public static final String I18N_YAXIS_LABEL_DEFAULT = + "W [NN + m]"; + + public static enum YAXIS { + W(0), + Q(1); + public int idx; + private YAXIS(int c) { + idx = c; + } + } @Override public void doOut(ArtifactAndFacet bundle, Document attr, boolean visible) { - + String name = bundle.getFacetName(); + logger.debug("FixWQChartGenerator.doOut: " + name); } @Override protected String getDefaultChartTitle() { - return "FixWQChart"; + return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); } @Override protected String getDefaultXAxisLabel() { - return "LABEL"; + return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); } @Override protected String getDefaultYAxisLabel(int pos) { - return "LABEL"; + return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); } @Override protected ChartGenerator.YAxisWalker getYAxisWalker() { - return null; + return new YAxisWalker() { + @Override + public int length() { + return YAXIS.values().length; + } + + @Override + public String getId(int idx) { + YAXIS[] yaxes = YAXIS.values(); + return yaxes[idx].toString(); + } + }; } }