/[schmitzm]/branches/2.0-RC2/src/skrueger/geotools/selection/StyledLayerSelectionModelSynchronizer.java
ViewVC logotype

Diff of /branches/2.0-RC2/src/skrueger/geotools/selection/StyledLayerSelectionModelSynchronizer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 96 by alfonx, Fri May 8 11:23:16 2009 UTC revision 151 by alfonx, Fri Jun 19 16:22:29 2009 UTC
# Line 4  import java.beans.PropertyChangeListener Line 4  import java.beans.PropertyChangeListener
4    
5  import javax.swing.ListSelectionModel;  import javax.swing.ListSelectionModel;
6    
7  import skrueger.geotools.selection.StyledLayerSelectionModel;  import org.apache.log4j.Logger;
8    
9    /**
10     * The {@link StyledLayerSelectionModelSynchronizer} is the super class for all
11     *
12     * @author mojays
13     *
14     * @param <E>
15     *            The concrete implementation of {@link StyledLayerSelectionModel}
16     *            that this Synchronizer works on.
17     */
18    public abstract class StyledLayerSelectionModelSynchronizer<E extends StyledLayerSelectionModel<?>>
19                    implements PropertyChangeListener {
20            protected final Logger LOGGER = Logger.getLogger(this.getClass());
21    
22            /**
23             * Flag to avoid event circles between {@link DpLayerVectorSelectionModel}
24             * and {@link ListSelectionModel} of the feature table.
25             */
26            protected boolean selectionChangeCausedByMe = false;
27            /**
28             * Holds the selection model of the layer to keep synchronized with the
29             * feature table.
30             */
31            protected final E layerSelModel;
32    
33            /**
34             * Allows to enable/disable the Synchronizer's functionality it.
35             */
36            private boolean enabled = true;
37    
38            /**
39             * Creates a new synchronizer
40             *
41             * @param layerSelModel
42             *            layer selection model to keep synchronized with
43             */
44            protected StyledLayerSelectionModelSynchronizer(E layerSelModel) {
45    
46                    this.layerSelModel = layerSelModel;
47            }
48    
49            /**
50             * Allows to disable this Synchronizer. Used to disable the selection
51             * functionality if no corresponding dialog is open.
52             *
53             * @param enabled
54             *            <code>true</code> or <code>false</code>
55             */
56            public void setEnabled(boolean enabled) {
57                    this.enabled = enabled;
58            }
59    
60            public boolean isEnabled() {
61                    return enabled;
62            }
63    
 public abstract class StyledLayerSelectionModelSynchronizer<E> implements PropertyChangeListener{  
           
           /** Flag to avoid event circles between {@link DpLayerVectorSelectionModel}  
            *  and {@link ListSelectionModel} of the feature table. */  
           protected boolean selectionChangeCausedByMe = false;  
           /** Holds the selection model of the layer to keep synchronized  
            *  with the feature table. */  
           protected final StyledLayerSelectionModel<E> layerSelModel;  
   
           /**  
                  * Creates a new synchronizer  
                  *  
                  * @param layerSelModel  
                  *            layer selection model to keep synchronized with  
                  */  
                 protected StyledLayerSelectionModelSynchronizer(  
                                 StyledLayerSelectionModel<E> layerSelModel) {  
   
                         this.layerSelModel = layerSelModel;  
                 }  
             
64  }  }

Legend:
Removed from v.96  
changed lines
  Added in v.151

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26