diff src/java/de/intevation/mxd/reader/SimpleRendererReader.java @ 26:3e24fffdf2bb

Moved reader components to reader folder.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 08 Apr 2011 12:26:17 +0200
parents src/java/de/intevation/mxd/SimpleRendererReader.java@cbd67b1100d8
children 40c0b4e5f91a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java/de/intevation/mxd/reader/SimpleRendererReader.java	Fri Apr 08 12:26:17 2011 +0200
@@ -0,0 +1,57 @@
+//package de.intevation.mxdaderr;
+
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+
+import com.esri.arcgis.carto.IFeatureRenderer;
+import com.esri.arcgis.display.ISymbol;
+import com.esri.arcgis.carto.SimpleRenderer;
+import com.esri.arcgis.display.SimpleMarkerSymbol;
+
+/**
+ * Reads simple renderer information.
+ *
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class SimpleRendererReader implements IRendererReader{
+
+    //Member
+    private ISymbol symbol;
+    private IFeatureRenderer renderer;
+    private static final Logger logger = Logger.getLogger(FeatureLayerReader.class);
+
+    //Constructor
+    public SimpleRendererReader(IFeatureRenderer renderer){
+        this.renderer = renderer;
+    }
+
+
+    //Methods
+    public boolean read() throws IOException{
+        logger.debug("read()");
+        if(renderer instanceof SimpleRenderer){
+            SimpleRenderer sr = (SimpleRenderer)renderer;
+            System.out.println("--------------------");
+            System.out.println("Renderer inforamtion:");
+            System.out.println("Label\t\t = " + sr.getLabel());
+            System.out.println("Description\t\t = " + sr.getDescription());
+            System.out.println("");
+            symbol = sr.getSymbol();
+            try{
+                ISymbolReader isr= new SimpleMarkerSymbolReader(symbol);
+                isr.read();
+                return true;
+            }
+            catch(Exception e){
+                e.printStackTrace();
+            }
+        }
+        return false;
+    }
+
+    public void getRenderer() throws IOException{
+        logger.debug("getRenderer() -> not implemented jet.");
+    }
+}
+// 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)