comparison src/java/de/intevation/mxd/writer/LineStyleWriter.java @ 177:9fd61f4ac0e3

Write lines with width smaller than 1 and write further line attributes.
author raimund renkert <raimund.renkert@intevation.de>
date Thu, 07 Jul 2011 15:05:08 +0200
parents 03daf386f19a
children f4eb506499f5
comparison
equal deleted inserted replaced
176:d95dbd643add 177:9fd61f4ac0e3
50 catch(NumberFormatException nfe) { 50 catch(NumberFormatException nfe) {
51 logger.warn("Error setting width. No line width set."); 51 logger.warn("Error setting width. No line width set.");
52 w = 0; 52 w = 0;
53 } 53 }
54 if(w < 1.0) { 54 if(w < 1.0) {
55 return false; 55 w = 1;
56 } 56 }
57 style.setWidth((int)w); 57 style.setWidth((int)w);
58 } 58 }
59 if(symbolElement.hasAttribute("angle")) { 59 if(symbolElement.hasAttribute("angle")) {
60 try { 60 try {
84 catch(NumberFormatException nfe) { 84 catch(NumberFormatException nfe) {
85 logger.warn("Error setting size. Setting size to 1."); 85 logger.warn("Error setting size. Setting size to 1.");
86 style.setSize (1); 86 style.setSize (1);
87 } 87 }
88 } 88 }
89
90 if(symbolElement.hasAttribute("offset")) {
91 double offset = 0;
92 try {
93 offset = Double.parseDouble(
94 symbolElement.getAttribute("offset"));
95 if(Math.abs(offset) < 1 && offset > 0) {
96 offset = 1;
97 }
98 else if (Math.abs(offset) < 1 && offset < 0) {
99 offset = -1;
100 }
101 style.setOffsetx(offset);
102 style.setOffsety(-99);
103 }
104 catch(NumberFormatException nfe) {
105 logger.warn("Could not set offset.");
106 }
107 }
108
109 if(symbolElement.hasAttribute("miterlimit")) {
110 double miter = 0;
111 try {
112 miter = Double.parseDouble(
113 symbolElement.getAttribute("miterlimit"));
114 style.setLinejoinmaxsize(miter);
115 }
116 catch(NumberFormatException nfe) {
117 logger.warn("Could not set miter limit.");
118 }
119 }
120
89 String type = symbolElement.getAttribute("type"); 121 String type = symbolElement.getAttribute("type");
90 if(type.equals("marker")) { 122 if(type.equals("marker")) {
91 SymbolWriter sw = new SymbolWriter(this.map, this.cl); 123 SymbolWriter sw = new SymbolWriter(this.map, this.cl);
92 sw.write(symbolElement); 124 sw.write(symbolElement);
93 String name = symbolElement.getAttribute("name"); 125 String name = symbolElement.getAttribute("name");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)