# HG changeset patch # User Christian Lins # Date 1338974484 0 # Node ID 8a24c1a7ae404a225635a7257ddade2be66d6fec # Parent b3a6b8cefa6f329b6444154eecb9a710bb45aabc FixWQChartGenerator flys-artifacts/trunk@4601 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r b3a6b8cefa6f -r 8a24c1a7ae40 flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQChartGenerator.java --- 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(); + } + }; } }