/[schmitzm]/trunk/src/skrueger/geotools/labelsearch/SearchResultFeature.java
ViewVC logotype

Annotation of /trunk/src/skrueger/geotools/labelsearch/SearchResultFeature.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 244 - (hide annotations)
Wed Jul 29 09:33:33 2009 UTC (15 years, 7 months ago) by alfonx
File MIME type: text/plain
File size: 2878 byte(s)
* Updated all .java and .properties headers with a recent LGPL 3.0 and a link to the project webpage.
1 alfonx 244 /*******************************************************************************
2     * Copyright (c) 2009 Martin O. J. Schmitz.
3     *
4     * This file is part of the SCHMITZM library - a collection of utility
5     * classes based on Java 1.6, focussing (not only) on Java Swing
6     * and the Geotools library.
7     *
8     * The SCHMITZM project is hosted at:
9     * http://wald.intevation.org/projects/schmitzm/
10     *
11     * This program is free software; you can redistribute it and/or
12     * modify it under the terms of the GNU Lesser General Public License
13     * as published by the Free Software Foundation; either version 3
14     * of the License, or (at your option) any later version.
15     *
16     * This program is distributed in the hope that it will be useful,
17     * but WITHOUT ANY WARRANTY; without even the implied warranty of
18     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19     * GNU General Public License for more details.
20     *
21     * You should have received a copy of the GNU Lesser General Public License (license.txt)
22     * along with this program; if not, write to the Free Software
23     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24     * or try this link: http://www.gnu.org/licenses/lgpl.html
25     *
26     * Contributors:
27     * Martin O. J. Schmitz - initial API and implementation
28     * Stefan A. Krüger - additional utility classes
29     ******************************************************************************/
30 alfonx 139 package skrueger.geotools.labelsearch;
31    
32     import javax.swing.SwingUtilities;
33    
34     import org.apache.log4j.Logger;
35     import org.geotools.feature.Feature;
36 alfonx 153 import org.geotools.map.MapLayer;
37 alfonx 139
38 alfonx 153 public class SearchResultFeature implements SearchResult {
39     final static private Logger LOGGER = Logger
40     .getLogger(SearchResultFeature.class);
41 alfonx 139
42     private final Feature feature;
43     private final String title;
44     private final schmitzm.geotools.gui.JMapPane mapPane;
45     private final String inTitle;
46    
47 alfonx 153 private final MapLayer mapLayer;
48    
49     public SearchResultFeature(Feature feature, String title, String inTitle,
50     schmitzm.geotools.gui.JMapPane mapPane, MapLayer mapLayer) {
51 alfonx 139 this.feature = feature;
52     this.title = title;
53     this.inTitle = inTitle;
54     this.mapPane = mapPane;
55 alfonx 153 this.mapLayer = mapLayer;
56 alfonx 139 }
57 alfonx 153
58 alfonx 139 @Override
59     public String toString() {
60     return feature.toString();
61     }
62    
63     public Feature getFeature() {
64     return feature;
65     }
66    
67     @Override
68     public String getTitle() {
69     return title;
70     }
71    
72     @Override
73     public void open() {
74 alfonx 153
75 alfonx 139 // GuiAndTools.checkThatWeAreOnEDT();
76     if (!SwingUtilities.isEventDispatchThread()) {
77     LOGGER.error("Not on EDT");
78     throw new RuntimeException("Not on EDT!");
79     }
80    
81     mapPane.zoomTo(feature);
82     mapPane.refresh();
83 alfonx 153
84     // TODO
85     // Mark the selected Feature using a spacial style.. similar to the
86     // selection stuff.
87     // mapLayer.getStyle().addFeatureTypeStyle( new FeatureTypeStyle());
88    
89 alfonx 139 }
90    
91     @Override
92     public String getInTitle() {
93     return inTitle;
94     }
95    
96     }

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