149 |
// TODO This clone is a deep clone and it is slow.. |
// TODO This clone is a deep clone and it is slow.. |
150 |
selectionMapStyle = StylingUtil.clone(originalStyle); |
selectionMapStyle = StylingUtil.clone(originalStyle); |
151 |
|
|
|
Rule[] rules = selectionMapStyle.getFeatureTypeStyles()[0].getRules(); |
|
152 |
|
|
153 |
Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule(); |
Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule(); |
154 |
selectedRule.setFilter(new Filter() { |
selectedRule.setFilter(new Filter() { |
163 |
if (obj instanceof Feature) { |
if (obj instanceof Feature) { |
164 |
Feature f = (Feature)obj; |
Feature f = (Feature)obj; |
165 |
LOGGER.info("treffer"); |
LOGGER.info("treffer"); |
166 |
return newSelection.contains(f); |
// TODO BAD CODE |
167 |
|
for (Feature ff : newSelection){ |
168 |
|
if (ff.getID().equals(f.getID())) return true; |
169 |
|
} |
170 |
|
return false; |
171 |
|
|
172 |
} |
} |
173 |
LOGGER.info("kein treffer"); |
LOGGER.info("kein treffer"); |
176 |
|
|
177 |
}); |
}); |
178 |
|
|
179 |
Symbolizer[] symbolizers = selectedRule.getSymbolizers(); |
Style defaultStyle = StylingUtil.createDefaultStyle(styledMapLayer.getGeoObject()); |
180 |
Style selectedStyle = StylingUtil.createDefaultStyle(styledMapLayer.getGeoObject()); |
selectedRule.setSymbolizers(new Symbolizer[] {defaultStyle.getFeatureTypeStyles()[0].getRules()[0].getSymbolizers()[0]} ); |
181 |
LangUtil.extendArray(symbolizers, selectedStyle); |
|
182 |
selectedRule.setSymbolizers(symbolizers); |
Rule[] rules = selectionMapStyle.getFeatureTypeStyles()[0].getRules(); |
183 |
|
rules = LangUtil.extendArray(rules, selectedRule); |
184 |
|
|
185 |
LangUtil.extendArray(rules, selectedRule); |
selectionMapStyle.getFeatureTypeStyles()[0].setRules(rules); |
186 |
|
|
187 |
// selectionMapStyle.setFeatureTypeStyles(originalStyle.getF) |
// selectionMapStyle.setFeatureTypeStyles(originalStyle.getF) |
188 |
|
|
189 |
// Flat copy the style |
// Flat copy the style |
190 |
|
|
191 |
|
// selectionMapStyle = StylingUtil.createDefaultStyle(styledMapLayer.getGeoObject()); |
192 |
|
|
193 |
|
|
194 |
} |
} |
216 |
|
|
217 |
@Override |
@Override |
218 |
public void performMapPaneEvent(JMapPaneEvent e) { |
public void performMapPaneEvent(JMapPaneEvent e) { |
219 |
if (!(e instanceof FeatureSelectedEvent)) |
|
220 |
|
if (!(e instanceof FeatureSelectedEvent)) { |
221 |
|
LOGGER.debug("Ignoring event "+e); |
222 |
return; |
return; |
223 |
|
} |
224 |
|
|
225 |
FeatureSelectedEvent fse = (FeatureSelectedEvent) e; |
FeatureSelectedEvent fse = (FeatureSelectedEvent) e; |
226 |
|
LOGGER.debug("Do event "+fse); |
227 |
|
LOGGER.debug("Do event "+fse.getSelectionResult()); |
228 |
|
|
229 |
// ignore event if it is caused by the DpLayerVectorSelectionModel |
// ignore event if it is caused by the DpLayerVectorSelectionModel |
230 |
if (selectionChangeCausedByMe) |
if (selectionChangeCausedByMe) |