comparison src/java/de/intevation/mxd/reader/PictureLineSymbolReader.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 df4e0946ef02
comparison
equal deleted inserted replaced
134:acc9e5430177 135:a4ab239509f1
69 69
70 try { 70 try {
71 symbolElement.setAttribute("name", symbol.getNameString()); 71 symbolElement.setAttribute("name", symbol.getNameString());
72 } 72 }
73 catch(IOException ioe) { 73 catch(IOException ioe) {
74 logger.warn("Could not read name. Setting name ti \"default\""); 74 logger.warn("Could not read name. Setting name to \"default\"");
75 symbolElement.setAttribute("name", "default"); 75 symbolElement.setAttribute("name", "default");
76 } 76 }
77 77
78 try { 78 try {
79 if(symbol.getColor() instanceof IRgbColor) { 79 if(symbol.getColor() instanceof IRgbColor) {
93 col.getBlue()); 93 col.getBlue());
94 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); 94 symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
95 } 95 }
96 } 96 }
97 catch(IOException ioe) { 97 catch(IOException ioe) {
98 logger.warn( 98 logger.warn("Could not read color.");
99 "Could not read color." +
100 " Setting color to black with no transparency");
101 Color black = new Color (0, 0, 0);
102 symbolElement.setAttribute("color", String.valueOf(black.getRGB()));
103 symbolElement.setAttribute("transparency", "-1");
104 } 99 }
105 100
106 try { 101 try {
107 symbolElement.setAttribute( 102 symbolElement.setAttribute(
108 "offset", 103 "offset",
109 String.valueOf(symbol.getOffset())); 104 String.valueOf(symbol.getOffset()));
110 } 105 }
111 catch(IOException ioe) { 106 catch(IOException ioe) {
112 logger.warn("Could not read offset. Setting offset to 0."); 107 logger.warn("Could not read offset.");
113 symbolElement.setAttribute("offset", "0");
114 } 108 }
115 109
116 try { 110 try {
117 symbolElement.setAttribute( 111 symbolElement.setAttribute(
118 "x_scale", 112 "x_scale",
119 String.valueOf(symbol.getXScale())); 113 String.valueOf(symbol.getXScale()));
120 } 114 }
121 catch(IOException ioe) { 115 catch(IOException ioe) {
122 logger.warn("Could not read x-scale. Setting x-scale to 0"); 116 logger.warn("Could not read x-scale.");
123 symbolElement.setAttribute("x_scale", "0");
124 } 117 }
125 118
126 try { 119 try {
127 symbolElement.setAttribute( 120 symbolElement.setAttribute(
128 "y_scale", 121 "y_scale",
129 String.valueOf(symbol.getYScale())); 122 String.valueOf(symbol.getYScale()));
130 } 123 }
131 catch(IOException ioe) { 124 catch(IOException ioe) {
132 logger.warn("Could not read y-scale. Setting y-scale to 0."); 125 logger.warn("Could not read y-scale.");
133 symbolElement.setAttribute("y_scale", "0");
134 } 126 }
135 127
136 try { 128 try {
137 symbolElement.setAttribute( 129 symbolElement.setAttribute(
138 "width", 130 "width",
139 String.valueOf(symbol.getWidth())); 131 String.valueOf(symbol.getWidth()));
140 } 132 }
141 catch(IOException ioe) { 133 catch(IOException ioe) {
142 logger.warn("Could not read width. Setting width to 1."); 134 logger.warn("Could not read width.");
143 symbolElement.setAttribute("width", "1");
144 } 135 }
145 136
146 symbolElement.setAttribute("type", "line"); 137 symbolElement.setAttribute("type", "line");
147 symbolElement.setAttribute("style", "picture"); 138 symbolElement.setAttribute("style", "picture");
148 139
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)