[Schmitzm-commits] r475 - branches/1.0-gt2-2.6/src/schmitzm/geotools/styling

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 16 13:18:34 CEST 2009


Author: alfonx
Date: 2009-10-16 13:18:34 +0200 (Fri, 16 Oct 2009)
New Revision: 475

Modified:
   branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java
Log:
* AtlasStyler now features a new sophisticated  color palette for up to 7 classes created by Arthur Rachowka.

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java	2009-10-15 14:04:16 UTC (rev 474)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/styling/StylingUtil.java	2009-10-16 11:18:34 UTC (rev 475)
@@ -149,12 +149,12 @@
 	/** Standard-Instanz eines {@link SLDTransformer}. */
 	public final static SLDTransformer SLDTRANSFORMER = new SLDTransformer();
 
-	/**
-	 * Standard-Instanz eines {@link StyleBuilder}.
-	 * 
-	 * @deprecated wurde ersetzt durch {@link #STYLE_BUILDER}
-	 */
-	public static final StyleBuilder builder = STYLE_BUILDER;
+//	/**
+//	 * Standard-Instanz eines {@link StyleBuilder}.
+//	 * 
+//	 * @deprecated wurde ersetzt durch {@link #STYLE_BUILDER}
+//	 */
+//	public static final StyleBuilder builder = STYLE_BUILDER;
 
 	/** Standard-Instanz einer {@link StyleFactory} */
 	public static final StyleFactory STYLE_FACTORY = CommonFactoryFinder
@@ -1580,7 +1580,7 @@
 	 *            colors for the palette
 	 */
 	public static BrewerPalette createBrewerPalette(String name, Color[] colors)
-			throws IOException {
+			 {
 		BrewerPalette palette = new BrewerPalette();
 		palette.setColors(colors);
 		palette.setName(name);
@@ -1588,17 +1588,29 @@
 
 		// set suitability to UNKNOWN for all viewers
 		PaletteSuitability suitability = new PaletteSuitability();
-		suitability.setSuitability(colors.length, new String[] { "?", "?", "?",
-				"?", "?", "?" });
-		palette.setPaletteSuitability(suitability);
+		try {
+			suitability.setSuitability(colors.length, new String[] { "?", "?", "?",
+					"?", "?", "?" });
+			palette.setPaletteSuitability(suitability);
+		} catch (IOException e) {
+			LOGGER.error("Unabel to PaletteSuitability.setSuitablility for colors.length="+colors,e);
+		}
 
-		// set the only scheme for the palette (include all colors)
+		// Create the trivial scheme for the palette (requested colors equals number of colors)
 		int[] schema = new int[colors.length];
-		for (int j = 0; j < schema.length; j++)
+		for (int j = 0; j < colors.length; j++)
 			schema[j] = j;
 		SampleScheme sampleScheme = new SampleScheme();
-		sampleScheme.setSampleScheme(schema.length, schema);
+
+		// set the trivial scheme for all schemas
+		for (int j = 2; j < schema.length; j++) {
+			sampleScheme.setSampleScheme(j, schema);
+//			sampleScheme.setSampleScheme(schema.length, schema);
+		}
+		
+		
 		palette.setColorScheme(sampleScheme);
+		
 
 		return palette;
 	}



More information about the Schmitzm-commits mailing list