Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENJob.java @ 1106:e9f66d63bdd0
Write user defined barriers into a shapefile that is placed in the Artifact's directory.
flys-artifacts/trunk@2609 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 30 Aug 2011 11:09:54 +0000 |
parents | 7230e087ef8b |
children | 563e015f0f22 |
comparison
equal
deleted
inserted
replaced
1105:adb52a2005e7 | 1106:e9f66d63bdd0 |
---|---|
3 import java.io.IOException; | 3 import java.io.IOException; |
4 import java.io.File; | 4 import java.io.File; |
5 import java.io.FileOutputStream; | 5 import java.io.FileOutputStream; |
6 import java.io.OutputStreamWriter; | 6 import java.io.OutputStreamWriter; |
7 import java.io.PrintWriter; | 7 import java.io.PrintWriter; |
8 import java.util.ArrayList; | |
9 import java.util.List; | |
8 | 10 |
9 | 11 |
10 public class WSPLGENJob { | 12 public class WSPLGENJob { |
11 | 13 |
12 public static final String GEL_SPERRE = "SPERRE"; | 14 public static final String GEL_SPERRE = "SPERRE"; |
15 | 17 |
16 protected String dgm; | 18 protected String dgm; |
17 protected String pro; | 19 protected String pro; |
18 protected String wsp; | 20 protected String wsp; |
19 protected String wspTag; | 21 protected String wspTag; |
20 protected String lin; | |
21 protected String axis; | 22 protected String axis; |
22 protected String area; | 23 protected String area; |
23 protected String gel; | 24 protected String gel; |
24 protected String outFile; | 25 protected String outFile; |
26 | |
27 protected List<String> lin; | |
25 | 28 |
26 protected int out; | 29 protected int out; |
27 | 30 |
28 protected double start; | 31 protected double start; |
29 protected double end; | 32 protected double end; |
33 protected double dist; | 36 protected double dist; |
34 | 37 |
35 | 38 |
36 | 39 |
37 public WSPLGENJob() { | 40 public WSPLGENJob() { |
38 out = -1; | 41 out = -1; |
39 start = Double.NaN; | 42 start = Double.NaN; |
40 end = Double.NaN; | 43 end = Double.NaN; |
41 from = Double.NaN; | 44 from = Double.NaN; |
42 to = Double.NaN; | 45 to = Double.NaN; |
43 diff = Double.NaN; | 46 diff = Double.NaN; |
44 dist = Double.NaN; | 47 dist = Double.NaN; |
48 lin = new ArrayList<String>(2); | |
45 } | 49 } |
46 | 50 |
47 | 51 |
48 public void setWsp(String wsp) { | 52 public void setWsp(String wsp) { |
49 this.wsp = wsp; | 53 this.wsp = wsp; |
63 public String getWspTag() { | 67 public String getWspTag() { |
64 return wspTag; | 68 return wspTag; |
65 } | 69 } |
66 | 70 |
67 | 71 |
68 public void setLin(String lin) { | 72 public void addLin(String lin) { |
69 this.lin = lin; | 73 this.lin.add(lin); |
70 } | 74 } |
71 | 75 |
72 | 76 |
73 public String getLin() { | 77 public List<String> getLin() { |
74 return lin; | 78 return lin; |
75 } | 79 } |
76 | 80 |
77 | 81 |
78 public void setAxis(String axis) { | 82 public void setAxis(String axis) { |
279 } | 283 } |
280 | 284 |
281 protected void writeLin(PrintWriter writer) | 285 protected void writeLin(PrintWriter writer) |
282 throws IllegalArgumentException | 286 throws IllegalArgumentException |
283 { | 287 { |
284 String lin = getLin(); | 288 List<String> lins = getLin(); |
285 | 289 |
286 if (lin != null && lin.length() > 0) { | 290 if (lins != null && !lins.isEmpty()) { |
287 writer.println("-LIN=\"" + lin + "\""); | 291 for (String lin: lins) { |
292 writer.println("-LIN=\"" + lin + "\""); | |
293 } | |
288 } | 294 } |
289 } | 295 } |
290 | 296 |
291 protected void writeAxis(PrintWriter writer) | 297 protected void writeAxis(PrintWriter writer) |
292 throws IllegalArgumentException | 298 throws IllegalArgumentException |