changeset 2659:4d8959a4b49d

Actually use font specified in theme document for linelabel. flys-artifacts/trunk@4333 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 02 May 2012 19:54:58 +0000
parents 08b7e8edda41
children 1a044c51abe4
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java
diffstat 3 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed May 02 19:02:55 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed May 02 19:54:58 2012 +0000
@@ -1,3 +1,13 @@
+2012-05-02	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	Actually use the font specified in theme document for linelabel.
+
+	* src/main/java/de/intevation/flys/utils/ThemeUtil.java:
+	  Fixed paths for linelabel-related fields in theme doc.
+
+	* src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java:
+	  Set font for linelabel.
+
 2012-05-02	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* doc/conf/themes.xml: No default background show for linelabels.
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java	Wed May 02 19:02:55 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java	Wed May 02 19:54:58 2012 +0000
@@ -252,7 +252,11 @@
                 ? ((HasLabel)xYSeries).getLabel()
                 : xYSeries.getKey().toString();
             // TODO Force water of some German rivers to flow direction mountains.
+            Font oldFont = g2.getFont();
+            g2.setFont(this.getLineLabelFont(series));
+            // TODO set color
             g2.drawString(waterlevelLabel, (float)xx, (float)yy-3f);
+            g2.setFont(oldFont);
         }
 
         int domainAxisIndex = plot.getDomainAxisIndex(domainAxis);
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Wed May 02 19:02:55 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Wed May 02 19:54:58 2012 +0000
@@ -56,22 +56,22 @@
         "/theme/field[@name='showlinelabel']/@default";
 
     public final static String XPATH_LINE_LABEL_FONT =
-        "/theme/field[@name='showlinelabelfont']/@default";
+        "/theme/field[@name='linelabelfont']/@default";
 
     public final static String XPATH_LINE_LABEL_COLOR =
-        "/theme/field[@name='showlinelabelcolor']/@default";
+        "/theme/field[@name='linelabelcolor']/@default";
 
     public final static String XPATH_LINE_LABEL_SIZE =
-        "/theme/field[@name='showlinelabelsize']/@default";
+        "/theme/field[@name='linelabelsize']/@default";
 
     public final static String XPATH_LINE_LABEL_STYLE =
-        "/theme/field[@name='showlinelabelstyle']/@default";
+        "/theme/field[@name='linelabelstyle']/@default";
 
     public final static String XPATH_LINE_LABEL_BGCOLOR =
-        "/theme/field[@name='showlinelabelbgcolor']/@default";
+        "/theme/field[@name='linelabelbgcolor']/@default";
 
     public final static String XPATH_LINE_LABEL_SHOWBG =
-        "/theme/field[@name='showlinelabelshowbg']/@default";
+        "/theme/field[@name='linelabelshowbg']/@default";
 
     public final static String XPATH_TRANSPARENCY =
         "/theme/field[@name='transparent']/@default";

http://dive4elements.wald.intevation.org