Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java @ 149:07e2033dd60e
Merged with Stephans commit.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 29 Jun 2011 17:59:52 +0200 |
parents | a4ab239509f1 |
children | 0bde090506f9 |
rev | line source |
---|---|
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.mxd.reader; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
3 import java.awt.Color; |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 import org.apache.log4j.Logger; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 import com.esri.arcgis.display.ISymbol; |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
8 import com.esri.arcgis.display.ILineSymbol; |
72
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
9 import com.esri.arcgis.display.IFillSymbol; |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 import com.esri.arcgis.display.SimpleFillSymbol; |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
11 import com.esri.arcgis.display.esriSimpleFillStyle; |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 import com.esri.arcgis.display.IRgbColor; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 import com.esri.arcgis.display.RgbColor; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 import org.w3c.dom.Element; |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
16 import java.io.IOException; |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 * Reads simple marker symbol information. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 * |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
23 public class SimpleFillSymbolReader |
80
83932f18dddc
All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
74
diff
changeset
|
24 extends AbstractSymbolReader { |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 * The logger. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 */ |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 private static final Logger logger = |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 Logger.getLogger(SimpleFillSymbolReader.class); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 * Private member. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 */ |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 private SimpleFillSymbol symbol; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 public SimpleFillSymbolReader(ISymbol symbol) throws Exception{ |
72
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
38 logger.debug("contructor(ISymbol)"); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
39 if(symbol instanceof SimpleFillSymbol) { |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
40 this.symbol = (SimpleFillSymbol)symbol; |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
41 } |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
42 else { |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
43 throw new Exception("Not a SimpleFillSymbol!"); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
44 } |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
45 } |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
46 |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
47 public SimpleFillSymbolReader(IFillSymbol symbol) throws Exception{ |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
48 logger.debug("contructor(IFillSymbol)"); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
49 if(symbol instanceof SimpleFillSymbol) { |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 this.symbol = (SimpleFillSymbol)symbol; |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
51 } |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
52 else { |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 throw new Exception("Not a SimpleFillSymbol!"); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
54 } |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
57 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
58 * Reads the symbol attributes. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
59 * |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
60 * @return The XML node. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
61 */ |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
62 public Element read() { |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 logger.debug("read()"); |
80
83932f18dddc
All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
74
diff
changeset
|
64 Element symbolElement = util.addSymbol(parent); |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
65 |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
66 try { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
67 symbolElement.setAttribute("name", symbol.getNameString()); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
68 } |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
69 catch(IOException ioe) { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
70 logger.warn("Could not read name. Setting name to \"default\""); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
71 symbolElement.setAttribute("name", "default"); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
72 } |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
73 symbolElement.setAttribute("style", "fill"); |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
74 int style; |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
75 try { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
76 style = symbol.getStyle(); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
77 } |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
78 catch(IOException ioe) { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
79 logger.warn( |
135
a4ab239509f1
Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents:
115
diff
changeset
|
80 "Could not read fill style."); |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
81 style = -1; |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
82 } |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
83 |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
84 switch(style) { |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
85 case esriSimpleFillStyle.esriSFSCross: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
86 symbolElement.setAttribute("fillstyle", "cross"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
87 case esriSimpleFillStyle.esriSFSSolid: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
88 symbolElement.setAttribute("fillstyle", "solid"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
89 case esriSimpleFillStyle.esriSFSVertical: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
90 symbolElement.setAttribute("fillstyle", "vertical"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
91 case esriSimpleFillStyle.esriSFSHorizontal: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
92 symbolElement.setAttribute("fillstyle", "horizontal"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
93 case esriSimpleFillStyle.esriSFSForwardDiagonal: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
94 symbolElement.setAttribute("fillstyle", "fwdiagonal"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
95 case esriSimpleFillStyle.esriSFSBackwardDiagonal: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
96 symbolElement.setAttribute("fillstyle", "bwdiagonal"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
97 case esriSimpleFillStyle.esriSFSDiagonalCross: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
98 symbolElement.setAttribute("fillstyle", "diagonalcross"); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
99 break; |
135
a4ab239509f1
Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents:
115
diff
changeset
|
100 default: break; |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
101 } |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
102 |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
103 try { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
104 if(symbol.getColor() instanceof IRgbColor) { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
105 IRgbColor color = (IRgbColor)symbol.getColor(); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
106 Color c = new Color ( |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
107 color.getRed(), |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
108 color.getGreen(), |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
109 color.getBlue()); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
110 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
111 symbolElement.setAttribute("transparency", |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
112 String.valueOf(color.getTransparency())); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
113 } |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
114 else { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
115 RgbColor col = new RgbColor(); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
116 col.setRGB(symbol.getColor().getRGB()); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
117 Color c = new Color ( |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
118 col.getRed(), |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
119 col.getGreen(), |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
120 col.getBlue()); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
121 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
122 symbolElement.setAttribute("transparency", |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
123 String.valueOf(col.getTransparency())); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
124 } |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
125 } |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
126 catch(IOException ioe) { |
135
a4ab239509f1
Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents:
115
diff
changeset
|
127 logger.warn("Could not read color."); |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
128 } |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
129 |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
130 try { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
131 ILineSymbol ls = symbol.getOutline(); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
132 LineSymbolReader lsr = new LineSymbolReader(); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
133 if(lsr.canRead(ls)) { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
134 lsr.setSymbol(ls); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
135 lsr.setUtil(util); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
136 lsr.setParent(symbolElement); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
137 lsr.read(); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
138 } |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
139 else { |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
140 logger.debug("The type of " + ls.getClass().toString() + |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
141 " is not implemented!"); |
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
142 } |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
143 } |
115
fb93f20478cc
Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
83
diff
changeset
|
144 catch(Exception e) { |
135
a4ab239509f1
Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents:
115
diff
changeset
|
145 logger.warn("Could not read line symbol."); |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
146 } |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
147 |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
148 return symbolElement; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
149 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
150 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
151 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |