Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java @ 241:7fbb643d5378
Set fill color to black and transparent if the mxd contains no color.
author | raimund renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 08 Aug 2011 17:19:03 +0200 |
parents | 0bde090506f9 |
children | df4e0946ef02 |
comparison
equal
deleted
inserted
replaced
240:b54afdbc5892 | 241:7fbb643d5378 |
---|---|
111 break; | 111 break; |
112 default: break; | 112 default: break; |
113 } | 113 } |
114 | 114 |
115 try { | 115 try { |
116 if(symbol.getColor() instanceof IRgbColor) { | 116 if(symbol.getColor().isNullColor()) { |
117 IRgbColor color = (IRgbColor)symbol.getColor(); | 117 symbolElement.setAttribute("color", "0"); |
118 Color c = new Color ( | 118 symbolElement.setAttribute("transparency", "255"); |
119 color.getRed(), | |
120 color.getGreen(), | |
121 color.getBlue()); | |
122 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | |
123 symbolElement.setAttribute("transparency", | |
124 String.valueOf(color.getTransparency())); | |
125 } | 119 } |
126 else { | 120 else { |
127 RgbColor col = new RgbColor(); | 121 if(symbol.getColor() instanceof IRgbColor) { |
128 col.setRGB(symbol.getColor().getRGB()); | 122 IRgbColor color = (IRgbColor)symbol.getColor(); |
129 Color c = new Color ( | 123 Color c = new Color ( |
130 col.getRed(), | 124 color.getRed(), |
131 col.getGreen(), | 125 color.getGreen(), |
132 col.getBlue()); | 126 color.getBlue()); |
133 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | 127 symbolElement.setAttribute( |
134 symbolElement.setAttribute("transparency", | 128 "color", |
129 String.valueOf(c.getRGB())); | |
130 symbolElement.setAttribute( | |
131 "transparency", | |
132 String.valueOf(color.getTransparency())); | |
133 } | |
134 else { | |
135 RgbColor col = new RgbColor(); | |
136 col.setRGB(symbol.getColor().getRGB()); | |
137 | |
138 Color c = new Color ( | |
139 col.getRed(), | |
140 col.getGreen(), | |
141 col.getBlue()); | |
142 symbolElement.setAttribute( | |
143 "color", | |
144 String.valueOf(c.getRGB())); | |
145 symbolElement.setAttribute("transparency", | |
135 String.valueOf(col.getTransparency())); | 146 String.valueOf(col.getTransparency())); |
147 } | |
136 } | 148 } |
137 } | 149 } |
138 catch(IOException ioe) { | 150 catch(IOException ioe) { |
139 logger.warn("Could not read color."); | 151 logger.warn("Could not read color."); |
140 } | 152 } |