diff src/java/de/intevation/mxd/reader/HashLineSymbolReader.java @ 135:a4ab239509f1

Updated the default values and reader error handling.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 22 Jun 2011 13:55:22 +0200
parents fb93f20478cc
children f4eb506499f5
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java	Wed Jun 22 12:01:28 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java	Wed Jun 22 13:55:22 2011 +0200
@@ -94,22 +94,18 @@
             }
         }
         catch(IOException ioe) {
-            logger.warn(
-                "Could not read color." +
-                " Setting color to black with no transparency.");
-            Color black = new Color(0, 0, 0);
-            symbolElement.setAttribute("color", String.valueOf(black.getRGB()));
-            symbolElement.setAttribute("transparency", "-1");
+            logger.warn("Could not read color.");
         }
+
         int cap;
         try {
             cap = symbol.getCap();
         }
         catch(IOException ioe) {
-            logger.warn("Could not read line cap. Setting line cap to \"butt\"");
+            logger.warn("Could not read line cap.");
             cap = -1;
         }
-        String capStyle = "butt";
+        String capStyle = "";
         switch(cap) {
             case esriLineCapStyle.esriLCSRound: capStyle = "round"; break;
             case esriLineCapStyle.esriLCSSquare: capStyle = "square"; break;
@@ -121,29 +117,29 @@
             join = symbol.getJoin();
         }
         catch(IOException ioe) {
-            logger.warn(
-                "Could not read line join." +
-                " Setting line join to \"bevel\".");
+            logger.warn("Could not read line join.");
             join = -1;
         }
-        String joinStyle = "bevel";
+        String joinStyle = "";
         switch(join) {
             case esriLineJoinStyle.esriLJSRound: joinStyle = "round"; break;
             case esriLineJoinStyle.esriLJSMitre: joinStyle = "miter"; break;
             default: break;
         }
-        symbolElement.setAttribute("cap", capStyle);
-        symbolElement.setAttribute("join", joinStyle);
+        if(!capStyle.equals("")) {
+            symbolElement.setAttribute("cap", capStyle);
+        }
+        if(!joinStyle.equals("")) {
+            symbolElement.setAttribute("join", joinStyle);
+        }
+
         try {
             symbolElement.setAttribute(
                 "linestart",
                 String.valueOf(symbol.getLineStartOffset()));
         }
         catch(IOException ioe) {
-            logger.warn(
-                "Could not read line start offset." +
-                " Setting line start offset to 0.");
-            symbolElement.setAttribute("linestart", "0");
+            logger.warn("Could not read line start offset.");
         }
 
         try {
@@ -152,10 +148,7 @@
                 String.valueOf(symbol.getMiterLimit()));
         }
         catch(IOException ioe) {
-            logger.warn(
-                "Could not read miter limit." +
-                " Setting miter limit to 0.");
-            symbolElement.setAttribute("miterlimit", "0");
+            logger.warn("Could not read miter limit.");
         }
 
         try {
@@ -164,8 +157,7 @@
                 String.valueOf(symbol.getOffset()));
         }
         catch(IOException ioe) {
-            logger.warn("Could not read offset. Setting offset to 0.");
-            symbolElement.setAttribute("offset", "0");
+            logger.warn("Could not read offset.");
         }
 
         try {
@@ -174,8 +166,7 @@
                  String.valueOf(symbol.getWidth()));
         }
         catch(IOException ioe) {
-            logger.warn("Could not read width. Setting width to 1.");
-            symbolElement.setAttribute("width", "1");
+            logger.warn("Could not read width.");
         }
 
         try {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)