annotate src/java/de/intevation/mxd/reader/LineFillSymbolReader.java @ 227:58d8ac962683

Replaced position of GetCaps-Link
author Stephan Holl <stephan.holl@intevation.de>
date Wed, 27 Jul 2011 13:45:21 +0200
parents 0bde090506f9
children df4e0946ef02
rev   line source
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 package de.intevation.mxd.reader;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 import java.awt.Color;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
4
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5 import org.apache.log4j.Logger;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 import com.esri.arcgis.display.ISymbol;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 import com.esri.arcgis.display.IFillSymbol;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 import com.esri.arcgis.display.ILineSymbol;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 import com.esri.arcgis.display.LineFillSymbol;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 import com.esri.arcgis.display.IRgbColor;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12 import com.esri.arcgis.display.RgbColor;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 import org.w3c.dom.Element;
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
15 import java.io.IOException;
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 /**
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18 * Reads marker line symbol information.
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 *
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 */
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 public class LineFillSymbolReader
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 extends AbstractSymbolReader{
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 /**
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 * The logger.
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 */
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 private static final Logger logger =
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 Logger.getLogger(LineFillSymbolReader.class);
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 /**
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 * Private member.
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 */
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 private LineFillSymbol symbol;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
36 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
37 * Constructor with symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
38 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
39 * @param symbol The symbol used to display polygons.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
40 */
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41 public LineFillSymbolReader(ISymbol symbol)
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 throws Exception {
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
43 logger.debug("contructor()");
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 if(symbol instanceof LineFillSymbol) {
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 this.symbol = (LineFillSymbol)symbol;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
47 else {
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48 throw new Exception("Not a LineFillSymbol!");
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
49 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
50 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
51
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
52 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
53 * Constructor with symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
54 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
55 * @param symbol The symbol used to display polygons.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 135
diff changeset
56 */
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
57 public LineFillSymbolReader(IFillSymbol symbol)
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
58 throws Exception {
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
59 logger.debug("contructor()");
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
60 if(symbol instanceof LineFillSymbol) {
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61 this.symbol = (LineFillSymbol)symbol;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
63 else {
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64 throw new Exception("Not a LineFillSymbol!");
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
65 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
66 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
67
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
68 /**
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
69 * Reads the symbol attributes.
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
70 *
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
71 * @return The XML node.
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
72 */
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
73 public Element read() {
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
74 logger.debug("read()");
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
75
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
76 Element symbolElement = util.addSymbol(parent);
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
78 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
79 symbolElement.setAttribute("name", symbol.getNameString());
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
80 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
81 catch(IOException ioe) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
82 logger.warn("Could not read name. Setting name to \"default\".");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
83 symbolElement.setAttribute("name", "default");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
84 }
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
85 symbolElement.setAttribute("style", "fill");
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
86
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
87 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
88 symbolElement.setAttribute(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
89 "offset",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
90 String.valueOf(symbol.getOffset()));
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
91 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
92 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
93 logger.warn("Could not read offset.");
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
94 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
95
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
96 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
97 symbolElement.setAttribute(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
98 "separation",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
99 String.valueOf(symbol.getSeparation()));
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
100 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
101 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
102 logger.warn("Could not read separation.");
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
103 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
104
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
105 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
106 symbolElement.setAttribute(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
107 "angle",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
108 String.valueOf(symbol.getAngle()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
109 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
110 catch(IOException e) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
111 logger.warn("Could not read angle.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
112 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
113
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
114 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
115 if(symbol.getColor() instanceof IRgbColor) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
116 IRgbColor color = (IRgbColor)symbol.getColor();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
117 Color c = new Color (
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
118 color.getRed(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
119 color.getGreen(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
120 color.getBlue());
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
121 symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
122 symbolElement.setAttribute("transparency",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
123 String.valueOf(color.getTransparency()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
124 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
125 else {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
126 RgbColor col = new RgbColor();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
127 col.setRGB(symbol.getColor().getRGB());
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
128 Color c = new Color (
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
129 col.getRed(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
130 col.getGreen(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
131 col.getBlue());
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
132 symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
133 symbolElement.setAttribute("transparency",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
134 String.valueOf(col.getTransparency()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
135 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
136 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
137 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
138 logger.warn("Could not read color.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
139 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
140
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
141 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
142 ILineSymbol ols = symbol.getOutline();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
143 LineSymbolReader olsr = new LineSymbolReader();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
144 if(olsr.canRead(ols)) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
145 olsr.setSymbol(ols);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
146 olsr.setUtil(util);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
147 olsr.setParent(symbolElement);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
148 olsr.read();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
149 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
150 else {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
151 logger.debug("The type of " + ols.getClass().toString() +
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
152 " is not implemented!");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
153 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
154 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
155 catch(Exception e) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
156 logger.warn("Could not read outline.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
157 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
158
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
159 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
160 ILineSymbol ls = symbol.getLineSymbol();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
161 LineSymbolReader lsr = new LineSymbolReader();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
162 if(lsr.canRead(ls)) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
163 symbolElement.setAttribute("hatch", "1");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
164 lsr.setSymbol(ls);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
165 lsr.setUtil(util);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
166 lsr.setParent(symbolElement);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
167 lsr.read();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
168 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
169 else {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
170 logger.debug("The type of " + ls.getClass().toString() +
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
171 " is not implemented!");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
172 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
173 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
174 catch(Exception e) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
175 logger.warn("Could not read line symbol.");
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
176 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
177 return parent;
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
178 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
179 }
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
180 // 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)