Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleLineSymbolReader.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 | 7b1433d3b574 |
comparison
equal
deleted
inserted
replaced
134:acc9e5430177 | 135:a4ab239509f1 |
---|---|
90 col.getBlue()); | 90 col.getBlue()); |
91 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | 91 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); |
92 } | 92 } |
93 } | 93 } |
94 catch(IOException ioe) { | 94 catch(IOException ioe) { |
95 logger.warn( | 95 logger.warn("Could not read color."); |
96 "Could not read color." + | |
97 " Setting color to black with no transparency."); | |
98 Color black = new Color(0, 0, 0); | |
99 symbolElement.setAttribute("color", String.valueOf(black.getRGB())); | |
100 symbolElement.setAttribute("transparency", "-1"); | |
101 } | 96 } |
102 | 97 |
103 try { | 98 try { |
104 symbolElement.setAttribute("width", String.valueOf(symbol.getWidth())); | 99 symbolElement.setAttribute("width", String.valueOf(symbol.getWidth())); |
105 } | 100 } |
106 catch(IOException ioe) { | 101 catch(IOException ioe) { |
107 logger.warn("Could not read width. Setting width to 1."); | 102 logger.warn("Could not read width."); |
108 symbolElement.setAttribute("width", "1"); | |
109 } | 103 } |
110 | 104 |
111 int style; | 105 int style; |
112 try { | 106 try { |
113 style = symbol.getStyle(); | 107 style = symbol.getStyle(); |
114 } | 108 } |
115 catch(IOException ioe) { | 109 catch(IOException ioe) { |
116 logger.warn( | 110 logger.warn("Could not read line style."); |
117 "Could not read line style." + | |
118 " Setting line style to \"none\"."); | |
119 style = -1; | 111 style = -1; |
120 } | 112 } |
121 switch(style) { | 113 switch(style) { |
122 case esriSimpleLineStyle.esriSLSSolid: | 114 case esriSimpleLineStyle.esriSLSSolid: |
123 symbolElement.setAttribute("linestyle", "solid"); break; | 115 symbolElement.setAttribute("linestyle", "solid"); break; |
127 symbolElement.setAttribute("linestyle", "dot"); break; | 119 symbolElement.setAttribute("linestyle", "dot"); break; |
128 case esriSimpleLineStyle.esriSLSDashDot: | 120 case esriSimpleLineStyle.esriSLSDashDot: |
129 symbolElement.setAttribute("linestyle", "dashdot"); break; | 121 symbolElement.setAttribute("linestyle", "dashdot"); break; |
130 case esriSimpleLineStyle.esriSLSDashDotDot: | 122 case esriSimpleLineStyle.esriSLSDashDotDot: |
131 symbolElement.setAttribute("linestyle", "dashdotdot"); break; | 123 symbolElement.setAttribute("linestyle", "dashdotdot"); break; |
132 default: symbolElement.setAttribute ("linestyle", "none"); | 124 default: break; |
133 } | 125 } |
134 | 126 |
135 symbolElement.setAttribute("type", "line"); | 127 symbolElement.setAttribute("type", "line"); |
136 symbolElement.setAttribute("style", "simple"); | 128 symbolElement.setAttribute("style", "simple"); |
137 | 129 |