Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/MapserverStyle.java @ 2792:fe987587ebc9
Merged revisions 4539-4540,4543,4545-4546 via svnmerge from
file:///home/clients/bsh/bsh-generischer-viewer/Material/SVN/flys-artifacts/trunk
........
r4539 | teichmann | 2012-05-27 20:02:13 +0200 (So, 27 Mai 2012) | 1 line
FixA: Added forgotten csv/report facets/generators to conf.
........
r4540 | teichmann | 2012-05-27 20:11:31 +0200 (So, 27 Mai 2012) | 1 line
FixA: Fixed class cast bug in report facet.
........
r4543 | teichmann | 2012-05-28 20:35:01 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: Added facet to return delta w/t as CSV
........
r4545 | teichmann | 2012-05-28 22:59:27 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: Made Delta W/t calculation finally work
........
r4546 | teichmann | 2012-05-28 23:34:24 +0200 (Mo, 28 Mai 2012) | 1 line
FixA: corrected fitting (Q->W instead W->Q).
........
flys-artifacts/tags/2.7@4547 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 29 May 2012 04:58:29 +0000 |
parents | 27cc95e65f18 |
children |
line wrap: on
line source
package de.intevation.flys.artifacts.model; import java.util.ArrayList; import java.util.List; public class MapserverStyle { public static class Clazz { protected List<ClazzItem> items; protected String name; public Clazz(String name) { this.name = name; this.items = new ArrayList<ClazzItem>(); } public void addItem(ClazzItem item) { if (item != null) { items.add(item); } } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("CLASS\n"); sb.append("NAME \"" + name + "\"\n"); for (ClazzItem item: items) { item.toString(sb); } sb.append("END\n"); return sb.toString(); } } public interface ClazzItem { void toString(StringBuilder sb); } public static class Style implements ClazzItem { protected String color; protected String outlinecolor; protected String symbol; protected int size; public void setColor(String color) { this.color = color; } public void setOutlineColor(String outlinecolor) { this.outlinecolor = outlinecolor; } public void setSize(int size) { this.size = size; } public void setSymbol(String symbol) { if (symbol != null && symbol.length() > 0) { this.symbol = symbol; } } public void toString(StringBuilder sb) { sb.append("STYLE\n"); sb.append("WIDTH " + String.valueOf(size) + "\n"); if (outlinecolor != null) { sb.append("OUTLINECOLOR " + outlinecolor + "\n"); } if (color != null) { sb.append("COLOR " + color + "\n"); } if (symbol != null) { sb.append("SYMBOL '" + symbol + "'\n"); } sb.append("END\n"); } } // end of Style public static class Label implements ClazzItem { protected String color; protected int size; public void setColor(String color) { this.color = color; } public void setSize(int size) { this.size = size; } @Override public void toString(StringBuilder sb) { sb.append("LABEL\n"); sb.append("ANGLE auto\n"); sb.append("SIZE " + String.valueOf(size) + "\n"); sb.append("COLOR " + color + "\n"); sb.append("TYPE truetype\n"); sb.append("FONT DefaultFont\n"); sb.append("POSITION ur\n"); sb.append("OFFSET 2 2\n"); sb.append("END\n"); } } public static class Expression implements ClazzItem { protected String value; public Expression(String value) { this.value = value; } @Override public void toString(StringBuilder sb) { sb.append("EXPRESSION " + value); sb.append("\n"); } } protected List<Clazz> classes; public MapserverStyle() { classes = new ArrayList<Clazz>(); } public void addClazz(Clazz clazz) { if (clazz != null) { classes.add(clazz); } } public String toString() { StringBuilder sb = new StringBuilder(); for (Clazz clazz: classes) { sb.append(clazz.toString()); } return sb.toString(); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :