/[schmitzm]/trunk/src/skrueger/geotools/selection/StyledFeatureLayerSelectionModel.java
ViewVC logotype

Annotation of /trunk/src/skrueger/geotools/selection/StyledFeatureLayerSelectionModel.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 111 - (hide annotations)
Tue May 12 23:33:14 2009 UTC (15 years, 9 months ago) by alfonx
File MIME type: text/plain
File size: 7175 byte(s)
* Fixed some bugs with the SelectionListeners and the JMapPane. To make this work,  StyledFeatureLayerSelectionModel now extends StyledLayerSelectionModel<String>. So the selection is remembered as a Set of Feature-IDs. This change was needed, because Feature.java doesn't overwrite the equals method, and therefore the HashSet didn't function as expected.
* Added new Tools and BUttons to MapPaneToolBar.java to select features
* Changed a lot in MapPaneToolBar.java. It now allows to position Spaces, Actions and Tools via the ID field. (the new feature is to mix them)
* Fixed a bug in AV's ClickInfoPanel that would suddenly pop up an AtlasViewer if started from Geopublisher under special circumstances.
* Moving layers in the legend is using MapContext's move method instead of remove and insert.
* LayerPanel's remember* Maps now all have the MapLayer's ID as a key. 

This commit includes latest schmitzm.jar and av.jar. The av.jar is also commited to the ISDSS, but the ISDSS will still have the old schmitzm.jar. Latest schmitzm.jar in ISDSS should be updated ASAP. I just don't know where to put it.
1 alfonx 96 /**
2     Copyright 2008 Stefan Alfons Krüger
3    
4     atlas-framework - This file is part of the Atlas Framework
5    
6     This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
7     This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
8     You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
9    
10     Diese Bibliothek ist freie Software; Sie dürfen sie unter den Bedingungen der GNU Lesser General Public License, wie von der Free Software Foundation veröffentlicht, weiterverteilen und/oder modifizieren; entweder gemäß Version 2.1 der Lizenz oder (nach Ihrer Option) jeder späteren Version.
11     Diese Bibliothek wird in der Hoffnung weiterverbreitet, daß sie nützlich sein wird, jedoch OHNE IRGENDEINE GARANTIE, auch ohne die implizierte Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Mehr Details finden Sie in der GNU Lesser General Public License.
12     Sie sollten eine Kopie der GNU Lesser General Public License zusammen mit dieser Bibliothek erhalten haben; falls nicht, schreiben Sie an die Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
13     **/
14    
15     package skrueger.geotools.selection;
16    
17     import java.util.Collection;
18     import java.util.HashSet;
19     import java.util.Set;
20     import java.util.Vector;
21    
22     import org.apache.log4j.Logger;
23     import org.geotools.feature.Feature;
24     import org.geotools.filter.AbstractFilterImpl;
25     import org.geotools.styling.Style;
26     import org.opengis.filter.Filter;
27    
28     import schmitzm.geotools.feature.FeatureUtil;
29 mojays 103 import skrueger.geotools.StyledFeatureCollectionInterface;
30     import skrueger.geotools.StyledFeatureSourceInterface;
31 alfonx 96
32     import com.vividsolutions.jts.geom.Envelope;
33    
34     /**
35 mojays 103 * This manager holds a set of {@link Feature Features} which are <i>selected</i>
36     * in a {@link StyledMapInterface} ({@link StyledFeatureCollectionInterface} or
37     * {@link StyledFeatureSourceInterface}).
38 alfonx 96 * @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany)
39     */
40 alfonx 111 public class StyledFeatureLayerSelectionModel extends StyledLayerSelectionModel<String> {
41 mojays 103 /**
42     * Creates a new selection model.
43     * @param styledMap styled map the selection is controlled of
44     */
45     public StyledFeatureLayerSelectionModel(StyledFeatureCollectionInterface styledMap) {
46     super(styledMap);
47     }
48    
49     /**
50     * Creates a new selection model.
51     * @param styledMap styled map the selection is controlled of
52     */
53     public StyledFeatureLayerSelectionModel(StyledFeatureSourceInterface styledMap) {
54     super(styledMap);
55     }
56    
57    
58    
59     //*********** UNUSED STUFF **************
60    
61     // /** A static logger for this class */
62     // private static final Logger LOGGER = Logger.getLogger(StyledFeatureLayerSelectionModel.class);
63     // /** Holds the current selection as {@link Style}. */
64     // protected Style selectionMapStyle = null;
65     // /** Holds the current selection as {@link Filter}. */
66     // protected Filter selectionFilter = null;
67     // /** Holds the current selection as {@code ChartStyle}.
68     // * TODO: determine an appropriate type for the chart styling. */
69     // protected Object selectionChartStyle = null;
70 alfonx 96 //
71     // /**
72     // * Creates a new selection model.
73     // * @param layer layer to control the selection of
74     // */
75     // public StyledFeatureLayerSelectionModel() {
76     // }
77     //
78     // /**
79     // * Not yet implemented!
80     // * Extends the current selection by all features contained by
81     // * the specified {@link Envelope}.
82     // * @param env defines a bounding box
83     // */
84     // public void addSelection(Envelope env) {
85     // // TODO: implement me!
86     // refreshSelection();
87     // }
88     //
89     // /**
90     // * Not yet implemented!
91     // * Reduces the current selection by all features contained by
92     // * the specified {@link Envelope}.
93     // * @param env defines a bounding box
94     // */
95     // public void removeSelection(Envelope env) {
96     // // TODO: implement me!
97     // refreshSelection();
98     // }
99     //
100     // /**
101     // * Not yet implemented!
102     // * Extends the current selection by all features accepted by
103     // * the specified {@link Filter}.
104     // * @param filter defines some features of the layer
105     // * @return {@code true} if selection has changed by calling this method
106     // */
107     // public boolean addSelection(Filter filter) {
108     // // TODO: implement me!
109     // refreshSelection();
110     // return false;
111     // }
112     //
113     // /**
114     // * Not yet implemented!
115     // * Removes all features accepted by the specified {@link Filter} from the
116     // * selection.
117     // * @param filter defines some features of the layer
118     // * @return {@code true} if selection has changed by calling this method
119     // */
120     // public boolean removeSelection(Filter filter) {
121     // // TODO: implement me!
122     // refreshSelection();
123     // return false;
124     // }
125     //
126     // /**
127     // * Returns a {@link Filter}, which defines the current selection.
128     // */
129     // public Filter getSelectionAsFilter() {
130     // return selectionFilter;
131     // }
132     //
133     // /**
134     // * Returns a {@link Style}, which highlights the current selection.
135     // */
136     // public Style getSelectionAsStyle() {
137     // return selectionMapStyle;
138     // }
139     //
140     // /**
141     // * Resets all selection objects with the new selection.
142     // */
143     // protected void resetSelectionObjects() {
144     //// resetMapStyle(); // TODO go to mapLayerSync
145     // resetFilter();
146     // resetChartStyle();
147     // }
148     //
149     //
150     ////
151     //// /**
152     //// * Creates a {@link Style} to highlight the current selection.
153     //// */
154     //// protected void resetMapStyle() {
155     //// selectionMapStyle = null;
156     //// try {
157     //// if ( selectionFeatures.isEmpty() )
158     //// selectionMapStyle = getLayer().getStyle();
159     //// else
160     //// selectionMapStyle = StylingUtil.createDefaultStyle(getLayer().getGeoObject());
161     ////
162     ////// getLayer().setStyle(selectionMapStyle);
163     //// } catch (Exception e) {
164     //// LOGGER.error("Error while trying to create a selection style",e);
165     //// }
166     //// }
167     //
168     // /**
169     // * Creates a {@link Filter} for the current selection.
170     // */
171     // protected void resetFilter() {
172     // // create a filter which accepts all Features contained
173     // // in the selection list
174     // selectionFilter = new AbstractFilterImpl( FeatureUtil.FILTER_FACTORY ) {
175     // public boolean evaluate(Object feature) {
176     // if ( feature instanceof Feature )
177     // return evaluate((Filter)feature);
178     // return false;
179     // }
180     // public boolean evaluate(Feature feature) {
181     // return selectionFeatures.contains(feature);
182     // }
183     // };
184     // }
185     //
186     // /**
187     // * Not yet implemented!
188     // * Creates a {@code ChartStyle} to highlight the current selection.
189     // */
190     // protected void resetChartStyle() {
191     // selectionChartStyle = null;
192     // // TODO: define the selectionChartStyle
193     // }
194     }

Properties

Name Value
svn:eol-style native
svn:keywords Id
svn:mime-type text/plain

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26