[Schmitzm-commits] r487 - in branches/1.0-gt2-2.6/src: schmitzm/geotools/gui schmitzm/jfree/chart/selection schmitzm/jfree/chart/style skrueger/geotools/selection skrueger/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Oct 20 20:33:55 CEST 2009


Author: alfonx
Date: 2009-10-20 20:33:53 +0200 (Tue, 20 Oct 2009)
New Revision: 487

Modified:
   branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureTablePane.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/GeoMapPane.java
   branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/selection/AbstractDatasetSelectionModel.java
   branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/style/ChartPlotStyle.java
   branches/1.0-gt2-2.6/src/skrueger/geotools/selection/ChartSelectionSynchronizer.java
   branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java
   branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java
Log:
* Improved listener & synchronizer dependencies in the Chart/Selection module.

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureTablePane.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureTablePane.java	2009-10-20 16:25:26 UTC (rev 486)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/FeatureTablePane.java	2009-10-20 18:33:53 UTC (rev 487)
@@ -44,7 +44,6 @@
 import javax.swing.event.ListSelectionListener;
 import javax.swing.event.TableModelEvent;
 import javax.swing.event.TableModelListener;
-import javax.swing.table.TableModel;
 
 import org.apache.log4j.Logger;
 import org.geotools.feature.FeatureCollection;
@@ -55,7 +54,6 @@
 import org.opengis.feature.simple.SimpleFeatureType;
 
 import schmitzm.geotools.feature.AttributeTypeFilter;
-import schmitzm.geotools.feature.FeatureTableModel;
 import schmitzm.geotools.feature.FeatureUtil;
 import schmitzm.geotools.styling.StylingUtil;
 import schmitzm.swing.JPanel;

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/GeoMapPane.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/GeoMapPane.java	2009-10-20 16:25:26 UTC (rev 486)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/gui/GeoMapPane.java	2009-10-20 18:33:53 UTC (rev 487)
@@ -41,6 +41,7 @@
 import org.geotools.map.MapContext;
 import org.geotools.renderer.GTRenderer;
 import org.geotools.renderer.lite.StreamingRenderer;
+import org.geotools.renderer.shape.ShapefileRenderer;
 
 import schmitzm.geotools.GTUtil;
 import schmitzm.geotools.map.event.JMapPaneEvent;

Modified: branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/selection/AbstractDatasetSelectionModel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/selection/AbstractDatasetSelectionModel.java	2009-10-20 16:25:26 UTC (rev 486)
+++ branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/selection/AbstractDatasetSelectionModel.java	2009-10-20 18:33:53 UTC (rev 487)
@@ -33,9 +33,9 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.Vector;
 
 import org.apache.log4j.Logger;
+import org.geotools.util.WeakHashSet;
 import org.jfree.data.general.Dataset;
 import org.jfree.data.general.DatasetChangeListener;
 import org.jfree.data.general.SeriesDataset;
@@ -67,7 +67,7 @@
   protected Map<E,Set<F>> selectedSeriesIdx = new HashMap<E,Set<F>>();
   
   /** Holds the listeners to the {@link DatasetSelectionModel}. */
-  protected Vector<DatasetSelectionListener> listeners = new Vector<DatasetSelectionListener>();
+  protected WeakHashSet<DatasetSelectionListener> listeners = new WeakHashSet<DatasetSelectionListener>(DatasetSelectionListener.class);
 
   /** Indicates whether a selection change is a part of multiple
    *  changes. If {@code true} {@link #refreshSelection()} has NO effect

Modified: branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/style/ChartPlotStyle.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/style/ChartPlotStyle.java	2009-10-20 16:25:26 UTC (rev 486)
+++ branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/style/ChartPlotStyle.java	2009-10-20 18:33:53 UTC (rev 487)
@@ -35,13 +35,9 @@
 import org.apache.log4j.Category;
 import org.jfree.chart.plot.CategoryMarker;
 import org.jfree.chart.plot.CategoryPlot;
-import org.jfree.chart.plot.Marker;
 import org.jfree.chart.plot.Plot;
 import org.jfree.chart.plot.ValueMarker;
 import org.jfree.chart.plot.XYPlot;
-import org.jfree.data.Range;
-import org.jfree.data.xy.XYSeries;
-import org.jfree.data.xy.XYSeriesCollection;
 import org.jfree.ui.Layer;
 import org.jfree.ui.RectangleInsets;
 

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/selection/ChartSelectionSynchronizer.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/selection/ChartSelectionSynchronizer.java	2009-10-20 16:25:26 UTC (rev 486)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/selection/ChartSelectionSynchronizer.java	2009-10-20 18:33:53 UTC (rev 487)
@@ -88,6 +88,11 @@
    */
   @Override
   public void propertyChange(PropertyChangeEvent evt) {
+	 
+	if (!isEnabled()) {
+		return;
+	}
+	  
     if (!(evt instanceof StyledLayerSelectionEvent))
       return;
     StyledLayerSelectionEvent selEvt = (StyledLayerSelectionEvent) evt;

Modified: branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java	2009-10-20 16:25:26 UTC (rev 486)
+++ branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java	2009-10-20 18:33:53 UTC (rev 487)
@@ -5,15 +5,14 @@
 import javax.swing.JButton;
 
 public class SmallButton extends JButton {
-	
+
 	public SmallButton() {
 		setBorder(BorderFactory.createEtchedBorder());
 	}
 
 	public SmallButton(Action action, String tooltip) {
-		this (action);
-		if (tooltip != null)
-			setToolTipText(tooltip);
+		this(action);
+		setToolTipText(tooltip);
 	}
 
 	public SmallButton(Action action) {

Modified: branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java	2009-10-20 16:25:26 UTC (rev 486)
+++ branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java	2009-10-20 18:33:53 UTC (rev 487)
@@ -2,7 +2,6 @@
 
 import javax.swing.Action;
 import javax.swing.BorderFactory;
-import javax.swing.JButton;
 import javax.swing.JToggleButton;
 
 public class SmallToggleButton extends JToggleButton{



More information about the Schmitzm-commits mailing list