[Schmitzm-commits] r176 - in trunk/src: schmitzm/geotools/gui schmitzm/geotools/gui/resource/locales skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 1 16:14:17 CEST 2009


Author: alfonx
Date: 2009-07-01 16:14:15 +0200 (Wed, 01 Jul 2009)
New Revision: 176

Modified:
   trunk/src/schmitzm/geotools/gui/FeatureCollectionFilterPanel.java
   trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java
   trunk/src/schmitzm/geotools/gui/FeatureTablePane.java
   trunk/src/schmitzm/geotools/gui/JMapPane.java
   trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java
   trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties
   trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties
   trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_fr.properties
   trunk/src/skrueger/geotools/StyledFS.java
Log:
* Further improved the usability of the filter panels (used in FilterDialog and AttributeTableDialog)... 
** The preview map now always shows the complete collections in gray and the selected / filtered features in red above it
** Added de/en/fr tooltips for the preview mappane
** GP/ATlas AttribtDialog and FilterDialog can now be closed by pressing ESC

* Organized Imports ;-)

FIXED?: With an open attribute table, open the filters dialog and set a filter .. works here for me now and updates the attribute table.

Modified: trunk/src/schmitzm/geotools/gui/FeatureCollectionFilterPanel.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/FeatureCollectionFilterPanel.java	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/FeatureCollectionFilterPanel.java	2009-07-01 14:14:15 UTC (rev 176)
@@ -10,9 +10,12 @@
  **/
 package schmitzm.geotools.gui;
 
+import java.awt.BorderLayout;
 import java.awt.Color;
+import java.awt.Component;
 import java.awt.Font;
 import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
 import java.awt.Insets;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -20,29 +23,28 @@
 import java.awt.event.MouseEvent;
 import java.util.Map;
 
+import javax.swing.BorderFactory;
 import javax.swing.JButton;
 import javax.swing.JLabel;
+import javax.swing.JPanel;
 import javax.swing.JTextField;
 import javax.swing.ListSelectionModel;
 import javax.swing.event.AncestorEvent;
 import javax.swing.event.AncestorListener;
 
+import org.apache.log4j.Logger;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.map.DefaultMapLayer;
-import org.geotools.styling.Rule;
 import org.geotools.styling.Style;
-import org.geotools.styling.Symbolizer;
 import org.opengis.filter.Filter;
 
 import schmitzm.geotools.feature.AttributeTypeFilter;
 import schmitzm.geotools.feature.FeatureOperationTree;
 import schmitzm.geotools.feature.FeatureOperationTreeFilter;
 import schmitzm.geotools.feature.FeatureOperationTreeParser;
-import schmitzm.geotools.feature.FeatureUtil;
 import schmitzm.geotools.styling.StylingUtil;
 import schmitzm.swing.ExceptionDialog;
 import schmitzm.swing.SwingUtil;
-import sun.util.logging.resources.logging;
 
 /**
  * Diese Klasse stellt ein Panel zur Verfuegung, mit der ein
@@ -60,7 +62,7 @@
  * @version 1.0
  */
 public class FeatureCollectionFilterPanel extends FeatureFilterPanel {
-
+	static Logger LOGGER = Logger.getLogger(FeatureCollectionFilterPanel.class);
 	/**
 	 * Konstante fuer die Layout-Constraints des Vorschau-Bereich.
 	 * 
@@ -107,6 +109,26 @@
 			.getName()
 			+ ".TestResultDetailsToolTip";
 
+	/**
+	 * Constant for the BorderTitle of the results panel
+	 */
+	public static final String RESULTS_BORDER_TITLE = FeatureCollectionFilterPanel.class
+			.getName()
+			+ ".ResultsBorderTitle";
+
+	/**
+	 * Constant for the BorderTitle of the filter definition part
+	 */
+	public static final String FILER_DEFINITION_BORDER_TITLE = FeatureCollectionFilterPanel.class
+			.getName()
+			+ ".FilterDefinitionBorderTitle";
+	/**
+	 * Constant for the ToolTip of the preview mappane
+	 */
+	public static final String PREVIEW_MAPPANE_TOOLTIP = FeatureCollectionFilterPanel.class
+			.getName()
+			+ ".PreviewMapPaneToolTip";
+
 	/** Panel fuer Filter-Vorschau. */
 	private FeatureTablePane previewPanel = null;
 	/** Button zum Testen der Formel */
@@ -119,12 +141,18 @@
 	/** Speichert, ob im Vorschau-Panel eine grafische Anzeige erscheinen soll */
 	private boolean geomPrev = false;
 	/** Speichert, die FeatureCollection */
-	private FeatureCollection fc = null;
+	private FeatureCollection fullFeatureCollection = null;
 
 	/** Speichert den letzten Fehler in der Filter-Regel. */
 	protected Throwable testError = null;
 
 	/**
+	 * A Panel with a titled border that contains all buttons used to define the
+	 * filter
+	 */
+	protected JPanel defineFilterPanel;
+
+	/**
 	 * Erzeugt ein neues Panel.
 	 * 
 	 * @param fc
@@ -187,8 +215,7 @@
 		super.initGUI();
 
 		// Button zum Testen des Filters
-		testButton = new JButton(GeotoolsGUIUtil.RESOURCE
-				.getString(TEST_BUTTON));
+		testButton = new JButton(GeotoolsGUIUtil.R(TEST_BUTTON));
 		testButton.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent e) {
 				performRuleTest();
@@ -196,11 +223,11 @@
 		});
 
 		// Button fuer Details des Test-Ergebnis
-		testResultDetails = new JButton(GeotoolsGUIUtil.RESOURCE
-				.getString(TESTRESULTDETAILS_BUTTON));
+		testResultDetails = new JButton(GeotoolsGUIUtil
+				.R(TESTRESULTDETAILS_BUTTON));
 		testResultDetails.setVisible(false);
-		testResultDetails.setToolTipText(GeotoolsGUIUtil.RESOURCE
-				.getString(TESTRESULTDETAILS_TOOLTIP));
+		testResultDetails.setToolTipText(GeotoolsGUIUtil
+				.R(TESTRESULTDETAILS_TOOLTIP));
 		testResultDetails.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent e) {
 				ExceptionDialog.show(FeatureCollectionFilterPanel.this,
@@ -214,11 +241,10 @@
 		testResult.setForeground(Color.RED);
 		testResult.setFont(testResult.getFont().deriveFont(Font.BOLD));
 
-		if (getPreviewPanel() == null)
+		if (getPreviewPanel() == null) {
+
 			setPreviewPanel(new FeatureTablePane(null, geomPrev) {
 
-				FeatureCollection fullFeatureCollection;
-
 				// In der Tabelle sollen einzelne Werte selektiert werden
 				// koennen
 				// und diese bei einem Doppelklick in die Formel uebernommen
@@ -227,10 +253,10 @@
 				protected void initGUI(boolean geomPreview) {
 					super.initGUI(geomPreview);
 
-					if (mapPane != null && fullFeatureCollection != null) {
+					mapPane
+							.setToolTipText(GeotoolsGUIUtil
+									.R(FeatureCollectionFilterPanel.PREVIEW_MAPPANE_TOOLTIP));
 
-					}
-
 					// nur einzelne Zellen duerfen selektiert werden
 					featuresTable.setColumnSelectionAllowed(true);
 					featuresTable
@@ -250,6 +276,26 @@
 										featuresTable.getSelectedColumn()));
 						}
 					});
+
+//					/*
+//					 * Der TableModelListener aus super.initGUI() will bei einem
+//					 * tableChanged event nur die selektieren anzeigen. In der
+//					 * vorschau eines filters läuft das anders.
+//					 */
+//					final int length = featuresTableModel.getTableModelListeners().length;
+//					if (length > 0)
+//						featuresTableModel
+//								.removeTableModelListener(featuresTableModel
+//										.getTableModelListeners()[length - 1]);
+//
+//					// Wenn neue FeatureCollection gesetzt wird, alle Features
+//					// in Vorschau anzeigen.
+//					featuresTableModel
+//							.addTableModelListener(new TableModelListener() {
+//								public void tableChanged(TableModelEvent e) {
+//									showFeaturesInMap(getFeatureCollection());
+//								}
+//							});
 				}
 
 				// Im Vorschau-Panel sollen nicht die in der Tabelle selektieren
@@ -266,55 +312,98 @@
 				 * table (= paramter fc) as a selection on top of the complete
 				 * feature collection (which is rendered in gray).
 				 */
-				protected void showFeaturesInMap(FeatureCollection fc) {
-					System.out.println("SHOW IN MAP!");
-					final FeatureCollection fullFeatureCollection = FeatureCollectionFilterPanel.this
-							.getFeatureCollection();
+				protected void showFeaturesInMap() {
+					
+					if (getPreviewPanel() == null)
+						return;
+					
+					FeatureCollection specialFeatureCollection = getFeatureCollection();
+					
+					final FeatureCollection allFeatures = FeatureCollectionFilterPanel.this.getFeatureCollection();
 
-					if (fullFeatureCollection != null && fc != null)
-						System.out.println(fullFeatureCollection.size()
-								+ " vs " + fc.size());
+					if (specialFeatureCollection != null && allFeatures != null)
+						LOGGER.debug("The result to show contains " + specialFeatureCollection.size()
+								+ " of total " + allFeatures.size());
 
-					getPreviewPanel().mapPane.getContext().clearLayerList();
+					if (getPreviewPanel().mapPane.getContext().getLayerCount() == 0) {
 
-					if (fullFeatureCollection != null) {
-						/**
-						 * Als unterstes layer sollen alle Features in grau
-						 * dargestellt werden. Darüber dann in rot das
-						 * Filterergebnis.
-						 */
-						getPreviewPanel().mapPane.getContext().addLayer(
-								new DefaultMapLayer(fullFeatureCollection,
-										StylingUtil.createStyleSimple(fullFeatureCollection, Color.lightGray, Color.darkGray)));
+						if (allFeatures != null) {
+							/**
+							 * Als unterstes layer sollen alle Features in grau
+							 * dargestellt werden. Dieses Layer soll nur einmal
+							 * eingefügt werden
+							 */
+							getPreviewPanel().mapPane.getContext().addLayer(
+									new DefaultMapLayer(allFeatures,
+											StylingUtil.createStyleSimple(
+													allFeatures,
+													Color.lightGray,
+													Color.darkGray)));
 
-						// This thows an exception... We have to move to GT filters i guess.
-						getPreviewPanel().mapPane.zoomTo(fullFeatureCollection);
+							// This thows an exception... We have to move to GT
+							// filters i guess.
+							getPreviewPanel().mapPane
+									.zoomTo(allFeatures);
+						}
 					}
 
-					if (fc != null) {
-
+					if (specialFeatureCollection != null && allFeatures != null) {
 						/**
-						 * Der Inhalt der Tabelle soll in rot darüber gezeichnet werden
+						 * Der Inhalt der Tabelle soll in rot darüber gezeichnet
+						 * werden. Dieses layer wird jedes mal neu erstellt.
 						 */
+						if (getPreviewPanel().mapPane.getContext()
+								.getLayerCount() > 1)
+							getPreviewPanel().mapPane.getContext().removeLayer(
+									1);
 
 						getPreviewPanel().mapPane.getContext().addLayer(
-								new DefaultMapLayer(fc, StylingUtil.createStyleSimple(fc, Color.red, Color.white)));
+								new DefaultMapLayer(specialFeatureCollection, StylingUtil
+										.createStyleSimple(specialFeatureCollection, Color.red,
+												Color.white)));
 					}
-
 				}
+			});
 
-			});
+			// The PreviewPanel gets a Border saying what it is
+			getPreviewPanel().setBorder(
+					BorderFactory.createTitledBorder(GeotoolsGUIUtil
+							.R(RESULTS_BORDER_TITLE)));
+
+			// SwingUtil.setPreferredWidth(getPreviewPanel(), 600);
+		}
 		// Geometry-Attribute sollen nicht angezeigt werden
 		getPreviewPanel().setAttributeFilter(AttributeTypeFilter.NO_GEOMETRY);
 
-		SwingUtil.setPreferredHeight(getPreviewPanel(), 50);
+		SwingUtil.setPreferredHeight(getPreviewPanel(), 150);
 
+		/**
+		 * Move all the Components that have been added so far into a new panel
+		 * that has a nice border.
+		 */
+		defineFilterPanel = new JPanel(getLayout());
+		// SwingUtil.setPreferredWidth(defineFilterPanel, 600);
+		defineFilterPanel.setBorder(BorderFactory
+				.createTitledBorder(GeotoolsGUIUtil
+						.R(FILER_DEFINITION_BORDER_TITLE)));
+		GridBagLayout gpl = (GridBagLayout) getLayout();
+		for (Component c : getComponents()) {
+			defineFilterPanel.add(c, gpl.getConstraints(c));
+		}
+		removeAll(); // From the contentpane
+		setLayout(new BorderLayout());
+
 		// zusaetzliche Komponenten einfuegen
-		add(testButton, layoutConstraints.get(TEST_BUTTON));
-		add(testResultDetails, layoutConstraints.get(TESTRESULTDETAILS_BUTTON));
-		add(testResult, layoutConstraints.get(TESTRESULT_LABEL));
-		add(getPreviewPanel(), layoutConstraints.get(PREVIEW_PANEL));
+		defineFilterPanel.add(testButton, layoutConstraints.get(TEST_BUTTON));
+		defineFilterPanel.add(testResultDetails, layoutConstraints
+				.get(TESTRESULTDETAILS_BUTTON));
+		defineFilterPanel.add(testResult, layoutConstraints
+				.get(TESTRESULT_LABEL));
 
+		add(defineFilterPanel, BorderLayout.NORTH);
+
+		add(getPreviewPanel(), BorderLayout.CENTER);
+
 		// listen to the moment, the panel is inserted into a frame
 		// and then set the TEST-Button the default button
 		addAncestorListener(new AncestorListener() {
@@ -359,6 +448,15 @@
 	public void resetCaptions(Map<String, Object> captionMap) {
 		super.resetCaptions(captionMap);
 		SwingUtil.resetCaption(testButton, captionMap.get(TEST_BUTTON));
+
+		/**
+		 * TODO ?! resteCaption doesn't handle BorderTitle yet
+		 * SwingUtil.resetCaption(defineFilterPanel.getBorder(),
+		 * captionMap.get(FILER_DEFINITION_BORDER_TITLE)); //
+		 * defineFilterPanel.setBorder(
+		 * BorderFactory.createTitledBorder(GeotoolsGUIUtil.RESOURCE //
+		 * .getString(FILER_DEFINITION_BORDER_TITLE)));
+		 */
 	}
 
 	/**
@@ -448,18 +546,18 @@
 		if (!fc.getSchema().equals(getFeatureType()))
 			throw new IllegalArgumentException(
 					"FeatureCollection does not fit to schema of the panel!");
-		this.fc = fc;
+		this.fullFeatureCollection = fc;
+		
 		if (getPreviewPanel() != null) {
 			getPreviewPanel().setFeatureCollection(fc);
 		}
 	}
 
 	/**
-	 * Liefert die {@link FeatureCollection}, auf die (gefiltert) im
-	 * Vorschau-Panel angezeigt wird.
+	 * Liefert die ungefilterte {@link FeatureCollection}, auf der gefiltert wird. 
 	 */
 	public FeatureCollection getFeatureCollection() {
-		return fc;
+		return fullFeatureCollection;
 	}
 
 	/**

Modified: trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java	2009-07-01 14:14:15 UTC (rev 176)
@@ -125,9 +125,9 @@
     applyButton = new JButton( SwingUtil.RESOURCE.getString("Apply") );
     add( filterPanel, BorderLayout.CENTER);
     JPanel buttonPanel = new JPanel( new FlowLayout(FlowLayout.CENTER, 10, 5) );
-    buttonPanel.add( okButton, BorderLayout.CENTER );
-    buttonPanel.add( cancelButton, BorderLayout.CENTER );
-    buttonPanel.add( applyButton, BorderLayout.CENTER );
+    buttonPanel.add( okButton);
+    buttonPanel.add( cancelButton);
+    buttonPanel.add( applyButton);
     add( buttonPanel, BorderLayout.SOUTH );
 
     // Aktionen der Filter-Fenster-Button

Modified: trunk/src/schmitzm/geotools/gui/FeatureTablePane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/FeatureTablePane.java	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/FeatureTablePane.java	2009-07-01 14:14:15 UTC (rev 176)
@@ -61,7 +61,15 @@
 	protected JMapPane mapPane = null;
 	/** Style, in dem die Features in der Karte dargestellt werden */
 	protected Style featureStyle = null;
+
 	/**
+	 * Constant for the ToolTip of the preview mappane
+	 */
+	public static final String PREVIEW_MAPPANE_TOOLTIP = FeatureTablePane.class
+			.getName()
+			+ ".PreviewMapPaneToolTip";
+
+	/**
 	 * Splitpane, das die Karten-Vorschau von der Tabelle trennt ({@code null}
 	 * wenn Karten-Vorschau deaktiviert ist).
 	 */
@@ -161,11 +169,18 @@
 			// splitPane.setInnerBorder(null);
 			splitPane.setLeftComponent(mapPane);
 			splitPane.setRightComponent(featuresTableScrollPane);
-			splitPane.setDividerLocation(0.3); // SK: Does have no effect
-												// because JMapPane overrules
-												// this
 			splitPane.setOneTouchExpandable(true);
+
+			// splitPane.setDividerLocation(0.3); // SK: Does not have an
+			// effect because the JSplitPane is not visible yet! Before the
+			// JSplitPane is visible, only the divider location can only be
+			// set in absolute int pixels.
+
+			splitPane.setDividerLocation(mapPane.getPreferredSize().width);
+
 			add(splitPane);
+
+			showFeaturesInMap();
 		} else {
 			add(featuresTableScrollPane);
 		}
@@ -200,16 +215,20 @@
 			// }
 			// }
 			// };
+			mapPane.setToolTipText(GeotoolsGUIUtil.R(PREVIEW_MAPPANE_TOOLTIP));
+
 			mapPane.setState(JMapPane.RESET);
 			mapPane.setWindowSelectionState(JMapPane.NONE);
 			mapPane.setHighlight(false);
-			mapPane.setMinimumSize(new Dimension(50, 50));
-			SwingUtil.setPreferredWidth(mapPane, 100);
+			mapPane.setMinimumSize(new Dimension(100, 100));
+			SwingUtil.setPreferredWidth(mapPane, 200);
 			mapPane.setBorder(BorderFactory.createLoweredBevelBorder());
+
 		}
 
 		// Tabelle fuer FeatureCollection
 		featuresTable = new SortableJTable();
+
 		featuresTable.setModel(featuresTableModel);
 		featuresTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
 		featuresTable.setColumnSelectionAllowed(false);
@@ -223,13 +242,22 @@
 							performListSelection();
 					}
 				});
-		// Wenn neue FeatureCollection gesetzt wird, alle Features
-		// in Vorschau anzeigen
+
+		// Wenn neue FeatureCollection gesetzt wird, werden trotzdem nur die
+		// selektierten rot angezeigt. Der rest grau.
 		featuresTableModel.addTableModelListener(new TableModelListener() {
 			public void tableChanged(TableModelEvent e) {
-				showFeaturesInMap(getFeatureCollection());
+				// showFeaturesInMap(getSelectedFeatures());
+				if (mapPane != null) {
+					// falls diese TableContextChange durch einen neu
+					// angewendeten filter passiert ist, soll sich auch das
+					// hintergund layer ändern.
+					mapPane.getContext().clearLayerList();
+				}
+				showFeaturesInMap();
 			}
 		});
+
 	}
 
 	/**
@@ -253,7 +281,7 @@
 	 * Prueft, ob der Geometry-Preview angezeigt wird.
 	 */
 	public boolean isGeometryPreviewVisible() {
-		return mapPane.isVisible();
+		return mapPane != null && mapPane.isVisible();
 	}
 
 	/**
@@ -307,65 +335,78 @@
 	}
 
 	/**
-	 * Zeigt die aktuell in der Tabelle selektierten Features im Preview-Bereich
-	 * an.
+	 * Zeigt die aktuell in der Tabelle selektierten Features in rot im
+	 * Preview-Bereich an.
 	 */
 	protected void performListSelection() {
-		FeatureCollection subCollection = getSelectedFeatures();
-		// Wenn keine Auswahl getaetigt ist, alle Features anzeigen
-		if (subCollection == null || subCollection.isEmpty())
-			subCollection = getFeatureCollection();
-		showFeaturesInMap(subCollection);
+		// FeatureCollection subCollection = getSelectedFeatures();
+		// // Wenn keine Auswahl getaetigt ist, alle Features anzeigen
+		// if (subCollection == null || subCollection.isEmpty())
+		// subCollection = getFeatureCollection();
+		showFeaturesInMap();
 	}
 
 	/**
-	 * Zeigt einen {@link FeatureCollection} in der Karte an. Diese Funktion hat
-	 * keinen Einfluss auf die in der Tabelle angezeigten Features!!
+	 * Zeigt einen die übergebene {@link FeatureCollection} rot in der Karte an.
+	 * Darunter liegen in grau alle Features. Diese Funktion hat keinen Einfluss
+	 * auf die in der Tabelle angezeigten Features!!
 	 * 
 	 * @param fc
 	 *            eine {@link FeatureCollection}
 	 */
-	protected void showFeaturesInMap(FeatureCollection fc) {
+	protected void showFeaturesInMap() {
 		if (mapPane == null)
 			return;
-		mapPane.getContext().clearLayerList();
 
-		final FeatureCollection allFeatures = getFeatureCollection();
+		FeatureCollection selectedFeatures = getSelectedFeatures();
 
 		/**
-		 * Add ALL features to the JMapPane as the base laye and style them in
-		 * grey
+		 * Das layer mit allen features soll nicht immer neu eingefügt werden.
+		 * Deshalb wird es nur einmal eingefügt.
 		 */
-		if (allFeatures != null) {
-			mapPane.getContext().addLayer(
-					new DefaultMapLayer(allFeatures, StylingUtil.createStyleSimple(allFeatures, Color.lightGray, Color.darkGray)));
+		if (mapPane.getContext().getLayerCount() == 0) {
+
+			final FeatureCollection allFeatures = getFeatureCollection();
+
+			/**
+			 * Add ALL features to the JMapPane as the base laye and style them
+			 * in grey
+			 */
+			if (allFeatures != null) {
+				mapPane.getContext().addLayer(
+						new DefaultMapLayer(allFeatures, StylingUtil
+								.createStyleSimple(allFeatures,
+										Color.lightGray, Color.darkGray)));
+			}
 		}
 
-		if (fc != null && fc.size() > 0
-				&& fc.getSchema().getDefaultGeometry() != null) {
+		// Das zweite Layer entfernen (wenne er schon vorhanden ist)
+		if (mapPane.getContext().getLayerCount() > 1)
+			mapPane.getContext().removeLayer(1);
 
+		// Und ggf. neu hinzufügen
+		if (selectedFeatures != null && selectedFeatures.size() > 0
+				&& selectedFeatures.getSchema().getDefaultGeometry() != null) {
+
 			if (getFeatureStyle() == null) {
-				setFeatureStyle(StylingUtil.createStyleSimple(fc, Color.red, Color.white));
+				setFeatureStyle(StylingUtil.createStyleSimple(selectedFeatures, Color.red,
+						Color.white));
 			}
-			mapPane.getContext().addLayer(fc, getFeatureStyle());
+			mapPane.getContext().addLayer(selectedFeatures, getFeatureStyle());
 
-			// if (featuresTableModel instanceof
-			// StyledFeatureCollectionTableModel) {
-			// bounds = ((StyledFeatureCollectionTableModel) featuresTableModel)
-			// .getBounds();
-			// }
-			// // featuresTableModel.getFeatureCollection().getBounds();
-			// if (bounds == null)
-			// bounds = fc.getBounds();
+			/**
+			 * TODO Das schmeisst eine blöde exception
+			 * java.lang.UnsupportedOperationException: Unbekanntes
+			 * Feature-Attribut: POP2002 at
+			 * schmitzm.geotools.feature.FeatureOperationTree
+			 * .evaluate(FeatureOperationTree.java:92) at
+			 * schmitzm.lang.tree.OperationTree.evaluate(OperationTree.java:181)
+			 * mapPane.zoomTo(getFeatureCollection()); //
+			 */
 
-			// System.out.println(fc.size());
+		}
 
-			mapPane.zoomTo(getFeatureCollection());
-			// zoom to the full bound if available,
-			// otherwise just to the bounds of the
-			// selected.
-
-		}
+		// Vorschaukarte aktualisieren
 		mapPane.refresh();
 	}
 }

Modified: trunk/src/schmitzm/geotools/gui/JMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-07-01 14:14:15 UTC (rev 176)
@@ -511,7 +511,7 @@
                             // CRS dem MapContext zuweisen
                             try {
                                 getContext().setCoordinateReferenceSystem(crs);
-                                LOGGER.debug("MapContext-CRS set to: "+crs);
+//                                LOGGER.debug("MapContext-CRS set to: "+crs);
                             } catch (Exception err) {
                                 LOGGER
                                         .error("CRS could not be assigned to map context.", err);

Modified: trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java	2009-07-01 14:14:15 UTC (rev 176)
@@ -118,6 +118,7 @@
 
 		// Change the sizes
 		mapPane.setPreferredSize(new Dimension(200, 300));
+		
 		featuresTable.getParent().setPreferredSize(new Dimension(400, 300));
 	    featuresTable.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
 

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties	2009-07-01 14:14:15 UTC (rev 176)
@@ -16,9 +16,18 @@
 schmitzm.geotools.feature.FeatureTableModel.AttrName=Attribut
 schmitzm.geotools.feature.FeatureTableModel.AttrType=Type
 schmitzm.geotools.feature.FeatureTableModel.AttrValue=Value
+
 schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestButton=Test filter
 schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestResultDetailsButton=?
 schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestResultDetailsToolTip=Show error details...
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.ResultsBorderTitle=Filter result:
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.FilterDefinitionBorderTitle=Define filter:
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.PreviewMapPaneToolTip=Red features are included by the filter,\ngray features are not.
+
+schmitzm.geotools.gui.FeatureTablePane.PreviewMapPaneToolTip=Red features are selected,\ngray features are not.
+
+schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE = Feature-Filter
+
 schmitzm.geotools.gui.MapActionControlPane.INFO=Info
 schmitzm.geotools.gui.MapActionControlPane.ZOOM_IN=Zoom in
 schmitzm.geotools.gui.MapActionControlPane.ZOOM_OUT=Zoom out

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties	2009-07-01 14:14:15 UTC (rev 176)
@@ -14,8 +14,16 @@
 org.geotools.styling.StyleBuilder.MARK_X=X
 
 schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestButton=Filter testen
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestResultDetailsButton=?
 schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestResultDetailsToolTip=Fehler-Details anzeigen...
-schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE=Feature-Filter
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.ResultsBorderTitle=Ergebnis des Filters:
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.FilterDefinitionBorderTitle=Filter definieren:
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.PreviewMapPaneToolTip=Rote Objekte treffen auf den Filter zu, graue Objekte nicht.
+
+schmitzm.geotools.gui.FeatureTablePane.PreviewMapPaneToolTip=Rote Objekte sind selektiert, graue Objekte nicht.
+
+schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE = Feature-Filter
+
 schmitzm.geotools.gui.MapActionControlPane.ZOOM_IN=Heran zoomen
 schmitzm.geotools.gui.MapActionControlPane.ZOOM_OUT=Heraus zoomen
 schmitzm.geotools.gui.MapActionControlPane.SELECT_TOP=Auswählen aus oberstem Layer

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_fr.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_fr.properties	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_fr.properties	2009-07-01 14:14:15 UTC (rev 176)
@@ -16,9 +16,16 @@
 schmitzm.geotools.feature.FeatureTableModel.AttrName=variable
 schmitzm.geotools.feature.FeatureTableModel.AttrType=type de données
 schmitzm.geotools.feature.FeatureTableModel.AttrValue=valeur
+
 schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestButton=Tester le filtre
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestResultDetailsButton=?
 schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestResultDetailsToolTip=Afficher erreur au détail...
-schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE=Filtre de Feature
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.ResultsBorderTitle=Résultat du filtre:
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.FilterDefinitionBorderTitle=Definir le fitre:
+
+schmitzm.geotools.gui.FeatureCollectionFilterPanel.PreviewMapPaneToolTip=Les objects rouges correspondent au filtre, les objets gris n'en correspondent pas.
+schmitzm.geotools.gui.FeatureTablePane.PreviewMapPaneToolTip=Les objets rouges sont sélectionnés, les objets gris n'en sont pas.
+
 schmitzm.geotools.gui.MapActionControlPane.ZOOM_IN=Zoom avant
 schmitzm.geotools.gui.MapActionControlPane.ZOOM_OUT=Zoom arrière
 schmitzm.geotools.gui.MapActionControlPane.SELECT_TOP=Sélectionner de la couche la plus haute

Modified: trunk/src/skrueger/geotools/StyledFS.java
===================================================================
--- trunk/src/skrueger/geotools/StyledFS.java	2009-07-01 10:06:26 UTC (rev 175)
+++ trunk/src/skrueger/geotools/StyledFS.java	2009-07-01 14:14:15 UTC (rev 176)
@@ -15,7 +15,6 @@
 import org.apache.log4j.Logger;
 import org.geotools.data.FeatureSource;
 import org.geotools.feature.AttributeType;
-import org.geotools.gui.swing.ExceptionMonitor;
 import org.geotools.styling.Style;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 



More information about the Schmitzm-commits mailing list