comparison src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.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
85 symbolElement.setAttribute("transparency", 85 symbolElement.setAttribute("transparency",
86 String.valueOf(col.getTransparency())); 86 String.valueOf(col.getTransparency()));
87 } 87 }
88 } 88 }
89 catch(IOException ioe) { 89 catch(IOException ioe) {
90 logger.warn( 90 logger.warn("Could not read color.");
91 "Could not read color." +
92 " Setting color to black with no transparency.");
93 Color black = new Color(0, 0, 0);
94 symbolElement.setAttribute("color", String.valueOf(black.getRGB()));
95 symbolElement.setAttribute("transparency", "-1");
96 } 91 }
97 92
98 try { 93 try {
99 symbolElement.setAttribute( 94 symbolElement.setAttribute(
100 "angle", 95 "angle",
101 String.valueOf(symbol.getAngle())); 96 String.valueOf(symbol.getAngle()));
102 } 97 }
103 catch(IOException ioe) { 98 catch(IOException ioe) {
104 logger.warn("Could not read angle. Setting angle to 0."); 99 logger.warn("Could not read angle.");
105 symbolElement.setAttribute("angle", "0");
106 } 100 }
107 101
108 try { 102 try {
109 symbolElement.setAttribute( 103 symbolElement.setAttribute(
110 "size", 104 "size",
119 symbolElement.setAttribute( 113 symbolElement.setAttribute(
120 "x_offset", 114 "x_offset",
121 String.valueOf(symbol.getXOffset())); 115 String.valueOf(symbol.getXOffset()));
122 } 116 }
123 catch(IOException ioe) { 117 catch(IOException ioe) {
124 logger.warn("Could not read x-offset. Setting x-offset to 0."); 118 logger.warn("Could not read x-offset.");
125 symbolElement.setAttribute("x_offset", "0");
126 } 119 }
127 120
128 try { 121 try {
129 symbolElement.setAttribute( 122 symbolElement.setAttribute(
130 "y_offset", 123 "y_offset",
131 String.valueOf(symbol.getYOffset())); 124 String.valueOf(symbol.getYOffset()));
132 } 125 }
133 catch(IOException ioe) { 126 catch(IOException ioe) {
134 logger.warn("Could not read y-offset. Setting y-offset to 0."); 127 logger.warn("Could not read y-offset.");
135 symbolElement.setAttribute("y_offset", "0");
136 } 128 }
137 129
138 try { 130 try {
139 symbolElement.setAttribute( 131 symbolElement.setAttribute(
140 "name", 132 "name",
149 symbolElement.setAttribute( 141 symbolElement.setAttribute(
150 "length", 142 "length",
151 String.valueOf(symbol.getLength())); 143 String.valueOf(symbol.getLength()));
152 } 144 }
153 catch(IOException ioe) { 145 catch(IOException ioe) {
154 logger.warn("Could not read length. Setting length to 1."); 146 logger.warn("Could not read length.");
155 symbolElement.setAttribute("length", "1");
156 } 147 }
157 148
158 try { 149 try {
159 symbolElement.setAttribute( 150 symbolElement.setAttribute(
160 "width", 151 "width",
161 String.valueOf(symbol.getWidth())); 152 String.valueOf(symbol.getWidth()));
162 } 153 }
163 catch(IOException ioe) { 154 catch(IOException ioe) {
164 logger.warn("Could not read width. Setting width to 1."); 155 logger.warn("Could not read width.");
165 symbolElement.setAttribute("width", "1");
166 } 156 }
167 symbolElement.setAttribute("style", "arrow"); 157 symbolElement.setAttribute("style", "arrow");
168 symbolElement.setAttribute("type", "marker"); 158 symbolElement.setAttribute("type", "marker");
169 return symbolElement; 159 return symbolElement;
170 } 160 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)