diff src/java/de/intevation/mxd/reader/CompositeGraphicsLayerReader.java @ 321:b6c0fbae16dc

Expand Graphics Layer Support
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 20 Sep 2012 17:58:29 +0200
parents 5ea3abee729d
children
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/CompositeGraphicsLayerReader.java	Thu Sep 20 13:01:33 2012 +0200
+++ b/src/java/de/intevation/mxd/reader/CompositeGraphicsLayerReader.java	Thu Sep 20 17:58:29 2012 +0200
@@ -23,7 +23,10 @@
 import org.apache.log4j.Logger;
 
 import com.esri.arcgis.carto.IGraphicsLayer;
+import com.esri.arcgis.carto.ILayer;
 import com.esri.arcgis.carto.CompositeGraphicsLayer;
+import com.esri.arcgis.carto.GraphicsSubLayer;
+
 import com.esri.arcgis.carto.AnnotateLayerPropertiesCollection;
 import com.esri.arcgis.carto.IAnnotateLayerProperties;
 import com.esri.arcgis.carto.LabelEngineLayerProperties;
@@ -194,9 +197,8 @@
                     IPoint poi = te.getGeometry().getEnvelope().getLowerLeft();
                     xmlTextElement.setAttribute("X", String.valueOf(poi.getX()));
                     xmlTextElement.setAttribute("Y", String.valueOf(poi.getY()));
+                    xmlTextElement.setAttribute("classId", String.valueOf(count));
 
-                    logger.debug("Text: " + te.getText());
-                    logger.debug(" X,Y: " + poi.getX() + ", " + poi.getY());
                     try {
                         ITextSymbol sym = te.getSymbol();
                         if(sym instanceof TextSymbol) {
@@ -219,8 +221,8 @@
                             layer.getName());
                 }
                 count++;
+                actElement = layer.next();
             }
-            logger.debug("Read " + count + " Elements");
         }
         catch(Exception e) {
             logger.warn("Could not read layer elements.");
@@ -263,8 +265,20 @@
         }
 
         // Static values for this layer
-        layerElement.setAttribute("type", "point");
+        layerElement.setAttribute("type", "annotation");
 
+        // Read Sublayers
+        for (int i = 0; i < layer.getCount(); i++) {
+            ILayer pLyr = layer.getLayer(i);
+            GraphicsSubLayer subbie = new GraphicsSubLayer((Object)pLyr);
+            if (subbie != null) {
+                GraphicsSubLayerReader lr = new GraphicsSubLayerReader(subbie);
+                lr.setUtil(util);
+                lr.read();
+            } else {
+                logger.warn("Could not convert sublayer to GraphicsSubLayer");
+            }
+        }
         return layerElement;
     }
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)