Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/LineFillSymbolReader.java @ 135:a4ab239509f1
Updated the default values and reader error handling.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 22 Jun 2011 13:55:22 +0200 |
parents | fb93f20478cc |
children | 0bde090506f9 |
comparison
equal
deleted
inserted
replaced
134:acc9e5430177 | 135:a4ab239509f1 |
---|---|
79 symbolElement.setAttribute( | 79 symbolElement.setAttribute( |
80 "offset", | 80 "offset", |
81 String.valueOf(symbol.getOffset())); | 81 String.valueOf(symbol.getOffset())); |
82 } | 82 } |
83 catch(IOException ioe) { | 83 catch(IOException ioe) { |
84 logger.warn("Could not read offset. Setting offset to 0."); | 84 logger.warn("Could not read offset."); |
85 symbolElement.setAttribute("offset", "0"); | |
86 } | 85 } |
87 | 86 |
88 try { | 87 try { |
89 symbolElement.setAttribute( | 88 symbolElement.setAttribute( |
90 "separation", | 89 "separation", |
91 String.valueOf(symbol.getSeparation())); | 90 String.valueOf(symbol.getSeparation())); |
92 } | 91 } |
93 catch(IOException ioe) { | 92 catch(IOException ioe) { |
94 logger.warn("Could not read separation. setting separation to 1."); | 93 logger.warn("Could not read separation."); |
95 symbolElement.setAttribute("separation", "1"); | |
96 } | 94 } |
97 | 95 |
98 try { | 96 try { |
99 symbolElement.setAttribute( | 97 symbolElement.setAttribute( |
100 "angle", | 98 "angle", |
101 String.valueOf(symbol.getAngle())); | 99 String.valueOf(symbol.getAngle())); |
102 } | 100 } |
103 catch(IOException e) { | 101 catch(IOException e) { |
104 logger.warn("Could not read angle. Setting angle to 0."); | 102 logger.warn("Could not read angle."); |
105 symbolElement.setAttribute("angle", "0"); | |
106 } | 103 } |
107 | 104 |
108 try { | 105 try { |
109 if(symbol.getColor() instanceof IRgbColor) { | 106 if(symbol.getColor() instanceof IRgbColor) { |
110 IRgbColor color = (IRgbColor)symbol.getColor(); | 107 IRgbColor color = (IRgbColor)symbol.getColor(); |
127 symbolElement.setAttribute("transparency", | 124 symbolElement.setAttribute("transparency", |
128 String.valueOf(col.getTransparency())); | 125 String.valueOf(col.getTransparency())); |
129 } | 126 } |
130 } | 127 } |
131 catch(IOException ioe) { | 128 catch(IOException ioe) { |
132 logger.warn( | 129 logger.warn("Could not read color."); |
133 "Could not read color." + | |
134 " Setting color to black with no transparency."); | |
135 Color black = new Color(0, 0, 0); | |
136 symbolElement.setAttribute( | |
137 "color", | |
138 String.valueOf(black.getRGB())); | |
139 symbolElement.setAttribute("transparency", "-1"); | |
140 } | 130 } |
141 | 131 |
142 try { | 132 try { |
143 ILineSymbol ols = symbol.getOutline(); | 133 ILineSymbol ols = symbol.getOutline(); |
144 LineSymbolReader olsr = new LineSymbolReader(); | 134 LineSymbolReader olsr = new LineSymbolReader(); |
152 logger.debug("The type of " + ols.getClass().toString() + | 142 logger.debug("The type of " + ols.getClass().toString() + |
153 " is not implemented!"); | 143 " is not implemented!"); |
154 } | 144 } |
155 } | 145 } |
156 catch(Exception e) { | 146 catch(Exception e) { |
157 logger.warn("Could not read outline. No fallback defined."); | 147 logger.warn("Could not read outline."); |
158 } | 148 } |
159 | 149 |
160 try { | 150 try { |
161 ILineSymbol ls = symbol.getLineSymbol(); | 151 ILineSymbol ls = symbol.getLineSymbol(); |
162 LineSymbolReader lsr = new LineSymbolReader(); | 152 LineSymbolReader lsr = new LineSymbolReader(); |
171 logger.debug("The type of " + ls.getClass().toString() + | 161 logger.debug("The type of " + ls.getClass().toString() + |
172 " is not implemented!"); | 162 " is not implemented!"); |
173 } | 163 } |
174 } | 164 } |
175 catch(Exception e) { | 165 catch(Exception e) { |
176 logger.warn("Could not read line symbol. No fallback defined"); | 166 logger.warn("Could not read line symbol."); |
177 } | 167 } |
178 return parent; | 168 return parent; |
179 } | 169 } |
180 } | 170 } |
181 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 171 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |