2 |
* Copyright (c) 2009 Martin O. J. Schmitz. |
* Copyright (c) 2009 Martin O. J. Schmitz. |
3 |
* |
* |
4 |
* This file is part of the SCHMITZM library - a collection of utility |
* 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 |
* classes based on Java 1.6, focusing (not only) on Java Swing |
6 |
* and the Geotools library. |
* and the Geotools library. |
7 |
* |
* |
8 |
* The SCHMITZM project is hosted at: |
* The SCHMITZM project is hosted at: |
39 |
import org.apache.log4j.Logger; |
import org.apache.log4j.Logger; |
40 |
import org.geotools.data.DefaultQuery; |
import org.geotools.data.DefaultQuery; |
41 |
import org.geotools.feature.AttributeType; |
import org.geotools.feature.AttributeType; |
|
import org.geotools.feature.Feature; |
|
42 |
import org.geotools.feature.FeatureCollection; |
import org.geotools.feature.FeatureCollection; |
43 |
import org.geotools.feature.FeatureType; |
import org.opengis.feature.simple.SimpleFeature; |
44 |
|
import org.opengis.feature.simple.SimpleFeatureType; |
45 |
import org.geotools.map.MapLayer; |
import org.geotools.map.MapLayer; |
46 |
import org.geotools.styling.Style; |
import org.geotools.styling.Style; |
47 |
import org.geotools.styling.TextSymbolizer; |
import org.geotools.styling.TextSymbolizer; |
82 |
} |
} |
83 |
|
|
84 |
private AttributeType getLabelAttribute(final TextSymbolizer ts, |
private AttributeType getLabelAttribute(final TextSymbolizer ts, |
85 |
final FeatureType schema) { |
final SimpleFeatureType schema) { |
86 |
if (ts == null) { |
if (ts == null) { |
87 |
// This layer has no labels |
// This layer has no labels |
88 |
return null; |
return null; |
141 |
* support case insensitivity and i don't find a lower or UPPER |
* support case insensitivity and i don't find a lower or UPPER |
142 |
* function. |
* function. |
143 |
*/ |
*/ |
144 |
final Iterator<Feature> fi = features.iterator(); |
final Iterator<SimpleFeature> fi = features.iterator(); |
145 |
while (fi.hasNext()) { |
while (fi.hasNext()) { |
146 |
final Feature f = fi.next(); |
final SimpleFeature f = fi.next(); |
147 |
|
|
148 |
final TextSymbolizer ts = StylingUtil.getTextSymbolizer(ml |
final TextSymbolizer ts = StylingUtil.getTextSymbolizer(ml |
149 |
.getStyle(), f); |
.getStyle(), f); |
204 |
return hits; |
return hits; |
205 |
} |
} |
206 |
|
|
207 |
protected SearchResult createSearchResult(final Feature f, final String title, |
protected SearchResult createSearchResult(final SimpleFeature f, final String title, |
208 |
final String inTitle, MapLayer ml) { |
final String inTitle, MapLayer ml) { |
209 |
return new SearchResultFeature(f, title, inTitle, mapPane, ml); |
return new SearchResultFeature(f, title, inTitle, mapPane, ml); |
210 |
} |
} |