changeset 1815:a97764363ba2

Apply point theme to heightmark data imported via datacage to longitudinal section diagram. flys-artifacts/trunk@3144 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 02 Nov 2011 13:41:39 +0000
parents a9b690d864a7
children 5364b86a0880
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/winfo.xml flys-artifacts/doc/conf/meta-data.xml flys-artifacts/doc/conf/themes.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFacet.java flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java
diffstat 8 files changed, 70 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Nov 02 13:41:39 2011 +0000
@@ -1,3 +1,30 @@
+2011-11-02	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	Apply point theme to heightmarks when imported in longitudinal
+	section diagram.
+
+	* src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java:
+	  Added new FacetType HEIGHTMARK_POINTS.
+	
+	* src/main/java/de/intevation/flys/artifacts/model/WKmsFacet.java:
+	  Allow name to be given in constructor.
+	
+	* src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java:
+	  If heightmarks were loaded, give respective name in WKmsFacet
+	  generation.
+
+	* doc/conf/themes.xml: Added virtual "Points" and concrete
+	  heightmark_points - theme.
+	
+	* doc/conf/artifacts/winfo.xml: Made longitudinal_section output
+	  compatible with heightmarks_points.
+
+	* src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java:
+	  Render heightmarks like other wkms.
+	
+	* doc/conf/meta-data.xml: Changed heightmark ids such that it can be
+	  identified in StaticWKmsFacet .
+
 2011-11-02	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/StyledXYSeries.java:
--- a/flys-artifacts/doc/conf/artifacts/winfo.xml	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/doc/conf/artifacts/winfo.xml	Wed Nov 02 13:41:39 2011 +0000
@@ -169,6 +169,7 @@
                         <facet name="longitudinal_section.w" description="facet.longitudinal_section.w"/>
                         <facet name="w_differences" description="facet.w_differences"/>
                         <facet name="other.wkms" description="facet.other.wkms"/>
+                        <facet name="heightmarks_points" description="facet.other.wkms.heightmarks_points"/>
                         <facet name="longitudinal_section.annotations" description="facet.longitudinal_section.annotations"/>
                     </facets>
                 </outputmode>
@@ -247,6 +248,7 @@
                     <facet name="longitudinal_section.q" description="facet.longitudinal_section.q"/>
                     <facet name="w_differences"          description="facet.w_differences"/>
                     <facet name="other.wkms"             description="facet.other.wkms"/>
+                    <facet name="heightmarks_points" description="facet.other.wkms.heightmarks_points"/>
                     <facet name="longitudinal_section.annotations" description="facet.longitudinal_section.annotations"/>
                   </facets>
                 </outputmode>
--- a/flys-artifacts/doc/conf/meta-data.xml	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Wed Nov 02 13:41:39 2011 +0000
@@ -145,7 +145,7 @@
                           <dc:elements>
                             <column>
                               <dc:attribute name="name" value="${prot_column_name}"/>
-                              <dc:attribute name="ids" value="heightmarks-wstv-${prot_rel_pos}-${prot_id}"/>
+                              <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/>
                               <dc:attribute name="factory" value="staticwkms"/>
                             </column>
                           </dc:elements>
--- a/flys-artifacts/doc/conf/themes.xml	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/doc/conf/themes.xml	Wed Nov 02 13:41:39 2011 +0000
@@ -492,6 +492,16 @@
         </fields>
     </theme>
 
+    <!-- Height Marks -->
+    <theme name="heightmarks_points">
+        <inherits>
+            <inherit from="Points"/>
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="0, 0, 0"/>
+        </fields>
+    </theme>
+
 
     <!-- Virtual themes are following now! -->
     <theme name="Lines" type="virtual">
@@ -502,6 +512,15 @@
         </fields>
     </theme>
 
+    <theme name="Points" type="virtual">
+        <fields>
+            <field name="showlines"  type="boolean" display="Linie anzeigen"  default="false"/>
+            <field name="linesize"   type="int"     display="Liniendicke"     default="1"/>
+            <field name="linetype"   type="Dash"    display="Linienart"       default="10"/>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen" default="true"/>
+        </fields>
+    </theme>
+
     <theme name="ColorLines" type="virtual">
         <inherits>
             <inherit from="Lines"/>
@@ -613,5 +632,6 @@
         <mapping from="w_differences" to="Differences"/>
         <mapping from="floodmap.riveraxis" to="RiverAxis"/>
         <mapping from="floodmap.kms" to="Kms"/>
+        <mapping from="heightmarks_points" to="heightmarks_points"/>
     </mappings>
 </themes>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java	Wed Nov 02 13:41:39 2011 +0000
@@ -16,6 +16,7 @@
 import de.intevation.artifacts.ArtifactNamespaceContext;
 import de.intevation.artifacts.CallMeta;
 
+import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.WKms;
 import de.intevation.flys.artifacts.model.WKmsFacet;
 import de.intevation.flys.artifacts.model.WKmsFactory;
@@ -34,6 +35,7 @@
  */
 public class StaticWKmsArtifact
 extends      StaticFLYSArtifact
+implements   FacetTypes
 {
     /** The logger for this class. */
     private static Logger logger =
@@ -96,7 +98,16 @@
 
                     String wkmsName = WKmsFactory.getWKmsName(col, wst);
 
+                    String name;
+                    if (parts[0].equals(HEIGHTMARKS_POINTS)) {
+                        name = HEIGHTMARKS_POINTS;
+                    }
+                    else {
+                        name = STATIC_WKMS;
+                    }
+
                     Facet facet = new WKmsFacet(
+                        name,
                         Resources.getMsg(
                             callMeta,
                             wkmsName,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Wed Nov 02 13:41:39 2011 +0000
@@ -35,6 +35,8 @@
 
     String STATIC_WKMS = "other.wkms";
 
+    String HEIGHTMARKS_POINTS = "heightmarks_points";
+
     String CSV = "csv";
     String WST = "wst";
     String AT  = "at";
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFacet.java	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFacet.java	Wed Nov 02 13:41:39 2011 +0000
@@ -17,9 +17,13 @@
 
     /** Trivial Constructor. */
     public WKmsFacet(String description) {
+        this(STATIC_WKMS, description);
+    }
+
+    public WKmsFacet(String name, String description) {
+        this.name        = name;
         this.description = description;
-        name = STATIC_WKMS;
-        index = 0;
+        this.index       = 0;
     }
 
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Wed Nov 02 12:16:32 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Wed Nov 02 13:41:39 2011 +0000
@@ -279,7 +279,7 @@
         else if (name.equals(LONGITUDINAL_ANNOTATION)) {
             doAnnotationsOut(f.getData(artifact, context), facet, attr, visible);
         }
-        else if (name.equals(STATIC_WKMS)) {
+        else if (name.equals(STATIC_WKMS) || name.equals(HEIGHTMARKS_POINTS)) {
             doWOut((WKms) f.getData(artifact, context), facet, attr, visible);
         }
         else if (name.equals(W_DIFFERENCES)) {

http://dive4elements.wald.intevation.org