# HG changeset patch # User Raimund Renkert # Date 1308306621 -7200 # Node ID f0a72d232aa87bd0a5edb1eda43d6dafab27f2df # Parent 9f74f4d3682202838f3233d6874adc551f732ae8 Set PATTERN for line symbols. diff -r 9f74f4d36822 -r f0a72d232aa8 ChangeLog --- a/ChangeLog Thu Jun 16 18:36:48 2011 +0200 +++ b/ChangeLog Fri Jun 17 12:30:21 2011 +0200 @@ -1,3 +1,10 @@ +2011-06-17 Raimund Renkert + + * src/java/de/intevation/mxd/writer/LineStyleWriter.java: + Write PATTERN to style block. + The pattern array must be exactly 10 in length (filled up with 0) + and patternlength must be set to the count of pattern elements. + 2011-06-16 Raimund Renkert * src/java/de/intevation/mxd/reader/IReader.java, diff -r 9f74f4d36822 -r f0a72d232aa8 src/java/de/intevation/mxd/writer/LineStyleWriter.java --- a/src/java/de/intevation/mxd/writer/LineStyleWriter.java Thu Jun 16 18:36:48 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/LineStyleWriter.java Fri Jun 17 12:30:21 2011 +0200 @@ -68,30 +68,27 @@ symbolObj sym = symbolSet.getSymbolByName(name); //The following lines are for dashed and/or dotted lines. - //These lines throw an "incorrect array size" error. - //TODO Find out how to set the pattern correctly.(Remove the "&& false" - //to use this block). - if(symbolElement.hasAttribute("linestyle") && false) { + if(symbolElement.hasAttribute("linestyle")) { String ls = symbolElement.getAttribute("linestyle"); double[] vals; if(ls.equals("dash")) { style.setPatternlength(2); - vals = new double[] {2.0, 2.0}; + vals = new double[] {4.0, 4.0, 0, 0, 0, 0, 0, 0, 0, 0}; style.setPattern(vals); } else if(ls.equals("dot")) { style.setPatternlength(2); - vals = new double[] {1.0, 2.0}; + vals = new double[] {1.0, 4.0, 0, 0, 0, 0, 0, 0, 0, 0}; style.setPattern(vals); } else if(ls.equals("dashdot")) { style.setPatternlength(4); - vals = new double[] {2.0, 2.0, 1.0, 2.0}; + vals = new double[] {5.0, 4.0, 1.0, 4.0, 0, 0, 0, 0, 0, 0}; style.setPattern(vals); } else if (ls.equals("dashdotdot")) { style.setPatternlength(6); - vals = new double[] {2.0, 2.0, 1.0, 2.0, 1.0, 2.0}; + vals = new double[] {5.0, 4.0, 1.0, 3.0, 1.0, 4.0, 0, 0, 0, 0}; style.setPattern(vals); } }