Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/MapserverStyle.java @ 4221:480de0dbca8e
Extended location input helper.
The locationpicker has now an attribute whether the input is distance or
location to display one or two clickable columns.
Replaced the record click handler with cell click handler.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 23 Oct 2012 13:17:20 +0200 |
parents | 27cc95e65f18 |
children |
rev | line source |
---|---|
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 public class MapserverStyle { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 public static class Clazz { |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
10 protected List<ClazzItem> items; |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
11 protected String name; |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
12 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
13 public Clazz(String name) { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
14 this.name = name; |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
15 this.items = new ArrayList<ClazzItem>(); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
16 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
17 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
18 public void addItem(ClazzItem item) { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
19 if (item != null) { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
20 items.add(item); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
21 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
22 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
23 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
24 @Override |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
25 public String toString() { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
26 StringBuilder sb = new StringBuilder(); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
27 sb.append("CLASS\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
28 sb.append("NAME \"" + name + "\"\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
29 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
30 for (ClazzItem item: items) { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
31 item.toString(sb); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
32 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
33 |
2616
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
34 sb.append("END\n"); |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
35 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
36 return sb.toString(); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
37 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
38 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
39 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
40 public interface ClazzItem { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
41 void toString(StringBuilder sb); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
42 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
43 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
44 public static class Style implements ClazzItem { |
1878
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
45 protected String color; |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 protected String outlinecolor; |
1816
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
47 protected String symbol; |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 protected int size; |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
1878
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
50 public void setColor(String color) { |
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
51 this.color = color; |
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
52 } |
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
53 |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 public void setOutlineColor(String outlinecolor) { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 this.outlinecolor = outlinecolor; |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 public void setSize(int size) { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 this.size = size; |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
1816
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
62 public void setSymbol(String symbol) { |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
63 if (symbol != null && symbol.length() > 0) { |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
64 this.symbol = symbol; |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
65 } |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
66 } |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
67 |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
68 public void toString(StringBuilder sb) { |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 sb.append("STYLE\n"); |
1877
1a6018d5f0b7
Set correct Mapserver attribute name to adjust the width of a line.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1876
diff
changeset
|
70 sb.append("WIDTH " + String.valueOf(size) + "\n"); |
2616
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
71 |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
72 if (outlinecolor != null) { |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
73 sb.append("OUTLINECOLOR " + outlinecolor + "\n"); |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
74 } |
1816
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
75 |
1878
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
76 if (color != null) { |
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
77 sb.append("COLOR " + color + "\n"); |
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
78 } |
84cf67a2a19e
Added support for fillcolors of polygons in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1877
diff
changeset
|
79 |
1816
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
80 if (symbol != null) { |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
81 sb.append("SYMBOL '" + symbol + "'\n"); |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
82 } |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1793
diff
changeset
|
83 |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 sb.append("END\n"); |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
85 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
86 } // end of Style |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
88 public static class Label implements ClazzItem { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
89 protected String color; |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
90 protected int size; |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
91 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
92 public void setColor(String color) { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
93 this.color = color; |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 } |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
95 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
96 public void setSize(int size) { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
97 this.size = size; |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
98 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
99 |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
100 @Override |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
101 public void toString(StringBuilder sb) { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
102 sb.append("LABEL\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
103 sb.append("ANGLE auto\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
104 sb.append("SIZE " + String.valueOf(size) + "\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
105 sb.append("COLOR " + color + "\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
106 sb.append("TYPE truetype\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
107 sb.append("FONT DefaultFont\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
108 sb.append("POSITION ur\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
109 sb.append("OFFSET 2 2\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
110 sb.append("END\n"); |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
111 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
112 } |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
2616
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
114 public static class Expression implements ClazzItem { |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
115 protected String value; |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
116 |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
117 public Expression(String value) { |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
118 this.value = value; |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
119 } |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
120 |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
121 @Override |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
122 public void toString(StringBuilder sb) { |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
123 sb.append("EXPRESSION " + value); |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
124 sb.append("\n"); |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
125 } |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
126 } |
27cc95e65f18
Defined a style for WSPLGEN layers which are now modifiable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1878
diff
changeset
|
127 |
1793
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 protected List<Clazz> classes; |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 public MapserverStyle() { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 classes = new ArrayList<Clazz>(); |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 public void addClazz(Clazz clazz) { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 if (clazz != null) { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 classes.add(clazz); |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 public String toString() { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 StringBuilder sb = new StringBuilder(); |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 for (Clazz clazz: classes) { |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 sb.append(clazz.toString()); |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 return sb.toString(); |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 } |
1636686070f7
Initial commit to support styles in maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |