comparison src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java @ 136:7632850b9520

Convert cartographic line template to mapfile pattern.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 23 Jun 2011 13:27:30 +0200
parents a4ab239509f1
children 6d294beb0e59
comparison
equal deleted inserted replaced
135:a4ab239509f1 136:7632850b9520
7 import com.esri.arcgis.display.ISymbol; 7 import com.esri.arcgis.display.ISymbol;
8 import com.esri.arcgis.display.ILineSymbol; 8 import com.esri.arcgis.display.ILineSymbol;
9 import com.esri.arcgis.display.CartographicLineSymbol; 9 import com.esri.arcgis.display.CartographicLineSymbol;
10 import com.esri.arcgis.display.IRgbColor; 10 import com.esri.arcgis.display.IRgbColor;
11 import com.esri.arcgis.display.RgbColor; 11 import com.esri.arcgis.display.RgbColor;
12 import com.esri.arcgis.display.Template;
12 13
13 import com.esri.arcgis.display.esriLineCapStyle; 14 import com.esri.arcgis.display.esriLineCapStyle;
14 import com.esri.arcgis.display.esriLineJoinStyle; 15 import com.esri.arcgis.display.esriLineJoinStyle;
15 16
16 import org.w3c.dom.Element; 17 import org.w3c.dom.Element;
173 catch(IOException ioe) { 174 catch(IOException ioe) {
174 logger.warn("Could not read width."); 175 logger.warn("Could not read width.");
175 } 176 }
176 //TODO Read further attributes depending on the Mapscript functionality: 177 //TODO Read further attributes depending on the Mapscript functionality:
177 // Template, MarkerSymbol, LineDecorations 178 // Template, MarkerSymbol, LineDecorations
179
180 try {
181 Template temp = (Template)symbol.getTemplate();
182 double length = temp.getInterval();
183 int count = temp.getPatternElementCount();
184 symbolElement.setAttribute("pattern_count", String.valueOf(count));
185 for (int j = 0; j < count; j++) {
186 double[] mark = new double[1];
187 double[] gap = new double[1];
188 temp.getPatternElement(j, mark, gap);
189 symbolElement.setAttribute(
190 "mark_" + j,
191 String.valueOf(mark[0]));
192 symbolElement.setAttribute("gap_" + j, String.valueOf(gap[0]));
193 }
194 }
195 catch(IOException ioe){
196 logger.warn("Could not read pattern elements.");
197 }
178 symbolElement.setAttribute("type", "line"); 198 symbolElement.setAttribute("type", "line");
179 symbolElement.setAttribute("style", "carto"); 199 symbolElement.setAttribute("style", "carto");
180 200
181 return symbolElement; 201 return symbolElement;
182 } 202 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)