[Schmitzm-commits] r1272 - in trunk: src/org/geopublishing src/org/geopublishing/atlasViewer src/org/geopublishing/atlasViewer/swing src/schmitzm/geotools/gui src/schmitzm/geotools/gui/resource/locales src_junit/org/geopublishing/atlasViewer src_junit/org/geopublishing/atlasViewer/swing src_junit/schmitzm/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Nov 15 01:53:56 CET 2010


Author: alfonx
Date: 2010-11-15 01:53:55 +0100 (Mon, 15 Nov 2010)
New Revision: 1272

Added:
   trunk/src/org/geopublishing/atlasViewer/
   trunk/src/org/geopublishing/atlasViewer/swing/
   trunk/src/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialog.java
   trunk/src/schmitzm/geotools/gui/FilterChangeListener.java
   trunk/src_junit/org/geopublishing/atlasViewer/swing/
   trunk/src_junit/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialogTest.java
   trunk/src_junit/schmitzm/swing/PopupListener.java
Modified:
   trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.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/schmitzm/geotools/gui/resource/locales/GTResourceBundle_ru.properties
Log:
AtlasSyler supports to set filters with the GUI. nice!

Added: trunk/src/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialog.java
===================================================================
--- trunk/src/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialog.java	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialog.java	2010-11-15 00:53:55 UTC (rev 1272)
@@ -0,0 +1,311 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Stefan A. Tzeggai.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v2.1
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ * 
+ * Contributors:
+ *     Stefan A. Tzeggai - initial API and implementation
+ ******************************************************************************/
+package org.geopublishing.atlasViewer.swing;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.io.IOException;
+
+import javax.swing.JComponent;
+import javax.swing.JRootPane;
+import javax.swing.KeyStroke;
+import javax.swing.table.JTableHeader;
+
+import org.apache.log4j.Logger;
+import org.geotools.filter.text.cql2.CQL;
+import org.geotools.map.MapLayer;
+import org.opengis.feature.type.AttributeDescriptor;
+import org.opengis.filter.Filter;
+
+import schmitzm.geotools.feature.CQLFilterParser;
+import schmitzm.geotools.feature.FeatureTypeTableModel;
+import schmitzm.geotools.feature.FilterParser;
+import schmitzm.geotools.gui.FeatureCollectionFilterPanel;
+import schmitzm.geotools.gui.FeatureLayerFilterDialog;
+import schmitzm.geotools.gui.GeotoolsGUIUtil;
+import schmitzm.geotools.gui.SelectableXMapPane;
+import schmitzm.lang.LangUtil;
+import schmitzm.swing.SwingUtil;
+import skrueger.AttributeMetaDataAttributeTypeFilter;
+import skrueger.AttributeMetadataImpl;
+import skrueger.AttributeMetadataInterface;
+import skrueger.geotools.AttributeMetadataMap;
+import skrueger.geotools.StyledFeaturesInterface;
+import skrueger.i8n.I8NUtil;
+
+/**
+ * This dialog extends the {@link FeatureLayerFilterDialog} by special features
+ * provided by the {@link AttributeMetadataImpl}:
+ * <ul>
+ * <li>The attribute table also shows the attribute description from the
+ * {@link AttributeMetadataImpl}-map.</li>
+ * <li>In the attribute table and the filter preview table only the attributes
+ * are shown which are declared as visible in the meta-data.</li>
+ * </ul>
+ * 
+ * @author <a href="mailto:schmitzm at bonn.edu">Martin Schmitz</a> (University of
+ *         Bonn/Germany)
+ * @version 1.0
+ */
+public class AtlasFeatureLayerFilterDialog extends FeatureLayerFilterDialog {
+	/**
+	 * Parser, der standardmaessig verwendet wird, um den {@link Filter} zu
+	 * erstellen.
+	 */
+	public static final FilterParser FILTER_PARSER = new CQLFilterParser();
+
+	static Logger LOGGER = Logger
+			.getLogger(AtlasFeatureLayerFilterDialog.class);
+
+	/** Holds the attribute meta data for the layer */
+	protected AttributeMetadataMap attrMetaDataMap;
+
+	private final StyledFeaturesInterface<?> styedFeatures;
+
+	/**
+	 * Created a new dialog
+	 * 
+	 * @param parent
+	 *            the parent Frame
+	 * @param mapPane
+	 *            the {@link SelectableXMapPane} where the layer is shown in
+	 * @param mapLayer
+	 *            the layer the features are taken from
+	 * @param attrMetaDataMap
+	 *            the attribute meta data for the features
+	 * @param initGUI
+	 *            determines, whether {@link #initGUI()} is called. If
+	 *            {@code false}, the constructor of the derived class must
+	 *            ensure that {@link #initGUI()} is called.
+	 * @param layerName
+	 *            Translated name of the layer
+	 * @throws IOException
+	 *             if an error occurs during determining the features form the
+	 *             layer
+	 */
+	protected AtlasFeatureLayerFilterDialog(Component parent,
+			StyledFeaturesInterface<?> styledFeatures,
+			SelectableXMapPane mapPane, MapLayer mapLayer, boolean initGUI) {
+		super(parent, mapPane, mapLayer, false, false);
+		this.attrMetaDataMap = styledFeatures.getAttributeMetaDataMap();
+		this.styedFeatures = styledFeatures;
+		if (!styledFeatures.getFilter().equals(Filter.INCLUDE)) {
+			setFilterRule(CQL.toCQL(styledFeatures.getFilter()));
+		}
+		if (initGUI) {
+			initGUI(styledFeatures.getTitle().toString());
+			pack();
+		}
+	}
+
+	/**
+	 * Created a new dialog
+	 * 
+	 * @param parent
+	 *            the parent Frame
+	 * @param styledFeatures
+	 * @throws IOException
+	 *             if an error occurs during determining the features form the
+	 *             layer
+	 */
+	public AtlasFeatureLayerFilterDialog(Component parent,
+			StyledFeaturesInterface<?> styledFeatures) {
+		this(parent, styledFeatures, null, null);
+	}
+
+	/**
+	 * Created a new dialog
+	 * 
+	 * @param parent
+	 *            the parent Frame
+	 * @param styledFeatures
+	 *            the attribute meta data for the features
+	 * @param mapPane
+	 *            the {@link SelectableXMapPane} where the layer is shown in
+	 * @param mapLayer
+	 *            the layer the features are taken from
+	 * @throws IOException
+	 *             if an error occurs during determining the features form the
+	 *             layer
+	 */
+	public AtlasFeatureLayerFilterDialog(Component parent,
+			StyledFeaturesInterface<?> styledFeatures,
+			SelectableXMapPane mapPane, MapLayer mapLayer) {
+		this(parent, styledFeatures, mapPane, mapLayer, true);
+	}
+
+	@Override
+	public FeatureCollectionFilterPanel getFilterPanel() {
+		if (filterPanel == null) {
+
+			filterPanel = new FeatureCollectionFilterPanel(FILTER_PARSER,
+					styedFeatures.getFeatureCollection(), false,
+					new AttributeMetaDataAttributeTypeFilter(attrMetaDataMap)) {
+
+				@Override
+				protected void initGUI() {
+
+					super.initGUI();
+
+					// Changing a few things to get the AttributeMetaData into
+					// the
+					// Table
+					attributeTableModel = new FeatureTypeTableModel() {
+
+						@Override
+						public String[] createColumnNames() {
+							String[] superColNames = super.createColumnNames();
+
+							superColNames[0] = GeotoolsGUIUtil
+									.R("AtlasFeatureLayerFilterDialog.AttributeTableHeader.VariableName");
+
+							String[] extendedArray = LangUtil
+									.extendArray(
+											superColNames,
+											GeotoolsGUIUtil
+													.R("AtlasFeatureLayerFilterDialog.AttributeTableHeader.Name"),
+											GeotoolsGUIUtil
+													.R("AtlasFeatureLayerFilterDialog.AttributeTableHeader.Description"),
+											GeotoolsGUIUtil
+													.R("AtlasFeatureLayerFilterDialog.AttributeTableHeader.Unit"));
+							return extendedArray;
+						}
+
+						@Override
+						public Object getValueAt(int row, int col) {
+
+							final AttributeDescriptor lookingForAD = attrTypes
+									.elementAt(row);
+							// int attrIdx =
+							// featureType.getAttributeDescriptors()
+							// .indexOf(lookingForAD);
+
+							AttributeMetadataInterface metaData = attrMetaDataMap
+									.get(lookingForAD.getName());
+							if (col == getColumnCount() - 3
+									&& attrMetaDataMap != null) {
+								/**
+								 * This column represents the translated title
+								 * of the variable
+								 */
+								return metaData == null ? null : metaData
+										.getTitle();
+							} else if (col == getColumnCount() - 2
+									&& attrMetaDataMap != null) {
+								/**
+								 * This column represents the translated
+								 * description of the variable
+								 */
+								if (metaData == null
+										|| I8NUtil.isEmpty(metaData.getDesc()))
+									return null;
+
+								return metaData.getDesc();
+							} else if (col == getColumnCount() - 1
+									&& attrMetaDataMap != null) {
+								/**
+								 * This column represents the translated UNIT of
+								 * the variable
+								 */
+								if (metaData == null
+										|| I8NUtil.isEmpty(metaData.getUnit()))
+									return null;
+
+								return metaData.getUnit();
+							}
+							return super.getValueAt(row, col);
+
+						}
+					};
+
+					attributeTableModel
+							.setAttributeFilter(new AttributeMetaDataAttributeTypeFilter(
+									attrMetaDataMap));
+
+					this.attributeTable.setModel(this.attributeTableModel);
+					this.attributeTable.setTableHeader(new JTableHeader(
+							attributeTable.getColumnModel()));
+					this.attributeTable.getColumnModel().getColumn(0)
+							.setMinWidth(150);
+					this.attributeTable.getColumnModel().getColumn(1)
+							.setMinWidth(100);
+					this.attributeTable.getColumnModel().getColumn(2)
+							.setPreferredWidth(200);
+					this.attributeTable.getColumnModel().getColumn(3)
+							.setPreferredWidth(200);
+					this.attributeTable.getColumnModel().getColumn(4)
+							.setPreferredWidth(60);
+
+					SwingUtil.setMinimumHeight(this.attributeTable, 250); // has
+																			// no
+																			// effect
+																			// :-(
+
+				}
+
+				@Override
+				protected void resetComponentsAfterTest(Throwable err) {
+					super.resetComponentsAfterTest(err);
+					// dis/enable OK- and APPLY-Button on error
+					okButton.setEnabled(err == null);
+					applyButton.setEnabled(err == null);
+				}
+			};
+
+		}
+		return filterPanel;
+	}
+
+	/**
+	 * Calls {@code super.initGUI()} and then replaces the {@code filterPanel}
+	 * with a new one.
+	 */
+	protected void initGUI(final String layerNameTranslated) {
+
+		super.initGUI();
+
+		if (layerNameTranslated != null) {
+			String windowTitle = GeotoolsGUIUtil.R(
+					"AtlasFeatureLayerFilterDialog.WindowTitle",
+					layerNameTranslated);
+			setTitle(windowTitle);
+		}
+	}
+
+	/**
+	 * Since the registerKeyboardAction() method is part of the JComponent class
+	 * definition, you must define the Escape keystroke and register the
+	 * keyboard action with a JComponent, not with a JDialog. The JRootPane for
+	 * the JDialog serves as an excellent choice to associate the registration,
+	 * as this will always be visible. If you override the protected
+	 * createRootPane() method of JDialog, you can return your custom JRootPane
+	 * with the keystroke enabled:
+	 */
+	@Override
+	protected JRootPane createRootPane() {
+		KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
+		JRootPane rootPane = new JRootPane();
+		rootPane.registerKeyboardAction(new ActionListener() {
+
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				setVisible(false);
+				dispose();
+			}
+
+		}, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+		return rootPane;
+	}
+
+}


Property changes on: trunk/src/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialog.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native

Modified: trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src/schmitzm/geotools/gui/FeatureLayerFilterDialog.java	2010-11-15 00:53:55 UTC (rev 1272)
@@ -43,9 +43,11 @@
 import javax.swing.JDialog;
 import javax.swing.JPanel;
 
+import org.apache.log4j.Logger;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.map.MapLayer;
 import org.geotools.map.event.MapLayerEvent;
+import org.geotools.util.WeakHashSet;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.feature.simple.SimpleFeatureType;
 import org.opengis.filter.Filter;
@@ -76,6 +78,8 @@
  */
 public class FeatureLayerFilterDialog extends JDialog implements
 		CaptionsChangeable {
+
+	Logger LOGGER = Logger.getLogger(FeatureLayerFilterDialog.class);
 	/**
 	 * Key, um den Titel des FeatureCollection-Filter-Dialogs in der
 	 * {@link CaptionsChangeable}-Map anzusprechen.
@@ -127,7 +131,22 @@
 	private MapLayer layer = null;
 	private final boolean geomPrev;
 
+	/***************************************************************************
+	 * Listeners to style changes
+	 */
+	final WeakHashSet<FilterChangeListener> listeners = new WeakHashSet<FilterChangeListener>(
+			FilterChangeListener.class);
+
 	/**
+	 * Adds a {@link FilterChangeListener} which gets called whenever the
+	 * {@link Filter} has changed. The list is WEAK! You have to keep a
+	 * reference of the listener gets garbage collected.
+	 */
+	public void addListener(final FilterChangeListener listener) {
+		listeners.add(listener);
+	}
+
+	/**
 	 * Erzeugt einen neuen Dialog.
 	 * 
 	 * @param parent
@@ -206,7 +225,7 @@
 		add(buttonPanel, BorderLayout.SOUTH);
 
 		// Aktionen der Filter-Fenster-Button
-		ActionListener action = new ActionListener() {
+		ActionListener buttonAction = new ActionListener() {
 			public void actionPerformed(ActionEvent e) {
 				// Ok- und Apply-Button > Filter anwenden und Event erzeugen
 				if (e.getSource() == okButton || e.getSource() == applyButton) {
@@ -219,35 +238,42 @@
 						newFilter = getFilter();
 					}
 
-					final Filter fiterInAction = getMapLayer().getQuery()
-							.getFilter();
+					// Inform the MapLayer if one is set:
+					if (getMapLayer() != null) {
+						final Filter fiterInAction = getMapLayer().getQuery()
+								.getFilter();
 
-					if (getMapPane() != null
-							&& !fiterInAction.equals(newFilter)) {
+						if (getMapPane() != null
+								&& !fiterInAction.equals(newFilter)) {
 
-						try {
-							FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFilterPanel()
-									.filterFeatureCollection();
-							FeatureSelectedEvent fse = new FeatureSelectedEvent(
-									getMapPane(), layer, null, fc, // SK,
-																	// 26.11.2009
-																	// passing
-																	// null as
-																	// the
-																	// bounds,
-																	// because
-																	// getBounds
-																	// can be
-																	// very
-																	// expensive
-									FeatureLayerFilterDialog.this);
-							getMapPane().fireMapPaneEvent(fse);
-						} catch (Exception err) {
-							ExceptionDialog.show(getFilterPanel(), err);
-							// Fenster nicht schliessen, bei OK!!
-							return;
+							try {
+								FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFilterPanel()
+										.filterFeatureCollection();
+								FeatureSelectedEvent fse = new FeatureSelectedEvent(
+										getMapPane(), layer, null, fc, // SK,
+										// 26.11.2009
+										// passing
+										// null as
+										// the
+										// bounds,
+										// because
+										// getBounds
+										// can be
+										// very
+										// expensive
+										FeatureLayerFilterDialog.this);
+								getMapPane().fireMapPaneEvent(fse);
+							} catch (Exception err) {
+								ExceptionDialog.show(getFilterPanel(), err);
+								// Fenster nicht schliessen, bei OK!!
+								return;
+							}
 						}
 					}
+
+					// Inform the listeners about the newFilter
+					fireFilterChangedEvent(newFilter);
+
 				}
 				// Ok- und Cancel-Button > Dialog schliessen
 				if (e.getSource() == okButton || e.getSource() == cancelButton) {
@@ -255,19 +281,38 @@
 				}
 			}
 		};
-		okButton.addActionListener(action);
-		cancelButton.addActionListener(action);
-		applyButton.addActionListener(action);
+		okButton.addActionListener(buttonAction);
+		cancelButton.addActionListener(buttonAction);
+		applyButton.addActionListener(buttonAction);
 
 		// Wenn sich die die Bezeichnung des Layers aendert, soll auch der
 		// Titel des Filter-Fensters geaendert werden
-		layer.addMapLayerListener(new MapLayerAdapter() {
-			@Override
-			public void layerChanged(MapLayerEvent e) {
-				// Bezeichnung der Checkbox aendern
-				setTitle(frameTitle + " [" + layer.getTitle() + "]");
+		if (layer != null) {
+			layer.addMapLayerListener(new MapLayerAdapter() {
+				@Override
+				public void layerChanged(MapLayerEvent e) {
+					// Bezeichnung der Checkbox aendern
+					setTitle(frameTitle + " [" + layer.getTitle() + "]");
+				}
+			});
+		}
+	}
+
+	/**
+	 * Stefan 11'2010: Added a system of WEAK refernced listeners to this class.
+	 * Allows to use the dialog without a MapPane or MapLayer.
+	 * 
+	 * @param newFilter
+	 */
+	protected void fireFilterChangedEvent(Filter newFilter) {
+		for (final FilterChangeListener l : listeners) {
+			// LOGGER.debug("fires a StyleChangedEvent... ");
+			try {
+				l.changed(newFilter);
+			} catch (Exception e) {
+				LOGGER.error(e);
 			}
-		});
+		}
 	}
 
 	public FeatureCollectionFilterPanel getFilterPanel() {

Added: trunk/src/schmitzm/geotools/gui/FilterChangeListener.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/FilterChangeListener.java	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src/schmitzm/geotools/gui/FilterChangeListener.java	2010-11-15 00:53:55 UTC (rev 1272)
@@ -0,0 +1,8 @@
+package schmitzm.geotools.gui;
+
+import org.opengis.filter.Filter;
+
+public interface FilterChangeListener {
+	public void changed(Filter newFilter);
+
+}


Property changes on: trunk/src/schmitzm/geotools/gui/FilterChangeListener.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties	2010-11-15 00:53:55 UTC (rev 1272)
@@ -183,3 +183,10 @@
 
 CRSLabel=Map shown in\: ${0} 
 CRSLabel.TT=Shows the coordinate reference system (CRS) of the map. 
+
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.VariableName = Variable
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Description = Description
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Name = Name
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Unit = Unit
+AtlasFeatureLayerFilterDialog.WindowTitle = Filter by attribute: ${0}
+FilterTableCellEditor.FilterDialogTitle = Filter for ${0} (${1}), ${2}
\ No newline at end of file

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties	2010-11-15 00:53:55 UTC (rev 1272)
@@ -182,3 +182,9 @@
 SearchMapDialog.title=Durchsuche Karte: ${0}
 SearchMapDialog.Explanation=<html>Es werden alle <b>Beschriftungen</b> dieser Karte durchsucht.</html> 
 
+
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Description=Beschreibung
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Name=Name
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Unit=Einheit\t
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.VariableName=Variable
+AtlasFeatureLayerFilterDialog.WindowTitle=Attributfilter\: ${0}

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_fr.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_fr.properties	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_fr.properties	2010-11-15 00:53:55 UTC (rev 1272)
@@ -178,3 +178,9 @@
 schmitzm.geotools.gui.GridPanelFormatter_DHDN.title= DHDN - 1,234,567 (H|R)
 schmitzm.geotools.gui.GridPanelFormatter_LatLon1.title= Degr\u00E9\u00B0 Minute' (N|O|S|W)
 schmitzm.geotools.gui.MapActionControlPane.INFO= Info
+
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Description = description
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Name = nom
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Unit = unit\u00E9
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.VariableName = variable
+AtlasFeatureLayerFilterDialog.WindowTitle = Filtre par attribute\: ${0} 

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_ru.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_ru.properties	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_ru.properties	2010-11-15 00:53:55 UTC (rev 1272)
@@ -169,3 +169,9 @@
 SearchMapDialog.searchString.Label=\u0412\u0432\u0435\u0441\u0442\u0438 \u043F\u043E\u0438\u0441\u043A\u043E\u0432\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443\:
 SearchMapDialog.searchString.tt=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442 \u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 [Enter \u0438\u043B\u0438 Return].
 SearchMapDialog.title=\u041F\u043E\u0438\u0441\u043A \u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439 \u043D\u0430 \u043A\u0430\u0440\u0442\u0435\: ${0}
+
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Description=\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Name=\u0418\u043C\u044F
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.Unit=\u0415\u0434.\u0438\u0437\u043C.
+AtlasFeatureLayerFilterDialog.AttributeTableHeader.VariableName=\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F
+AtlasFeatureLayerFilterDialog.WindowTitle=\u0424\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u043F\u043E \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443\: ${0}

Added: trunk/src_junit/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialogTest.java
===================================================================
--- trunk/src_junit/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialogTest.java	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src_junit/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialogTest.java	2010-11-15 00:53:55 UTC (rev 1272)
@@ -0,0 +1,45 @@
+package org.geopublishing.atlasViewer.swing;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.opengis.filter.Filter;
+
+import schmitzm.geotools.gui.FilterChangeListener;
+import schmitzm.swing.TestingUtil;
+import skrueger.geotools.StyledFS;
+
+public class AtlasFeatureLayerFilterDialogTest {
+
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	@After
+	public void tearDown() throws Exception {
+	}
+
+	@Test
+	public void testShowGuiWithoutMapLayerNorMapPane() throws Throwable {
+
+		if (!TestingUtil.isInteractive())
+			return;
+
+		StyledFS sf = TestingUtil.TestDatasetsVector.countryShp.getStyledFS();
+
+		AtlasFeatureLayerFilterDialog d = new AtlasFeatureLayerFilterDialog(
+				null, sf);
+
+		FilterChangeListener listener = new FilterChangeListener() {
+
+			@Override
+			public void changed(Filter newFilter) {
+				System.out.println("JA");
+			}
+		};
+		d.addListener(listener);
+
+		TestingUtil.testGui(d, 40);
+
+	}
+}


Property changes on: trunk/src_junit/org/geopublishing/atlasViewer/swing/AtlasFeatureLayerFilterDialogTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native

Added: trunk/src_junit/schmitzm/swing/PopupListener.java
===================================================================
--- trunk/src_junit/schmitzm/swing/PopupListener.java	2010-11-14 23:06:23 UTC (rev 1271)
+++ trunk/src_junit/schmitzm/swing/PopupListener.java	2010-11-15 00:53:55 UTC (rev 1272)
@@ -0,0 +1,31 @@
+//package schmitzm.swing;
+//
+//import java.awt.event.MouseAdapter;
+//import java.awt.event.MouseEvent;
+//
+//import javax.swing.JPopupMenu;
+//
+//public class PopupListener extends MouseAdapter {
+//
+//	private final JPopupMenu popup;
+//
+//	public PopupListener(JPopupMenu popup) {
+//		this.popup = popup;
+//	}
+//
+//	@Override
+//	public void mousePressed(MouseEvent e) {
+//		showPopup(e);
+//	}
+//
+//	@Override
+//	public void mouseReleased(MouseEvent e) {
+//		showPopup(e);
+//	}
+//
+//	private void showPopup(MouseEvent e) {
+//		if (e.isPopupTrigger()) {
+//			popup.show(e.getComponent(), e.getX(), e.getY());
+//		}
+//	}
+// }


Property changes on: trunk/src_junit/schmitzm/swing/PopupListener.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native



More information about the Schmitzm-commits mailing list