comparison src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java @ 72:2cbe423b1fda

Added wrapper for fill symbol reader.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 26 May 2011 16:49:03 +0200
parents b41fcf268827
children 7eba97e8201b
comparison
equal deleted inserted replaced
71:260748e3d08f 72:2cbe423b1fda
5 5
6 import org.apache.log4j.Logger; 6 import org.apache.log4j.Logger;
7 7
8 import com.esri.arcgis.display.ISymbol; 8 import com.esri.arcgis.display.ISymbol;
9 import com.esri.arcgis.display.ILineSymbol; 9 import com.esri.arcgis.display.ILineSymbol;
10 import com.esri.arcgis.display.IFillSymbol;
10 import com.esri.arcgis.display.SimpleFillSymbol; 11 import com.esri.arcgis.display.SimpleFillSymbol;
11 import com.esri.arcgis.display.MultiLayerLineSymbol;
12 import com.esri.arcgis.display.SimpleLineSymbol;
13 import com.esri.arcgis.display.MarkerLineSymbol;
14 import com.esri.arcgis.display.PictureLineSymbol;
15 import com.esri.arcgis.display.CartographicLineSymbol;
16 import com.esri.arcgis.display.HashLineSymbol;
17 import com.esri.arcgis.display.MultiLayerFillSymbol; 12 import com.esri.arcgis.display.MultiLayerFillSymbol;
18 import com.esri.arcgis.display.esriSimpleFillStyle; 13 import com.esri.arcgis.display.esriSimpleFillStyle;
19 import com.esri.arcgis.display.IRgbColor; 14 import com.esri.arcgis.display.IRgbColor;
20 import com.esri.arcgis.display.RgbColor; 15 import com.esri.arcgis.display.RgbColor;
21 16
44 private SimpleFillSymbol symbol; 39 private SimpleFillSymbol symbol;
45 private MapToXMLUtils util; 40 private MapToXMLUtils util;
46 41
47 42
48 public SimpleFillSymbolReader(ISymbol symbol) throws Exception{ 43 public SimpleFillSymbolReader(ISymbol symbol) throws Exception{
49 logger.debug("contructor()"); 44 logger.debug("contructor(ISymbol)");
45 if(symbol instanceof SimpleFillSymbol) {
46 this.symbol = (SimpleFillSymbol)symbol;
47 }
48 else {
49 throw new Exception("Not a SimpleFillSymbol!");
50 }
51 }
52
53 public SimpleFillSymbolReader(IFillSymbol symbol) throws Exception{
54 logger.debug("contructor(IFillSymbol)");
50 if(symbol instanceof SimpleFillSymbol) { 55 if(symbol instanceof SimpleFillSymbol) {
51 this.symbol = (SimpleFillSymbol)symbol; 56 this.symbol = (SimpleFillSymbol)symbol;
52 } 57 }
53 else { 58 else {
54 throw new Exception("Not a SimpleFillSymbol!"); 59 throw new Exception("Not a SimpleFillSymbol!");
134 String.valueOf(col.getTransparency())); 139 String.valueOf(col.getTransparency()));
135 } 140 }
136 141
137 try { 142 try {
138 ILineSymbol ls = symbol.getOutline(); 143 ILineSymbol ls = symbol.getOutline();
139 if(ls instanceof MultiLayerLineSymbol) { 144 LineSymbolReader lsr = new LineSymbolReader();
140 ISymbolReader sreader = new MultiLayerLineSymbolReader(ls); 145 if(lsr.canRead(ls)) {
141 sreader.setParent(symbolElement); 146 lsr.setSymbol(ls);
142 sreader.setUtil(util); 147 lsr.setUtil(util);
143 sreader.read(); 148 lsr.setParent(symbolElement);
144 } 149 lsr.read();
145 else if(ls instanceof SimpleLineSymbol) {
146 ISymbolReader sreader = new SimpleLineSymbolReader(ls);
147 sreader.setParent(symbolElement);
148 sreader.setUtil(util);
149 sreader.read();
150 }
151 else if(ls instanceof MarkerLineSymbol) {
152 ISymbolReader sreader = new MarkerLineSymbolReader(ls);
153 sreader.setParent(symbolElement);
154 sreader.setUtil(util);
155 sreader.read();
156 }
157 else if(ls instanceof PictureLineSymbol) {
158 ISymbolReader sreader = new PictureLineSymbolReader(ls);
159 sreader.setParent(symbolElement);
160 sreader.setUtil(util);
161 sreader.read();
162 }
163 else if(ls instanceof CartographicLineSymbol) {
164 ISymbolReader sreader = new CartoLineSymbolReader(ls);
165 sreader.setParent(symbolElement);
166 sreader.setUtil(util);
167 sreader.read();
168 }
169 else if(ls instanceof HashLineSymbol) {
170 ISymbolReader sreader = new HashLineSymbolReader(ls);
171 sreader.setParent(symbolElement);
172 sreader.setUtil(util);
173 sreader.read();
174 } 150 }
175 else { 151 else {
176 logger.debug("The type of " + ls.getClass().toString() + 152 logger.debug("The type of " + ls.getClass().toString() +
177 " is not implemented!"); 153 " is not implemented!");
178 } 154 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)