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; |
141 |
|
|
142 |
} else { |
} else { |
143 |
LOGGER.debug("SELECTION .. change style"); |
LOGGER.debug("SELECTION .. change style"); |
|
selectionMapStyle = StylingUtil |
|
|
.createDefaultStyle(styledMapLayer.getGeoObject()); |
|
144 |
|
|
145 |
selectionMapStyle = styledMapLayer.getStyle(); |
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 |
|
|