annotate src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java @ 78:df17d4c2f9eb

Merged in Raimunds changes
author Stephan Holl <stephan.holl@intevation.de>
date Thu, 26 May 2011 16:13:50 +0200
parents b41fcf268827
children 2cbe423b1fda
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;
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 import com.esri.arcgis.display.SimpleFillSymbol;
68
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
11 import com.esri.arcgis.display.MultiLayerLineSymbol;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
12 import com.esri.arcgis.display.SimpleLineSymbol;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
13 import com.esri.arcgis.display.MarkerLineSymbol;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
14 import com.esri.arcgis.display.PictureLineSymbol;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
15 import com.esri.arcgis.display.CartographicLineSymbol;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
16 import com.esri.arcgis.display.HashLineSymbol;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
17 import com.esri.arcgis.display.MultiLayerFillSymbol;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
18 import com.esri.arcgis.display.esriSimpleFillStyle;
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 import com.esri.arcgis.display.IRgbColor;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 import com.esri.arcgis.display.RgbColor;
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 import org.w3c.dom.Element;
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 import de.intevation.mxd.utils.MapToXMLUtils;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 /**
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 * Reads simple marker symbol information.
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 * @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
30 */
43
ef7ca23c4233 Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents: 36
diff changeset
31 public class SimpleFillSymbolReader
ef7ca23c4233 Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents: 36
diff changeset
32 implements ISymbolReader {
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33
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 * The logger.
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 */
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 private static final Logger logger =
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 Logger.getLogger(SimpleFillSymbolReader.class);
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40 /**
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41 * Private member.
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 private Element renderer;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 private SimpleFillSymbol symbol;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 private MapToXMLUtils util;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
47
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48 public SimpleFillSymbolReader(ISymbol symbol) throws Exception{
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
49 logger.debug("contructor()");
43
ef7ca23c4233 Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents: 36
diff changeset
50 if(symbol instanceof SimpleFillSymbol) {
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
51 this.symbol = (SimpleFillSymbol)symbol;
43
ef7ca23c4233 Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents: 36
diff changeset
52 }
ef7ca23c4233 Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents: 36
diff changeset
53 else {
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
54 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
55 }
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
56 }
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
57
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
58 /**
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
59 * Setter for the parent XML element.
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
60 *
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61 * @param parent The XML parent node.
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 public void setParent(Element parent) {
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64 this.renderer = parent;
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
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 * Setter for XML document helper.
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
69 *
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
70 * @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
71 */
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
72 public void setUtil(MapToXMLUtils util) {
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
73 this.util = util;
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
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 * Reads the symbol attributes.
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
78 *
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
79 * @return The XML node.
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 public Element read()
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
82 throws IOException {
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
83 logger.debug("read()");
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
84 Element symbolElement;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
85 try {
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
86 symbolElement = util.addSymbol(renderer);
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
87 }
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
88 catch(Exception e) {
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
89 e.printStackTrace();
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
90 return null;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
91 }
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 symbolElement.setAttribute("name", symbol.getNameString());
68
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
94 symbolElement.setAttribute("style", "fill");
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
95 int style = symbol.getStyle();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
96 switch(style) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
97 case esriSimpleFillStyle.esriSFSCross:
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
98 symbolElement.setAttribute("fillstyle", "cross"); break;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
99 case esriSimpleFillStyle.esriSFSSolid:
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
100 symbolElement.setAttribute("fillstyle", "solid"); break;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
101 case esriSimpleFillStyle.esriSFSVertical:
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
102 symbolElement.setAttribute("fillstyle", "vertical"); break;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
103 case esriSimpleFillStyle.esriSFSHorizontal:
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
104 symbolElement.setAttribute("fillstyle", "horizontal"); break;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
105 case esriSimpleFillStyle.esriSFSForwardDiagonal:
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
106 symbolElement.setAttribute("fillstyle", "fwdiagonal"); break;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
107 case esriSimpleFillStyle.esriSFSBackwardDiagonal:
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
108 symbolElement.setAttribute("fillstyle", "bwdiagonal"); break;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
109 case esriSimpleFillStyle.esriSFSDiagonalCross:
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
110 symbolElement.setAttribute("fillstyle", "diagonalcross");
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
111 break;
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
112 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
113 }
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
114
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
115 if(symbol.getColor() instanceof IRgbColor) {
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
116 IRgbColor color = (IRgbColor)symbol.getColor();
68
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
117 Color c = new Color (
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
118 color.getRed(),
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
119 color.getGreen(),
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
120 color.getBlue());
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
121 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
122 symbolElement.setAttribute("transparency",
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
123 String.valueOf(color.getTransparency()));
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
124 }
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
125 else {
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
126 RgbColor col = new RgbColor();
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
127 col.setRGB(symbol.getColor().getRGB());
68
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
128 Color c = new Color (
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
129 col.getRed(),
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
130 col.getGreen(),
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
131 col.getBlue());
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
132 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
133 symbolElement.setAttribute("transparency",
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
134 String.valueOf(col.getTransparency()));
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
135 }
68
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
136
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
137 try {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
138 ILineSymbol ls = symbol.getOutline();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
139 if(ls instanceof MultiLayerLineSymbol) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
140 ISymbolReader sreader = new MultiLayerLineSymbolReader(ls);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
141 sreader.setParent(symbolElement);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
142 sreader.setUtil(util);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
143 sreader.read();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
144 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
145 else if(ls instanceof SimpleLineSymbol) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
146 ISymbolReader sreader = new SimpleLineSymbolReader(ls);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
147 sreader.setParent(symbolElement);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
148 sreader.setUtil(util);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
149 sreader.read();
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 if(ls instanceof MarkerLineSymbol) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
152 ISymbolReader sreader = new MarkerLineSymbolReader(ls);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
153 sreader.setParent(symbolElement);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
154 sreader.setUtil(util);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
155 sreader.read();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
156 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
157 else if(ls instanceof PictureLineSymbol) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
158 ISymbolReader sreader = new PictureLineSymbolReader(ls);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
159 sreader.setParent(symbolElement);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
160 sreader.setUtil(util);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
161 sreader.read();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
162 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
163 else if(ls instanceof CartographicLineSymbol) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
164 ISymbolReader sreader = new CartoLineSymbolReader(ls);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
165 sreader.setParent(symbolElement);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
166 sreader.setUtil(util);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
167 sreader.read();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
168 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
169 else if(ls instanceof HashLineSymbol) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
170 ISymbolReader sreader = new HashLineSymbolReader(ls);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
171 sreader.setParent(symbolElement);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
172 sreader.setUtil(util);
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
173 sreader.read();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
174 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
175 else {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
176 logger.debug("The type of " + ls.getClass().toString() +
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
177 " is not implemented!");
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
178 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
179 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
180 catch(Exception e) {
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
181 e.printStackTrace();
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
182 }
686a88eb531d Added multi layer fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 43
diff changeset
183
36
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
184 return symbolElement;
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
185 }
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
186 }
472aa36d0e01 Added a new layer reader and symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
187 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)