/[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 96 - (hide annotations)
Fri May 8 11:23:16 2009 UTC (15 years, 9 months ago) by alfonx
File MIME type: text/plain
File size: 6687 byte(s)
(Hacking Session in action - atomic commits can't be ensured)
- Remodeling the SelectionModels
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    
30     import com.vividsolutions.jts.geom.Envelope;
31    
32     /**
33     * This manager takes care of every object selection for a {@link DpLayerVector}
34     * in the several atlas components and informs the appropriate components
35     * to keep the selection synchronized.
36     * <ul>
37     * <li>Geographical map of the layer</li>
38     * <li>Feature attribute table of the layer</li>
39     * <li>Chart visualizations of the layer</li>
40     * </ul>
41     * @author <a href="mailto:[email protected]">Martin Schmitz</a> (University of Bonn/Germany)
42     */
43     public class StyledFeatureLayerSelectionModel extends StyledLayerSelectionModel<Feature> {
44     /** A static logger for this class */
45     private static final Logger LOGGER = Logger.getLogger(StyledFeatureLayerSelectionModel.class);
46     /** Holds the current selection as {@link Style}. */
47     protected Style selectionMapStyle = null;
48     /** Holds the current selection as {@link Filter}. */
49     protected Filter selectionFilter = null;
50     /** Holds the current selection as {@code ChartStyle}.
51     * TODO: determine an appropriate type for the chart styling. */
52     protected Object selectionChartStyle = null;
53     //
54     // /**
55     // * Creates a new selection model.
56     // * @param layer layer to control the selection of
57     // */
58     // public StyledFeatureLayerSelectionModel() {
59     // }
60     //
61     // /**
62     // * Not yet implemented!
63     // * Extends the current selection by all features contained by
64     // * the specified {@link Envelope}.
65     // * @param env defines a bounding box
66     // */
67     // public void addSelection(Envelope env) {
68     // // TODO: implement me!
69     // refreshSelection();
70     // }
71     //
72     // /**
73     // * Not yet implemented!
74     // * Reduces the current selection by all features contained by
75     // * the specified {@link Envelope}.
76     // * @param env defines a bounding box
77     // */
78     // public void removeSelection(Envelope env) {
79     // // TODO: implement me!
80     // refreshSelection();
81     // }
82     //
83     // /**
84     // * Not yet implemented!
85     // * Extends the current selection by all features accepted by
86     // * the specified {@link Filter}.
87     // * @param filter defines some features of the layer
88     // * @return {@code true} if selection has changed by calling this method
89     // */
90     // public boolean addSelection(Filter filter) {
91     // // TODO: implement me!
92     // refreshSelection();
93     // return false;
94     // }
95     //
96     // /**
97     // * Not yet implemented!
98     // * Removes all features accepted by the specified {@link Filter} from the
99     // * selection.
100     // * @param filter defines some features of the layer
101     // * @return {@code true} if selection has changed by calling this method
102     // */
103     // public boolean removeSelection(Filter filter) {
104     // // TODO: implement me!
105     // refreshSelection();
106     // return false;
107     // }
108     //
109     // /**
110     // * Returns a {@link Filter}, which defines the current selection.
111     // */
112     // public Filter getSelectionAsFilter() {
113     // return selectionFilter;
114     // }
115     //
116     // /**
117     // * Returns a {@link Style}, which highlights the current selection.
118     // */
119     // public Style getSelectionAsStyle() {
120     // return selectionMapStyle;
121     // }
122     //
123     // /**
124     // * Resets all selection objects with the new selection.
125     // */
126     // protected void resetSelectionObjects() {
127     //// resetMapStyle(); // TODO go to mapLayerSync
128     // resetFilter();
129     // resetChartStyle();
130     // }
131     //
132     //
133     ////
134     //// /**
135     //// * Creates a {@link Style} to highlight the current selection.
136     //// */
137     //// protected void resetMapStyle() {
138     //// selectionMapStyle = null;
139     //// try {
140     //// if ( selectionFeatures.isEmpty() )
141     //// selectionMapStyle = getLayer().getStyle();
142     //// else
143     //// selectionMapStyle = StylingUtil.createDefaultStyle(getLayer().getGeoObject());
144     ////
145     ////// getLayer().setStyle(selectionMapStyle);
146     //// } catch (Exception e) {
147     //// LOGGER.error("Error while trying to create a selection style",e);
148     //// }
149     //// }
150     //
151     // /**
152     // * Creates a {@link Filter} for the current selection.
153     // */
154     // protected void resetFilter() {
155     // // create a filter which accepts all Features contained
156     // // in the selection list
157     // selectionFilter = new AbstractFilterImpl( FeatureUtil.FILTER_FACTORY ) {
158     // public boolean evaluate(Object feature) {
159     // if ( feature instanceof Feature )
160     // return evaluate((Filter)feature);
161     // return false;
162     // }
163     // public boolean evaluate(Feature feature) {
164     // return selectionFeatures.contains(feature);
165     // }
166     // };
167     // }
168     //
169     // /**
170     // * Not yet implemented!
171     // * Creates a {@code ChartStyle} to highlight the current selection.
172     // */
173     // protected void resetChartStyle() {
174     // selectionChartStyle = null;
175     // // TODO: define the selectionChartStyle
176     // }
177     }

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