[Schmitzm-commits] r1950 - trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon Apr 16 00:33:12 CEST 2012


Author: alfonx
Date: 2012-04-16 00:33:12 +0200 (Mon, 16 Apr 2012)
New Revision: 1950

Modified:
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StylingUtil.java
Log:


Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StylingUtil.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StylingUtil.java	2012-04-15 11:31:30 UTC (rev 1949)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StylingUtil.java	2012-04-15 22:33:12 UTC (rev 1950)
@@ -90,6 +90,7 @@
 import org.geotools.filter.OrImpl;
 import org.geotools.filter.expression.DivideImpl;
 import org.geotools.filter.function.FilterFunction_strConcat;
+import org.geotools.filter.visitor.DuplicatingFilterVisitor;
 import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.renderer.lite.RendererUtilities;
 import org.geotools.resources.i18n.Vocabulary;
@@ -159,7 +160,8 @@
 /**
  * Diese Klasse enthaelt Hilfsfunktionen zum GeoTools-Styling
  * 
- * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
+ * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
+ *         (University of Bonn/Germany)
  * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
  * 
  * @version 1.1
@@ -184,35 +186,40 @@
 	}
 
 	/** Standard-Instanz einer {@link StyleFactory} */
-	public static final StyleFactory STYLE_FACTORY = CommonFactoryFinder.getStyleFactory(GeoTools.getDefaultHints());
+	public static final StyleFactory STYLE_FACTORY = CommonFactoryFinder
+			.getStyleFactory(GeoTools.getDefaultHints());
 
 	/** Standard-Instanz eines {@link StyleBuilder}. */
-	public static final StyleBuilder STYLE_BUILDER = new StyleBuilder(STYLE_FACTORY);
+	public static final StyleBuilder STYLE_BUILDER = new StyleBuilder(
+			STYLE_FACTORY);
 
 	public static final FilterFactory2 ff = FeatureUtil.FILTER_FACTORY2;
 
 	/** A Filter to mark a {@link TextSymbolizer} class as disabled **/
-	public final static PropertyIsEqualTo LABEL_CLASS_DISABLED_FILTER = ff.equals(ff.literal("LABEL_CLASS_DISABLED"),
-			ff.literal("YES"));
+	public final static PropertyIsEqualTo LABEL_CLASS_DISABLED_FILTER = ff
+			.equals(ff.literal("LABEL_CLASS_DISABLED"), ff.literal("YES"));
 
 	/** A Filter to mark a {@link TextSymbolizer} class as enabled **/
-	public final static PropertyIsEqualTo LABEL_CLASS_ENABLED_FILTER = ff.equals(ff.literal("LABEL_CLASS_ENABLED"),
-			ff.literal("LABEL_CLASS_ENABLED"));
+	public final static PropertyIsEqualTo LABEL_CLASS_ENABLED_FILTER = ff
+			.equals(ff.literal("LABEL_CLASS_ENABLED"),
+					ff.literal("LABEL_CLASS_ENABLED"));
 
-	public static final DuplicatingStyleVisitor DUPLICATINGSTYLEVISITOR = new DuplicatingStyleVisitor(STYLE_FACTORY);
+	public static final DuplicatingStyleVisitor DUPLICATINGSTYLEVISITOR = new DuplicatingStyleVisitor(
+			STYLE_FACTORY);
 
 	// ** Do not change the value, it is needed to recognize SLD **//
 	static final String ALL_LABEL_CLASSES_ENABLED = "ALL_LABEL_CLASSES_ENABLED";
 	/**
-	 * A Filter to mark that one class/rule has been disabled. Sorry, AtlasStyler specifc, but used in Sl
-	 * #createLegendSwing method
+	 * A Filter to mark that one class/rule has been disabled. Sorry,
+	 * AtlasStyler specifc, but used in Sl #createLegendSwing method
 	 **/
-	public static final PropertyIsEqualTo RL_DISABLED_FILTER = ff.equals(ff.literal("ALL_LABEL_CLASSES_DISABLED"),
-			ff.literal("YES"));
+	public static final PropertyIsEqualTo RL_DISABLED_FILTER = ff.equals(
+			ff.literal("ALL_LABEL_CLASSES_DISABLED"), ff.literal("YES"));
 	/**
 	 * A Filter to mark that one class/rule is enabled
 	 **/
-	public static final PropertyIsEqualTo RL_ENABLED_FILTER = ff.equals(ff.literal(ALL_LABEL_CLASSES_ENABLED),
+	public static final PropertyIsEqualTo RL_ENABLED_FILTER = ff.equals(
+			ff.literal(ALL_LABEL_CLASSES_ENABLED),
 			ff.literal(ALL_LABEL_CLASSES_ENABLED));
 
 	// ** Do not change the value, it is needed to recognize SLD **//
@@ -221,7 +228,8 @@
 	/**
 	 * A Filter to mark that one class/rule is enabled
 	 **/
-	public static final PropertyIsEqualTo RL_FILTER_APPLIED_FILTER = ff.equals(ff.literal(RL_FILTER_APPLIED_STR),
+	public static final PropertyIsEqualTo RL_FILTER_APPLIED_FILTER = ff.equals(
+			ff.literal(RL_FILTER_APPLIED_STR),
 			ff.literal(RL_FILTER_APPLIED_STR));
 
 	/**
@@ -232,14 +240,17 @@
 	}
 
 	/**
-	 * RegEx Patter to read palette information from gdalinfo output, for images wir <code>RGB</code>, @see
-	 * {@link #parseColormapToSld(URL)} @see {@link #parseColormapToSld(File)}
+	 * RegEx Patter to read palette information from gdalinfo output, for images
+	 * wir <code>RGB</code>, @see {@link #parseColormapToSld(URL)} @see
+	 * {@link #parseColormapToSld(File)}
 	 **/
-	public static final Pattern GDALINFO_COLORMAP_RGB = Pattern.compile("^[^\\d]*(\\d+): (\\d+),(\\d+),(\\d+).*$");
+	public static final Pattern GDALINFO_COLORMAP_RGB = Pattern
+			.compile("^[^\\d]*(\\d+): (\\d+),(\\d+),(\\d+).*$");
 
 	/**
-	 * RegEx Patter to read palette information from gdalinfo output, for images wir <code>RGBA</code> @see
-	 * {@link #parseColormapToSld(URL)} @see {@link #parseColormapToSld(File)}
+	 * RegEx Patter to read palette information from gdalinfo output, for images
+	 * wir <code>RGBA</code> @see {@link #parseColormapToSld(URL)} @see
+	 * {@link #parseColormapToSld(File)}
 	 **/
 	public static final Pattern GDALINFO_COLORMAP_RGBA = Pattern
 			.compile("^[^\\d]*(\\d+): (\\d+),(\\d+),(\\d+),(\\d+).*$");
@@ -251,32 +262,40 @@
 	static final Literal size3 = FeatureUtil.FILTER_FACTORY2.literal(3);
 
 	static final Graphic SELECTION_GRAPHIC1 = STYLE_FACTORY.createGraphic(
-			new ExternalGraphic[0],
-			new Mark[] { STYLE_FACTORY.createMark(FeatureUtil.FILTER_FACTORY2.literal("square"), null,
-					STYLE_FACTORY.createFill(STYLE_BUILDER.colorExpression(Color.WHITE)), size1, zeroLit) },
-			new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2.literal(1), size1, zeroLit);
+			new ExternalGraphic[0], new Mark[] { STYLE_FACTORY.createMark(
+					FeatureUtil.FILTER_FACTORY2.literal("square"), null,
+					STYLE_FACTORY.createFill(STYLE_BUILDER
+							.colorExpression(Color.WHITE)), size1, zeroLit) },
+			new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2
+					.literal(1), size1, zeroLit);
 
 	static final Graphic SELECTION_GRAPHIC2 = STYLE_FACTORY.createGraphic(
-			new ExternalGraphic[0],
-			new Mark[] { STYLE_FACTORY.createMark(FeatureUtil.FILTER_FACTORY2.literal("circle"), null,
-					STYLE_FACTORY.createFill(STYLE_BUILDER.colorExpression(Color.BLACK)), size2, zeroLit) },
-			new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2.literal(1), size2, zeroLit);
-	static final Graphic SELECTION_GRAPHIC3 = STYLE_FACTORY
-			.createGraphic(new ExternalGraphic[0],
-					new Mark[] { STYLE_FACTORY.createMark(FeatureUtil.FILTER_FACTORY2.literal("circle"), null,
-							STYLE_FACTORY.createFill(STYLE_BUILDER.colorExpression(Color.YELLOW.brighter())), size3,
-							zeroLit) }, new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2.literal(1),
-					size3, zeroLit);
+			new ExternalGraphic[0], new Mark[] { STYLE_FACTORY.createMark(
+					FeatureUtil.FILTER_FACTORY2.literal("circle"), null,
+					STYLE_FACTORY.createFill(STYLE_BUILDER
+							.colorExpression(Color.BLACK)), size2, zeroLit) },
+			new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2
+					.literal(1), size2, zeroLit);
+	static final Graphic SELECTION_GRAPHIC3 = STYLE_FACTORY.createGraphic(
+			new ExternalGraphic[0], new Mark[] { STYLE_FACTORY.createMark(
+					FeatureUtil.FILTER_FACTORY2.literal("circle"), null,
+					STYLE_FACTORY.createFill(STYLE_BUILDER
+							.colorExpression(Color.YELLOW.brighter())), size3,
+					zeroLit) }, new org.geotools.styling.Symbol[0],
+			FeatureUtil.FILTER_FACTORY2.literal(1), size3, zeroLit);
 
 	static final Graphic BLINK_GRAPHIC1 = STYLE_FACTORY.createGraphic(
-			new ExternalGraphic[0],
-			new Mark[] { STYLE_FACTORY.createMark(FeatureUtil.FILTER_FACTORY2.literal("circle"), null,
-					STYLE_FACTORY.createFill(STYLE_BUILDER.colorExpression(Color.WHITE)), size0, halfLit) },
-			new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2.literal(1), size0, zeroLit);
+			new ExternalGraphic[0], new Mark[] { STYLE_FACTORY.createMark(
+					FeatureUtil.FILTER_FACTORY2.literal("circle"), null,
+					STYLE_FACTORY.createFill(STYLE_BUILDER
+							.colorExpression(Color.WHITE)), size0, halfLit) },
+			new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2
+					.literal(1), size0, zeroLit);
 	private static final FilterFactory FILTER_FACTORY = FeatureUtil.FILTER_FACTORY;
 
 	/**
-	 * THis string is set as the Name of the Rules that describe selected features
+	 * THis string is set as the Name of the Rules that describe selected
+	 * features
 	 **/
 	public static final String SELECTION_RULE_ID = "SelectionRule";
 
@@ -286,28 +305,31 @@
 	private static final String OPTIMIZED_COMMENT = "<!-- This SLD has been exported in an 'optimized' version. This version potentially renders faster, but AtlasStyler will not be able to load it correctly.-->";
 
 	/**
-	 * Unless {@link ColorMap} is not sorted automatically, this method calls {@link #sortColorMap(ColorMap)} after
-	 * inserting the color map entry.
+	 * Unless {@link ColorMap} is not sorted automatically, this method calls
+	 * {@link #sortColorMap(ColorMap)} after inserting the color map entry.
 	 * 
 	 * @param colorMap
 	 *            the color map to extend
 	 * @param colorMapEntry
 	 *            the new entry
 	 */
-	public static ColorMap addColorMapEntryAndSort(ColorMap colorMap, ColorMapEntry colorMapEntry) {
+	public static ColorMap addColorMapEntryAndSort(ColorMap colorMap,
+			ColorMapEntry colorMapEntry) {
 		colorMap.addColorMapEntry(colorMapEntry);
 		return sortColorMap(colorMap);
 	}
 
 	/**
-	 * Applies general properties (color map type and extended colors) to a {@link ColorMap}.
+	 * Applies general properties (color map type and extended colors) to a
+	 * {@link ColorMap}.
 	 * 
 	 * @param sourceColorMap
 	 *            color map the properties are taken from
 	 * @param destColormap
 	 *            color map the properties are set
 	 */
-	public static void applyColorMapProperties(ColorMap sourceColorMap, ColorMap destColormap) {
+	public static void applyColorMapProperties(ColorMap sourceColorMap,
+			ColorMap destColormap) {
 		if (sourceColorMap == null || destColormap == null)
 			return;
 		destColormap.setExtendedColors(sourceColorMap.getExtendedColors());
@@ -315,7 +337,8 @@
 	}
 
 	/**
-	 * Removes all label information from the {@link ColorMapEntry}s of the given {@link ColorMap}
+	 * Removes all label information from the {@link ColorMapEntry}s of the
+	 * given {@link ColorMap}
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
@@ -366,7 +389,8 @@
 	/**
 	 * Kopiert eine {@link ColorMap}.
 	 * 
-	 * @return <code>null</code> wenn die uebergebene ColorMap <code>null</code> ist
+	 * @return <code>null</code> wenn die uebergebene ColorMap <code>null</code>
+	 *         ist
 	 */
 	public static ColorMap cloneColorMap(ColorMap colorMap) {
 		// MS: Leider kommt der DuplicatingStyleVisitor nicht damit klar, dass
@@ -393,7 +417,8 @@
 	/**
 	 * Kopiert einen {@link ColorMapEntry}.
 	 * 
-	 * @return <code>null</code> wenn der uebergebene ColorMapEntry <code>null</code> ist
+	 * @return <code>null</code> wenn der uebergebene ColorMapEntry
+	 *         <code>null</code> ist
 	 * 
 	 *         TODO doppelt mit copy( ColorMapEntry? )
 	 */
@@ -401,20 +426,24 @@
 		if (colorMapEntry == null)
 			return null;
 
-		return createColorMapEntry(colorMapEntry.getLabel(), getQuantityFromColorMapEntry(colorMapEntry),
-				getColorFromColorMapEntry(colorMapEntry), getOpacityFromColorMapEntry(colorMapEntry));
+		return createColorMapEntry(colorMapEntry.getLabel(),
+				getQuantityFromColorMapEntry(colorMapEntry),
+				getColorFromColorMapEntry(colorMapEntry),
+				getOpacityFromColorMapEntry(colorMapEntry));
 	}
 
 	/**
-	 * Prueft, ob zwei {@link ColorMapEntry}-Instanzen gleich sind. Dies ist der Fall, wenn ihnen der gleiche Wert, die
-	 * gleiche Farbe, die gleiche Transparenz und das gleiche Label zugeordnet ist.
+	 * Prueft, ob zwei {@link ColorMapEntry}-Instanzen gleich sind. Dies ist der
+	 * Fall, wenn ihnen der gleiche Wert, die gleiche Farbe, die gleiche
+	 * Transparenz und das gleiche Label zugeordnet ist.
 	 * 
 	 * @param cme1
 	 *            ein Farbpaletten-Eintrag
 	 * @param cme2
 	 *            ein anderer Farbpaletten-Eintrag
 	 */
-	public static boolean colorMapEntriesEqual(ColorMapEntry cme1, ColorMapEntry cme2) {
+	public static boolean colorMapEntriesEqual(ColorMapEntry cme1,
+			ColorMapEntry cme2) {
 		if (cme1 == null ^ cme2 == null)
 			return false;
 		if (cme1 == cme2)
@@ -432,7 +461,8 @@
 		// Wert auf Gleichheit testen
 		Double quan1 = getQuantityFromColorMapEntry(cme1);
 		Double quan2 = getQuantityFromColorMapEntry(cme2);
-		if (quan1 == null ^ quan2 == null || quan1 != null && !quan1.equals(quan2))
+		if (quan1 == null ^ quan2 == null || quan1 != null
+				&& !quan1.equals(quan2))
 			return false;
 		// Transparenz auf Gleichheit testen
 		Double op1 = getOpacityFromColorMapEntry(cme1);
@@ -446,7 +476,8 @@
 	/**
 	 * Kopiert einen {@link ColorMapEntry}.
 	 * 
-	 * @return <code>null</code> wenn der uebergebene ColorMapEntry <code>null</code> ist
+	 * @return <code>null</code> wenn der uebergebene ColorMapEntry
+	 *         <code>null</code> ist
 	 */
 	public static ColorMapEntry copy(ColorMapEntry colorMapEntry) {
 		DuplicatingStyleVisitor duplicatingStyleVisitor = new DuplicatingStyleVisitor();
@@ -488,8 +519,9 @@
 	}
 
 	/**
-	 * Since GT2.6, the AttributeNames are case sensitive. Also the raster Styles need GeometryProperty set to "geom" to
-	 * work. This method checks all referenced AttributeNames.
+	 * Since GT2.6, the AttributeNames are case sensitive. Also the raster
+	 * Styles need GeometryProperty set to "geom" to work. This method checks
+	 * all referenced AttributeNames.
 	 * 
 	 * @param Schema
 	 *            may be <code>null</code>, e.g. for raster layers
@@ -501,15 +533,17 @@
 	}
 
 	/**
-	 * Since GT2.6, the AttributeNames are case sensitive. Also the raster Styles need GeometryProperty set to "geom" to
-	 * work. This method checks all referenced AttributeNames and checks them against the schema.
+	 * Since GT2.6, the AttributeNames are case sensitive. Also the raster
+	 * Styles need GeometryProperty set to "geom" to work. This method checks
+	 * all referenced AttributeNames and checks them against the schema.
 	 * 
 	 * @param Schema
 	 *            may be <code>null</code>, e.g. for raster layers
 	 * 
 	 *            TODO Rename to correctStye
 	 */
-	public static Style correctPropertyNames(Style style, final SimpleFeatureType schema) {
+	public static Style correctPropertyNames(Style style,
+			final SimpleFeatureType schema) {
 
 		DuplicatingStyleVisitor dsv = new DuplicatingStyleVisitor() {
 			@Override
@@ -531,8 +565,9 @@
 				} else if (expression instanceof PropertyName) {
 					PropertyName pName = (PropertyName) expression;
 
-					Name correctedName = FeatureUtil.findBestMatchingAttributeFallBackFirst(schema,
-							pName.getPropertyName());
+					Name correctedName = FeatureUtil
+							.findBestMatchingAttributeFallBackFirst(schema,
+									pName.getPropertyName());
 
 					return ff.property(correctedName);
 				}
@@ -547,7 +582,8 @@
 					divFilter.setExpression2(copy(divFilter.getExpression2()));
 				} else if (filter instanceof IsNullImpl) {
 					IsNullImpl isNullFilter = (IsNullImpl) filter;
-					isNullFilter.setExpression1(copy(isNullFilter.getExpression1()));
+					isNullFilter.setExpression1(copy(isNullFilter
+							.getExpression1()));
 				} else if (filter instanceof NotImpl) {
 					NotImpl notFilter = (NotImpl) filter;
 					List<Filter> children = notFilter.getChildren();
@@ -580,7 +616,8 @@
 					// TODO noch viel mehr faelle!!
 					if (filter instanceof IsBetweenImpl) {
 						IsBetweenImpl isbetween = (IsBetweenImpl) filter;
-						isbetween.setExpression(copy(isbetween.getExpression()));
+						isbetween
+								.setExpression(copy(isbetween.getExpression()));
 					}
 
 				}
@@ -637,8 +674,8 @@
 	}
 
 	/**
-	 * @return A {@link FeatureTypeStyle} that can be used style the given geoObject during a blink or highlight
-	 *         process.
+	 * @return A {@link FeatureTypeStyle} that can be used style the given
+	 *         geoObject during a blink or highlight process.
 	 */
 	public static FeatureTypeStyle createBlinkFeatureTypeStyle(Object geoObject) {
 		if (geoObject instanceof GridCoverage2D
@@ -674,52 +711,65 @@
 
 		case NONE:
 		default:
-			throw new IllegalArgumentException("Provide a suitable GeometryForm object, NONE not allowed");
+			throw new IllegalArgumentException(
+					"Provide a suitable GeometryForm object, NONE not allowed");
 		}
 
-		return STYLE_BUILDER.createFeatureTypeStyle(symbolizers, Double.NaN, Double.NaN);
+		return STYLE_BUILDER.createFeatureTypeStyle(symbolizers, Double.NaN,
+				Double.NaN);
 	}
 
-	private static Symbolizer[] createBlinkFeatureTypeStyleLine(Symbolizer[] symbolizers) {
+	private static Symbolizer[] createBlinkFeatureTypeStyleLine(
+			Symbolizer[] symbolizers) {
 		LineSymbolizer ls = STYLE_BUILDER.createLineSymbolizer(Color.red, 6.);
 		symbolizers = LangUtil.extendArray(symbolizers, ls);
 
-		LineSymbolizer ls2 = STYLE_BUILDER.createLineSymbolizer(Color.black, 4.);
+		LineSymbolizer ls2 = STYLE_BUILDER
+				.createLineSymbolizer(Color.black, 4.);
 		symbolizers = LangUtil.extendArray(symbolizers, ls2);
 
-		LineSymbolizer ls3 = STYLE_BUILDER.createLineSymbolizer(Color.white, 2.);
+		LineSymbolizer ls3 = STYLE_BUILDER
+				.createLineSymbolizer(Color.white, 2.);
 		symbolizers = LangUtil.extendArray(symbolizers, ls3);
 		return symbolizers;
 	}
 
-	private static Symbolizer[] createBlinkFeatureTypeStylePolygon(Symbolizer[] symbolizers) {
-		PolygonSymbolizer pol1 = STYLE_BUILDER.createPolygonSymbolizer(STYLE_BUILDER.createStroke(Color.red, 4), null);
+	private static Symbolizer[] createBlinkFeatureTypeStylePolygon(
+			Symbolizer[] symbolizers) {
+		PolygonSymbolizer pol1 = STYLE_BUILDER.createPolygonSymbolizer(
+				STYLE_BUILDER.createStroke(Color.red, 4), null);
 		symbolizers = LangUtil.extendArray(symbolizers, pol1);
 
-		PolygonSymbolizer pol2 = STYLE_BUILDER.createPolygonSymbolizer(STYLE_BUILDER.createStroke(Color.black, 2),
+		PolygonSymbolizer pol2 = STYLE_BUILDER.createPolygonSymbolizer(
+				STYLE_BUILDER.createStroke(Color.black, 2),
 				STYLE_BUILDER.createFill(Color.WHITE, .5));
 		symbolizers = LangUtil.extendArray(symbolizers, pol2);
 		return symbolizers;
 	}
 
-	private static Symbolizer[] createBlinkFeatureTypeStylePoint(Symbolizer[] symbolizers) {
+	private static Symbolizer[] createBlinkFeatureTypeStylePoint(
+			Symbolizer[] symbolizers) {
 		Graphic bg2;
 		Literal size0 = FeatureUtil.FILTER_FACTORY2.literal(26);
 		Literal size1 = FeatureUtil.FILTER_FACTORY2.literal(28);
 
-		Graphic bg1 = STYLE_FACTORY.createGraphic(
-				new ExternalGraphic[0],
-				new Mark[] { STYLE_FACTORY.createMark(FeatureUtil.FILTER_FACTORY2.literal("circle"),
-						STYLE_BUILDER.createStroke(Color.red, 2.), null, size1, halfLit) },
-				new org.geotools.styling.Symbol[0], FeatureUtil.FILTER_FACTORY2.literal(1), size1, zeroLit);
+		Graphic bg1 = STYLE_FACTORY.createGraphic(new ExternalGraphic[0],
+				new Mark[] { STYLE_FACTORY.createMark(
+						FeatureUtil.FILTER_FACTORY2.literal("circle"),
+						STYLE_BUILDER.createStroke(Color.red, 2.), null, size1,
+						halfLit) }, new org.geotools.styling.Symbol[0],
+				FeatureUtil.FILTER_FACTORY2.literal(1), size1, zeroLit);
 
 		PointSymbolizer ps1 = STYLE_FACTORY.createPointSymbolizer();
 		ps1.setGraphic(bg1);
 		symbolizers = LangUtil.extendArray(symbolizers, ps1);
 
-		bg2 = STYLE_FACTORY.createGraphic(new ExternalGraphic[0], new Mark[] { STYLE_FACTORY.createMark(
-				FeatureUtil.FILTER_FACTORY2.literal("circle"), STYLE_BUILDER.createStroke(Color.black, 2.),
-				STYLE_BUILDER.createFill(Color.WHITE, 0.3), size0, halfLit) }, new org.geotools.styling.Symbol[0],
+		bg2 = STYLE_FACTORY.createGraphic(new ExternalGraphic[0],
+				new Mark[] { STYLE_FACTORY.createMark(
+						FeatureUtil.FILTER_FACTORY2.literal("circle"),
+						STYLE_BUILDER.createStroke(Color.black, 2.),
+						STYLE_BUILDER.createFill(Color.WHITE, 0.3), size0,
+						halfLit) }, new org.geotools.styling.Symbol[0],
 				FeatureUtil.FILTER_FACTORY2.literal(1), size0, zeroLit);
 
 		PointSymbolizer ps2 = STYLE_FACTORY.createPointSymbolizer();
@@ -730,11 +780,13 @@
 	}
 
 	/**
-	 * Creates a new {@link BrewerPalette} with only one scheme (which includes all colors). The suitablity of the
-	 * palette is set to "unknown" for all viewer types.
+	 * Creates a new {@link BrewerPalette} with only one scheme (which includes
+	 * all colors). The suitablity of the palette is set to "unknown" for all
+	 * viewer types.
 	 * 
 	 * @param name
-	 *            name for the palette (also the description is set to this value)
+	 *            name for the palette (also the description is set to this
+	 *            value)
 	 * @param colors
 	 *            colors for the palette
 	 */
@@ -747,10 +799,13 @@
 		// set suitability to UNKNOWN for all viewers
 		PaletteSuitability suitability = new PaletteSuitability();
 		try {
-			suitability.setSuitability(colors.length, new String[] { "?", "?", "?", "?", "?", "?" });
+			suitability.setSuitability(colors.length, new String[] { "?", "?",
+					"?", "?", "?", "?" });
 			palette.setPaletteSuitability(suitability);
 		} catch (IOException e) {
-			LOGGER.error("Unabel to PaletteSuitability.setSuitablility for colors.length=" + colors, e);
+			LOGGER.error(
+					"Unabel to PaletteSuitability.setSuitablility for colors.length="
+							+ colors, e);
 		}
 
 		// Create the trivial scheme for the palette (requested colors equals
@@ -783,7 +838,8 @@
 	 * @param opacity
 	 *            Transparenz fuer die Farbe des Farbpaletten-Eintrag
 	 */
-	public static ColorMapEntry createColorMapEntry(String label, Double quantity, Color color, double opacity) {
+	public static ColorMapEntry createColorMapEntry(String label,
+			Double quantity, Color color, double opacity) {
 		ColorMapEntry newEntry = STYLE_FACTORY.createColorMapEntry();
 		try {
 			newEntry.setLabel(label);
@@ -797,23 +853,28 @@
 	}
 
 	/**
-	 * Erstellt einen Default-Style fuer die Klassen/Interfaces: StyledFeaturesInterface, GridCoverage2D,
-	 * FeatureCollection, FeatureSource und GeometryAttributeType.
+	 * Erstellt einen Default-Style fuer die Klassen/Interfaces:
+	 * StyledFeaturesInterface, GridCoverage2D, FeatureCollection, FeatureSource
+	 * und GeometryAttributeType.
 	 * 
 	 * @param object
-	 *            {@link GridCoverage2D}, {@link org.geotools.coverage.grid.io.AbstractGridCoverage2DReader} oder
-	 *            {@link FeatureCollection}
+	 *            {@link GridCoverage2D},
+	 *            {@link org.geotools.coverage.grid.io.AbstractGridCoverage2DReader}
+	 *            oder {@link FeatureCollection}
 	 * @return {@code null} falls kein Style generiert werden kann
 	 * 
-	 * @Deprectated Use FeatureUtil.createDefaultStyle and FeatureUtil.getGeometryForm
+	 * @Deprectated Use FeatureUtil.createDefaultStyle and
+	 *              FeatureUtil.getGeometryForm
 	 */
 	public static Style createDefaultStyle(Object object) {
 
 		if (object instanceof StyledFeaturesInterface)
-			return FeatureUtil.createDefaultStyle(((StyledFeaturesInterface<?>) object).getSchema()
-					.getGeometryDescriptor());
+			return FeatureUtil
+					.createDefaultStyle(((StyledFeaturesInterface<?>) object)
+							.getSchema().getGeometryDescriptor());
 
-		if (object instanceof GridCoverage2D || object instanceof AbstractGridCoverage2DReader
+		if (object instanceof GridCoverage2D
+				|| object instanceof AbstractGridCoverage2DReader
 				|| object instanceof StyledRasterInterface)
 			return GridUtil.createDefaultStyle();
 
@@ -822,15 +883,18 @@
 		}
 
 		if (object instanceof FeatureCollection)
-			return FeatureUtil.createDefaultStyle((FeatureCollection<SimpleFeatureType, SimpleFeature>) object);
+			return FeatureUtil
+					.createDefaultStyle((FeatureCollection<SimpleFeatureType, SimpleFeature>) object);
 
 		if (object instanceof FeatureSource)
-			return FeatureUtil.createDefaultStyle(((FeatureSource) object).getSchema().getGeometryDescriptor());
+			return FeatureUtil.createDefaultStyle(((FeatureSource) object)
+					.getSchema().getGeometryDescriptor());
 
 		if (object instanceof GeometryDescriptor)
 			return FeatureUtil.createDefaultStyle((GeometryDescriptor) object);
 
-		LOGGER.warn("createDefaultStyle could not handle " + object + " and returned an empty (invalid) Style");
+		LOGGER.warn("createDefaultStyle could not handle " + object
+				+ " and returned an empty (invalid) Style");
 		return STYLE_BUILDER.createStyle();
 	}
 
@@ -840,15 +904,19 @@
 	 * @param name
 	 *            Name fuer die {@link GridSampleDimension}
 	 * @param colorMap
-	 *            fuer jeden Eintrag der {@link ColorMap} wird eine {@link Category} erzeugt
+	 *            fuer jeden Eintrag der {@link ColorMap} wird eine
+	 *            {@link Category} erzeugt
 	 * @param noDataValues
-	 *            Werte fuer die zusaetzliche {@link Category Categorys} erstellt werden, welche die transparent
-	 *            dargestellt werden (wenn {@code null} wird keine zusaetzliche {@link Category} erstellt)
+	 *            Werte fuer die zusaetzliche {@link Category Categorys}
+	 *            erstellt werden, welche die transparent dargestellt werden
+	 *            (wenn {@code null} wird keine zusaetzliche {@link Category}
+	 *            erstellt)
 	 * @param unit
-	 *            Einheit der Werte in der {@link GridSampleDimension} (kann {@code null} sein)
+	 *            Einheit der Werte in der {@link GridSampleDimension} (kann
+	 *            {@code null} sein)
 	 */
-	public static GridSampleDimension createDiscreteGridSampleDimension(String name, ColorMap colorMap,
-			double[] noDataValues, Unit<?> unit) {
+	public static GridSampleDimension createDiscreteGridSampleDimension(
+			String name, ColorMap colorMap, double[] noDataValues, Unit<?> unit) {
 		if (colorMap.getColorMapEntries().length == 0)
 			return null;
 
@@ -870,12 +938,15 @@
 			// label = String.valueOf(intValue);
 			if (label == null)
 				label = "";
-			categories.put(intValue, new Category(label, new Color[] { color },
-			// New by Stefan Tzeggai 12.9.11: GT8 Migration
-			// new NumberRange(intValue, intValue), new NumberRange<Integer>(
-			// intValue, intValue)));
-					new NumberRange<Integer>(Integer.class, intValue, intValue), new NumberRange<Integer>(
-							Integer.class, intValue, intValue)));
+			categories.put(intValue,
+					new Category(label, new Color[] { color },
+					// New by Stefan Tzeggai 12.9.11: GT8 Migration
+					// new NumberRange(intValue, intValue), new
+					// NumberRange<Integer>(
+					// intValue, intValue)));
+							new NumberRange<Integer>(Integer.class, intValue,
+									intValue), new NumberRange<Integer>(
+									Integer.class, intValue, intValue)));
 		}
 
 		// If NoData-Value is set, create an additional Category
@@ -895,16 +966,19 @@
 		final int higherEnd = Integer.MAX_VALUE;
 
 		// New by Stefan Tzeggai 12.9.11: GT8 Migration
-		categories.put(colorMapMax + 10, new Category("_autoNoData1_", new Color[] { new Color(0, 0, 0, 0) },
-				new NumberRange<Integer>(Integer.class, colorMapMax + 1, colorMapMax + 2), new NumberRange<Integer>(
+		categories.put(colorMapMax + 10, new Category("_autoNoData1_",
+				new Color[] { new Color(0, 0, 0, 0) },
+				new NumberRange<Integer>(Integer.class, colorMapMax + 1,
+						colorMapMax + 2), new NumberRange<Integer>(
 						Integer.class, colorMapMax + 1, higherEnd)));
 		// new Color[] { new Color(0, 0, 0, 0) }, new NumberRange(
 		// colorMapMax + 1, colorMapMax + 2), new NumberRange(
 		// colorMapMax + 1, higherEnd)));
 		if (colorMapMin < colorMapMax)
-			categories.put(colorMapMin - 10, new Category("_autoNoData2_", new Color[] { new Color(0, 0, 0, 0) },
-			// new NumberRange(colorMapMin-2, colorMapMin-1), //
-			// logischer, aber klappt nicht!?
+			categories.put(colorMapMin - 10, new Category("_autoNoData2_",
+					new Color[] { new Color(0, 0, 0, 0) },
+					// new NumberRange(colorMapMin-2, colorMapMin-1), //
+					// logischer, aber klappt nicht!?
 					NumberRange.create(colorMapMax + 3, colorMapMax + 4),
 					// new NumberRange(colorMapMax + 3, colorMapMax + 4),
 					NumberRange.create(lowerStart, colorMapMin - 1)
@@ -912,8 +986,8 @@
 					));
 
 		// Create the GridSampleDimension
-		GridSampleDimension gsd = new GridSampleDimension(name, categories.values().toArray(new Category[0]), unit)
-				.geophysics(true);
+		GridSampleDimension gsd = new GridSampleDimension(name, categories
+				.values().toArray(new Category[0]), unit).geophysics(true);
 
 		for (Category c : gsd.getCategories())
 			LOGGER.debug(c.toString());
@@ -922,7 +996,8 @@
 	}
 
 	/**
-	 * Erzeugt eine {@link Category} fuer die NoData-Werte transparent dargestellt werden.
+	 * Erzeugt eine {@link Category} fuer die NoData-Werte transparent
+	 * dargestellt werden.
 	 * 
 	 * @param geoValue
 	 *            Geo-Wert, der NoData repraesentiert
@@ -932,7 +1007,8 @@
 	}
 
 	/**
-	 * Erzeugt eine {@link Category} fuer die NoData-Werte transparent dargestellt werden.
+	 * Erzeugt eine {@link Category} fuer die NoData-Werte transparent
+	 * dargestellt werden.
 	 * 
 	 * @param value
 	 *            Sample-Wert der Category
@@ -940,39 +1016,52 @@
 	 *            Geo-Wert, der NoData repraesentiert
 	 */
 	public static Category createNoDataCategory(int value, double geoValue) {
-		return new Category(Vocabulary.formatInternational(VocabularyKeys.NODATA),
+		return new Category(
+				Vocabulary.formatInternational(VocabularyKeys.NODATA),
 				// New by Stefan Tzeggai 12.9.11: GT8 Migration
-				new Color[] { new Color(0, 0, 0, 0) }, new NumberRange<Integer>(Integer.class, value, value),
+				new Color[] { new Color(0, 0, 0, 0) },
+				new NumberRange<Integer>(Integer.class, value, value),
 				new NumberRange<Double>(Double.class, geoValue, geoValue));
 	}
 
 	/**
 	 * @param geoObject
-	 *            the {@link GeometryForm} the selection style shall be created for.
+	 *            the {@link GeometryForm} the selection style shall be created
+	 *            for.
 	 * @param type
-	 *            define the look of the selection style by choosing a constant from {@link SelectionStylesTypes}
+	 *            define the look of the selection style by choosing a constant
+	 *            from {@link SelectionStylesTypes}
 	 * 
-	 * @return a {@link Style} that is suitable to identify features of the given type as selected items.
+	 * @return a {@link Style} that is suitable to identify features of the
+	 *         given type as selected items.
 	 */
-	public static FeatureTypeStyle createSelectionFTStyle(GeometryForm geometryForm, SelectionStylesTypes type) {
-		Symbolizer[] symbolizers = createSelectionSymbolizers(geometryForm, type);
+	public static FeatureTypeStyle createSelectionFTStyle(
+			GeometryForm geometryForm, SelectionStylesTypes type) {
+		Symbolizer[] symbolizers = createSelectionSymbolizers(geometryForm,
+				type);
 
-		return STYLE_BUILDER.createFeatureTypeStyle(symbolizers, 0.0, Double.POSITIVE_INFINITY);
+		return STYLE_BUILDER.createFeatureTypeStyle(symbolizers, 0.0,
+				Double.POSITIVE_INFINITY);
 	}
 
 	/**
 	 * @param geoObject
-	 *            {@link GridCoverage2D}, {@link AbstractGridCoverage2DReader}, {@link FeatureCollection},
-	 *            {@link GeometryAttributeType} or {@link FeatureSource}
+	 *            {@link GridCoverage2D}, {@link AbstractGridCoverage2DReader},
+	 *            {@link FeatureCollection}, {@link GeometryAttributeType} or
+	 *            {@link FeatureSource}
 	 * 
 	 * @param type
-	 *            define the look of the selection style by choosing a constant from {@link SelectionStylesTypes}
+	 *            define the look of the selection style by choosing a constant
+	 *            from {@link SelectionStylesTypes}
 	 * 
-	 * @return a {@link Style} that is suitable to identify features of the given type as selected items.
+	 * @return a {@link Style} that is suitable to identify features of the
+	 *         given type as selected items.
 	 */
-	public static FeatureTypeStyle createSelectionFTStyle(Object geoObject, SelectionStylesTypes type) {
+	public static FeatureTypeStyle createSelectionFTStyle(Object geoObject,
+			SelectionStylesTypes type) {
 
-		if (geoObject instanceof AbstractCoverage || geoObject instanceof AbstractGridCoverage2DReader) {
+		if (geoObject instanceof AbstractCoverage
+				|| geoObject instanceof AbstractGridCoverage2DReader) {
 			// Wenn irgendwann mal selection für raster möglich ist, dann hier
 			// einen schöneren style erstellen.
 			return GridUtil.createDefaultStyle().featureTypeStyles().get(0);
@@ -998,7 +1087,8 @@
 	 * @param selectionIds
 	 * @return
 	 */
-	public static Rule createSelectionRule(GeometryForm geometryForm, String idPropertyName, List<String> selectionIds,
+	public static Rule createSelectionRule(GeometryForm geometryForm,
+			String idPropertyName, List<String> selectionIds,
 			SelectionStylesTypes type) {
 
 		if (idPropertyName == null)
@@ -1017,7 +1107,8 @@
 		if (selectionIds.size() > 0) {
 			for (String id : selectionIds) {
 				PropertyIsEqualTo equal = FilterUtil.FILTER_FAC2.equals(
-						FilterUtil.FILTER_FAC2.property(idPropertyName), FilterUtil.FILTER_FAC2.literal(id));
+						FilterUtil.FILTER_FAC2.property(idPropertyName),
+						FilterUtil.FILTER_FAC2.literal(id));
 				equals.add(equal);
 			}
 			rule.setFilter(FilterUtil.FILTER_FAC2.or(equals));
@@ -1027,14 +1118,16 @@
 		}
 
 		// Symboizers
-		Symbolizer[] symbolizers = createSelectionSymbolizers(geometryForm, type);
+		Symbolizer[] symbolizers = createSelectionSymbolizers(geometryForm,
+				type);
 
 		rule.symbolizers().addAll(Arrays.asList(symbolizers));
 
 		return rule;
 	}
 
-	public static Style createSelectionStyle(Object geoObject, SelectionStylesTypes type) {
+	public static Style createSelectionStyle(Object geoObject,
+			SelectionStylesTypes type) {
 		FeatureTypeStyle fts = createSelectionFTStyle(geoObject, type);
 		Style style = STYLE_FACTORY.createStyle();
 		style.featureTypeStyles().clear();
@@ -1043,7 +1136,8 @@
 
 	}
 
-	public static Symbolizer[] createSelectionSymbolizers(GeometryForm geometryForm, SelectionStylesTypes type) {
+	public static Symbolizer[] createSelectionSymbolizers(
+			GeometryForm geometryForm, SelectionStylesTypes type) {
 		Symbolizer[] symbolizers = new Symbolizer[0];
 
 		double size = 15.;
@@ -1062,7 +1156,8 @@
 			break;
 
 		case POLYGON:
-			symbolizers = addSelectionSymbolizersPolygon(type, symbolizers, size);
+			symbolizers = addSelectionSymbolizersPolygon(type, symbolizers,
+					size);
 			break;
 
 		case LINE:
@@ -1070,7 +1165,8 @@
 			break;
 
 		case ANY:
-			symbolizers = addSelectionSymbolizersPolygon(type, symbolizers, size);
+			symbolizers = addSelectionSymbolizersPolygon(type, symbolizers,
+					size);
 			symbolizers = addSelectionSymbolizersPoint(symbolizers);
 			// symbolizers = addSelectionSymbolizersLine(symbolizers);
 			break;
@@ -1082,17 +1178,19 @@
 		return symbolizers;
 	}
 
-	private static Symbolizer[] addSelectionSymbolizersLine(Symbolizer[] symbolizers) {
+	private static Symbolizer[] addSelectionSymbolizersLine(
+			Symbolizer[] symbolizers) {
 		LineSymbolizer ls = STYLE_BUILDER.createLineSymbolizer(Color.red, 3.);
 		symbolizers = LangUtil.extendArray(symbolizers, ls);
 
-		LineSymbolizer ls2 = STYLE_BUILDER.createLineSymbolizer(Color.white, 1.);
+		LineSymbolizer ls2 = STYLE_BUILDER
+				.createLineSymbolizer(Color.white, 1.);
 		symbolizers = LangUtil.extendArray(symbolizers, ls2);
 		return symbolizers;
 	}
 
-	private static Symbolizer[] addSelectionSymbolizersPolygon(SelectionStylesTypes type, Symbolizer[] symbolizers,
-			double size) {
+	private static Symbolizer[] addSelectionSymbolizersPolygon(
+			SelectionStylesTypes type, Symbolizer[] symbolizers, double size) {
 		String markShapeName = "";
 		if (type == SelectionStylesTypes.LeftTop2RightBottom_lines
 				|| type == SelectionStylesTypes.LeftTop2RightBottom_lines_smallgaps
@@ -1114,7 +1212,8 @@
 				Mark fillMark = STYLE_BUILDER.createMark(markShapeName);
 				fillMark.setStroke(STYLE_BUILDER.createStroke(Color.red, 3.));
 
-				Graphic fillGraphic = STYLE_BUILDER.createGraphic(null, fillMark, null);
+				Graphic fillGraphic = STYLE_BUILDER.createGraphic(null,
+						fillMark, null);
 
 				fillGraphic.setSize(FILTER_FACTORY.literal(size));
 
@@ -1122,33 +1221,39 @@
 				fill.setGraphicFill(fillGraphic);
 			}
 
-			PolygonSymbolizer polS0 = STYLE_BUILDER.createPolygonSymbolizer(outline, fill);
+			PolygonSymbolizer polS0 = STYLE_BUILDER.createPolygonSymbolizer(
+					outline, fill);
 
 			symbolizers = LangUtil.extendArray(symbolizers, polS0);
 		}
 
 		{ // White
-			Stroke outline = STYLE_BUILDER.createStroke(Color.yellow.brighter(), 1);
+			Stroke outline = STYLE_BUILDER.createStroke(
+					Color.yellow.brighter(), 1);
 
 			Fill fill = null;
 
 			if (type != SelectionStylesTypes.Outline_only) {
 				Mark fillMark = STYLE_BUILDER.createMark(markShapeName);
-				fillMark.setStroke(STYLE_BUILDER.createStroke(Color.yellow.brighter(), 1.));
-				Graphic fillGraphic = STYLE_BUILDER.createGraphic(null, fillMark, null);
+				fillMark.setStroke(STYLE_BUILDER.createStroke(
+						Color.yellow.brighter(), 1.));
+				Graphic fillGraphic = STYLE_BUILDER.createGraphic(null,
+						fillMark, null);
 				fillGraphic.setSize(FILTER_FACTORY.literal(size));
 				fill = STYLE_BUILDER.createFill();
 				fill.setGraphicFill(fillGraphic);
 			}
 
-			PolygonSymbolizer polS0 = STYLE_BUILDER.createPolygonSymbolizer(outline, fill);
+			PolygonSymbolizer polS0 = STYLE_BUILDER.createPolygonSymbolizer(
+					outline, fill);
 			// polS0.setGeometry(offsetFunction);
 			symbolizers = LangUtil.extendArray(symbolizers, polS0);
 		}
 		return symbolizers;
 	}
 
-	private static Symbolizer[] addSelectionSymbolizersPoint(Symbolizer[] symbolizers) {
+	private static Symbolizer[] addSelectionSymbolizersPoint(
+			Symbolizer[] symbolizers) {
 		PointSymbolizer ps = STYLE_FACTORY.createPointSymbolizer();
 		ps.setGraphic(SELECTION_GRAPHIC1);
 		symbolizers = LangUtil.extendArray(symbolizers, ps);
@@ -1164,16 +1269,18 @@
 	}
 
 	/**
-	 * Creates a {@link Style} for a {@link Grid} layer from a {@link ColorMap} Title will be set to
-	 * {@link GridUtil#UNTITLED_RASTER_STYLE_TITLE}
+	 * Creates a {@link Style} for a {@link Grid} layer from a {@link ColorMap}
+	 * Title will be set to {@link GridUtil#UNTITLED_RASTER_STYLE_TITLE}
 	 * 
 	 * @param colorMap
 	 *            If null, then defaultStyle for Grid will be used
 	 * @param name
-	 *            The name to give to the Style. null will result in name {@link GridUtil#UNTITLED_RASTER_STYLE_TITLE}
+	 *            The name to give to the Style. null will result in name
+	 *            {@link GridUtil#UNTITLED_RASTER_STYLE_TITLE}
 	 * 
-	 * @return Always a Style that you can apply to a {@link GridCoverage}. Style has name
-	 *         {@link GridUtil#DEFAULT_RASTER_STYLE_NAME} if no colormap was provided.
+	 * @return Always a Style that you can apply to a {@link GridCoverage}.
+	 *         Style has name {@link GridUtil#DEFAULT_RASTER_STYLE_NAME} if no
+	 *         colormap was provided.
 	 * 
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
@@ -1188,19 +1295,23 @@
 	 * @param colorMap
 	 *            If null, then defaultStyle for Grid will be used
 	 * @param name
-	 *            The name to give to the Style. null will result in name= {@link GridUtil#UNNAMED_RASTER_STYLE_NAME} or
+	 *            The name to give to the Style. null will result in name=
+	 *            {@link GridUtil#UNNAMED_RASTER_STYLE_NAME} or
 	 *            GridUtil#DEFAULT_RASTER_STYLE_NAME} (if no colorMap is given).
 	 * 
 	 * @param title
 	 *            The Title to give to the Style. null will result in title=
-	 *            {@link GridUtil#UNTITLED_RASTER_STYLE_TITLE} or {@link GridUtil#DEFAULT_RASTER_STYLE_TITLE} (if no
-	 *            colorMap is given)
+	 *            {@link GridUtil#UNTITLED_RASTER_STYLE_TITLE} or
+	 *            {@link GridUtil#DEFAULT_RASTER_STYLE_TITLE} (if no colorMap is
+	 *            given)
 	 * 
-	 * @return Always a {@link Style} that you can be applyed to a {@link GridCoverage}.
+	 * @return Always a {@link Style} that you can be applyed to a
+	 *         {@link GridCoverage}.
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
-	public static Style createStyleFromColorMap(ColorMap colorMap, String name, String title) {
+	public static Style createStyleFromColorMap(ColorMap colorMap, String name,
+			String title) {
 		if (colorMap == null)
 			return GridUtil.createDefaultStyle();
 
@@ -1228,7 +1339,8 @@
 		RuleImpl ruleImpl = new RuleImpl(symbolizers) {
 		};
 		Rule[] rules = { ruleImpl };
-		FeatureTypeStyleImpl featureTypeStyleImpl = new FeatureTypeStyleImpl(rules) {
+		FeatureTypeStyleImpl featureTypeStyleImpl = new FeatureTypeStyleImpl(
+				rules) {
 		};
 
 		Style style = STYLE_FACTORY.createStyle();
@@ -1239,7 +1351,8 @@
 	}
 
 	/**
-	 * Erzeugt einen {@link Style} aus einem {@linkplain Element JDOM-Element}, des eine SLD-Definition enthaelt
+	 * Erzeugt einen {@link Style} aus einem {@linkplain Element JDOM-Element},
+	 * des eine SLD-Definition enthaelt
 	 * 
 	 * @param element
 	 *            Element mit SLD-Definition
@@ -1262,7 +1375,8 @@
 		}
 	}
 
-	public static Style createStyleSimple(Object geoObject, Color color, Color color2) {
+	public static Style createStyleSimple(Object geoObject, Color color,
+			Color color2) {
 		if (geoObject instanceof GridCoverage2D
 				|| geoObject instanceof org.geotools.coverage.grid.io.AbstractGridCoverage2DReader) {
 			// Wenn irgendwann mal selection für raster möglich ist, dann hier
@@ -1285,12 +1399,14 @@
 
 			break;
 		case POLYGON:
-			PolygonSymbolizer polS = STYLE_BUILDER.createPolygonSymbolizer(STYLE_BUILDER.createStroke(color2),
+			PolygonSymbolizer polS = STYLE_BUILDER.createPolygonSymbolizer(
+					STYLE_BUILDER.createStroke(color2),
 					STYLE_BUILDER.createFill(color));
 			symbolizers = LangUtil.extendArray(symbolizers, polS);
 
 		case LINE:
-			LineSymbolizer ls = STYLE_BUILDER.createLineSymbolizer(STYLE_BUILDER.createStroke(color));
+			LineSymbolizer ls = STYLE_BUILDER
+					.createLineSymbolizer(STYLE_BUILDER.createStroke(color));
 			symbolizers = LangUtil.extendArray(symbolizers, ls);
 			break;
 
@@ -1298,7 +1414,8 @@
 			// In case of ANY, create a Style with polygon and point
 			// symbolizers.
 
-			polS = STYLE_BUILDER.createPolygonSymbolizer(STYLE_BUILDER.createStroke(color2),
+			polS = STYLE_BUILDER.createPolygonSymbolizer(
+					STYLE_BUILDER.createStroke(color2),
 					STYLE_BUILDER.createFill(color));
 			ps = createPointSymbolizer(color, color2);
 
@@ -1311,63 +1428,77 @@
 		}
 
 		style.featureTypeStyles().get(0).rules().clear();
-		style.featureTypeStyles().get(0).rules().add(STYLE_FACTORY.createRule());
+		style.featureTypeStyles().get(0).rules()
+				.add(STYLE_FACTORY.createRule());
 
 		style.featureTypeStyles().get(0).rules().get(0).symbolizers().clear();
-		style.featureTypeStyles().get(0).rules().get(0).symbolizers().addAll(Arrays.asList(symbolizers));
+		style.featureTypeStyles().get(0).rules().get(0).symbolizers()
+				.addAll(Arrays.asList(symbolizers));
 
 		return style;
 	}
 
-	private static PointSymbolizer createPointSymbolizer(Color color, Color color2) {
-		PointSymbolizer ps = STYLE_BUILDER.createPointSymbolizer(STYLE_BUILDER.createGraphic(null,
-				STYLE_BUILDER.createMark("circle"), null));
-		ps.getGraphic().getMarks()[0].setFill(STYLE_BUILDER.createFill(color, 0.5));
+	private static PointSymbolizer createPointSymbolizer(Color color,
+			Color color2) {
+		PointSymbolizer ps = STYLE_BUILDER.createPointSymbolizer(STYLE_BUILDER
+				.createGraphic(null, STYLE_BUILDER.createMark("circle"), null));
+		ps.getGraphic().getMarks()[0].setFill(STYLE_BUILDER.createFill(color,
+				0.5));
 
 		// ps.getGraphic().getMarks()[0].setSize(STYLE_BUILDER
 		// .literalExpression(8.));
 
 		ps.getGraphic().setSize(STYLE_BUILDER.literalExpression(8.));
-		ps.getGraphic().getMarks()[0].setStroke(STYLE_BUILDER.createStroke(color2));
+		ps.getGraphic().getMarks()[0].setStroke(STYLE_BUILDER
+				.createStroke(color2));
 		return ps;
 	}
 
 	/**
-	 * SLD Rules können die Paramter MinScaleDenominator und MaxScaleDenominator enthalten. Dadurch können Elemente für
-	 * manche Zoom-Stufen deaktiviert werden.
+	 * SLD Rules können die Paramter MinScaleDenominator und MaxScaleDenominator
+	 * enthalten. Dadurch können Elemente für manche Zoom-Stufen deaktiviert
+	 * werden.
 	 * 
-	 * Kommentar: "Sichtbarkeit" bezieht es nicht darauf, ob die Elemente auf dem Kartenausschnitt sichtbar sind,
-	 * sondern um die SLD Regeln, welche das SimpleFeature evt. nur Scalenabhängig zeichnen.<br/>
-	 * SK 19.6.2009:Bei einem {@link PolygonSymbolizer} zählt nicht der Rand, sondern nur ob eine Füllung vorhanden ist!
-	 * Man kann dann zwar leider nicht auf ein Rand eines Polygons ohne Fill klicken, aber dafür kann man durch die
-	 * ungefüllte Fläche klicken.
+	 * Kommentar: "Sichtbarkeit" bezieht es nicht darauf, ob die Elemente auf
+	 * dem Kartenausschnitt sichtbar sind, sondern um die SLD Regeln, welche das
+	 * SimpleFeature evt. nur Scalenabhängig zeichnen.<br/>
+	 * SK 19.6.2009:Bei einem {@link PolygonSymbolizer} zählt nicht der Rand,
+	 * sondern nur ob eine Füllung vorhanden ist! Man kann dann zwar leider
+	 * nicht auf ein Rand eines Polygons ohne Fill klicken, aber dafür kann man
+	 * durch die ungefüllte Fläche klicken.
 	 * 
 	 * @param fc
-	 *            Die zu filternde FeatureCollection. Diese wird nicht verändert.
+	 *            Die zu filternde FeatureCollection. Diese wird nicht
+	 *            verändert.
 	 * @param style
-	 *            Der Style, mit dem die Features gerendert werden (z.b. layer.getStyle() )
+	 *            Der Style, mit dem die Features gerendert werden (z.b.
+	 *            layer.getStyle() )
 	 * 
 	 * @param scaleDenominator
-	 *            Der aktuelle ScaleDenomitor für den die Sichtbarkeit ermittelt wird.
+	 *            Der aktuelle ScaleDenomitor für den die Sichtbarkeit ermittelt
+	 *            wird.
 	 * 
 	 * @see RendererUtilities.calculateOGCScale
 	 * 
-	 * @return Eine FeatureCollection in welcher nur die Features enthalten sind, welche bei aktuellen Scale mit dem
-	 *         übergebenen Style gerendert werden.
+	 * @return Eine FeatureCollection in welcher nur die Features enthalten
+	 *         sind, welche bei aktuellen Scale mit dem übergebenen Style
+	 *         gerendert werden.
 	 * 
 	 *         TODO Was ist mit raster?!
 	 * 
-	 *         TODO Das sollte man besser machen: Zuerst die FIlter der sichtbaren regeln raussuchen, und dann direkt am
-	 *         anfang damitmit mitfiltern...
+	 *         TODO Das sollte man besser machen: Zuerst die FIlter der
+	 *         sichtbaren regeln raussuchen, und dann direkt am anfang damitmit
+	 *         mitfiltern...
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
 	public static MemoryFeatureCollection filterSLDVisibleOnly(
-			final FeatureCollection<SimpleFeatureType, SimpleFeature> fc, final Style style,
-			final Double scaleDenominator) {
+			final FeatureCollection<SimpleFeatureType, SimpleFeature> fc,
+			final Style style, final Double scaleDenominator) {
 
 		// Eine im Speicher gehaltene FeatureCollection der sichtbaren
-		final MemoryFeatureCollection fcVisible = new MemoryFeatureCollection(fc.getSchema());
+		final MemoryFeatureCollection fcVisible = new MemoryFeatureCollection(
+				fc.getSchema());
 
 		// Prüfen aller Features in der Collection
 		final Iterator<SimpleFeature> fcIt = fc.iterator();
@@ -1381,18 +1512,22 @@
 
 					// Leave out FTSs that are selection related
 					if (fts.getName() != null
-							&& fts.getName().equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME))
+							&& fts.getName()
+									.equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME))
 						continue;
 
 					final List<Rule> rules = fts.rules();
 
 					for (final Rule rule : rules) {
-						final double maxScaleDenominator = rule.getMaxScaleDenominator();
-						final double minScaleDenominator = rule.getMinScaleDenominator();
+						final double maxScaleDenominator = rule
+								.getMaxScaleDenominator();
+						final double minScaleDenominator = rule
+								.getMinScaleDenominator();
 
 						// 1. Check: Trifft die Rule auf den aktuellen Scale der
 						// JMapPane?
-						if ((minScaleDenominator > scaleDenominator) || (scaleDenominator > maxScaleDenominator)) {
+						if ((minScaleDenominator > scaleDenominator)
+								|| (scaleDenominator > maxScaleDenominator)) {
 							continue;
 						}
 
@@ -1411,21 +1546,25 @@
 						boolean passt = false;
 						for (final Symbolizer symb : rule.getSymbolizers()) {
 
-							final Geometry geom = (Geometry) feature.getDefaultGeometry();
+							final Geometry geom = (Geometry) feature
+									.getDefaultGeometry();
 
-							if ((geom instanceof MultiPoint) || (geom instanceof com.vividsolutions.jts.geom.Point)) {
+							if ((geom instanceof MultiPoint)
+									|| (geom instanceof com.vividsolutions.jts.geom.Point)) {
 								if (symb instanceof PointSymbolizer) {
 									if (((PointSymbolizer) symb).getGraphic() != null)
 										passt = true;
 									break;
 								}
-							} else if ((geom instanceof MultiLineString) || (geom instanceof LineString)) {
+							} else if ((geom instanceof MultiLineString)
+									|| (geom instanceof LineString)) {
 								if (symb instanceof LineSymbolizer) {
 									if (((LineSymbolizer) symb).getStroke() != null)
 										passt = true;
 									break;
 								}
-							} else if ((geom instanceof MultiPolygon) || (geom instanceof Polygon)) {
+							} else if ((geom instanceof MultiPolygon)
+									|| (geom instanceof Polygon)) {
 
 								if (symb instanceof PolygonSymbolizer) {
 									if (((PolygonSymbolizer) symb).getFill() != null)
@@ -1458,16 +1597,22 @@
 		} catch (final java.lang.IllegalStateException e) {
 			LOGGER.error("Iterating over the features", e);
 			/**
-			 * SK: 14.Apri 2009. It happened a few time to that fcIt.hasNext suddenly threw an exception for the
-			 * "africa countries.shp": Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: ShapeType
-			 * changed illegally from Polygon to Undefined at org.geotools.
-			 * data.shapefile.shp.ShapefileReader.nextRecord(ShapefileReader .java:452) at
-			 * org.geotools.data.shapefile.indexed. IndexedShapefileDataStore$Reader
+			 * SK: 14.Apri 2009. It happened a few time to that fcIt.hasNext
+			 * suddenly threw an exception for the "africa countries.shp":
+			 * Exception in thread "AWT-EventQueue-0"
+			 * java.lang.IllegalStateException: ShapeType changed illegally from
+			 * Polygon to Undefined at org.geotools.
+			 * data.shapefile.shp.ShapefileReader.nextRecord(ShapefileReader
+			 * .java:452) at org.geotools.data.shapefile.indexed.
+			 * IndexedShapefileDataStore$Reader
 			 * .next(IndexedShapefileDataStore.java:1272) at
-			 * org.geotools.data.FIDFeatureReader.next(FIDFeatureReader.java:92) at org
-			 * .geotools.data.FilteringFeatureReader.hasNext( FilteringFeatureReader .java:125) at
-			 * org.geotools.data.store.FeatureReaderIterator.hasNext( FeatureReaderIterator.java:44) at
-			 * schmitzm.geotools.feature.FeatureUtil .filterSLDVisibleOnly(FeatureUtil.java:216) *
+			 * org.geotools.data.FIDFeatureReader.next(FIDFeatureReader.java:92)
+			 * at org .geotools.data.FilteringFeatureReader.hasNext(
+			 * FilteringFeatureReader .java:125) at
+			 * org.geotools.data.store.FeatureReaderIterator.hasNext(
+			 * FeatureReaderIterator.java:44) at
+			 * schmitzm.geotools.feature.FeatureUtil
+			 * .filterSLDVisibleOnly(FeatureUtil.java:216) *
 			 * 
 			 */
 		}
@@ -1479,40 +1624,50 @@
 	}
 
 	/**
-	 * SLD Rules können die Paramter MinScaleDenominator und MaxScaleDenominator enthalten. Dadurch können Elemente für
-	 * manche Zoom-Stufen deaktiviert werden.
+	 * SLD Rules können die Paramter MinScaleDenominator und MaxScaleDenominator
+	 * enthalten. Dadurch können Elemente für manche Zoom-Stufen deaktiviert
+	 * werden.
 	 * 
 	 * @param fc
-	 *            Die zu filternde FeatureCollection. Diese wird nicht verändert.
+	 *            Die zu filternde FeatureCollection. Diese wird nicht
+	 *            verändert.
 	 * @param style
-	 *            Der Style, mit dem die Features gerendert werden (z.b. layer.getStyle() )
+	 *            Der Style, mit dem die Features gerendert werden (z.b.
+	 *            layer.getStyle() )
 	 * 
-	 * @return Eine FeatureCollection in welcher nur die Features enthalten sind, welche bei aktuellen Scale mit dem
-	 *         übergebenen Style gerendert werden.
+	 * @return Eine FeatureCollection in welcher nur die Features enthalten
+	 *         sind, welche bei aktuellen Scale mit dem übergebenen Style
+	 *         gerendert werden.
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
 	public static FeatureCollection<SimpleFeatureType, SimpleFeature> filterSLDVisibleOnly(
-			final FeatureCollection<SimpleFeatureType, SimpleFeature> fc, final Style style, XMapPane xMapPane) {
+			final FeatureCollection<SimpleFeatureType, SimpleFeature> fc,
+			final Style style, XMapPane xMapPane) {
 
 		if (xMapPane == null || style == null)
 			return new EmptyFeatureCollection(fc.getSchema());
 
 		// Der "scaleDenominator" der aktuellen JMapPane
-		Double scaleDenominator = RendererUtilities.calculateOGCScale(new ReferencedEnvelope(xMapPane.getMapArea(),
-				xMapPane.getMapContext().getCoordinateReferenceSystem()), xMapPane.getBounds().width, null);
+		Double scaleDenominator = RendererUtilities.calculateOGCScale(
+				new ReferencedEnvelope(xMapPane.getMapArea(), xMapPane
+						.getMapContext().getCoordinateReferenceSystem()),
+				xMapPane.getBounds().width, null);
 
 		return filterSLDVisibleOnly(fc, style, scaleDenominator);
 	}
 
 	/**
-	 * Ermittelt fuer einen Wert den {@link ColorMapEntry} aus einer {@link ColorMap}.
+	 * Ermittelt fuer einen Wert den {@link ColorMapEntry} aus einer
+	 * {@link ColorMap}.
 	 * 
 	 * @param value
 	 *            Wert
-	 * @return {@code null}, wenn in der {@link ColorMap} kein expliziter Eintrag fuer den Wert hinterlegt ist
+	 * @return {@code null}, wenn in der {@link ColorMap} kein expliziter
+	 *         Eintrag fuer den Wert hinterlegt ist
 	 */
-	public static ColorMapEntry findColorMapEntry(ColorMap colorMap, double value) {
+	public static ColorMapEntry findColorMapEntry(ColorMap colorMap,
+			double value) {
 		for (ColorMapEntry entry : colorMap.getColorMapEntries())
 			if (value == getQuantityFromColorMapEntry(entry))
 				return entry;
@@ -1526,7 +1681,8 @@
 	 *            Farbpaletten-Eintrag
 	 */
 	public static Color getColorFromColorMapEntry(ColorMapEntry entry) {
-		if (entry == null || entry.getColor() == null || entry.getColor().evaluate(null) == null)
+		if (entry == null || entry.getColor() == null
+				|| entry.getColor().evaluate(null) == null)
 			return null;
 
 		// // Transparenz
@@ -1561,11 +1717,14 @@
 	}
 
 	/**
-	 * Liefert die Farbpalette zu einem Style, wenn der Style aus einem {@link RasterSymbolizer} erzeugt wurde.
+	 * Liefert die Farbpalette zu einem Style, wenn der Style aus einem
+	 * {@link RasterSymbolizer} erzeugt wurde.
 	 * 
 	 * @param style
-	 *            Style Wenn <code>null</code>, dann wird style auf {@link GridUtil}.createDefaultStyle() gesetzt
-	 * @return <code>null</code> wenn der Style nicht auf einem {@link RasterSymbolizer} basiert.
+	 *            Style Wenn <code>null</code>, dann wird style auf
+	 *            {@link GridUtil}.createDefaultStyle() gesetzt
+	 * @return <code>null</code> wenn der Style nicht auf einem
+	 *         {@link RasterSymbolizer} basiert.
 	 */
 	public static ColorMap getColorMapFromStyle(final Style style) {
 		final List<ColorMap> colorMapsFromStyle = getColorMapsFromStyle(style);
@@ -1577,10 +1736,12 @@
 	}
 
 	/**
-	 * Liefert alle Farbpaletten aus einem Style, wenn irgendo {@link RasterSymbolizer} enthalten sind.
+	 * Liefert alle Farbpaletten aus einem Style, wenn irgendo
+	 * {@link RasterSymbolizer} enthalten sind.
 	 * 
 	 * @param style
-	 *            Style Wenn <code>null</code>, dann wird style auf {@link GridUtil}.createDefaultStyle() gesetzt
+	 *            Style Wenn <code>null</code>, dann wird style auf
+	 *            {@link GridUtil}.createDefaultStyle() gesetzt
 	 * @return Leere Liste wenn keine RasterSymbolizer enthalten ist.
 	 */
 	public static List<ColorMap> getColorMapsFromStyle(Style style) {
@@ -1610,7 +1771,8 @@
 	 */
 	public static int getColorMapType(String typeStr) {
 		if (typeStr == null)
-			throw new IllegalArgumentException("Unknown color map type: " + typeStr);
+			throw new IllegalArgumentException("Unknown color map type: "
+					+ typeStr);
 
 		typeStr = typeStr.trim().toLowerCase();
 		if (typeStr.equals("ramp") || typeStr.equals("type_ramp"))
@@ -1654,11 +1816,14 @@
 
         </code>
 	 * 
-	 * Returns the first attribute found in the label expression of the given {@link TextSymbolizer}. If non is found
-	 * for some reason, the method tries to return the first attribute from the schema. We expect the layer to have some
-	 * attributes, because otherwise AS shouldn't even create the LabellingTab.
+	 * Returns the first attribute found in the label expression of the given
+	 * {@link TextSymbolizer}. If non is found for some reason, the method tries
+	 * to return the first attribute from the schema. We expect the layer to
+	 * have some attributes, because otherwise AS shouldn't even create the
+	 * LabellingTab.
 	 */
-	public static PropertyName getFirstPropertyName(final SimpleFeatureType ft, final TextSymbolizer textSymbolizer) {
+	public static PropertyName getFirstPropertyName(final SimpleFeatureType ft,
+			final TextSymbolizer textSymbolizer) {
 		final Expression labelExpression = textSymbolizer.getLabel();
 		try {
 			if (labelExpression instanceof PropertyName) {
@@ -1666,7 +1831,8 @@
 				return (PropertyName) labelExpression;
 			} else if (labelExpression instanceof Function) {
 				final Function filterExpression = (Function) labelExpression;
-				final FilterAttributeExtractor attExVid = new FilterAttributeExtractor(ft);
+				final FilterAttributeExtractor attExVid = new FilterAttributeExtractor(
+						ft);
 
 				attExVid.visit(filterExpression, null);
 
@@ -1681,8 +1847,8 @@
 					prop1 = attributeNames[0];
 				} else {
 
-					if (filterExpression.toString().indexOf(attributeNames[0]) < filterExpression.toString().indexOf(
-							attributeNames[1])) {
+					if (filterExpression.toString().indexOf(attributeNames[0]) < filterExpression
+							.toString().indexOf(attributeNames[1])) {
 						prop1 = attributeNames[0];
 						// prop2 = attributeNames[1];
 					} else {
@@ -1699,11 +1865,13 @@
 		}
 
 		// TODO this is not rockhard.. could NPE
-		return FilterUtil.FILTER_FAC2.property(ft.getAttributeDescriptors().get(1).getLocalName());
+		return FilterUtil.FILTER_FAC2.property(ft.getAttributeDescriptors()
+				.get(1).getLocalName());
 	}
 
 	/**
-	 * @return the {@link Color} used in the {@link Graphic} or null, if an {@link ExternalGraphic} is used.
+	 * @return the {@link Color} used in the {@link Graphic} or null, if an
+	 *         {@link ExternalGraphic} is used.
 	 * 
 	 * @param graphic
 	 *            If <code>null</code> returns <code>null</code>
@@ -1751,7 +1919,8 @@
 	}
 
 	/**
-	 * Super smart metod ;-) Needs to be extended to look at the graphic width and Geometry type.
+	 * Super smart metod ;-) Needs to be extended to look at the graphic width
+	 * and Geometry type.
 	 * 
 	 * @param geometryDescriptor
 	 * @param avgNn
@@ -1762,7 +1931,8 @@
 	}
 
 	/**
-	 * Super smart metod ;-) Needs to be extended to look at the graphic width and Geometry type.
+	 * Super smart metod ;-) Needs to be extended to look at the graphic width
+	 * and Geometry type.
 	 * 
 	 * @param geometryDescriptor
 	 * @param avgNn
@@ -1823,7 +1993,9 @@
 			return 1.0;
 		Object exprValue = expression.evaluate(null);
 
-		return (exprValue instanceof String) ? Double.valueOf((String) exprValue) : ((Number) exprValue).doubleValue();
+		return (exprValue instanceof String) ? Double
+				.valueOf((String) exprValue) : ((Number) exprValue)
+				.doubleValue();
 	}
 
 	/**
@@ -1888,12 +2060,15 @@
 			return null;
 		Object exprValue = expression.evaluate(null);
 
-		return (exprValue instanceof String) ? Double.valueOf((String) exprValue) : ((Number) exprValue).doubleValue();
+		return (exprValue instanceof String) ? Double
+				.valueOf((String) exprValue) : ((Number) exprValue)
+				.doubleValue();
 	}
 
 	/**
-	 * Returns all {@link RasterSymbolizer} that are contained in a {@link Style}. {@link RasterSymbolizer} from
-	 * {@link FeatureTypeStyle}s that are selection related are ignored.
+	 * Returns all {@link RasterSymbolizer} that are contained in a
+	 * {@link Style}. {@link RasterSymbolizer} from {@link FeatureTypeStyle}s
+	 * that are selection related are ignored.
 	 */
 	public static List<RasterSymbolizer> getRasterSymbolizers(Style style) {
 		final List<RasterSymbolizer> rsList = new ArrayList<RasterSymbolizer>();
@@ -1904,10 +2079,12 @@
 		return rsList;
 	}
 
-	public static void getRasterSymbolizers(final List<RasterSymbolizer> rsList, FeatureTypeStyle fts) {
+	public static void getRasterSymbolizers(
+			final List<RasterSymbolizer> rsList, FeatureTypeStyle fts) {
 		// Leave out FTSs that are selection related
 		if (fts.getName() != null
-				&& fts.getName().equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME))
+				&& fts.getName()
+						.equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME))
 			return;
 
 		for (Rule r : fts.rules()) {
@@ -1923,10 +2100,11 @@
 	 * Geopublisher allows to use one or two attributes for labeling, like
 	 * 
 	 * 
-	 * Returns the second attribute found in the label expression of the given {@link TextSymbolizer} or
-	 * <code>null</code>.
+	 * Returns the second attribute found in the label expression of the given
+	 * {@link TextSymbolizer} or <code>null</code>.
 	 */
-	public static PropertyName getSecondPropertyName(final SimpleFeatureType ft, final TextSymbolizer textSymbolizer) {
+	public static PropertyName getSecondPropertyName(
+			final SimpleFeatureType ft, final TextSymbolizer textSymbolizer) {
 		try {
 
 			final Expression labelExpression = textSymbolizer.getLabel();
@@ -1935,7 +2113,8 @@
 				return null;
 			} else if (labelExpression instanceof Function) {
 				final Function filterExpression = (Function) labelExpression;
-				final FilterAttributeExtractor attExVid = new FilterAttributeExtractor(ft);
+				final FilterAttributeExtractor attExVid = new FilterAttributeExtractor(
+						ft);
 
 				attExVid.visit(filterExpression, null);
 
@@ -1944,8 +2123,8 @@
 					return null;
 
 				String prop2 = null;
-				if (filterExpression.toString().indexOf(attributeNames[0]) < filterExpression.toString().indexOf(
-						attributeNames[1])) {
+				if (filterExpression.toString().indexOf(attributeNames[0]) < filterExpression
+						.toString().indexOf(attributeNames[1])) {
 					prop2 = attributeNames[1];
 				} else {
 					prop2 = attributeNames[0];
@@ -1963,12 +2142,13 @@
 	}
 
 	/**
-	 * Returns <code>null</code> or any {@link FeatureTypeStyle} contained in the given {@link Style} that is SELECTION
-	 * related.
+	 * Returns <code>null</code> or any {@link FeatureTypeStyle} contained in
+	 * the given {@link Style} that is SELECTION related.
 	 * 
 	 * @see {@link FeatureMapLayerSelectionSynchronizer#SELECTION_STYLING_FTS_NAME}
 	 */
-	public static FeatureTypeStyle getSelectionFeatureTypeStyle(final Style style) {
+	public static FeatureTypeStyle getSelectionFeatureTypeStyle(
+			final Style style) {
 
 		if (style == null)
 			return null;
@@ -1979,7 +2159,8 @@
 			FeatureTypeStyle fts = style.featureTypeStyles().get(ii);
 
 			if (fts.getName() != null
-					&& fts.getName().equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME)) {
+					&& fts.getName()
+							.equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME)) {
 				return style.featureTypeStyles().get(ii);
 			}
 		}
@@ -2081,15 +2262,16 @@
 
 	/**
 	 * @param style
-	 *            A {@link Style} to search for the first {@link TextSymbolizer} that will be used for the given
-	 *            {@link SimpleFeature}.
+	 *            A {@link Style} to search for the first {@link TextSymbolizer}
+	 *            that will be used for the given {@link SimpleFeature}.
 	 * 
 	 * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
 	 * 
-	 * @return <code>null</code> or the first {@link TextSymbolizer} found in the style that applies to the
-	 *         {@link SimpleFeature}.
+	 * @return <code>null</code> or the first {@link TextSymbolizer} found in
+	 *         the style that applies to the {@link SimpleFeature}.
 	 */
-	public static TextSymbolizer getTextSymbolizer(final Style style, final SimpleFeature f) {
+	public static TextSymbolizer getTextSymbolizer(final Style style,
+			final SimpleFeature f) {
 		if (f == null)
 			return null;
 		try {
@@ -2124,12 +2306,14 @@
 
 	/**
 	 * @param style
-	 *            A {@link Style} to search for all {@link TextSymbolizer}s . No guarantee, that any one of them will
-	 *            ever be used for any feature (think about filters).
+	 *            A {@link Style} to search for all {@link TextSymbolizer}s . No
+	 *            guarantee, that any one of them will ever be used for any
+	 *            feature (think about filters).
 	 * 
 	 * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
 	 * 
-	 * @return {@link List} or all {@link TextSymbolizer}s found in the {@link Style}.
+	 * @return {@link List} or all {@link TextSymbolizer}s found in the
+	 *         {@link Style}.
 	 */
 	public static List<TextSymbolizer> getTextSymbolizers(final Style style) {
 		List<TextSymbolizer> results = new ArrayList<TextSymbolizer>();
@@ -2153,14 +2337,17 @@
 
 	/**
 	 * @param symbolizers
-	 *            List of Symbolizers to search for all {@link TextSymbolizer}s . No guarantee, that any one of them
-	 *            will ever be used for any feature (think about filters).
+	 *            List of Symbolizers to search for all {@link TextSymbolizer}s
+	 *            . No guarantee, that any one of them will ever be used for any
+	 *            feature (think about filters).
 	 * 
 	 * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
 	 * 
-	 * @return {@link List} or all {@link TextSymbolizer}s found in the given symbolizers.
+	 * @return {@link List} or all {@link TextSymbolizer}s found in the given
+	 *         symbolizers.
 	 */
-	public static List<TextSymbolizer> getTextSymbolizers(Symbolizer[] symbolizers) {
+	public static List<TextSymbolizer> getTextSymbolizers(
+			Symbolizer[] symbolizers) {
 		List<TextSymbolizer> results = new ArrayList<TextSymbolizer>();
 		try {
 			if (symbolizers != null) {
@@ -2182,14 +2369,17 @@
 
 	/**
 	 * @param style
-	 *            A {@link Style} to search for all {@link TextSymbolizer}s . No guarantee, that any one of them will
-	 *            ever be used for any feature (think about filters).
+	 *            A {@link Style} to search for all {@link TextSymbolizer}s . No
+	 *            guarantee, that any one of them will ever be used for any
+	 *            feature (think about filters).
 	 * 
 	 * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
 	 * 
-	 * @return {@link List} or all {@link TextSymbolizer}s found in the {@link Style}.
+	 * @return {@link List} or all {@link TextSymbolizer}s found in the
+	 *         {@link Style}.
 	 */
-	public static List<TextSymbolizer> getVisibleTextSymbolizers(final Style style) {
+	public static List<TextSymbolizer> getVisibleTextSymbolizers(
+			final Style style) {
 		List<TextSymbolizer> results = new ArrayList<TextSymbolizer>();
 		try {
 			if (style != null) {
@@ -2202,8 +2392,9 @@
 							/*
 							 * We are comparing it to AsUtil.alwaysfalsefilter
 							 * 
-							 * public static final PropertyIsEqualTo allwaysFalseFilter = ff2.equals(ff2 .literal("1"),
-							 * ff2.literal("2"));
+							 * public static final PropertyIsEqualTo
+							 * allwaysFalseFilter = ff2.equals(ff2
+							 * .literal("1"), ff2.literal("2"));
 							 */
 							try {
 
@@ -2211,14 +2402,20 @@
 								if (f instanceof And) {
 									And and = (And) f;
 									if (and.getChildren() != null) {
-										Filter candidateF = and.getChildren().get(0);
+										Filter candidateF = and.getChildren()
+												.get(0);
 										if (candidateF instanceof PropertyIsEqualTo) {
 											final PropertyIsEqualTo compare = (PropertyIsEqualTo) candidateF;
 											if (compare.getExpression1() instanceof Literal
 													&& compare.getExpression2() instanceof Literal) {
-												Literal test1 = (Literal) compare.getExpression1();
-												Literal test2 = (Literal) compare.getExpression2();
-												if (test1.toString().equals("1") && test2.toString().equals("2")) {
+												Literal test1 = (Literal) compare
+														.getExpression1();
+												Literal test2 = (Literal) compare
+														.getExpression2();
+												if (test1.toString()
+														.equals("1")
+														&& test2.toString()
+																.equals("2")) {
 													// This TextSymbolizer is
 													// disabled using
 													// ASUtil.allwaysFalseFilter
@@ -2232,7 +2429,9 @@
 									}
 								}
 							} catch (Exception e) {
-								LOGGER.debug("Checking for textSymbolizer allwaysFalseFilter", e);
+								LOGGER.debug(
+										"Checking for textSymbolizer allwaysFalseFilter",
+										e);
 							}
 						}
 
@@ -2256,7 +2455,8 @@
 	 *            The first {@link Style}
 	 * @param style2file
 	 *            A {@link File} pointing to the second {@link Style}
-	 * @return <code>true</code> is they are different, ignoring any XML fomatting.
+	 * @return <code>true</code> is they are different, ignoring any XML
+	 *         fomatting.
 	 */
 	public static boolean isStyleDifferent(Style style1, File style2file) {
 		try {
@@ -2288,7 +2488,8 @@
 	 *            The first {@link Style}
 	 * @param style2
 	 *            The second {@link Style} to compare to
-	 * @return <code>true</code> is they are different, ignoring any XML fomatting.
+	 * @return <code>true</code> is they are different, ignoring any XML
+	 *         fomatting.
 	 */
 	public static boolean isStyleDifferent(Style style1, Style style2) {
 		try {
@@ -2299,8 +2500,8 @@
 			return !style1string.equals(style2string);
 
 		} catch (Exception e) {
-			LOGGER.debug("Compating styles " + style1 + " and " + style2 + " failed. So we assume they are different.",
-					e);
+			LOGGER.debug("Compating styles " + style1 + " and " + style2
+					+ " failed. So we assume they are different.", e);
 			return true;
 		}
 
@@ -2334,7 +2535,8 @@
 	 * @param inputStream
 	 *            {@link InputStream} to read the SLD from
 	 * 
-	 * @return An {@link Array} of {@link Style}s, can be length==0. null if file not exists
+	 * @return An {@link Array} of {@link Style}s, can be length==0. null if
+	 *         file not exists
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
@@ -2342,11 +2544,14 @@
 
 		Style[] styles = null;
 		try {
-			SLDParser stylereader = new SLDParser(StylingUtil.STYLE_FACTORY, inputStream);
+			SLDParser stylereader = new SLDParser(StylingUtil.STYLE_FACTORY,
+					inputStream);
 			styles = stylereader.readXML();
 			return styles;
 		} catch (Exception e) {
-			LOGGER.warn(" ... no styles recognized. Return 'new Style[] { null }' ", e);
+			LOGGER.warn(
+					" ... no styles recognized. Return 'new Style[] { null }' ",
+					e);
 			return new Style[] { null };
 		}
 
@@ -2358,8 +2563,8 @@
 	 * @param url
 	 *            {@link URL} to read the SLD from
 	 * 
-	 * @return An {@link Array} of {@link Style}s, can be length==0 if no UserStyles in SLD file. null if file not
-	 *         exists
+	 * @return An {@link Array} of {@link Style}s, can be length==0 if no
+	 *         UserStyles in SLD file. null if file not exists
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
@@ -2375,14 +2580,18 @@
 		}
 	}
 
-	public static StyledLayerDescriptor loadStyledLayerDescriptor(InputStream inputStream) {
+	public static StyledLayerDescriptor loadStyledLayerDescriptor(
+			InputStream inputStream) {
 		StyledLayerDescriptor sld = null;
 		try {
-			SLDParser stylereader = new SLDParser(StylingUtil.STYLE_FACTORY, inputStream);
+			SLDParser stylereader = new SLDParser(StylingUtil.STYLE_FACTORY,
+					inputStream);
 			sld = stylereader.parseSLD();
 			return sld;
 		} catch (Exception e) {
-			LOGGER.warn(" ... no StyledLayerDescriptor recognized. Returning null ", e);
+			LOGGER.warn(
+					" ... no StyledLayerDescriptor recognized. Returning null ",
+					e);
 			return sld;
 		}
 	}
@@ -2390,22 +2599,27 @@
 	public static StyledLayerDescriptor loadStyledLayerDescriptor(Reader reader) {
 		StyledLayerDescriptor sld = null;
 		try {
-			SLDParser stylereader = new SLDParser(StylingUtil.STYLE_FACTORY, reader);
+			SLDParser stylereader = new SLDParser(StylingUtil.STYLE_FACTORY,
+					reader);
 			sld = stylereader.parseSLD();
 			return sld;
 		} catch (Exception e) {
-			LOGGER.warn(" ... no StyledLayerDescriptor recognized. Returning null ", e);
+			LOGGER.warn(
+					" ... no StyledLayerDescriptor recognized. Returning null ",
+					e);
 			return sld;
 		}
 	}
 
-	static public ColorMap parseColormapToSld(File colormapFile) throws IOException {
+	static public ColorMap parseColormapToSld(File colormapFile)
+			throws IOException {
 		return parseColormapToSld(DataUtilities.fileToURL(colormapFile));
 	}
 
 	/**
-	 * Creates a Geotools Colormap containing all the Color Palette definitions defined in the File. The File may have
-	 * different formats. Supported formats are<br/>
+	 * Creates a Geotools Colormap containing all the Color Palette definitions
+	 * defined in the File. The File may have different formats. Supported
+	 * formats are<br/>
 	 * <ul>
 	 * <li>gdalinfo output</li>
 	 * </ul>
@@ -2415,7 +2629,9 @@
 	 * 
 	 * TODO Stefan Tzeggai Support gdal xml.aux format!
 	 * 
-	 * @see http ://osgeo-org.1803224.n2.nabble.com/gdal-dev-Color-palette-file-for -use-in-rgb2pct-td4493744.html
+	 * @see http 
+	 *      ://osgeo-org.1803224.n2.nabble.com/gdal-dev-Color-palette-file-for
+	 *      -use-in-rgb2pct-td4493744.html
 	 */
 	static public ColorMap parseColormapToSld(URL url) throws IOException {
 
@@ -2434,56 +2650,66 @@
 
 				Matcher matcher = GDALINFO_COLORMAP_RGBA.matcher(line);
 				if (matcher.find()) {
-					Color color = new Color(Integer.valueOf(matcher.group(2)), Integer.valueOf(matcher.group(3)),
-							Integer.valueOf(matcher.group(4)), Integer.valueOf(matcher.group(5)));
+					Color color = new Color(Integer.valueOf(matcher.group(2)),
+							Integer.valueOf(matcher.group(3)),
+							Integer.valueOf(matcher.group(4)),
+							Integer.valueOf(matcher.group(5)));
 
 					// Arrays verlängern
 					labels = LangUtil.extendArray(labels, "");
 					colors = LangUtil.extendArray(colors, color);
-					quantities = LangUtil.extendArray(quantities, Double.valueOf(matcher.group(1)));
+					quantities = LangUtil.extendArray(quantities,
+							Double.valueOf(matcher.group(1)));
 
 					// Zur nächsten Zeile springen
 					continue;
 				}
 			} catch (Exception e) {
-				LOGGER.warn("Error parsing a line to ColorMapEntry. Line = '" + line + "'. Skipped.", e);
+				LOGGER.warn("Error parsing a line to ColorMapEntry. Line = '"
+						+ line + "'. Skipped.", e);
 			}
 
 			try {
 				Matcher matcher = GDALINFO_COLORMAP_RGB.matcher(line);
 				if (matcher.find()) {
-					Color color = new Color(Integer.valueOf(matcher.group(2)), Integer.valueOf(matcher.group(3)),
+					Color color = new Color(Integer.valueOf(matcher.group(2)),
+							Integer.valueOf(matcher.group(3)),
 							Integer.valueOf(matcher.group(4)));
 
 					// Arrays verlängern
 					labels = LangUtil.extendArray(labels, "");
 					colors = LangUtil.extendArray(colors, color);
-					quantities = LangUtil.extendArray(quantities, Double.valueOf(matcher.group(1)));
+					quantities = LangUtil.extendArray(quantities,
+							Double.valueOf(matcher.group(1)));
 
 					// Zur nächsten Zeile springen
 					continue;
 
 				}
 			} catch (Exception e) {
-				LOGGER.warn("Error parsing a line to ColorMapEntry. Line = '" + line + "'. Skipped.", e);
+				LOGGER.warn("Error parsing a line to ColorMapEntry. Line = '"
+						+ line + "'. Skipped.", e);
 			}
 		}
 
 		int type = ColorMap.TYPE_VALUES;
-		ColorMap createColorMap = STYLE_BUILDER.createColorMap(labels, quantities, colors, type);
+		ColorMap createColorMap = STYLE_BUILDER.createColorMap(labels,
+				quantities, colors, type);
 		return createColorMap;
 	}
 
 	/**
-	 * Unless {@link ColorMap} has no methods to remove an entry this method creates a new {@link ColorMap} with the
-	 * identical entries except the one to remove.
+	 * Unless {@link ColorMap} has no methods to remove an entry this method
+	 * creates a new {@link ColorMap} with the identical entries except the one
+	 * to remove.
 	 * 
 	 * @param colorMap
 	 *            the color map to remove entries from
 	 * @param colorMapEntry
 	 *            the entry to remove
 	 */
-	public static ColorMap removeColorMapEntry(ColorMap colorMap, ColorMapEntry colorMapEntry) {
+	public static ColorMap removeColorMapEntry(ColorMap colorMap,
+			ColorMapEntry colorMapEntry) {
 		ColorMap newColorMap = new ColorMapImpl();
 		applyColorMapProperties(colorMap, newColorMap);
 
@@ -2496,8 +2722,9 @@
 	}
 
 	/**
-	 * Unless {@link ColorMap} has no methods to remove an entry this method creates a new {@link ColorMap} with the
-	 * identical entries except the one to remove.
+	 * Unless {@link ColorMap} has no methods to remove an entry this method
+	 * creates a new {@link ColorMap} with the identical entries except the one
+	 * to remove.
 	 * 
 	 * @param colorMap
 	 *            the color map to remove entries from
@@ -2517,8 +2744,8 @@
 	}
 
 	/**
-	 * Creates a copy of the given {@link Style}, removing any {@link FeatureTypeStyle}s that are only SELECTION
-	 * related.
+	 * Creates a copy of the given {@link Style}, removing any
+	 * {@link FeatureTypeStyle}s that are only SELECTION related.
 	 * 
 	 * @see {@link FeatureMapLayerSelectionSynchronizer#SELECTION_STYLING_FTS_NAME}
 	 */
@@ -2535,7 +2762,8 @@
 			FeatureTypeStyle fts = style.featureTypeStyles().get(ii);
 
 			if (fts.getName() != null
-					&& fts.getName().equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME)) {
+					&& fts.getName()
+							.equals(FeatureMapLayerSelectionSynchronizer.SELECTION_STYLING_FTS_NAME)) {
 				cleanStyle.featureTypeStyles().remove(ii);
 				break;
 			}
@@ -2551,11 +2779,13 @@
 	 * @param oldColor
 	 * @param newColor
 	 */
-	public static void replaceFillColor(Fill fill, Color oldColor, Color newColor) {
+	public static void replaceFillColor(Fill fill, Color oldColor,
+			Color newColor) {
 		if (fill == null)
 			return;
 
-		if ((fill.getColor() != null) && (getColorFromExpression(fill.getColor()).equals(oldColor)))
+		if ((fill.getColor() != null)
+				&& (getColorFromExpression(fill.getColor()).equals(oldColor)))
 			fill.setColor(STYLE_BUILDER.colorExpression(newColor));
 
 		replaceGraphicColor(fill.getGraphicFill(), oldColor, newColor);
@@ -2571,7 +2801,8 @@
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
-	public static void replaceGraphicColor(Graphic graphic, Color oldColor, Color newColor) {
+	public static void replaceGraphicColor(Graphic graphic, Color oldColor,
+			Color newColor) {
 		if (graphic == null)
 			return;
 
@@ -2593,7 +2824,8 @@
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
-	public static void replaceLineSymbolizerColor(LineSymbolizer ps, Color oldColor, Color newColor) {
+	public static void replaceLineSymbolizerColor(LineSymbolizer ps,
+			Color oldColor, Color newColor) {
 		if (ps == null)
 			return;
 
@@ -2605,7 +2837,8 @@
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
-	public static void replacePointSymbolizerColor(PointSymbolizer ps, Color oldColor, Color newColor) {
+	public static void replacePointSymbolizerColor(PointSymbolizer ps,
+			Color oldColor, Color newColor) {
 		if (ps == null)
 			return;
 
@@ -2620,7 +2853,8 @@
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 * @param ps
 	 */
-	public static void replacePolygonSymbolizerColor(PolygonSymbolizer ps, Color oldColor, Color newColor) {
+	public static void replacePolygonSymbolizerColor(PolygonSymbolizer ps,
+			Color oldColor, Color newColor) {
 		replaceFillColor(ps.getFill(), oldColor, newColor);
 		replaceStrokeColor(ps.getStroke(), oldColor, newColor);
 	}
@@ -2632,11 +2866,14 @@
 	 * @param oldColor
 	 * @param newColor
 	 */
-	public static void replaceStrokeColor(Stroke stroke, Color oldColor, Color newColor) {
+	public static void replaceStrokeColor(Stroke stroke, Color oldColor,
+			Color newColor) {
 		if (stroke == null)
 			return;
 
-		if ((stroke.getColor() != null) && (StylingUtil.getColorFromExpression(stroke.getColor()).equals(oldColor)))
+		if ((stroke.getColor() != null)
+				&& (StylingUtil.getColorFromExpression(stroke.getColor())
+						.equals(oldColor)))
 			stroke.setColor(StylingUtil.STYLE_BUILDER.colorExpression(newColor));
 
 		replaceGraphicColor(stroke.getGraphicFill(), oldColor, newColor);
@@ -2650,7 +2887,8 @@
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
-	public static void replaceSymbolizerColor(Symbolizer symb, Color oldColor, Color newColor) {
+	public static void replaceSymbolizerColor(Symbolizer symb, Color oldColor,
+			Color newColor) {
 		if (symb == null)
 			return;
 
@@ -2674,47 +2912,59 @@
 	final static Parser parser = new Parser(SLD_CONFIGURATION);
 
 	/**
-	 * Saves the {@link Style} to OGC SLD. Overwrites any existing file. If a FeatureTypeStyle for selection is used, it
-	 * is automatically removed. This method also checks, whether the style is actually differing from any existing
-	 * style in the {@link File}. If there is no difference, the file is not saved again (that is more svn friendly).<br/>
+	 * Saves the {@link Style} to OGC SLD. Overwrites any existing file. If a
+	 * FeatureTypeStyle for selection is used, it is automatically removed. This
+	 * method also checks, whether the style is actually differing from any
+	 * existing style in the {@link File}. If there is no difference, the file
+	 * is not saved again (that is more svn friendly).<br/>
 	 * All text ist converted to UTF-8.
 	 * 
 	 * @param origStyle
-	 *            {@link Style} to save. Any selectino related FeatureTypeStyle will be removed.
+	 *            {@link Style} to save. Any selectino related FeatureTypeStyle
+	 *            will be removed.
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 * 
-	 * @return <code>true</code> if the file was really written. <code>false</code> means, that the existing file
-	 *         already contained the same content and was not touched.
+	 * @return <code>true</code> if the file was really written.
+	 *         <code>false</code> means, that the existing file already
+	 *         contained the same content and was not touched.
 	 * @throws IOException
 	 */
-	public static final boolean saveStyleToSld(Style origStyle, File exportFile) throws IOException {
+	public static final boolean saveStyleToSld(Style origStyle, File exportFile)
+			throws IOException {
 		return saveStyleToSld(origStyle, exportFile, false, null);
 	}
 
 	/**
-	 * Saves the {@link Style} to OGC SLD. Overwrites any existing file. If a FeatureTypeStyle for selection is used, it
-	 * is automatically removed. This method also checks, whether the style is actually differing from any existing
-	 * style in the {@link File}. If there is no difference, the file is not saved again (that is more svn friendly).<br/>
+	 * Saves the {@link Style} to OGC SLD. Overwrites any existing file. If a
+	 * FeatureTypeStyle for selection is used, it is automatically removed. This
+	 * method also checks, whether the style is actually differing from any
+	 * existing style in the {@link File}. If there is no difference, the file
+	 * is not saved again (that is more svn friendly).<br/>
 	 * All text ist converted to UTF-8.
 	 * 
 	 * @param origStyle
-	 *            {@link Style} to save. Any selectino related FeatureTypeStyle will be removed.
+	 *            {@link Style} to save. Any selectino related FeatureTypeStyle
+	 *            will be removed.
 	 * 
 	 * @param optimized
-	 *            If <code>true</code> any redundant information (typically used by AtlasStyler for GUI state and
-	 *            internal information) is thrown away.
+	 *            If <code>true</code> any redundant information (typically used
+	 *            by AtlasStyler for GUI state and internal information) is
+	 *            thrown away.
 	 * 
 	 * @param title
-	 *            when using optimized, a new title may be defined the the {@link Style} or <code>null</code>.
+	 *            when using optimized, a new title may be defined the the
+	 *            {@link Style} or <code>null</code>.
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 * 
-	 * @return <code>true</code> if the file was really written. <code>false</code> means, that the existing file
-	 *         already contained the same content and was not touched.
+	 * @return <code>true</code> if the file was really written.
+	 *         <code>false</code> means, that the existing file already
+	 *         contained the same content and was not touched.
 	 * @throws IOException
 	 */
-	public static final boolean saveStyleToSld(Style origStyle, File exportFile, boolean optimized, String title)
+	public static final boolean saveStyleToSld(Style origStyle,
+			File exportFile, boolean optimized, String title)
 			throws IOException {
 		try {
 
@@ -2743,7 +2993,8 @@
 				String string = nativeWritten.getBuffer().toString();
 
 				if (optimized) {
-					string = string.replaceFirst("\\<sld", OPTIMIZED_COMMENT + "\n<sld");
+					string = string.replaceFirst("\\<sld", OPTIMIZED_COMMENT
+							+ "\n<sld");
 				}
 				IOUtils.write(string, output, "UTF-8");
 			} finally {
@@ -2752,15 +3003,18 @@
 			}
 
 			LOGGER.debug("Validating stored file " + exportFile + "... ");
-			List<Exception> validateSld = validateSld(new FileInputStream(exportFile));
+			List<Exception> validateSld = validateSld(new FileInputStream(
+					exportFile));
 			if (validateSld.size() > 0) {
-				LOGGER.error(exportFile + " is not valid SLD: " + validateSld.size() + " exceptions");
+				LOGGER.error(exportFile + " is not valid SLD: "
+						+ validateSld.size() + " exceptions");
 			}
 			for (Exception e : validateSld) {
 				LOGGER.warn(exportFile + " " + e.getLocalizedMessage(), e);
 			}
 		} catch (TransformerException te) {
-			LOGGER.warn("TransformerException while saving Style to SLD file " + exportFile, te);
+			LOGGER.warn("TransformerException while saving Style to SLD file "
+					+ exportFile, te);
 			return false;
 		}
 		return true;
@@ -2785,8 +3039,8 @@
 		}
 
 		for (Name ftsName : ftsRules.keySet()) {
-			oStyle.featureTypeStyles()
-					.add(STYLE_BUILDER.createFeatureTypeStyle(ftsName.toString(),
+			oStyle.featureTypeStyles().add(
+					STYLE_BUILDER.createFeatureTypeStyle(ftsName.toString(),
 							ftsRules.get(ftsName).toArray(new Rule[0])));
 		}
 
@@ -2811,7 +3065,8 @@
 	}
 
 	/**
-	 * @return a Simplified filter, free of any filters used as markers by AtlasStyler.
+	 * @return a Simplified filter, free of any filters used as markers by
+	 *         AtlasStyler.
 	 */
 	public static Filter simpliyfyFilter(Filter f) {
 
@@ -2892,7 +3147,9 @@
 				try {
 					is.close();
 				} catch (IOException e1) {
-					LOGGER.error("Closing the InputStream after the Seriouse Exception failed", e1);
+					LOGGER.error(
+							"Closing the InputStream after the Seriouse Exception failed",
+							e1);
 				}
 			return el;
 		}
@@ -2901,32 +3158,38 @@
 	}
 
 	/**
-	 * True if the given XMl coming from the {@link InputStream} is validates against SLD 1.0
+	 * True if the given XMl coming from the {@link InputStream} is validates
+	 * against SLD 1.0
 	 */
 	public static boolean validates(InputStream is) {
 		return validateSld(is).size() == 0;
 	}
 
 	/**
-	 * Exports the {@link Style} to OGC SLD. If a FeatureTypeStyle for selection is used, it is automatically removed.
+	 * Exports the {@link Style} to OGC SLD. If a FeatureTypeStyle for selection
+	 * is used, it is automatically removed.
 	 * 
 	 * @param exportStyle
-	 *            {@link Style} to save. Any selectino related FeatureTypeStyle will be removed.
+	 *            {@link Style} to save. Any selectino related FeatureTypeStyle
+	 *            will be removed.
 	 * 
 	 * @param optimized
-	 *            If <code>true</code> any redundant information (typically used by AtlasStyler for GUI state and
-	 *            internal information) is thrown away.
+	 *            If <code>true</code> any redundant information (typically used
+	 *            by AtlasStyler for GUI state and internal information) is
+	 *            thrown away.
 	 * 
 	 * @param title
-	 *            when using optimized, a new title may be defined the the {@link Style} or <code>null</code>.
+	 *            when using optimized, a new title may be defined the the
+	 *            {@link Style} or <code>null</code>.
 	 * 
 	 * 
 	 * 
 	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 * @throws TransformerException
 	 */
-	public static final void saveStyleToSLD(Style exportStyle, OutputStream exportStream, boolean optimized,
-			String title) throws TransformerException {
+	public static final void saveStyleToSLD(Style exportStyle,
+			OutputStream exportStream, boolean optimized, String title)
+			throws TransformerException {
 
 		exportStyle = removeSelectionFeatureTypeStyle(exportStyle);
 
@@ -2951,8 +3214,9 @@
 	}
 
 	/**
-	 * AtlasStyler has a fixed system that allows to use one or two label attributes. If two are used, the are seperated
-	 * by ": ". This mehtod stes one or two ProperybaName fields.
+	 * AtlasStyler has a fixed system that allows to use one or two label
+	 * attributes. If two are used, the are seperated by ": ". This mehtod stes
+	 * one or two ProperybaName fields.
 	 * 
 	 * @param symbolizer
 	 *            the {@link TextSymbolizer} to call setLabel(Expression) on.
@@ -2961,13 +3225,17 @@
 	 * @param literalLabelField2
 	 *            may be <code>null</code>
 	 */
-	public static void setDoublePropertyName(final TextSymbolizer symbolizer, final PropertyName literalLabelField1,
+	public static void setDoublePropertyName(final TextSymbolizer symbolizer,
+			final PropertyName literalLabelField1,
 			final PropertyName literalLabelField2) {
-		if (literalLabelField2 != null && !literalLabelField2.getPropertyName().isEmpty()
+		if (literalLabelField2 != null
+				&& !literalLabelField2.getPropertyName().isEmpty()
 				&& !literalLabelField2.toString().equalsIgnoreCase("-")) {
 			final Literal trenner = FilterUtil.FILTER_FAC2.literal(": ");
-			final Function f3 = FilterUtil.FILTER_FAC2.function("strConcat", trenner, literalLabelField2);
-			final Function bothExpression = FilterUtil.FILTER_FAC2.function("strConcat", literalLabelField1, f3);
+			final Function f3 = FilterUtil.FILTER_FAC2.function("strConcat",
+					trenner, literalLabelField2);
+			final Function bothExpression = FilterUtil.FILTER_FAC2.function(
+					"strConcat", literalLabelField1, f3);
 			LOGGER.debug("Extended label expression is now: " + bothExpression);
 			symbolizer.setLabel(bothExpression);
 		} else {
@@ -2983,7 +3251,8 @@
 	 * @param opacity
 	 *            Transparenzwert
 	 */
-	public static void setOpacityForColorMapEntry(ColorMapEntry entry, double opacity) {
+	public static void setOpacityForColorMapEntry(ColorMapEntry entry,
+			double opacity) {
 		if (entry != null)
 			entry.setOpacity(STYLE_BUILDER.literalExpression(opacity));
 	}
@@ -2996,7 +3265,8 @@
 	 * @param quantity
 	 *            neuer Wert
 	 */
-	public static void setQuantityForColorMapEntry(ColorMapEntry entry, double quantity) {
+	public static void setQuantityForColorMapEntry(ColorMapEntry entry,
+			double quantity) {
 		if (entry != null)
 			entry.setQuantity(STYLE_BUILDER.literalExpression(quantity));
 	}
@@ -3034,7 +3304,8 @@
 	}
 
 	/**
-	 * Converts a {@link StyledLayerDescriptor} or any of it's subcomponents to XML.
+	 * Converts a {@link StyledLayerDescriptor} or any of it's subcomponents to
+	 * XML.
 	 * 
 	 * @throws TransformerException
 	 */
@@ -3042,7 +3313,8 @@
 		return SLDTRANSFORMER.transform(sld);
 	}
 
-	public static boolean validates(FeatureTypeStyle fts) throws IOException, TransformerException {
+	public static boolean validates(FeatureTypeStyle fts) throws IOException,
+			TransformerException {
 		// Bytestream not file!
 		Style s = STYLE_BUILDER.createStyle();
 		s.featureTypeStyles().add(fts);
@@ -3060,7 +3332,8 @@
 		}
 	}
 
-	public static boolean isStyleDifferent(FeatureTypeStyle fts1, FeatureTypeStyle fts2) {
+	public static boolean isStyleDifferent(FeatureTypeStyle fts1,
+			FeatureTypeStyle fts2) {
 		Style style1 = STYLE_BUILDER.createStyle();
 		style1.featureTypeStyles().add(fts1);
 
@@ -3075,17 +3348,21 @@
 		return xml;
 	}
 
-	public static void correctGeometryPropertyname(final SimpleFeatureType schema, Symbolizer sym) {
+	public static void correctGeometryPropertyname(
+			final SimpleFeatureType schema, Symbolizer sym) {
 		String newGpn = sym.getGeometryPropertyName();
 
 		if (schema != null) {
 			// If we have a schema,
-			GeometryDescriptor geometryDescriptor = schema.getGeometryDescriptor();
-			if (geometryDescriptor != null)
+			GeometryDescriptor geometryDescriptor = schema
+					.getGeometryDescriptor();
+			if (geometryDescriptor != null) {
 				newGpn = geometryDescriptor.getName().toString();
+			}
 
 			if (newGpn != null) {
-				NameImpl found = FeatureUtil.findBestMatchingAttribute(schema, newGpn);
+				NameImpl found = FeatureUtil.findBestMatchingAttribute(schema,
+						newGpn);
 				if (found != null)
 					newGpn = found.getLocalPart();
 				else
@@ -3094,11 +3371,45 @@
 		} else {
 			newGpn = null;
 		}
-		sym.setGeometryPropertyName(newGpn == null ? null : newGpn.toString());
+
+		/**
+		 * Solved: This killed any geometry transformations wrapped arround the
+		 * geometry property.
+		 * 
+		 * See http://docs.geoserver.org/stable/en/user/styling
+		 * /sld-extensions/geometry-transformations.html
+		 * 
+		 * We only want to update or add the GeoemtryProperty for
+		 * PointSymbolizers working on Polygon geometries:
+		 */
+
+		final String newGpnFinal = newGpn;
+		DuplicatingFilterVisitor setPropertiesToNewGeom = new DuplicatingFilterVisitor() {
+
+			@Override
+			public Object visit(PropertyName expression, Object data) {
+				return StylingUtil.STYLE_BUILDER
+						.attributeExpression(newGpnFinal);
+			}
+		};
+
+		if (newGpn != null) {
+
+			if (sym.getGeometry() != null) {
+				System.out.println(sym.getGeometry());
+				Expression accepted = (Expression) sym.getGeometry().accept(
+						setPropertiesToNewGeom, null);
+				sym.setGeometry(accepted);
+				System.out.println(sym.getGeometry());
+			} else
+				sym.setGeometryPropertyName(newGpn);
+
+		}
 	}
 
 	/***************************************************************************
-	 * Copies all Values from one {@link TextSymbolizer} to another {@link TextSymbolizer}
+	 * Copies all Values from one {@link TextSymbolizer} to another
+	 * {@link TextSymbolizer}
 	 * 
 	 * @param from
 	 *            {@link TextSymbolizer} source
@@ -3108,7 +3419,8 @@
 	 * @author <a href="mailto:skpublic at wikisquare.de">Stefan Alfons Tzeggai</a>
 	 */
 
-	public static void copyAllValues(final TextSymbolizer from, final TextSymbolizer to) {
+	public static void copyAllValues(final TextSymbolizer from,
+			final TextSymbolizer to) {
 		to.setLabel(from.getLabel());
 		to.setPriority(from.getPriority());
 
@@ -3116,10 +3428,14 @@
 
 		final FilterFactory2 ff2 = FeatureUtil.FILTER_FACTORY2;
 
-		to.getFonts()[0].setFontFamily(ff2.literal(from.getFonts()[0].getFontFamily().toString()));
-		to.getFonts()[0].setFontSize(ff2.literal(from.getFonts()[0].getFontSize().toString()));
-		to.getFonts()[0].setFontWeight(ff2.literal(from.getFonts()[0].getFontWeight().toString()));
-		to.getFonts()[0].setFontStyle(ff2.literal(from.getFonts()[0].getFontStyle().toString()));
+		to.getFonts()[0].setFontFamily(ff2.literal(from.getFonts()[0]
+				.getFontFamily().toString()));
+		to.getFonts()[0].setFontSize(ff2.literal(from.getFonts()[0]
+				.getFontSize().toString()));
+		to.getFonts()[0].setFontWeight(ff2.literal(from.getFonts()[0]
+				.getFontWeight().toString()));
+		to.getFonts()[0].setFontStyle(ff2.literal(from.getFonts()[0]
+				.getFontStyle().toString()));
 	}
 
 	/**



More information about the Schmitzm-commits mailing list