diff flys-artifacts/src/main/java/de/intevation/flys/jfree/XYStyle.java @ 2648:8aaa7f4ce06a

Let theme define whether or not to display a (yet static) label for line). flys-artifacts/trunk@4306 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 26 Apr 2012 09:51:13 +0000
parents 991e4a5df323
children f1dcd5f94ffa
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/XYStyle.java	Thu Apr 26 08:11:48 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/XYStyle.java	Thu Apr 26 09:51:13 2012 +0000
@@ -13,6 +13,7 @@
 
 
 /**
+ * Utility to apply theme-settings to a renderer.
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
  */
 public class XYStyle implements Style {
@@ -38,6 +39,7 @@
         applyPointSize(r, idx);
         applyShowMinimum(r, idx);
         applyShowMaximum(r, idx);
+        applyShowLineLabel(r, idx);
 
         return r;
     }
@@ -50,6 +52,15 @@
     }
 
 
+    /** Tells the renderer whether or not to add a label to a line. */
+    protected void applyShowLineLabel(XYLineAndShapeRenderer r, int idx) {
+        if (!(r instanceof EnhancedLineAndShapeRenderer)) {
+            return;
+        }
+        boolean showLabelLine = ThemeUtil.parseShowLineLabel(theme);
+        ((EnhancedLineAndShapeRenderer)r).setShowLineLabel(showLabelLine, idx);
+    }
+
     protected void applyLineSize(XYLineAndShapeRenderer r, int idx) {
         int size = ThemeUtil.parseLineWidth(theme);
         r.setSeriesStroke(

http://dive4elements.wald.intevation.org