diff src/java/de/intevation/mxd/reader/MarkerSymbolReader.java @ 71:260748e3d08f

Added wrapper for line symbol reader.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 26 May 2011 16:01:29 +0200
parents 6d181c02efce
children 7eba97e8201b
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/MarkerSymbolReader.java	Thu May 26 14:28:52 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/MarkerSymbolReader.java	Thu May 26 16:01:29 2011 +0200
@@ -7,6 +7,7 @@
 import org.apache.log4j.Logger;
 
 import com.esri.arcgis.display.ISymbol;
+import com.esri.arcgis.display.SimpleMarkerSymbol;
 import com.esri.arcgis.display.ArrowMarkerSymbol;
 import com.esri.arcgis.display.CharacterMarkerSymbol;
 import com.esri.arcgis.display.PictureMarkerSymbol;
@@ -28,14 +29,27 @@
 
     private ISymbol symbol;
 
-    public MarkerSymbolReader(ISymbol symbol) throws Exception{
-        logger.debug("contructor()");
+    public MarkerSymbolReader(ISymbol symbol)
+    throws Exception {
+        logger.debug("contructor(ISymbol)");
         this.symbol = symbol;
     }
 
+    public MarkerSymbolReader() {
+        logger.debug("contructor()");
+        this.symbol = null;
+    }
+
     public Element read() throws Exception {
+        if(symbol == null) {
+            return parent;
+        }
+
         ISymbolReader sreader = null;
-        if(symbol instanceof ArrowMarkerSymbol) {
+        if(symbol instanceof SimpleMarkerSymbol) {
+            sreader = new SimpleMarkerSymbolReader(symbol);
+        }
+        else if(symbol instanceof ArrowMarkerSymbol) {
             sreader = new ArrowMarkerSymbolReader(symbol);
         }
         else if(symbol instanceof CharacterMarkerSymbol) {
@@ -59,4 +73,22 @@
         }
         return parent;
     }
+
+    public void setSymbol(ISymbol sym) {
+        this.symbol = sym;
+    }
+
+    public boolean canRead(ISymbol sym) {
+        if(sym instanceof SimpleMarkerSymbol ||
+           sym instanceof ArrowMarkerSymbol ||
+           sym instanceof PictureMarkerSymbol ||
+           sym instanceof CharacterMarkerSymbol ||
+           sym instanceof MultiLayerMarkerSymbol) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)