changeset 90:82a1f39214fd

Added method to save the symbolset.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 31 May 2011 19:04:55 +0200
parents 475ee3e4bc8b
children 35e2b555b305
files ChangeLog src/java/de/intevation/mxd/writer/MapScriptWriter.java src/java/de/intevation/mxd/writer/SymbolWriter.java
diffstat 3 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 31 18:33:54 2011 +0200
+++ b/ChangeLog	Tue May 31 19:04:55 2011 +0200
@@ -1,3 +1,11 @@
+2011-05-31  Raimund Renkert  <raimund.renkert@intevation.de>
+
+	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
+	  Removed obsolete code.
+
+	* src/java/de/intevation/mxd/writer/SymbolWriter.java:
+	  Added method to save the symbolset.
+
 2011-05-31  Raimund Renkert  <raimund.renkert@intevation.de>
 
 	* src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.java,
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Tue May 31 18:33:54 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Tue May 31 19:04:55 2011 +0200
@@ -236,8 +236,6 @@
                     swriter.write (symbolElement);
                 }
             }
-            symbolSetObj symbolSet = map.getSymbolset();
-            saveSymbolSet(symbolSet);
         }
     }
 }
--- a/src/java/de/intevation/mxd/writer/SymbolWriter.java	Tue May 31 18:33:54 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/SymbolWriter.java	Tue May 31 19:04:55 2011 +0200
@@ -1,6 +1,10 @@
 package de.intevation.mxd.writer;
 
 import org.apache.log4j.Logger;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.BufferedInputStream;
+import java.util.Properties;
 
 import org.w3c.dom.Element;
 
@@ -61,6 +65,9 @@
         else {
             return false;
         }
+
+        saveSymbolSet(symbolSet);
+
         return true;
     }
 
@@ -108,5 +115,17 @@
             return false;
         }
     }
+
+    private void saveSymbolSet(symbolSetObj symbols)
+    throws Exception {
+        String path = "";// TODO Get the correct path. Mapfile path or symbolset path
+        if(path.equals("")) {
+            return;
+        }
+        else if(path.endsWith(".map")) {
+            path.replace(".map", ".sym");
+        }
+        symbols.save(path);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)