Mercurial > mxd2map
changeset 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 | b54afdbc5892 |
children | bb25c7a4553e |
files | ChangeLog src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java |
diffstat | 2 files changed, 35 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Aug 08 17:12:22 2011 +0200 +++ b/ChangeLog Mon Aug 08 17:19:03 2011 +0200 @@ -1,3 +1,9 @@ +2011-08-08 Raimund Renkert <raimund.renkert@intevation.de> + + * src/java/de/intevation/mxd/writer/SimpleFillSymbolReader.java: + Set fill color to black and transparent if the mxd contains no + color. + 2011-08-08 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/writer/FillStyleWriter.java:
--- a/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java Mon Aug 08 17:12:22 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java Mon Aug 08 17:19:03 2011 +0200 @@ -113,26 +113,38 @@ } try { - if(symbol.getColor() instanceof IRgbColor) { - IRgbColor color = (IRgbColor)symbol.getColor(); - Color c = new Color ( - color.getRed(), - color.getGreen(), - color.getBlue()); - symbolElement.setAttribute("color", String.valueOf(c.getRGB())); - symbolElement.setAttribute("transparency", - String.valueOf(color.getTransparency())); + if(symbol.getColor().isNullColor()) { + symbolElement.setAttribute("color", "0"); + symbolElement.setAttribute("transparency", "255"); } else { - RgbColor col = new RgbColor(); - col.setRGB(symbol.getColor().getRGB()); - Color c = new Color ( - col.getRed(), - col.getGreen(), - col.getBlue()); - symbolElement.setAttribute("color", String.valueOf(c.getRGB())); - symbolElement.setAttribute("transparency", + if(symbol.getColor() instanceof IRgbColor) { + IRgbColor color = (IRgbColor)symbol.getColor(); + Color c = new Color ( + color.getRed(), + color.getGreen(), + color.getBlue()); + symbolElement.setAttribute( + "color", + String.valueOf(c.getRGB())); + symbolElement.setAttribute( + "transparency", + String.valueOf(color.getTransparency())); + } + else { + RgbColor col = new RgbColor(); + col.setRGB(symbol.getColor().getRGB()); + + Color c = new Color ( + col.getRed(), + col.getGreen(), + col.getBlue()); + symbolElement.setAttribute( + "color", + String.valueOf(c.getRGB())); + symbolElement.setAttribute("transparency", String.valueOf(col.getTransparency())); + } } } catch(IOException ioe) {