Mercurial > mxd2map
annotate 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 (2011-05-26) |
parents | b41fcf268827 |
children | 7eba97e8201b |
rev | line source |
---|---|
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.mxd.reader; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 import java.io.IOException; |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
4 import java.awt.Color; |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 import com.esri.arcgis.display.ISymbol; |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
9 import com.esri.arcgis.display.ILineSymbol; |
72
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
10 import com.esri.arcgis.display.IFillSymbol; |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 import com.esri.arcgis.display.SimpleFillSymbol; |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
12 import com.esri.arcgis.display.MultiLayerFillSymbol; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
13 import com.esri.arcgis.display.esriSimpleFillStyle; |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 import com.esri.arcgis.display.IRgbColor; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 import com.esri.arcgis.display.RgbColor; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 import org.w3c.dom.Element; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.mxd.utils.MapToXMLUtils; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 * Reads simple marker symbol information. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 * |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
26 public class SimpleFillSymbolReader |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
27 implements ISymbolReader { |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 * The logger. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 */ |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 private static final Logger logger = |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 Logger.getLogger(SimpleFillSymbolReader.class); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 * Private member. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 */ |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 private Element renderer; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 private SimpleFillSymbol symbol; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 private MapToXMLUtils util; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 public SimpleFillSymbolReader(ISymbol symbol) throws Exception{ |
72
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
44 logger.debug("contructor(ISymbol)"); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
45 if(symbol instanceof SimpleFillSymbol) { |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
46 this.symbol = (SimpleFillSymbol)symbol; |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
47 } |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
48 else { |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
49 throw new Exception("Not a SimpleFillSymbol!"); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
50 } |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
51 } |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
52 |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
53 public SimpleFillSymbolReader(IFillSymbol symbol) throws Exception{ |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
54 logger.debug("contructor(IFillSymbol)"); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
55 if(symbol instanceof SimpleFillSymbol) { |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 this.symbol = (SimpleFillSymbol)symbol; |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
57 } |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
58 else { |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
59 throw new Exception("Not a SimpleFillSymbol!"); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
60 } |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
61 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
62 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
64 * Setter for the parent XML element. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
65 * |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
66 * @param parent The XML parent node. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
67 */ |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
68 public void setParent(Element parent) { |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
69 this.renderer = parent; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
70 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
71 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
72 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
73 * Setter for XML document helper. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
74 * |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
75 * @param util The helper class for storing map information. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
76 */ |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
77 public void setUtil(MapToXMLUtils util) { |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
78 this.util = util; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
79 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
80 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
81 /** |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
82 * Reads the symbol attributes. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
83 * |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
84 * @return The XML node. |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
85 */ |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
86 public Element read() |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
87 throws IOException { |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
88 logger.debug("read()"); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
89 Element symbolElement; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
90 try { |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
91 symbolElement = util.addSymbol(renderer); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
92 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
93 catch(Exception e) { |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
94 e.printStackTrace(); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
95 return null; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
96 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
97 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
98 symbolElement.setAttribute("name", symbol.getNameString()); |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
99 symbolElement.setAttribute("style", "fill"); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
100 int style = symbol.getStyle(); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
101 switch(style) { |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
102 case esriSimpleFillStyle.esriSFSCross: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
103 symbolElement.setAttribute("fillstyle", "cross"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
104 case esriSimpleFillStyle.esriSFSSolid: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
105 symbolElement.setAttribute("fillstyle", "solid"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
106 case esriSimpleFillStyle.esriSFSVertical: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
107 symbolElement.setAttribute("fillstyle", "vertical"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
108 case esriSimpleFillStyle.esriSFSHorizontal: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
109 symbolElement.setAttribute("fillstyle", "horizontal"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
110 case esriSimpleFillStyle.esriSFSForwardDiagonal: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
111 symbolElement.setAttribute("fillstyle", "fwdiagonal"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
112 case esriSimpleFillStyle.esriSFSBackwardDiagonal: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
113 symbolElement.setAttribute("fillstyle", "bwdiagonal"); break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
114 case esriSimpleFillStyle.esriSFSDiagonalCross: |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
115 symbolElement.setAttribute("fillstyle", "diagonalcross"); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
116 break; |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
117 default: symbolElement.setAttribute("fillstyle", "empty"); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
36
diff
changeset
|
118 } |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
119 |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
120 if(symbol.getColor() instanceof IRgbColor) { |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
121 IRgbColor color = (IRgbColor)symbol.getColor(); |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
122 Color c = new Color ( |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
123 color.getRed(), |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
124 color.getGreen(), |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
125 color.getBlue()); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
126 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
127 symbolElement.setAttribute("transparency", |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
128 String.valueOf(color.getTransparency())); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
129 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
130 else { |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
131 RgbColor col = new RgbColor(); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
132 col.setRGB(symbol.getColor().getRGB()); |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
133 Color c = new Color ( |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
134 col.getRed(), |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
135 col.getGreen(), |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
136 col.getBlue()); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
137 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
138 symbolElement.setAttribute("transparency", |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
139 String.valueOf(col.getTransparency())); |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
140 } |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
141 |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
142 try { |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
143 ILineSymbol ls = symbol.getOutline(); |
72
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
144 LineSymbolReader lsr = new LineSymbolReader(); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
145 if(lsr.canRead(ls)) { |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
146 lsr.setSymbol(ls); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
147 lsr.setUtil(util); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
148 lsr.setParent(symbolElement); |
2cbe423b1fda
Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
69
diff
changeset
|
149 lsr.read(); |
68
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
150 } |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
151 else { |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
152 logger.debug("The type of " + ls.getClass().toString() + |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
153 " is not implemented!"); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
154 } |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
155 } |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
156 catch(Exception e) { |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
157 e.printStackTrace(); |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
158 } |
686a88eb531d
Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
159 |
36
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
160 return symbolElement; |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
161 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
162 } |
472aa36d0e01
Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
163 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |