25 |
* |
* |
26 |
* Contributors: |
* Contributors: |
27 |
* Martin O. J. Schmitz - initial API and implementation |
* Martin O. J. Schmitz - initial API and implementation |
28 |
* Stefan A. Krüger - additional utility classes |
* Stefan A. Tzeggai - additional utility classes |
29 |
******************************************************************************/ |
******************************************************************************/ |
30 |
/** |
/** |
31 |
Copyright 2008 Stefan Alfons Krüger |
Copyright 2008 Stefan Alfons Tzeggai |
32 |
|
|
33 |
atlas-framework - This file is part of the Atlas Framework |
atlas-framework - This file is part of the Atlas Framework |
34 |
|
|
69 |
|
|
70 |
import schmitzm.geotools.FilterUtil; |
import schmitzm.geotools.FilterUtil; |
71 |
import schmitzm.geotools.gui.SelectableXMapPane; |
import schmitzm.geotools.gui.SelectableXMapPane; |
72 |
|
import schmitzm.geotools.gui.XMapPaneEvent; |
73 |
import schmitzm.geotools.map.event.FeatureSelectedEvent; |
import schmitzm.geotools.map.event.FeatureSelectedEvent; |
74 |
import schmitzm.geotools.map.event.JMapPaneListener; |
import schmitzm.geotools.map.event.JMapPaneListener; |
|
import schmitzm.geotools.map.event.MapPaneEvent; |
|
75 |
import schmitzm.geotools.styling.StylingUtil; |
import schmitzm.geotools.styling.StylingUtil; |
76 |
import skrueger.geotools.MapPaneToolBar; |
import skrueger.geotools.MapPaneToolBar; |
77 |
import skrueger.geotools.StyledFeaturesInterface; |
import skrueger.geotools.StyledFeaturesInterface; |
220 |
// moment. We do not use the styledLayer.getStyle, because in |
// moment. We do not use the styledLayer.getStyle, because in |
221 |
// the atlas, this always return the default style, but |
// the atlas, this always return the default style, but |
222 |
// additional styles might be selected. |
// additional styles might be selected. |
223 |
// Taking the style from the mapLayer indicated, that we have to |
// Taking the style from the mapLayer indicates, that we have to |
224 |
// remove any selection rules first. |
// remove any selection rules first. |
225 |
|
|
226 |
FeatureTypeStyle selectionFTStyle = StylingUtil |
FeatureTypeStyle selectionFTStyle = StylingUtil |
262 |
} else { |
} else { |
263 |
Set<FeatureId> fids = new HashSet<FeatureId>(); |
Set<FeatureId> fids = new HashSet<FeatureId>(); |
264 |
for (String fid : newSelection) { |
for (String fid : newSelection) { |
265 |
fids.add(FilterUtil.FILTER_FAC2.featureId(fid)); |
if (fid != null) |
266 |
|
fids.add(FilterUtil.FILTER_FAC2.featureId(fid)); |
267 |
} |
} |
268 |
|
|
269 |
selectionFTStyle.rules().get(0).setFilter( |
selectionFTStyle.rules().get(0).setFilter( |
417 |
* {@link StyledFeatureLayerSelectionModel} |
* {@link StyledFeatureLayerSelectionModel} |
418 |
*/ |
*/ |
419 |
@Override |
@Override |
420 |
public void performMapPaneEvent(MapPaneEvent e) { |
public void performMapPaneEvent(XMapPaneEvent e) { |
421 |
|
|
422 |
// Ignore event if it is caused by us or the synchronizer is disabled. |
// Ignore event if it is caused by us or the synchronizer is disabled. |
423 |
if (!isEnabled() || selectionChangeCausedByMe) |
if (!isEnabled() || selectionChangeCausedByMe) |