[Schmitzm-commits] r1669 - in trunk/schmitzm-gt/src: main/java/de/schmitzm/geotools main/java/de/schmitzm/geotools/data main/java/de/schmitzm/geotools/feature main/java/de/schmitzm/geotools/grid main/java/de/schmitzm/geotools/gui main/java/de/schmitzm/geotools/io main/java/de/schmitzm/geotools/labelsearch main/java/de/schmitzm/geotools/styling test/java/de/schmitzm/geotools/feature test/java/de/schmitzm/geotools/testing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 9 23:58:34 CEST 2011


Author: alfonx
Date: 2011-08-09 23:58:32 +0200 (Tue, 09 Aug 2011)
New Revision: 1669

Added:
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/InvertedBrewerPalette.java
Modified:
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/LegendIconFeatureRenderer.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/QualityQuantizable.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/AttributeTypeFactory.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/CQLFilterParser.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/grid/GridUtil.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapRenderingStateEvent.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/SelectableFeatureTablePane.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/io/GeoImportUtil.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/LabelSearch.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchMapDialog.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchResultTableModel.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeatureCollectionTableModel.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeaturesInterface.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StylingUtil.java
   trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/feature/FeatureUtilTest.java
   trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/testing/GTTestingUtil.java
Log:
Neue Klasse in geotools.styling:
/**
 * Liefert die Farben einer {@link BrewerPalette} un Invertierter Reihenfolge aus.
 */
public class InvertedBrewerPalette extends BrewerPalette {

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/LegendIconFeatureRenderer.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/LegendIconFeatureRenderer.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/LegendIconFeatureRenderer.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -88,7 +88,7 @@
  * latter returns {@code null} even though the attribut is not nillable.</li>
  * </ul>
  * 
- * @author Stefan Alfons Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH Alfons Tzeggai
  */
 public class LegendIconFeatureRenderer {
 	// private static final Dimension SIZE = new Dimension(30,20);

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/QualityQuantizable.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/QualityQuantizable.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/data/QualityQuantizable.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -7,7 +7,7 @@
  * number between <code>0</code> and <code>1</code>. If quality is
  * <code>1</code>, translations (=inputs) exist for every supported language.
  * 
- * @author Stefan A. Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
  */
 public interface QualityQuantizable {
 

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/AttributeTypeFactory.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/AttributeTypeFactory.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/AttributeTypeFactory.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -13,7 +13,7 @@
  * This class "simulates" the old AttributeTypeFactory from gt2.4 but uses the
  * new API.
  * 
- * @author stefan
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH
  */
 public class AttributeTypeFactory {
 

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/CQLFilterParser.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/CQLFilterParser.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/CQLFilterParser.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -45,7 +45,7 @@
  * information about available operators and their tooltips.
  * 
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
- * @author Stefan Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH Tzeggai
  * 
  */
 public class CQLFilterParser implements FilterParser {

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/grid/GridUtil.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/grid/GridUtil.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/grid/GridUtil.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -394,7 +394,7 @@
 	 * 
 	 * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
 	 *         (University of Bonn/Germany)
-	 * @author Stefan Alfons Tzeggai (DEFAULT_RASTER_STYLE_NAME,
+	 * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH Alfons Tzeggai (DEFAULT_RASTER_STYLE_NAME,
 	 *         DEFAULT_RASTER_STYLE_TITLE)
 	 */
 	public static Style createDefaultStyle() {

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapRenderingStateEvent.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapRenderingStateEvent.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapRenderingStateEvent.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -4,7 +4,7 @@
  * Events of this Class are fired, when rendering starts and stops. Cancels and
  * Errors are fired as Stops.
  * 
- * @author stefan
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH
  * 
  */
 public class MapRenderingStateEvent extends XMapPaneEvent {

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/SelectableFeatureTablePane.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/SelectableFeatureTablePane.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/SelectableFeatureTablePane.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -65,7 +65,7 @@
  * {@link SelectableXMapPane} . Can be configured to show a simple preview
  * {@link SelectableXMapPane} to the left of the table.
  * 
- * @author Stefan A. Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
  * 
  */
 public class SelectableFeatureTablePane extends FeatureTablePane {

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/io/GeoImportUtil.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/io/GeoImportUtil.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/io/GeoImportUtil.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -98,7 +98,7 @@
  * 
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
  *         (University of Bonn/Germany)
- * @author Stefan Tzeggai, wikisquare.de
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH Tzeggai, wikisquare.de
  */
 public class GeoImportUtil {
 

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/LabelSearch.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/LabelSearch.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/LabelSearch.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -60,7 +60,7 @@
  * analyze the {@link Style} of every visible(?) layer and determine the label
  * attribute. This field is then searched for every feature.
  * 
- * @author Stefan A. Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
  * 
  */
 public class LabelSearch {

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchMapDialog.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchMapDialog.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchMapDialog.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -64,7 +64,7 @@
 import de.schmitzm.swing.SwingUtil;
 
 /**
- * @author Stefan A. Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
  */
 public class SearchMapDialog extends javax.swing.JDialog {
 	final static private Logger LOGGER = Logger

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchResultTableModel.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchResultTableModel.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/labelsearch/SearchResultTableModel.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -42,7 +42,7 @@
  * The three columns of this {@link TableModel} are: result number, full name,
  * name of layer containing the result
  * 
- * @author Stefan A. Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
  * 
  */
 public class SearchResultTableModel extends AbstractTableModel implements

Added: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/InvertedBrewerPalette.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/InvertedBrewerPalette.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/InvertedBrewerPalette.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -0,0 +1,96 @@
+package de.schmitzm.geotools.styling;
+
+import java.awt.Color;
+
+import org.apache.commons.lang.ArrayUtils;
+import org.geotools.brewer.color.BrewerPalette;
+import org.geotools.brewer.color.PaletteSuitability;
+import org.geotools.brewer.color.PaletteType;
+import org.geotools.brewer.color.SampleScheme;
+
+/**
+ * Liefert die Farben einer {@link BrewerPalette} un Invertierter Reihenfolge aus.
+ */
+public class InvertedBrewerPalette extends BrewerPalette {
+
+	@Override
+	public PaletteType getType() {
+		return original.getType();
+	}
+
+	@Override
+	public void setType(PaletteType type) {
+		throw new IllegalStateException(InvertedBrewerPalette.class.getSimpleName() + " is read-only");
+	}
+
+	@Override
+	public Color getColor(int index, int length) {
+		return getColors(length)[index];
+	}
+
+	@Override
+	public int getMaxColors() {
+		return original.getMaxColors();
+	}
+
+	@Override
+	public int getMinColors() {
+		return original.getMinColors();
+	}
+
+	@Override
+	public PaletteSuitability getPaletteSuitability() {
+		return original.getPaletteSuitability();
+	}
+
+	@Override
+	public void setPaletteSuitability(PaletteSuitability suitability) {
+		throw new IllegalStateException(InvertedBrewerPalette.class.getSimpleName() + " is read-only");
+	}
+
+	@Override
+	public SampleScheme getColorScheme() {
+		throw new IllegalStateException(InvertedBrewerPalette.class.getSimpleName() + " is read-only");
+	}
+
+	@Override
+	public void setColorScheme(SampleScheme scheme) {
+		throw new IllegalStateException(InvertedBrewerPalette.class.getSimpleName() + " is read-only");
+	}
+
+	private final BrewerPalette original;
+
+	public InvertedBrewerPalette(BrewerPalette bp) {
+		original = bp;
+	}
+
+	@Override
+	public void setName(String name) {
+		throw new IllegalStateException(InvertedBrewerPalette.class.getSimpleName() + " is read-only");
+	}
+
+	@Override
+	public void setDescription(String description) {
+		throw new IllegalStateException(InvertedBrewerPalette.class.getSimpleName() + " is read-only");
+	}
+
+	@Override
+	public void setColors(Color[] colors) {
+		throw new IllegalStateException(InvertedBrewerPalette.class.getSimpleName() + " is read-only");
+	}
+
+	@Override
+	public Color[] getColors(int length) {
+		final Color[] colors = original.getColors(length);
+		ArrayUtils.reverse(colors);
+		return colors;
+	}
+
+	@Override
+	public Color[] getColors() {
+		final Color[] colors = original.getColors();
+		ArrayUtils.reverse(colors);
+		return colors;
+	}
+
+}


Property changes on: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/InvertedBrewerPalette.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeatureCollectionTableModel.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeatureCollectionTableModel.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeatureCollectionTableModel.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -63,7 +63,7 @@
  * applied.</li>
  * </ul>
  * 
- * @author Stefan A. Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
  */
 public class StyledFeatureCollectionTableModel extends
 		FeatureCollectionTableModel {

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeaturesInterface.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeaturesInterface.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StyledFeaturesInterface.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -43,7 +43,7 @@
  * This Interface combines all styled layers that are running on
  * {@link FeatureCollection} or {@link FeatureSource}
  * 
- * @author Stefan A. Tzeggai
+ * @author Stefan A. Tzeggai (wikisquare.de) für CPA Systems GmbH A. Tzeggai
  * 
  * @param <T>
  *            The base Type returned in the getObject() method.

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	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/styling/StylingUtil.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -2209,7 +2209,7 @@
 	 *            A {@link Style} to search for the first {@link TextSymbolizer}
 	 *            that will be used for the given {@link SimpleFeature}.
 	 * 
-	 * @author Stefan A. Tzeggai
+	 * @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}.
@@ -2254,7 +2254,7 @@
 	 *            guarantee, that any one of them will ever be used for any
 	 *            feature (think about filters).
 	 * 
-	 * @author Stefan A. Tzeggai
+	 * @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}.
@@ -2285,7 +2285,7 @@
 	 *            . No guarantee, that any one of them will ever be used for any
 	 *            feature (think about filters).
 	 * 
-	 * @author Stefan A. Tzeggai
+	 * @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.
@@ -2317,7 +2317,7 @@
 	 *            guarantee, that any one of them will ever be used for any
 	 *            feature (think about filters).
 	 * 
-	 * @author Stefan A. Tzeggai
+	 * @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}.

Modified: trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/feature/FeatureUtilTest.java
===================================================================
--- trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/feature/FeatureUtilTest.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/feature/FeatureUtilTest.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -34,8 +34,17 @@
 import de.schmitzm.testing.TestingClass;
 
 public class FeatureUtilTest extends TestingClass {
+	
 
 	@Test
+	public void testAddFormelTrigger() {
+		String formel = "asd +sdf +sdf";
+		String f = "sdf";
+		formel = formel.replaceAll("\\b(" + Pattern.quote(f)+")", "NEW.$1");
+		assertEquals("asd +NEW.sdf + qwer", formel);
+	}
+
+	@Test
 	public void testFeatureTypeChecks() throws Exception {
 
 		GeometryDescriptor defaultGeometry = FeatureUtil.createFeatureType(
@@ -54,6 +63,11 @@
 	@Test
 	public void testGetCQLAttributNames() throws Exception {
 		List<String> aa;
+		
+		aa = FeatureUtil.getCQLAttributNames("100=1P_HH/HH_GES");
+		assertEquals(2, aa.size());
+		assertEquals("1P_HH", aa.get(0));
+		assertEquals("HH_GES", aa.get(1));
 
 		aa = FeatureUtil.getCQLAttributNames("1P_HH/HH_GES");
 		assertEquals(2, aa.size());

Modified: trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/testing/GTTestingUtil.java
===================================================================
--- trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/testing/GTTestingUtil.java	2011-08-08 15:52:39 UTC (rev 1668)
+++ trunk/schmitzm-gt/src/test/java/de/schmitzm/geotools/testing/GTTestingUtil.java	2011-08-09 21:58:32 UTC (rev 1669)
@@ -257,7 +257,7 @@
 		sr.paint(g2d, new Rectangle(100, 100), geoArea);
 		g2d.dispose();
 
-		TestingUtil.testGui(bi, 1);
+		TestingUtil.testGui(bi, 100);
 
 		return bi;
 	}



More information about the Schmitzm-commits mailing list