diff src/java/de/intevation/mxd/writer/FillStyleWriter.java @ 101:461ee9193097

Write PATTERN to the style if a hatch symbol is used to fill a polygon.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 08 Jun 2011 12:29:26 +0200
parents 18e4f143896b
children 11d63bf00326
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/FillStyleWriter.java	Wed Jun 08 11:28:36 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/FillStyleWriter.java	Wed Jun 08 12:29:26 2011 +0200
@@ -183,6 +183,30 @@
             style.setOutlinewidth(Double.parseDouble(
                 symbolElement.getAttribute("outline_size")));
         }
+        if(symbolElement.hasAttribute("linestyle")) {
+            String ls = symbolElement.getAttribute("linestyle");
+            double[] vals;
+            if(ls.equals("dash")) {
+                style.setPatternlength(2);
+                vals = new double[] {2.0, 2.0};
+                style.setPattern(vals);
+            }
+            else if(ls.equals("dot")) {
+                style.setPatternlength(2);
+                vals = new double[] {1.0, 2.0};
+                style.setPattern(vals);
+            }
+            else if(ls.equals("dashdot")) {
+                style.setPatternlength(4);
+                vals = new double[] {2.0, 2.0, 1.0, 2.0};
+                style.setPattern(vals);
+            }
+            else if (ls.equals("dashdotdot")) {
+                style.setPatternlength(6);
+                vals = new double[] {2.0, 2.0, 1.0, 2.0, 1.0, 2.0};
+                style.setPattern(vals);
+            }
+        }
 
         if(type.equals("marker")) {
             style.setSymbolByName(map, name);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)