changeset 2193:73490b828a90

Manual Point Theming improved. flys-artifacts/trunk@3804 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 27 Jan 2012 14:21:51 +0000
parents 922c672ec6c1
children 05984871520f
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/themes.xml flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java
diffstat 3 files changed, 32 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Jan 27 14:19:22 2012 +0000
+++ b/flys-artifacts/ChangeLog	Fri Jan 27 14:21:51 2012 +0000
@@ -1,3 +1,10 @@
+2012-01-27  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* doc/conf/themes.xml: Better theme for manual points.
+
+	* src/main/java/de/intevation/flys/exports/XYChartGenerator.java:
+	  Theme text part of manual points. Offset it a bit.
+
 2012-01-27	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/Calculation5.java:
--- a/flys-artifacts/doc/conf/themes.xml	Fri Jan 27 14:19:22 2012 +0000
+++ b/flys-artifacts/doc/conf/themes.xml	Fri Jan 27 14:21:51 2012 +0000
@@ -680,6 +680,21 @@
         </fields>
     </theme>
 
+    <!-- Manual Points -->
+    <theme name="ManualPoints">
+        <inherits>
+            <inherit from="Points"/>
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="250, 0, 0"/>
+            <field name="font"      type="Font"  display="Schriftart"      default="arial"/>
+            <field name="textcolor" type="Color" display="Schriftfarbe"    default="0, 0, 0"/>
+            <field name="textsize"  type="int"   display="Schriftgröße" default="10"/>
+            <field name="textstyle" type="Style" display="Schriftstil"     default="standard"/>
+            <field name="pointsize"  type="int"     display="Punktdicke"           default="3"     hints="h"/>
+        </fields>
+    </theme>
+
     <!-- Height Marks -->
     <theme name="heightmarks_points">
         <inherits>
@@ -942,6 +957,6 @@
         <mapping from="cross_section.area" to="Area"/>
         <mapping from="hyk" to="Hyk"/>
         <mapping from="longitudinal_section.area" to="Area"/>
-        <mapping from="manualpoints" to="LongitudinalSectionPoints"/>
+        <mapping from="manualpoints" to="ManualPoints"/>
     </mappings>
 </themes>
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Fri Jan 27 14:19:22 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Fri Jan 27 14:21:51 2012 +0000
@@ -1186,6 +1186,11 @@
 
             // Other Text Annotations.
             for (XYTextAnnotation ta: fa.getTextAnnotations()) {
+                // Style the text.
+                if (textStyle != null) {
+                    textStyle.apply(ta);
+                }
+                ta.setY(area.above(0.05d, ta.getY()));
                 plot.getRenderer().addAnnotation(ta, org.jfree.ui.Layer.FOREGROUND);
             }
 
@@ -1674,6 +1679,10 @@
         public double atLeft() {
             return xRange.getLowerBound();
         }
+
+        public double above(double percent, double base) {
+            return base + yRange.getLength() * percent;
+        }
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org