Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.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 |
---|---|
75 try { | 75 try { |
76 style = symbol.getStyle(); | 76 style = symbol.getStyle(); |
77 } | 77 } |
78 catch(IOException ioe) { | 78 catch(IOException ioe) { |
79 logger.warn( | 79 logger.warn( |
80 "Could not read fill style." + | 80 "Could not read fill style."); |
81 " Setting fill style to \"empty\""); | |
82 style = -1; | 81 style = -1; |
83 } | 82 } |
84 | 83 |
85 switch(style) { | 84 switch(style) { |
86 case esriSimpleFillStyle.esriSFSCross: | 85 case esriSimpleFillStyle.esriSFSCross: |
96 case esriSimpleFillStyle.esriSFSBackwardDiagonal: | 95 case esriSimpleFillStyle.esriSFSBackwardDiagonal: |
97 symbolElement.setAttribute("fillstyle", "bwdiagonal"); break; | 96 symbolElement.setAttribute("fillstyle", "bwdiagonal"); break; |
98 case esriSimpleFillStyle.esriSFSDiagonalCross: | 97 case esriSimpleFillStyle.esriSFSDiagonalCross: |
99 symbolElement.setAttribute("fillstyle", "diagonalcross"); | 98 symbolElement.setAttribute("fillstyle", "diagonalcross"); |
100 break; | 99 break; |
101 default: symbolElement.setAttribute("fillstyle", "empty"); | 100 default: break; |
102 } | 101 } |
103 | 102 |
104 try { | 103 try { |
105 if(symbol.getColor() instanceof IRgbColor) { | 104 if(symbol.getColor() instanceof IRgbColor) { |
106 IRgbColor color = (IRgbColor)symbol.getColor(); | 105 IRgbColor color = (IRgbColor)symbol.getColor(); |
123 symbolElement.setAttribute("transparency", | 122 symbolElement.setAttribute("transparency", |
124 String.valueOf(col.getTransparency())); | 123 String.valueOf(col.getTransparency())); |
125 } | 124 } |
126 } | 125 } |
127 catch(IOException ioe) { | 126 catch(IOException ioe) { |
128 logger.warn( | 127 logger.warn("Could not read color."); |
129 "Could not read color." + | |
130 " Setting color to black with no transparency"); | |
131 Color black = new Color(0, 0, 0); | |
132 symbolElement.setAttribute("color", String.valueOf(black.getRGB())); | |
133 symbolElement.setAttribute("transparency", "-1"); | |
134 } | 128 } |
135 | 129 |
136 try { | 130 try { |
137 ILineSymbol ls = symbol.getOutline(); | 131 ILineSymbol ls = symbol.getOutline(); |
138 LineSymbolReader lsr = new LineSymbolReader(); | 132 LineSymbolReader lsr = new LineSymbolReader(); |
146 logger.debug("The type of " + ls.getClass().toString() + | 140 logger.debug("The type of " + ls.getClass().toString() + |
147 " is not implemented!"); | 141 " is not implemented!"); |
148 } | 142 } |
149 } | 143 } |
150 catch(Exception e) { | 144 catch(Exception e) { |
151 logger.warn("Could not read line symbol. No fallback defined."); | 145 logger.warn("Could not read line symbol."); |
152 } | 146 } |
153 | 147 |
154 return symbolElement; | 148 return symbolElement; |
155 } | 149 } |
156 } | 150 } |