[PATCH 1 of 6] Fix area label rendering

Wald Commits scm-commit at wald.intevation.org
Tue Sep 24 18:37:45 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1380039231 -7200
# Node ID 988dde49ae654f58a78d36d831112ba93b1380eb
# Parent  4605d6ca4ee9155060eb43228843eb715bc21afc
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 ;)

diff -r 4605d6ca4ee9 -r 988dde49ae65 artifacts/doc/conf/themes/default.xml
--- 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>
 
diff -r 4605d6ca4ee9 -r 988dde49ae65 artifacts/doc/conf/themes/second.xml
--- 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>
 
diff -r 4605d6ca4ee9 -r 988dde49ae65 artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java
--- 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) {
diff -r 4605d6ca4ee9 -r 988dde49ae65 artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java
--- 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);


More information about the Dive4elements-commits mailing list