changeset 177:9fd61f4ac0e3

Write lines with width smaller than 1 and write further line attributes.
author raimund renkert <raimund.renkert@intevation.de>
date Thu, 07 Jul 2011 15:05:08 +0200 (2011-07-07)
parents d95dbd643add
children d10d5f560b1a
files ChangeLog src/java/de/intevation/mxd/writer/LineStyleWriter.java
diffstat 2 files changed, 39 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 07 14:19:56 2011 +0200
+++ b/ChangeLog	Thu Jul 07 15:05:08 2011 +0200
@@ -1,3 +1,9 @@
+2011-07-07  Raimund Renkert  <raimund.renkert@intevation.de>
+
+	* src/java/de/intevation/mxd/writer/LineStyleWriter.java:
+	  Set line width to 1 if the width is smaller than 1 in mxd file and
+	  write further line attributes to the style object.
+
 2011-07-07  Raimund Renkert  <raimund.renkert@intevation.de>
 
 	* src/java/de/intevation/mxd/writer/SymbolWriter.java:
--- a/src/java/de/intevation/mxd/writer/LineStyleWriter.java	Thu Jul 07 14:19:56 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/LineStyleWriter.java	Thu Jul 07 15:05:08 2011 +0200
@@ -52,7 +52,7 @@
                 w = 0;
             }
             if(w < 1.0) {
-                return false;
+                w = 1;
             }
             style.setWidth((int)w);
         }
@@ -86,6 +86,38 @@
                 style.setSize (1);
             }
         }
+
+        if(symbolElement.hasAttribute("offset")) {
+            double offset = 0;
+            try {
+                offset = Double.parseDouble(
+                             symbolElement.getAttribute("offset"));
+                if(Math.abs(offset) < 1 && offset > 0) {
+                    offset = 1;
+                }
+                else if (Math.abs(offset) < 1 && offset < 0) {
+                    offset = -1;
+                }
+                style.setOffsetx(offset);
+                style.setOffsety(-99); 
+            }
+            catch(NumberFormatException nfe) {
+                logger.warn("Could not set offset.");
+            }
+        }
+
+        if(symbolElement.hasAttribute("miterlimit")) {
+            double miter = 0;
+            try {
+                miter = Double.parseDouble(
+                            symbolElement.getAttribute("miterlimit"));
+                style.setLinejoinmaxsize(miter);
+            }
+            catch(NumberFormatException nfe) {
+                logger.warn("Could not set miter limit.");
+            }
+        }
+
         String type = symbolElement.getAttribute("type");
         if(type.equals("marker")) {
             SymbolWriter sw = new SymbolWriter(this.map, this.cl);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)