# HG changeset patch # User Felix Wolfsteller # Date 1335437125 0 # Node ID 6f5fc3de0d4861d0a904070c1bdc4f10044428ea # Parent 8aaa7f4ce06a462ba194c019e6c9c1dc27b63f70 Most of issue454: Label waterlines. flys-artifacts/trunk@4308 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8aaa7f4ce06a -r 6f5fc3de0d48 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Apr 26 09:51:13 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Apr 26 10:45:25 2012 +0000 @@ -1,3 +1,10 @@ +2012-04-26 Felix Wolfsteller + + Most of issue454: Label waterlevels. + + * src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java + (drawSecondaryPass): Use correct label for lines. + 2012-04-26 Felix Wolfsteller * src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java diff -r 8aaa7f4ce06a -r 6f5fc3de0d48 flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java --- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java Thu Apr 26 09:51:13 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java Thu Apr 26 10:45:25 2012 +0000 @@ -17,6 +17,7 @@ import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; import org.jfree.data.xy.XYDataset; +import org.jfree.data.xy.XYSeriesCollection; import org.jfree.ui.RectangleEdge; import org.jfree.util.BooleanList; import org.jfree.util.ShapeUtilities; @@ -236,12 +237,13 @@ (y1 < 0.0)); } - boolean doWaterlevelLabel = false; + // Draw label of line. if (isShowLineLabel(series) && isMinimumX (dataset, series, item)) { - // TODO find name of dataset/series - String waterlevelLabel = "label"; + String waterlevelLabel = + ((XYSeriesCollection) dataset).getSeries(series) + .getKey().toString(); // TODO Force water of some German rivers to flow direction mountains. - g2.drawString("waterlevel label", (float)xx, (float)yy-3f); + g2.drawString(waterlevelLabel, (float)xx, (float)yy-3f); } int domainAxisIndex = plot.getDomainAxisIndex(domainAxis);