comparison src/java/de/intevation/mxd/writer/LineStyleWriter.java @ 122:f0a72d232aa8

Set PATTERN for line symbols.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 17 Jun 2011 12:30:21 +0200
parents 11d63bf00326
children cd18c61cbcf6
comparison
equal deleted inserted replaced
121:9f74f4d36822 122:f0a72d232aa8
66 } 66 }
67 String name = symbolElement.getAttribute("name"); 67 String name = symbolElement.getAttribute("name");
68 symbolObj sym = symbolSet.getSymbolByName(name); 68 symbolObj sym = symbolSet.getSymbolByName(name);
69 69
70 //The following lines are for dashed and/or dotted lines. 70 //The following lines are for dashed and/or dotted lines.
71 //These lines throw an "incorrect array size" error. 71 if(symbolElement.hasAttribute("linestyle")) {
72 //TODO Find out how to set the pattern correctly.(Remove the "&& false"
73 //to use this block).
74 if(symbolElement.hasAttribute("linestyle") && false) {
75 String ls = symbolElement.getAttribute("linestyle"); 72 String ls = symbolElement.getAttribute("linestyle");
76 double[] vals; 73 double[] vals;
77 if(ls.equals("dash")) { 74 if(ls.equals("dash")) {
78 style.setPatternlength(2); 75 style.setPatternlength(2);
79 vals = new double[] {2.0, 2.0}; 76 vals = new double[] {4.0, 4.0, 0, 0, 0, 0, 0, 0, 0, 0};
80 style.setPattern(vals); 77 style.setPattern(vals);
81 } 78 }
82 else if(ls.equals("dot")) { 79 else if(ls.equals("dot")) {
83 style.setPatternlength(2); 80 style.setPatternlength(2);
84 vals = new double[] {1.0, 2.0}; 81 vals = new double[] {1.0, 4.0, 0, 0, 0, 0, 0, 0, 0, 0};
85 style.setPattern(vals); 82 style.setPattern(vals);
86 } 83 }
87 else if(ls.equals("dashdot")) { 84 else if(ls.equals("dashdot")) {
88 style.setPatternlength(4); 85 style.setPatternlength(4);
89 vals = new double[] {2.0, 2.0, 1.0, 2.0}; 86 vals = new double[] {5.0, 4.0, 1.0, 4.0, 0, 0, 0, 0, 0, 0};
90 style.setPattern(vals); 87 style.setPattern(vals);
91 } 88 }
92 else if (ls.equals("dashdotdot")) { 89 else if (ls.equals("dashdotdot")) {
93 style.setPatternlength(6); 90 style.setPatternlength(6);
94 vals = new double[] {2.0, 2.0, 1.0, 2.0, 1.0, 2.0}; 91 vals = new double[] {5.0, 4.0, 1.0, 3.0, 1.0, 4.0, 0, 0, 0, 0};
95 style.setPattern(vals); 92 style.setPattern(vals);
96 } 93 }
97 } 94 }
98 String type = symbolElement.getAttribute("type"); 95 String type = symbolElement.getAttribute("type");
99 96
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)