Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java @ 450:20a480753ff9
Render labels in vertical cross section charts.
gnv-artifacts/trunk@498 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 04 Jan 2010 02:49:42 +0000 |
parents | f5a041000357 |
children | bc5901bb4525 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java Sun Jan 03 15:57:02 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java Mon Jan 04 02:49:42 2010 +0000 @@ -123,6 +123,25 @@ } } + public ValueAxis getDomainAxis() { + return getDomainAxis(0); + } + + public ValueAxis getDomainAxis(int index) { + return index < domainAxes.size() + ? (ValueAxis)domainAxes.get(index) + : null; + } + + public ValueAxis getRangeAxis() { + return getRangeAxis(0); + } + + public ValueAxis getRangeAxis(int index) { + return index < rangeAxes.size() + ? (ValueAxis)rangeAxes.get(index) + : null; + } public void configureRangeAxis() { // we just have 1 dataset @@ -191,6 +210,7 @@ if (!isEmptyOrNull(dataset)) { // draw data drawPolygons(savedG2, dataArea, info); + drawLabels(savedG2, dataArea, info); } g2.setClip(savedClip); @@ -270,12 +290,20 @@ } + private void drawLabels( + Graphics2D g2, + Rectangle2D area, + PlotRenderingInfo info + ) { + renderer.drawLabels(g2, this, area, dataset); + } + private void drawPolygons( Graphics2D g2, Rectangle2D area, PlotRenderingInfo info ) { - renderer.draw(g2, area, dataset); + renderer.drawPolygons(g2, area, dataset); } @@ -330,14 +358,14 @@ return space; } - private RectangleEdge getDomainAxisEdge() { + public RectangleEdge getDomainAxisEdge() { return Plot.resolveDomainAxisLocation( getDomainAxisLocation(), orientation ); } - private RectangleEdge getDomainAxisEdge(int idx) { + public RectangleEdge getDomainAxisEdge(int idx) { AxisLocation location = getDomainAxisLocation(idx); RectangleEdge result = Plot.resolveDomainAxisLocation( location, orientation @@ -350,14 +378,14 @@ } - private RectangleEdge getRangeAxisEdge() { + public RectangleEdge getRangeAxisEdge() { return Plot.resolveRangeAxisLocation( getRangeAxisLocation(), orientation ); } - private RectangleEdge getRangeAxisEdge(int idx) { + public RectangleEdge getRangeAxisEdge(int idx) { AxisLocation location = getRangeAxisLocation(idx); RectangleEdge result = Plot.resolveRangeAxisLocation( location,