/[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 106 by alfonx, Fri May 8 15:13:49 2009 UTC revision 109 by mojays, Tue May 12 13:14:26 2009 UTC
# Line 26  import javax.swing.text.Utilities; Line 26  import javax.swing.text.Utilities;
26    
27  import org.geotools.feature.Feature;  import org.geotools.feature.Feature;
28  import org.geotools.map.MapLayer;  import org.geotools.map.MapLayer;
29    import org.geotools.styling.PolygonSymbolizer;
30  import org.geotools.styling.Rule;  import org.geotools.styling.Rule;
31  import org.geotools.styling.RuleImpl;  import org.geotools.styling.RuleImpl;
32  import org.geotools.styling.Style;  import org.geotools.styling.Style;
# Line 35  import org.opengis.filter.Filter; Line 36  import org.opengis.filter.Filter;
36  import org.opengis.filter.FilterVisitor;  import org.opengis.filter.FilterVisitor;
37  import org.opengis.layer.StyleURL;  import org.opengis.layer.StyleURL;
38    
39    import schmitzm.geotools.FilterUtil;
40  import schmitzm.geotools.gui.FeatureCollectionTableModel;  import schmitzm.geotools.gui.FeatureCollectionTableModel;
41  import schmitzm.geotools.gui.JMapPane;  import schmitzm.geotools.gui.JMapPane;
42  import schmitzm.geotools.map.event.FeatureSelectedEvent;  import schmitzm.geotools.map.event.FeatureSelectedEvent;
# Line 147  public class FeatureMapLayerSelectionSyn Line 149  public class FeatureMapLayerSelectionSyn
149                                  Style originalStyle = styledMapLayer.getStyle();                                  Style originalStyle = styledMapLayer.getStyle();
150    
151                                  // TODO This clone is a deep clone and it is slow..                                  // TODO This clone is a deep clone and it is slow..
152                                  selectionMapStyle = StylingUtil.clone(originalStyle);                                  selectionMapStyle = StylingUtil
   
                                 // TODO BAD CODE  
                                 Style defaultStyle = StylingUtil  
153                                                  .createDefaultStyle(styledMapLayer.getGeoObject());                                                  .createDefaultStyle(styledMapLayer.getGeoObject());
154                                    
155    //                              Symbolizer sss = selectionMapStyle.getFeatureTypeStyles()[0].getRules()[0].getSymbolizers()[0];
156    //                              if (sss instanceof PolygonSymbolizer) {
157    //                                      PolygonSymbolizer ps = (PolygonSymbolizer) sss;
158    //                                      ps.getFill().setOpacity( FilterUtil.FILTER_FAC.literal(0.5));
159    //                              }
160    
161                                  // Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule();                                  // Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule();
162                                  defaultStyle.getFeatureTypeStyles()[0].getRules()[0]                                  selectionMapStyle.getFeatureTypeStyles()[0].getRules()[0]
163                                                  .setFilter(new Filter() {                                                  .setFilter(new Filter() {
164    
165                                                          @Override                                                          @Override
# Line 181  public class FeatureMapLayerSelectionSyn Line 186  public class FeatureMapLayerSelectionSyn
186                                                  });                                                  });
187    
188                                  selectionMapStyle.setFeatureTypeStyles(LangUtil.extendArray(                                  selectionMapStyle.setFeatureTypeStyles(LangUtil.extendArray(
189                                                  selectionMapStyle.getFeatureTypeStyles(), defaultStyle                                                  originalStyle
190                                                                  .getFeatureTypeStyles()[0]));                                                                  .getFeatureTypeStyles(), selectionMapStyle.getFeatureTypeStyles()));
191    
192                                  // selectionMapStyle.setFeatureTypeStyles(originalStyle.getF)                                  // selectionMapStyle.setFeatureTypeStyles(originalStyle.getF)
193    
# Line 221  public class FeatureMapLayerSelectionSyn Line 226  public class FeatureMapLayerSelectionSyn
226  //                      LOGGER.debug("Ignoring event " + e);  //                      LOGGER.debug("Ignoring event " + e);
227                          return;                          return;
228                  }                  }
229                    // only listen to events directly coming from JMapPane
230                    // selection (ignore selections from FilterDialog)
231                    if ( e.getSourceObject() != this.mapPane )
232                      return;
233                    
234                  FeatureSelectedEvent fse = (FeatureSelectedEvent) e;                  FeatureSelectedEvent fse = (FeatureSelectedEvent) e;
235  //              LOGGER.debug("Do event " + fse);  //              LOGGER.debug("Do event " + fse);
236  //              LOGGER.debug("Do event " + fse.getSelectionResult());  //              LOGGER.debug("Do event " + fse.getSelectionResult());

Legend:
Removed from v.106  
changed lines
  Added in v.109

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26