Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java @ 284:b48bcd1ab1ab
Added example for Query-layers
author | Stephan Holl <stephan.holl@intevation.de> |
---|---|
date | Thu, 10 Nov 2011 10:15:24 +0100 |
parents | df4e0946ef02 |
children | a46adb3697fa |
rev | line source |
---|---|
243
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
1 /* |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH, Germany <info@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
3 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
4 * This file is part of MXD2map. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
5 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
6 * This program is free software under the LGPL (>=v2.1) |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
7 * Read the file LICENCE.txt coming with the software for details |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
8 * or visit http://www.gnu.org/licenses/ if it does not exist. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
9 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
10 * MXD2map has been developed on behalf of the |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
11 * Bundesamt fuer Seeschifffahrt und Hydrographie (BSH) in Hamburg |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
12 * by Intevation GmbH. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
13 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
14 * Authors: |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
15 * Raimund Renkert <raimund.renkert@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
16 * Bjoern Schilberg <bjoern.schilberg@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
17 * Stephan Holl <stephan.holl@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
18 */ |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
19 |
33
c51376f8e24c
Separated converter components into packages.
Raimund Renkert <rrenkert@intevation.de>
parents:
31
diff
changeset
|
20 package de.intevation.mxd.reader; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 |
74
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
73
diff
changeset
|
22 import java.lang.Exception; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 import org.apache.log4j.Logger; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 import com.esri.arcgis.carto.IFeatureRenderer; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 import com.esri.arcgis.carto.ClassBreaksRenderer; |
44
9b5fb5e5914d
Added expressions for mapserver classes.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
28 import com.esri.arcgis.display.ISymbol; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
30 import org.w3c.dom.Element; |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
31 |
33
c51376f8e24c
Separated converter components into packages.
Raimund Renkert <rrenkert@intevation.de>
parents:
31
diff
changeset
|
32 import de.intevation.mxd.utils.MapToXMLUtils; |
116
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
33 import java.io.IOException; |
33
c51376f8e24c
Separated converter components into packages.
Raimund Renkert <rrenkert@intevation.de>
parents:
31
diff
changeset
|
34 |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 * Reads the ClassBreaksRender Object Attributes. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 * |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 */ |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
40 public class ClassBreakRendererReader |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
41 implements IRendererReader { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
43 /** |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
44 * The logger. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
45 */ |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 private static final Logger logger = |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 Logger.getLogger(ClassBreakRendererReader.class); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
49 /** |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
50 * Private member. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
51 */ |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 private ClassBreaksRenderer renderer; |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
53 private Element layer; |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
54 private MapToXMLUtils util; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 |
181 | 56 /** |
57 * Constructor with renderer. | |
58 * | |
59 * @param renderer The ArcGIS renderer. | |
60 */ | |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
61 public ClassBreakRendererReader(IFeatureRenderer renderer) |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
62 throws Exception { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 logger.debug("contructor()"); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
64 if(renderer instanceof ClassBreaksRenderer) |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
65 this.renderer = (ClassBreaksRenderer)renderer; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
66 else |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
67 throw new Exception("Not a ClassBreaksRenderer!"); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
68 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
69 |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
70 /** |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
71 * Setter for the parent XML element. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
72 * |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
73 * @param parent The XML parent node. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
74 */ |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
75 public void setParent(Element parent) { |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
76 this.layer = parent; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
77 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
78 |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
79 /** |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
80 * Setter for XML document helper. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
81 * |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
82 * @param util The helper class for storing map information. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
83 */ |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
84 public void setUtil(MapToXMLUtils util) { |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
85 this.util = util; |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
86 } |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
87 |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
88 /** |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
89 * Reads the Renderer attributes. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
90 * |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
91 * @return The XML node. |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
92 */ |
116
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
93 public Element read() { |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
94 logger.debug("read()"); |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
95 |
116
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
96 int count = 0; |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
97 try { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
98 count = renderer.getBreakCount(); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
99 } |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
100 catch(IOException ioe) { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
101 logger.warn( |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
102 "No break symbols found in renderer." + |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
103 " Stopped reading this renderer."); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
104 return layer; |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
105 } |
74
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
73
diff
changeset
|
106 |
116
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
107 for(int i = 0; i < count; i++){ |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
108 Element rendererElement = util.addRenderer(layer); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
109 try { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
110 rendererElement.setAttribute("value", |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
111 String.valueOf(renderer.getBreak(i))); |
124
0f5819732288
Set label text as class name in mapfile.
Raimund Renkert <rrenkert@intevation.de>
parents:
116
diff
changeset
|
112 rendererElement.setAttribute("label", renderer.getLabel(i)); |
116
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
113 rendererElement.setAttribute( |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
114 "field_count", |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
115 String.valueOf(renderer.getFieldCount())); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
116 for(int j = 0; j < renderer.getFieldCount(); j++) { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
117 rendererElement.setAttribute( |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
118 "expression_field_" + j, |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
119 renderer.getField(j)); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
120 |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
121 } |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
122 rendererElement.setAttribute( |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
123 "min_value", |
126
ff0354265a7d
Write the correct expression for double values.
Raimund Renkert <rrenkert@intevation.de>
parents:
124
diff
changeset
|
124 String.valueOf(renderer.getLowBreak(i))); |
116
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
125 rendererElement.setAttribute("expression_operator", "<="); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
126 |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
127 ISymbol sym = renderer.getSymbol(i); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
128 MarkerSymbolReader markerReader = new MarkerSymbolReader(); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
129 LineSymbolReader lineReader = new LineSymbolReader(); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
130 FillSymbolReader fillReader = new FillSymbolReader(); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
131 if(markerReader.canRead(sym)) { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
132 markerReader.setSymbol(sym); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
133 markerReader.setUtil(util); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
134 markerReader.setParent(rendererElement); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
135 markerReader.read(); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
136 } |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
137 else if(lineReader.canRead(sym)) { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
138 lineReader.setSymbol(sym); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
139 lineReader.setUtil(util); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
140 lineReader.setParent(rendererElement); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
141 lineReader.read(); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
142 } |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
143 else if(fillReader.canRead(sym)) { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
144 fillReader.setSymbol(sym); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
145 fillReader.setUtil(util); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
146 fillReader.setParent(rendererElement); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
147 fillReader.read(); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
148 } |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
149 else { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
150 logger.debug("Not a known symbol type: " + |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
151 sym.getClass().toString()); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
152 } |
74
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
73
diff
changeset
|
153 } |
116
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
154 catch(Exception e) { |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
155 logger.error( |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
156 "Could not read data for " + i + |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
157 ". break of renderer. Stopped reading this renderer."); |
c8a1361ddd38
Improved exceptionhandlin for renderer reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
158 return layer; |
44
9b5fb5e5914d
Added expressions for mapserver classes.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
159 } |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
26
diff
changeset
|
160 } |
44
9b5fb5e5914d
Added expressions for mapserver classes.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
161 return layer; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
162 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
163 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
164 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |