christian@3242: package de.intevation.flys.exports; christian@3242: christian@3242: import java.awt.BasicStroke; christian@3242: import java.awt.Color; christian@3242: import java.awt.Font; christian@3242: import java.awt.Paint; christian@3242: import java.awt.Stroke; christian@3242: christian@3242: import java.text.NumberFormat; christian@3242: christian@3242: import java.util.ArrayList; christian@3242: import java.util.HashMap; christian@3242: import java.util.List; christian@3242: import java.util.Map; christian@3242: christian@3242: import org.w3c.dom.Document; christian@3242: christian@3242: import org.apache.log4j.Logger; christian@3242: christian@3242: import org.jfree.chart.ChartFactory; christian@3242: import org.jfree.chart.JFreeChart; christian@3242: import org.jfree.chart.LegendItem; christian@3242: import org.jfree.chart.LegendItemCollection; christian@3242: import org.jfree.chart.annotations.XYBoxAnnotation; christian@3242: import org.jfree.chart.annotations.XYLineAnnotation; christian@3242: import org.jfree.chart.annotations.XYTextAnnotation; christian@3242: import org.jfree.chart.axis.NumberAxis; christian@3242: import org.jfree.chart.axis.ValueAxis; christian@3242: import org.jfree.chart.plot.Marker; christian@3242: import org.jfree.chart.plot.PlotOrientation; christian@3242: import org.jfree.chart.plot.XYPlot; christian@3242: import org.jfree.data.Range; christian@3242: import org.jfree.data.general.Series; christian@3242: import org.jfree.data.xy.XYSeries; christian@3242: import org.jfree.data.xy.XYSeriesCollection; christian@3242: import org.jfree.data.xy.XYDataset; christian@3242: christian@3242: import org.jfree.ui.TextAnchor; christian@3242: christian@3242: import de.intevation.artifactdatabase.state.ArtifactAndFacet; christian@3242: import de.intevation.artifactdatabase.state.Facet; christian@3242: christian@3242: import de.intevation.flys.jfree.Bounds; christian@3242: import de.intevation.flys.jfree.DoubleBounds; christian@3242: import de.intevation.flys.jfree.FLYSAnnotation; christian@3242: import de.intevation.flys.jfree.StickyAxisAnnotation; christian@3242: import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; christian@3242: import de.intevation.flys.jfree.StyledAreaSeriesCollection; christian@3242: import de.intevation.flys.jfree.StyledXYSeries; christian@3242: christian@3242: import de.intevation.flys.themes.ThemeAccess; christian@3242: import de.intevation.flys.utils.ThemeUtil; christian@3242: christian@3242: import de.intevation.flys.artifacts.model.HYKFactory; christian@3242: christian@3242: import org.json.JSONArray; christian@3242: import org.json.JSONException; christian@3242: christian@3242: /** Two Ranges that span a rectangular area. */ christian@3242: public class ChartArea { christian@3242: protected Range xRange; christian@3242: protected Range yRange; christian@3242: christian@3242: public ChartArea(Range rangeX, Range rangeY) { christian@3242: this.xRange = rangeX; christian@3242: this.yRange = rangeY; christian@3242: } christian@3242: christian@3242: public ChartArea(ValueAxis axisX, ValueAxis axisY) { christian@3242: this.xRange = axisX.getRange(); christian@3242: this.yRange = axisY.getRange(); christian@3242: } christian@3242: christian@3242: public double ofLeft(double percent) { christian@3242: return xRange.getLowerBound() christian@3242: + xRange.getLength() * percent; christian@3242: } christian@3242: christian@3242: public double ofRight(double percent) { christian@3242: return xRange.getUpperBound() christian@3242: - xRange.getLength() * percent; christian@3242: } christian@3242: christian@3242: public double ofGround(double percent) { christian@3242: return yRange.getLowerBound() christian@3242: + yRange.getLength() * percent; christian@3242: } christian@3242: christian@3242: public double atTop() { christian@3242: return yRange.getUpperBound(); christian@3242: } christian@3242: christian@3242: public double atGround() { christian@3242: return yRange.getLowerBound(); christian@3242: } christian@3242: christian@3242: public double atRight() { christian@3242: return xRange.getUpperBound(); christian@3242: } christian@3242: christian@3242: public double atLeft() { christian@3242: return xRange.getLowerBound(); christian@3242: } christian@3242: christian@3242: public double above(double percent, double base) { christian@3242: return base + yRange.getLength() * percent; christian@3242: } christian@3242: }