Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/FeatureLayerReader.java @ 179:f3a91cd7440b
Added a first version of feature labeling.
author | raimund renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 08 Jul 2011 16:32:05 +0200 |
parents | a4ab239509f1 |
children | f4eb506499f5 |
comparison
equal
deleted
inserted
replaced
178:d10d5f560b1a | 179:f3a91cd7440b |
---|---|
2 | 2 |
3 import org.apache.log4j.Logger; | 3 import org.apache.log4j.Logger; |
4 | 4 |
5 import com.esri.arcgis.carto.ILayer; | 5 import com.esri.arcgis.carto.ILayer; |
6 import com.esri.arcgis.carto.FeatureLayer; | 6 import com.esri.arcgis.carto.FeatureLayer; |
7 import com.esri.arcgis.carto.AnnotateLayerPropertiesCollection; | |
8 import com.esri.arcgis.carto.IAnnotateLayerProperties; | |
9 import com.esri.arcgis.carto.LabelEngineLayerProperties; | |
7 import com.esri.arcgis.geodatabase.FeatureClassName; | 10 import com.esri.arcgis.geodatabase.FeatureClassName; |
8 import com.esri.arcgis.system.IName; | 11 import com.esri.arcgis.system.IName; |
9 import com.esri.arcgis.system.IPropertySet; | 12 import com.esri.arcgis.system.IPropertySet; |
10 import org.w3c.dom.Element; | 13 import org.w3c.dom.Element; |
11 | 14 |
133 } | 136 } |
134 catch(IOException ioe) { | 137 catch(IOException ioe) { |
135 logger.warn( | 138 logger.warn( |
136 "Could not read definition query."); | 139 "Could not read definition query."); |
137 } | 140 } |
141 | |
142 try { | |
143 AnnotateLayerPropertiesCollection annotation= | |
144 (AnnotateLayerPropertiesCollection)layer.getAnnotationProperties(); | |
145 | |
146 if (layer.isDisplayAnnotation() && annotation.getCount() > 0){ | |
147 for(int i = 0; i < annotation.getCount(); i++) { | |
148 IAnnotateLayerProperties prop = annotation.getProperties(0); | |
149 if(prop instanceof LabelEngineLayerProperties) { | |
150 try { | |
151 LabelEngineReader lr = new LabelEngineReader(prop); | |
152 lr.setParent(layerElement); | |
153 lr.setUtil(util); | |
154 lr.read(); | |
155 } | |
156 catch(Exception e) { | |
157 logger.warn("Could not read label properties."); | |
158 } | |
159 } | |
160 } | |
161 } | |
162 } | |
163 catch(IOException ioe) { | |
164 logger.warn("Could not read Annotation properties."); | |
165 } | |
166 | |
138 try { | 167 try { |
139 IName fcn = layer.getDataSourceName(); | 168 IName fcn = layer.getDataSourceName(); |
140 if(fcn instanceof FeatureClassName) { | 169 if(fcn instanceof FeatureClassName) { |
141 FeatureClassName name = (FeatureClassName)fcn; | 170 FeatureClassName name = (FeatureClassName)fcn; |
142 layerElement.setAttribute("data_source", name.getName()); | 171 layerElement.setAttribute("data_source", name.getName()); |