Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartArea.java @ 3257:2aca387333d6
Removed superfluous imports.
flys-artifacts/trunk@4893 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 08 Jul 2012 07:56:46 +0000 |
parents | 1dca41dba135 |
children | 9422b559b2d5 |
comparison
equal
deleted
inserted
replaced
3256:17ca0a43027a | 3257:2aca387333d6 |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import java.awt.BasicStroke; | 3 import org.jfree.chart.axis.ValueAxis; |
4 import java.awt.Color; | |
5 import java.awt.Font; | |
6 import java.awt.Paint; | |
7 import java.awt.Stroke; | |
8 | 4 |
9 import java.text.NumberFormat; | 5 import org.jfree.data.Range; |
10 | 6 |
11 import java.util.ArrayList; | 7 /** Two Ranges that span a rectangular area. */ |
12 import java.util.HashMap; | 8 public class ChartArea { |
13 import java.util.List; | 9 protected Range xRange; |
14 import java.util.Map; | 10 protected Range yRange; |
15 | 11 |
16 import org.w3c.dom.Document; | 12 public ChartArea(Range rangeX, Range rangeY) { |
13 this.xRange = rangeX; | |
14 this.yRange = rangeY; | |
15 } | |
17 | 16 |
18 import org.apache.log4j.Logger; | 17 public ChartArea(ValueAxis axisX, ValueAxis axisY) { |
18 this.xRange = axisX.getRange(); | |
19 this.yRange = axisY.getRange(); | |
20 } | |
19 | 21 |
20 import org.jfree.chart.ChartFactory; | 22 public double ofLeft(double percent) { |
21 import org.jfree.chart.JFreeChart; | 23 return xRange.getLowerBound() |
22 import org.jfree.chart.LegendItem; | 24 + xRange.getLength() * percent; |
23 import org.jfree.chart.LegendItemCollection; | 25 } |
24 import org.jfree.chart.annotations.XYBoxAnnotation; | |
25 import org.jfree.chart.annotations.XYLineAnnotation; | |
26 import org.jfree.chart.annotations.XYTextAnnotation; | |
27 import org.jfree.chart.axis.NumberAxis; | |
28 import org.jfree.chart.axis.ValueAxis; | |
29 import org.jfree.chart.plot.Marker; | |
30 import org.jfree.chart.plot.PlotOrientation; | |
31 import org.jfree.chart.plot.XYPlot; | |
32 import org.jfree.data.Range; | |
33 import org.jfree.data.general.Series; | |
34 import org.jfree.data.xy.XYSeries; | |
35 import org.jfree.data.xy.XYSeriesCollection; | |
36 import org.jfree.data.xy.XYDataset; | |
37 | 26 |
38 import org.jfree.ui.TextAnchor; | 27 public double ofRight(double percent) { |
28 return xRange.getUpperBound() | |
29 - xRange.getLength() * percent; | |
30 } | |
39 | 31 |
40 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | 32 public double ofGround(double percent) { |
41 import de.intevation.artifactdatabase.state.Facet; | 33 return yRange.getLowerBound() |
34 + yRange.getLength() * percent; | |
35 } | |
42 | 36 |
43 import de.intevation.flys.jfree.Bounds; | 37 public double atTop() { |
44 import de.intevation.flys.jfree.DoubleBounds; | 38 return yRange.getUpperBound(); |
45 import de.intevation.flys.jfree.FLYSAnnotation; | 39 } |
46 import de.intevation.flys.jfree.StickyAxisAnnotation; | |
47 import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; | |
48 import de.intevation.flys.jfree.StyledAreaSeriesCollection; | |
49 import de.intevation.flys.jfree.StyledXYSeries; | |
50 | 40 |
51 import de.intevation.flys.themes.ThemeAccess; | 41 public double atGround() { |
52 import de.intevation.flys.utils.ThemeUtil; | 42 return yRange.getLowerBound(); |
43 } | |
53 | 44 |
54 import de.intevation.flys.artifacts.model.HYKFactory; | 45 public double atRight() { |
46 return xRange.getUpperBound(); | |
47 } | |
55 | 48 |
56 import org.json.JSONArray; | 49 public double atLeft() { |
57 import org.json.JSONException; | 50 return xRange.getLowerBound(); |
51 } | |
58 | 52 |
59 /** Two Ranges that span a rectangular area. */ | 53 public double above(double percent, double base) { |
60 public class ChartArea { | 54 return base + yRange.getLength() * percent; |
61 protected Range xRange; | |
62 protected Range yRange; | |
63 | |
64 public ChartArea(Range rangeX, Range rangeY) { | |
65 this.xRange = rangeX; | |
66 this.yRange = rangeY; | |
67 } | |
68 | |
69 public ChartArea(ValueAxis axisX, ValueAxis axisY) { | |
70 this.xRange = axisX.getRange(); | |
71 this.yRange = axisY.getRange(); | |
72 } | |
73 | |
74 public double ofLeft(double percent) { | |
75 return xRange.getLowerBound() | |
76 + xRange.getLength() * percent; | |
77 } | |
78 | |
79 public double ofRight(double percent) { | |
80 return xRange.getUpperBound() | |
81 - xRange.getLength() * percent; | |
82 } | |
83 | |
84 public double ofGround(double percent) { | |
85 return yRange.getLowerBound() | |
86 + yRange.getLength() * percent; | |
87 } | |
88 | |
89 public double atTop() { | |
90 return yRange.getUpperBound(); | |
91 } | |
92 | |
93 public double atGround() { | |
94 return yRange.getLowerBound(); | |
95 } | |
96 | |
97 public double atRight() { | |
98 return xRange.getUpperBound(); | |
99 } | |
100 | |
101 public double atLeft() { | |
102 return xRange.getLowerBound(); | |
103 } | |
104 | |
105 public double above(double percent, double base) { | |
106 return base + yRange.getLength() * percent; | |
107 } | |
108 } | 55 } |
56 } |