/[schmitzm]/branches/2.1/src/skrueger/geotools/selection/FeatureMapLayerSelectionSynchronizer.java
ViewVC logotype

Diff of /branches/2.1/src/skrueger/geotools/selection/FeatureMapLayerSelectionSynchronizer.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 101 by alfonx, Fri May 8 13:17:02 2009 UTC
# Line 22  import javax.swing.JTable; Line 22  import javax.swing.JTable;
22  import javax.swing.ListSelectionModel;  import javax.swing.ListSelectionModel;
23  import javax.swing.event.ListSelectionEvent;  import javax.swing.event.ListSelectionEvent;
24  import javax.swing.event.ListSelectionListener;  import javax.swing.event.ListSelectionListener;
25    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.Rule;
30    import org.geotools.styling.RuleImpl;
31  import org.geotools.styling.Style;  import org.geotools.styling.Style;
32    import org.geotools.styling.StyleImpl;
33    import org.opengis.filter.Filter;
34    import org.opengis.filter.FilterVisitor;
35    import org.opengis.layer.StyleURL;
36    
37  import schmitzm.geotools.gui.FeatureCollectionTableModel;  import schmitzm.geotools.gui.FeatureCollectionTableModel;
38  import schmitzm.geotools.gui.JMapPane;  import schmitzm.geotools.gui.JMapPane;
# Line 129  public class FeatureMapLayerSelectionSyn Line 136  public class FeatureMapLayerSelectionSyn
136                  try {                  try {
137                          if (newSelection.isEmpty()) {                          if (newSelection.isEmpty()) {
138    
                                 LOGGER.debug("NO SELECTION");  
139                                  selectionMapStyle = styledMapLayer.getStyle();                                  selectionMapStyle = styledMapLayer.getStyle();
140                                    LOGGER.debug("NO SELECTION .. reset original style");
141                                    
142                          } else {                          } else {
143                                  LOGGER.debug("SELECTION EXISTEnT");                                  LOGGER.debug("SELECTION .. change style");
144                                  selectionMapStyle = StylingUtil                                  
145                                                  .createDefaultStyle(styledMapLayer.getGeoObject());                                  Style originalStyle = styledMapLayer.getStyle();
146                                    
147                                    // TODO This clone is a deep clone and it is slow..
148                                    selectionMapStyle =  StylingUtil.clone(originalStyle);
149                                    
150                                    Rule[] rules = selectionMapStyle.getFeatureTypeStyles()[0].getRules();
151                                    
152                                    Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule();
153                                    selectedRule.setFilter(new Filter() {
154    
155                                            @Override
156                                            public Object accept(FilterVisitor visitor, Object extraData) {
157                                                    return null;
158                                            }
159    
160                                            @Override
161                                            public boolean evaluate(Object obj) {
162                                                    
163                                                    return false;
164                                            }
165                                            
166                                    });
167                                    
168                                    
169    //                              selectionMapStyle.setFeatureTypeStyles(originalStyle.getF)
170                                    
171                                    // Flat copy the style
172                                    
173                                    
174                                    
175                                    
176                          }                          }
177    
178                          mapLayer.setStyle(selectionMapStyle);                          mapLayer.setStyle(selectionMapStyle);

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26