/[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 97 by alfonx, Fri May 8 12:10:42 2009 UTC revision 151 by alfonx, Fri Jun 19 16:22:29 2009 UTC
# Line 6  import javax.swing.ListSelectionModel; Line 6  import javax.swing.ListSelectionModel;
6    
7  import org.apache.log4j.Logger;  import org.apache.log4j.Logger;
8    
9  import skrueger.geotools.selection.StyledLayerSelectionModel;  /**
10     * The {@link StyledLayerSelectionModelSynchronizer} is the super class for all
11  public abstract class StyledLayerSelectionModelSynchronizer<E> implements PropertyChangeListener{   *
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());          protected final Logger LOGGER = Logger.getLogger(this.getClass());
21            
22            /** Flag to avoid event circles between {@link DpLayerVectorSelectionModel}          /**
23             *  and {@link ListSelectionModel} of the feature table. */           * Flag to avoid event circles between {@link DpLayerVectorSelectionModel}
24            protected boolean selectionChangeCausedByMe = false;           * and {@link ListSelectionModel} of the feature table.
25            /** Holds the selection model of the layer to keep synchronized           */
26             *  with the feature table. */          protected boolean selectionChangeCausedByMe = false;
27            protected final StyledLayerSelectionModel<E> layerSelModel;          /**
28             * Holds the selection model of the layer to keep synchronized with the
29            /**           * feature table.
30                   * Creates a new synchronizer           */
31                   *          protected final E layerSelModel;
32                   * @param layerSelModel  
33                   *            layer selection model to keep synchronized with          /**
34                   */           * Allows to enable/disable the Synchronizer's functionality it.
35                  protected StyledLayerSelectionModelSynchronizer(           */
36                                  StyledLayerSelectionModel<E> layerSelModel) {          private boolean enabled = true;
37    
38                          this.layerSelModel = layerSelModel;          /**
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    
64  }  }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26