# HG changeset patch # User Felix Wolfsteller # Date 1328534400 0 # Node ID c9a40e3fdf163a28327461e563cdebb2ddf66ab9 # Parent 1dad713412a76d78bac0422d80edae6b5ae457a2 Added a second Y axis for ReferenceCurveGenerator. flys-artifacts/trunk@3922 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 1dad713412a7 -r c9a40e3fdf16 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Feb 06 13:09:05 2012 +0000 +++ b/flys-artifacts/ChangeLog Mon Feb 06 13:20:00 2012 +0000 @@ -1,3 +1,9 @@ +2012-02-06 Felix Wolfsteller + + * src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java: + Added further i18n stubs. + Also added a second Y axis (experimental, to ease axis labeling etc.). + 2012-02-06 Felix Wolfsteller * doc/conf/artifacts/winfo.xml: Register new export output and csv diff -r 1dad713412a7 -r c9a40e3fdf16 flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java Mon Feb 06 13:09:05 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java Mon Feb 06 13:20:00 2012 +0000 @@ -30,13 +30,16 @@ implements FacetTypes { public static enum YAXIS { - W(0); + W_M(0), + W_CM(1); + public int idx; private YAXIS(int c) { idx = c; } } + /** House logger. */ private static Logger logger = Logger.getLogger(ReferenceCurveGenerator.class); @@ -46,6 +49,18 @@ public static final String I18N_CHART_SUBTITLE = "chart.reference.curve.subtitle"; + public static final String W_CM_DEFAULT = + "chart.reference.curve.wcm"; + + public static final String W_NNM_DEFAULT = + "chart.reference.curve.wnn"; + + public static final String START_GAUGE = + "chart.reference.curve.start_at_gauge"; + + public static final String START_FREE = + "chart.reference.curve.start_free"; + /* public static final String I18N_XAXIS_LABEL = @@ -54,16 +69,19 @@ public static final String I18N_YAXIS_LABEL = "chart.reference.curve.yaxis.label"; */ - public static final String I18N_CHART_TITLE_DEFAULT = - "Bezugslinie"; /* public static final String I18N_XAXIS_LABEL_DEFAULT = - "W [NN+m]"; + "W [NN + m]"; public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; */ + + public static final String I18N_CHART_TITLE_DEFAULT = + "Bezugslinie"; + + public ReferenceCurveGenerator() { super(); } @@ -79,7 +97,8 @@ String label = getYAxisLabel(index); NumberAxis axis = createNumberAxis(index, label); - if (index == YAXIS.W.idx) { + // TODO aspect-ratio settings. + if (index == YAXIS.W_M.idx) { axis.setAutoRangeIncludesZero(false); } axis.setLabelFont(labelFont); @@ -117,6 +136,7 @@ @Override protected String getDefaultXAxisLabel() { // TODO i18nreturn msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); + // at_gauge + w_cm return "W am Bezugsort- oder Pegel."; } @@ -128,10 +148,13 @@ @Override protected String getDefaultYAxisLabel(int index) { String label = "default"; - if (index == YAXIS.W.idx) { + if (index == YAXIS.W_M.idx) { //label = msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); - //TODO i18n - return "W am Zielort oder -pegel"; + //TODO i18n + return "W am Zielort"; + } + else if (index == YAXIS.W_CM.idx) { + return "W am Zielpegel"; } return label; @@ -169,6 +192,7 @@ } + /** Register DataSeries with (maybe transformed) points. */ public void doReferenceOut( Object data, Document theme, @@ -191,7 +215,12 @@ series.add(values[0], values[1], false); } - addAxisSeries(series, YAXIS.W.idx, visible); + if (ww.endAtGauge()) { + addAxisSeries(series, YAXIS.W_M.idx, visible); + } + else { + addAxisSeries(series, YAXIS.W_CM.idx, visible); + } }