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

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

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

revision 158 by alfonx, Mon Jun 22 13:45:32 2009 UTC revision 224 by alfonx, Tue Jul 14 15:57:19 2009 UTC
# Line 26  import javax.swing.ListSelectionModel; Line 26  import javax.swing.ListSelectionModel;
26  import javax.swing.event.ListSelectionListener;  import javax.swing.event.ListSelectionListener;
27    
28  import org.geotools.feature.Feature;  import org.geotools.feature.Feature;
 import org.geotools.filter.FidFilter;  
 import org.geotools.filter.FidFilterImpl;  
29  import org.geotools.map.MapLayer;  import org.geotools.map.MapLayer;
30  import org.geotools.styling.FeatureTypeStyle;  import org.geotools.styling.FeatureTypeStyle;
31  import org.geotools.styling.Style;  import org.geotools.styling.Style;
 import org.opengis.filter.Filter;  
 import org.opengis.filter.FilterVisitor;  
32  import org.opengis.filter.identity.FeatureId;  import org.opengis.filter.identity.FeatureId;
33    
34  import schmitzm.geotools.FilterUtil;  import schmitzm.geotools.FilterUtil;
# Line 43  import schmitzm.geotools.map.event.JMapP Line 39  import schmitzm.geotools.map.event.JMapP
39  import schmitzm.geotools.styling.StylingUtil;  import schmitzm.geotools.styling.StylingUtil;
40  import schmitzm.lang.LangUtil;  import schmitzm.lang.LangUtil;
41  import skrueger.geotools.MapPaneToolBar;  import skrueger.geotools.MapPaneToolBar;
42  import skrueger.geotools.StyledMapInterface;  import skrueger.geotools.StyledLayerInterface;
43    
44  /**  /**
45   * This class keeps the selection of a (feature) {@link JTable} synchronized   * This class keeps the selection of a (feature) {@link JTable} synchronized
# Line 72  public class FeatureMapLayerSelectionSyn Line 68  public class FeatureMapLayerSelectionSyn
68           * model.           * model.
69           */           */
70          protected final MapLayer mapLayer;          protected final MapLayer mapLayer;
71          protected final StyledMapInterface<?> styledMapLayer;          protected final StyledLayerInterface<?> styledLayer;
72          protected final JMapPane mapPane;          protected final JMapPane mapPane;
73          private final MapPaneToolBar toolBar;          private final MapPaneToolBar toolBar;
74    
# Line 88  public class FeatureMapLayerSelectionSyn Line 84  public class FeatureMapLayerSelectionSyn
84           */           */
85          public FeatureMapLayerSelectionSynchronizer(          public FeatureMapLayerSelectionSynchronizer(
86                          StyledFeatureLayerSelectionModel layerSelModel,                          StyledFeatureLayerSelectionModel layerSelModel,
87                          StyledMapInterface<?> styledMapLayer, MapLayer mapLayer,                          StyledLayerInterface<?> styledLayer, MapLayer mapLayer,
88                          JMapPane mapPane, MapPaneToolBar toolBar) {                          JMapPane mapPane, MapPaneToolBar toolBar) {
89    
90                  super(layerSelModel);                  super(layerSelModel);
91                  this.styledMapLayer = styledMapLayer;                  this.styledLayer = styledLayer;
92    
93                  this.mapLayer = mapLayer;                  this.mapLayer = mapLayer;
94                  this.mapPane = mapPane;                  this.mapPane = mapPane;
# Line 149  public class FeatureMapLayerSelectionSyn Line 145  public class FeatureMapLayerSelectionSyn
145                  try {                  try {
146                          if (newSelection.isEmpty()) {                          if (newSelection.isEmpty()) {
147    
148                                  selectionMapStyle = styledMapLayer.getStyle();                                  selectionMapStyle = styledLayer.getStyle();
149                                  // LOGGER.debug("NO SELECTION .. set to original style directly");                                  // LOGGER.debug("NO SELECTION .. set to original style directly");
150    
151                          } else {                          } else {
152                                  LOGGER.debug("SELECTION .. change style");                                  LOGGER.debug("SELECTION .. change style");
153    
154                                  // We take Style from the MapLayer that is displayed at the                                  // We take Style from the MapLayer that is displayed at the
155                                  // moment. We do not use the styledMapLayer.getStyle, because in                                  // moment. We do not use the styledLayer.getStyle, because in
156                                  // the atlas, this always return the default style, but                                  // the atlas, this always return the default style, but
157                                  // additionaly styles might be selected.                                  // additional styles might be selected.
158                                  // Taking the style from the mapLayer indicated, that we have to                                  // Taking the style from the mapLayer indicated, that we have to
159                                  // remove any selection rules first.                                  // remove any selection rules first.
160                                  Style originalStyle = mapLayer.getStyle();                                  Style originalStyle = mapLayer.getStyle();
# Line 166  public class FeatureMapLayerSelectionSyn Line 162  public class FeatureMapLayerSelectionSyn
162                                  // TODO The default style is not good here. We need                                  // TODO The default style is not good here. We need
163                                  // .createSelectionStyle(normalStyle, geoObj);                                  // .createSelectionStyle(normalStyle, geoObj);
164                                  selectionMapStyle = StylingUtil                                  selectionMapStyle = StylingUtil
165                                                  .createSelectionStyle(styledMapLayer.getGeoObject());                                                  .createSelectionStyle(styledLayer.getGeoObject());
166                                  // selectionMapStyle = StylingUtil                                  // selectionMapStyle = StylingUtil
167                                  // .createDefaultStyle(styledMapLayer.getGeoObject());                                  // .createDefaultStyle(styledLayer.getGeoObject());
168    
169                                  selectionMapStyle.getFeatureTypeStyles()[0]                                  selectionMapStyle.getFeatureTypeStyles()[0]
170                                                  .setName(SELECTION_STYLING);                                                  .setName(SELECTION_STYLING);

Legend:
Removed from v.158  
changed lines
  Added in v.224

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26