annotate src/java/de/intevation/mxd/reader/CartoLineSymbolReader.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 7632850b9520
rev   line source
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 package de.intevation.mxd.reader;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 import java.awt.Color;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
4
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5 import org.apache.log4j.Logger;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 import com.esri.arcgis.display.ISymbol;
67
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
8 import com.esri.arcgis.display.ILineSymbol;
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 import com.esri.arcgis.display.CartographicLineSymbol;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 import com.esri.arcgis.display.IRgbColor;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 import com.esri.arcgis.display.RgbColor;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 import com.esri.arcgis.display.esriLineCapStyle;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 import com.esri.arcgis.display.esriLineJoinStyle;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 import org.w3c.dom.Element;
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
17 import java.io.IOException;
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 /**
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 * Reads cartoline symbol information.
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 *
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 */
80
83932f18dddc All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 74
diff changeset
24 public class CartoLineSymbolReader
83932f18dddc All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 74
diff changeset
25 extends AbstractSymbolReader {
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 /**
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 * The logger.
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 */
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 private static final Logger logger =
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 Logger.getLogger(CartoLineSymbolReader.class);
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 /**
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 * Private member.
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 */
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 private CartographicLineSymbol symbol;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 public CartoLineSymbolReader(ISymbol symbol)
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39 throws Exception {
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40 logger.debug("contructor()");
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41 if(symbol instanceof CartographicLineSymbol) {
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 this.symbol = (CartographicLineSymbol)symbol;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
43 }
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 else {
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 throw new Exception("Not a CartographicLineSymbol!");
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46 }
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
47 }
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48
67
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
49
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
50 public CartoLineSymbolReader(ILineSymbol symbol)
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
51 throws Exception {
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
52 logger.debug("contructor()");
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
53 if(symbol instanceof CartographicLineSymbol) {
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
54 this.symbol = (CartographicLineSymbol)symbol;
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
55 }
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
56 else {
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
57 throw new Exception("Not a CartographicLineSymbol!");
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
58 }
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
59 }
5ed9e720b6cd Read the hash symbol in the hash line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 65
diff changeset
60
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61 /**
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62 * Reads the symbol attributes.
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
63 *
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64 * @return The XML node.
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
65 */
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
66 public Element read() {
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
67 logger.debug("read()");
80
83932f18dddc All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 74
diff changeset
68 Element symbolElement = util.addSymbol(parent);
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
69
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
70 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
71 symbolElement.setAttribute("name", symbol.getNameString());
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
72 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
73 catch(IOException ioe) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
74 logger.warn("Could not read name. Setting name to \"default\"");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
75 symbolElement.setAttribute("name", "default");
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
76 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
77
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
78 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
79 if(symbol.getColor() instanceof IRgbColor) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
80 IRgbColor color = (IRgbColor)symbol.getColor();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
81 Color c = new Color (
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
82 color.getRed(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
83 color.getGreen(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
84 color.getBlue());
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
85 symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
86 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
87 else {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
88 RgbColor col = new RgbColor();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
89 col.setRGB(symbol.getColor().getRGB());
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
90 Color c = new Color (
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
91 col.getRed(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
92 col.getGreen(),
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
93 col.getBlue());
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
94 symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
95 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
96 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
97 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
98 logger.warn("Could not read color.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
99 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
100
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
101 int cap;
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
102 String capStyle = "";
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
103 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
104 cap = symbol.getCap();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
105 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
106 catch(IOException ioe) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
107 logger.warn(
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
108 "Could not read line cap.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
109 cap = -1;
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
110 }
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
111 switch(cap) {
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
112 case esriLineCapStyle.esriLCSRound: capStyle = "round"; break;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
113 case esriLineCapStyle.esriLCSSquare: capStyle = "square"; break;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
114 default: break;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
115 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
116
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
117
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
118 int join;
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
119 String joinStyle = "";
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
120 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
121 join = symbol.getJoin();
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
122 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
123 catch(IOException ioe) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
124 logger.warn(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
125 "Could not read line join." +
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
126 " Setting line join to \"bevel\".");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
127 join = -1;
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
128 }
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
129 switch(join) {
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
130 case esriLineJoinStyle.esriLJSRound: joinStyle = "round"; break;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
131 case esriLineJoinStyle.esriLJSMitre: joinStyle = "miter"; break;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
132 default: break;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
133 }
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
134 if(!capStyle.equals("")) {
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
135 symbolElement.setAttribute("cap", capStyle);
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
136 }
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
137 if (!joinStyle.equals("")) {
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
138 symbolElement.setAttribute("join", joinStyle);
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
139 }
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
140
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
141 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
142 symbolElement.setAttribute(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
143 "linestart",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
144 String.valueOf(symbol.getLineStartOffset()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
145 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
146 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
147 logger.warn("Could not read line start offset.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
148 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
149
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
150 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
151 symbolElement.setAttribute(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
152 "miterlimit",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
153 String.valueOf(symbol.getMiterLimit()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
154 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
155 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
156 logger.warn("Could not read miter limit.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
157 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
158
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
159 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
160 symbolElement.setAttribute(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
161 "offset",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
162 String.valueOf(symbol.getOffset()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
163 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
164 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
165 logger.warn("Could not read offset.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
166 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
167
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
168 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
169 symbolElement.setAttribute(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
170 "width",
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
171 String.valueOf(symbol.getWidth()));
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
172 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
173 catch(IOException ioe) {
135
a4ab239509f1 Updated the default values and reader error handling.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
174 logger.warn("Could not read width.");
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
175 }
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
176 //TODO Read further attributes depending on the Mapscript functionality:
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
177 // Template, MarkerSymbol, LineDecorations
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
178 symbolElement.setAttribute("type", "line");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 97
diff changeset
179 symbolElement.setAttribute("style", "carto");
65
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
180
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
181 return symbolElement;
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
182 }
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
183 }
9fca9e09b966 Added cartographic line symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
184 // 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)