changeset 7119:988dde49ae65

Fix area label rendering. Previously the showarealabel setting was neither parsed nor used to decide if the arealabel should be drawn. It is mostly off but enabled for Cross Sections. It is now also shown in the style editors in case someone got used to it ;)
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 24 Sep 2013 18:13:51 +0200
parents 4605d6ca4ee9
children d13398318b11
files artifacts/doc/conf/themes/default.xml artifacts/doc/conf/themes/second.xml artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java
diffstat 4 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/themes/default.xml	Tue Sep 24 16:23:18 2013 +0200
+++ b/artifacts/doc/conf/themes/default.xml	Tue Sep 24 18:13:51 2013 +0200
@@ -167,7 +167,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="false"/>
         </fields>
     </theme>
     <!-- top level classes defining additional attributes-->
@@ -1200,7 +1200,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="false"/>
         </fields>
     </theme>
 
@@ -1269,7 +1269,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="true"/>
         </fields>
     </theme>
 
@@ -1470,7 +1470,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="false"/>
         </fields>
     </theme>
 
--- a/artifacts/doc/conf/themes/second.xml	Tue Sep 24 16:23:18 2013 +0200
+++ b/artifacts/doc/conf/themes/second.xml	Tue Sep 24 18:13:51 2013 +0200
@@ -152,7 +152,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="false"/>
         </fields>
     </theme>
     <!-- top level classes defining additional attributes-->
@@ -1185,7 +1185,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="false"/>
         </fields>
     </theme>
 
@@ -1254,7 +1254,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="true"/>
         </fields>
     </theme>
 
@@ -1455,7 +1455,7 @@
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+                display="Flächenbeschriftung anzeigen" default="false"/>
         </fields>
     </theme>
 
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java	Tue Sep 24 16:23:18 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java	Tue Sep 24 18:13:51 2013 +0200
@@ -70,7 +70,7 @@
         applyShowShape(renderer);
         applyOutlineColor(renderer);
         applyOutlineStyle(renderer);
-        applyShowArea(renderer);
+        applyShowAreaLabel(renderer);
         if (mode == FILL_MODE.UNDER) {
             renderer.setAreaCalculationMode(StableXYDifferenceRenderer.CALCULATE_NEGATIVE_AREA);
         }
@@ -139,8 +139,8 @@
     }
 
     /** Inform renderer whether it should draw a label. */
-    protected void applyShowArea(StableXYDifferenceRenderer renderer) {
-        renderer.setLabelArea(theme.parseShowArea());
+    protected void applyShowAreaLabel(StableXYDifferenceRenderer renderer) {
+        renderer.setLabelArea(theme.parseShowAreaLabel());
     }
 
     protected void applyOutlineStyle(StableXYDifferenceRenderer renderer) {
--- a/artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java	Tue Sep 24 16:23:18 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java	Tue Sep 24 18:13:51 2013 +0200
@@ -73,6 +73,8 @@
 
     public final static String SHOW_AREA = "showarea";
 
+    public final static String SHOW_AREA_LABEL = "showarealabel";
+
     public final static String SHOW_MIDDLE_HEIGHT = "showmiddleheight";
 
     public final static String LABEL_FONT_COLOR = "labelfontcolor";
@@ -416,6 +418,11 @@
         return parseBoolean(show, false);
     }
 
+    public boolean parseShowAreaLabel() {
+        String show = getValue(SHOW_AREA_LABEL);
+        return parseBoolean(show, false);
+    }
+
     public boolean parseShowPointLabel() {
         String show = getValue(SHOW_POINT_LABEL);
         return parseBoolean(show, false);

http://dive4elements.wald.intevation.org