/[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 125 by alfonx, Sat May 23 11:33:59 2009 UTC revision 128 by alfonx, Sat May 30 16:27:26 2009 UTC
# Line 24  import javax.swing.ListSelectionModel; Line 24  import javax.swing.ListSelectionModel;
24  import javax.swing.event.ListSelectionListener;  import javax.swing.event.ListSelectionListener;
25    
26  import org.geotools.feature.Feature;  import org.geotools.feature.Feature;
 import org.geotools.feature.FeatureCollection;  
27  import org.geotools.map.MapLayer;  import org.geotools.map.MapLayer;
28  import org.geotools.styling.FeatureTypeStyle;  import org.geotools.styling.FeatureTypeStyle;
29  import org.geotools.styling.Style;  import org.geotools.styling.Style;
# Line 150  public class FeatureMapLayerSelectionSyn Line 149  public class FeatureMapLayerSelectionSyn
149                                  // TODO The default style is not good here. We need                                  // TODO The default style is not good here. We need
150                                  // .createSelectionStyle(normalStyle, geoObj);                                  // .createSelectionStyle(normalStyle, geoObj);
151                                  selectionMapStyle = StylingUtil                                  selectionMapStyle = StylingUtil
152                                                  .createDefaultStyle(styledMapLayer.getGeoObject());                                                  .createSelectionStyle(styledMapLayer.getGeoObject());
153    //                              selectionMapStyle = StylingUtil
154    //                              .createDefaultStyle(styledMapLayer.getGeoObject());
155    
156                                  selectionMapStyle.getFeatureTypeStyles()[0]                                  selectionMapStyle.getFeatureTypeStyles()[0]
157                                                  .setName(SELECTION_STYLING);                                                  .setName(SELECTION_STYLING);
158    
                                 // Symbolizer sss =  
                                 // selectionMapStyle.getFeatureTypeStyles()[0].getRules()[0].getSymbolizers()[0];  
                                 // if (sss instanceof PolygonSymbolizer) {  
                                 // PolygonSymbolizer ps = (PolygonSymbolizer) sss;  
                                 // ps.getFill().setOpacity( FilterUtil.FILTER_FAC.literal(0.5));  
                                 // }  
   
159                                  // Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule();                                  // Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule();
160                                  selectionMapStyle.getFeatureTypeStyles()[0].getRules()[0]                                  selectionMapStyle.getFeatureTypeStyles()[0].getRules()[0]
161                                                  .setFilter(new Filter() {                                                  .setFilter(new Filter() {
# Line 202  public class FeatureMapLayerSelectionSyn Line 196  public class FeatureMapLayerSelectionSyn
196                                  } else {                                  } else {
197                                          newFeatureTypes = originalFeatureTypeStyles;                                          newFeatureTypes = originalFeatureTypeStyles;
198                                  }                                  }
199                                  //                                                                
                                 // // REMOVE any Selection_Styling FTS (usually the last one)  
                                 //                                
                                 // for (FeatureTypeStyle fts : originalFeatureTypeStyles){  
                                 // if (fts.getName().equals(SELECTION_STYLING)) continue;  
                                 // newFeatureTypes =  
                                 //                                        
                                 // LangUtil.extendArray(  
                                 // originalFeatureTypeStyles, selectionMapStyle  
                                 // .getFeatureTypeStyles());  
                                 // }  
   
200                                  // The last FTS is the selection FTS                                  // The last FTS is the selection FTS
201                                  newFeatureTypes = LangUtil.extendArray(newFeatureTypes,                                  newFeatureTypes = LangUtil.extendArray(newFeatureTypes,
202                                                  selectionMapStyle.getFeatureTypeStyles());                                                  selectionMapStyle.getFeatureTypeStyles());
203    
204                                  selectionMapStyle.setFeatureTypeStyles(newFeatureTypes);                                  selectionMapStyle.setFeatureTypeStyles(newFeatureTypes);
205    
                                 // selectionMapStyle.setFeatureTypeStyles(originalStyle.getF)  
   
                                 // Flat copy the style  
   
                                 // selectionMapStyle =  
                                 // StylingUtil.createDefaultStyle(styledMapLayer.getGeoObject());  
   
206                          }                          }
207    
208                          mapLayer.setStyle(selectionMapStyle);                          mapLayer.setStyle(selectionMapStyle);

Legend:
Removed from v.125  
changed lines
  Added in v.128

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26