diff flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java @ 3015:9cea02b51241

Added better doc and todo. flys-artifacts/trunk@4580 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 05 Jun 2012 11:53:51 +0000
parents bdc86e61428c
children e19ff9086035
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java	Tue Jun 05 09:11:24 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java	Tue Jun 05 11:53:51 2012 +0000
@@ -66,8 +66,17 @@
     }
 
 
-    /** Draw a background-box of a text to render. */
-    public static void drawTextBox(Graphics2D g2, String text, float textX, float textY, Color bgColor) {
+    /**
+     * Draw a background-box of a text to render.
+     * @param g2 graphics device to use
+     * @param text text to draw
+     * @param textX x-position for text
+     * @param textY y-position for text
+     * @param bgColor color to fill box with.
+     */
+    public static void drawTextBox(Graphics2D g2,
+        String text, float textX, float textY, Color bgColor
+    ) {
         Rectangle2D hotspotBox = g2.getFontMetrics().getStringBounds(text, g2);
         float w = (float) hotspotBox.getWidth(), h = (float) hotspotBox.getHeight();
         hotspotBox.setRect(textX, textY-h, w, h);
@@ -263,6 +272,7 @@
         }
 
         // Draw label of line.
+        // TODO add colision detection
         if (isShowLineLabel(series) && isMinimumX (dataset, series, item)) {
             XYSeries xYSeries = ((XYSeriesCollection) dataset).getSeries(series);
             String waterlevelLabel = (xYSeries instanceof HasLabel)

http://dive4elements.wald.intevation.org