Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java @ 7691:fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
The SyncNumberAxis was completely broken. It only synced
in one direction and even that did not work correctly when
data was added to the axis (and the syncAxis rescaled but
forgot the old axis) then there were lots of ways to bypass
that scaling. And i also think the trans calculation was wrong.
It has been replaced by a "mostly" simple method to just keep
the W in M and W in CM+Datum axes in sync. I say "Mostly" because
it had to deal with the Bounds interface.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 13 Dec 2013 19:03:00 +0100 |
parents | b64c263df4d1 |
children | 75ef6963f1c9 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java Fri Dec 13 17:44:57 2013 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java Fri Dec 13 19:03:00 2013 +0100 @@ -61,8 +61,6 @@ public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurve"; public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; - protected NumberAxis firstYAxis; - /** Trivial Constructor. */ public ComputedDischargeCurveGenerator () { super(); @@ -100,40 +98,6 @@ return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); } - - /** - * Create Y (range) axis for given index, here with a special axis - * that depends on other axis (does translation and scaling for - * special case at gauge in cm). - * @return A NumberAxis, possibly scaled. - */ - @Override - protected NumberAxis createYAxis(int index) { - if (index == 0) { - firstYAxis = super.createYAxis(0); - return firstYAxis; - } - YAxisWalker walker = getYAxisWalker(); - - Font labelFont = new Font( - DEFAULT_FONT_NAME, - Font.BOLD, - getYAxisFontSize(index)); - - SyncNumberAxis axis = new SyncNumberAxis( - walker.getId(index), - getYAxisLabel(index), - firstYAxis); - - axis.setAutoRangeIncludesZero(false); - axis.setLabelFont(labelFont); - axis.setTickLabelFont(labelFont); - axis.setShift((double)-getCurrentGaugeDatum()); - - return axis; - } - - /** * Process data, build up plot. */