changeset 4283:7140bb0f92b0

Added new themes for W and Q markers in Historical Discharge WQ charts. ThemeUtil.parseLineColorField() will now use parseColor() to parse the color string. This enables using hex colors in theme configs.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 29 Oct 2012 06:54:48 +0100
parents 8b4988815974
children 7a94d5e7fc3d
files flys-artifacts/doc/conf/default-themes.xml flys-artifacts/doc/conf/second-themes.xml flys-artifacts/doc/conf/themes.xml flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledValueMarker.java flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java
diffstat 5 files changed, 68 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/default-themes.xml	Mon Oct 29 05:59:27 2012 +0100
+++ b/flys-artifacts/doc/conf/default-themes.xml	Mon Oct 29 06:54:48 2012 +0100
@@ -81,7 +81,7 @@
 
     <theme name="HistoricalDischargeWQCurve">
         <inherits>
-            <inherit from="DischargeCurve" />
+            <inherit from="HiddenColorLines" />
         </inherits>
         <fields>
             <field name="linecolor" type="Color" display="Linienfarbe"
@@ -89,6 +89,38 @@
         </fields>
     </theme>
 
+    <theme name="HistoricalDischargeWQW">
+        <inherits>
+            <inherit from="HiddenColorLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="#0000FF" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hidden="true" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hidden="true" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="5" hidden="true" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeWQQ">
+        <inherits>
+            <inherit from="HiddenColorLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hidden="true" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hidden="true" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="5" hidden="true" />
+        </fields>
+    </theme>
+
 
     <!-- Discharge Longitudinal Section -->
     <theme name="LongitudinalSectionW">
--- a/flys-artifacts/doc/conf/second-themes.xml	Mon Oct 29 05:59:27 2012 +0100
+++ b/flys-artifacts/doc/conf/second-themes.xml	Mon Oct 29 06:54:48 2012 +0100
@@ -72,6 +72,37 @@
         </inherits>
     </theme>
 
+    <theme name="HistoricalDischargeWQW">
+        <inherits>
+            <inherit from="DischargeCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hidden="true" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hidden="true" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="5" hidden="true" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeWQQ">
+        <inherits>
+            <inherit from="DischargeCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="104, 104, 104" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hidden="true" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hidden="true" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="5" hidden="true" />
+        </fields>
+    </theme>
 
     <!-- Discharge Longitudinal Section -->
     <theme name="LongitudinalSectionW">
--- a/flys-artifacts/doc/conf/themes.xml	Mon Oct 29 05:59:27 2012 +0100
+++ b/flys-artifacts/doc/conf/themes.xml	Mon Oct 29 06:54:48 2012 +0100
@@ -133,6 +133,8 @@
 		<mapping from="historical_discharge.historicalw" to="HistoricalDischargeCurveW" />
 		<mapping from="historical_discharge.historicalw.diff" to="HistoricalDischargeCurveWDiff" />
 		<mapping from="historical_discharge.wq.curve" to="HistoricalDischargeWQCurve" />
+		<mapping from="historical_discharge.wq.w" to="HistoricalDischargeWQW" />
+		<mapping from="historical_discharge.wq.q" to="HistoricalDischargeWQQ" />
 		<mapping from="cross_section" to="CrossSection" />
 		<mapping from="cross_section_water_line" to="CrossSectionWaterLine" />
 		<mapping from="computed_discharge_curve.q" to="ComputedDischargeCurve" />
--- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledValueMarker.java	Mon Oct 29 05:59:27 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledValueMarker.java	Mon Oct 29 06:54:48 2012 +0100
@@ -19,7 +19,7 @@
     public StyledValueMarker(double value, Document theme) {
         super(value);
 
-        Color color = ThemeUtil.parsePointColor(theme);
+        Color color = ThemeUtil.parseLineColorField(theme);
         if(color == null) {
             color = Color.BLACK;
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Mon Oct 29 05:59:27 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Mon Oct 29 06:54:48 2012 +0100
@@ -592,7 +592,7 @@
         String lineColorStr = getLineColorString(theme);
         logger.debug("parseLineColorField: lineColorStr = " +
                 (lineColorStr == null ? "null" : lineColorStr));
-        return parseRGB(lineColorStr);
+        return parseColor(lineColorStr);
     }
 
 

http://dive4elements.wald.intevation.org