Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 2398:5d8d24984819
New abstract methods in ChartGenerator and moved a method from ChartGenerator to XYChartGenerator.
flys-artifacts/trunk@4024 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 10 Feb 2012 10:24:33 +0000 |
parents | cd4fb19ab892 |
children | 4e82bcd07550 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Fri Feb 10 10:20:02 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Fri Feb 10 10:24:33 2012 +0000 @@ -39,6 +39,7 @@ import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; +import de.intevation.flys.jfree.Bounds; import de.intevation.flys.jfree.FLYSAnnotation; import de.intevation.flys.jfree.StickyAxisAnnotation; import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; @@ -500,6 +501,37 @@ } + protected Range getValueAxisRange() { + String[] ranges = getValueAxisRangeFromRequest(); + + if (ranges == null || ranges.length < 2) { + logger.debug("No range specified. Lower and upper Y == 0"); + return null; + } + + if (ranges[0].length() > 0 && ranges[1].length() > 0) { + try { + double from = Double.parseDouble(ranges[0]); + double to = Double.parseDouble(ranges[1]); + + if (from == 0 && to == 0) { + logger.debug("No range specified. Lower and upper Y == 0"); + return null; + } + + return from > to + ? new Range(to, from) + : new Range(from, to); + } + catch (NumberFormatException nfe) { + logger.warn("Wrong values for value axis range."); + } + } + + return null; + } + + protected boolean zoomX(XYPlot plot, ValueAxis axis, Range range, Range x) { return zoom(plot, axis, range, x); } @@ -576,6 +608,38 @@ } + @Override + public Bounds getXBounds(int axis) { + // TODO IMPLEMENT ME + throw new RuntimeException( + "XYChartGenerator.getXBounds(int) not implemented"); + } + + + @Override + protected void setXBounds(int axis, Bounds bounds) { + // TODO IMPLEMENT ME + throw new RuntimeException( + "XYChartGenerator.setXBounds(int,Bounds) not implemented"); + } + + + @Override + public Bounds getYBounds(int axis) { + // TODO IMPLEMENT ME + throw new RuntimeException( + "XYChartGenerator.getYBounds(int) not implemented"); + } + + + @Override + protected void setYBounds(int axis, Bounds bounds) { + // TODO IMPLEMENT ME + throw new RuntimeException( + "XYChartGenerator.setYBounds(int,Bounds) not implemented"); + } + + /** Get color for hyk zones by their type (which is the name). */ public Paint colorForHYKZone(String zoneName) { if (zoneName.startsWith("R")) {