Mercurial > mxd2map
changeset 122:f0a72d232aa8
Set PATTERN for line symbols.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 17 Jun 2011 12:30:21 +0200 |
parents | 9f74f4d36822 |
children | 3c792458a716 |
files | ChangeLog src/java/de/intevation/mxd/writer/LineStyleWriter.java |
diffstat | 2 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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 <raimund.renkert@intevation.de> + + * 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 <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/reader/IReader.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); } }