/[schmitzm]/branches/2.4.x/src/skrueger/geotools/labelsearch/SearchResultFeature.java
ViewVC logotype

Diff of /branches/2.4.x/src/skrueger/geotools/labelsearch/SearchResultFeature.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 152 by alfonx, Thu Jun 11 12:52:58 2009 UTC revision 153 by alfonx, Sat Jun 20 12:48:24 2009 UTC
# Line 4  import javax.swing.SwingUtilities; Line 4  import javax.swing.SwingUtilities;
4    
5  import org.apache.log4j.Logger;  import org.apache.log4j.Logger;
6  import org.geotools.feature.Feature;  import org.geotools.feature.Feature;
7    import org.geotools.map.MapLayer;
8    
9  public class SearchResultFeature implements SearchResult {  public class SearchResultFeature implements SearchResult {
10          final static private Logger LOGGER = Logger.getLogger(SearchResultFeature.class);          final static private Logger LOGGER = Logger
11                                    .getLogger(SearchResultFeature.class);
12    
13          private final Feature feature;          private final Feature feature;
14          private final String title;          private final String title;
15          private final schmitzm.geotools.gui.JMapPane mapPane;          private final schmitzm.geotools.gui.JMapPane mapPane;
16          private final String inTitle;          private final String inTitle;
17    
18          public SearchResultFeature(Feature feature, String title, String inTitle, schmitzm.geotools.gui.JMapPane mapPane) {          private final MapLayer mapLayer;
19    
20            public SearchResultFeature(Feature feature, String title, String inTitle,
21                            schmitzm.geotools.gui.JMapPane mapPane, MapLayer mapLayer) {
22                  this.feature = feature;                  this.feature = feature;
23                  this.title = title;                  this.title = title;
24                  this.inTitle = inTitle;                  this.inTitle = inTitle;
25                  this.mapPane = mapPane;                  this.mapPane = mapPane;
26                    this.mapLayer = mapLayer;
27          }          }
28            
29          @Override          @Override
30          public String toString() {          public String toString() {
31                  return feature.toString();                  return feature.toString();
# Line 37  public class SearchResultFeature impleme Line 42  public class SearchResultFeature impleme
42    
43          @Override          @Override
44          public void open() {          public void open() {
45                    
46                  // GuiAndTools.checkThatWeAreOnEDT();                  // GuiAndTools.checkThatWeAreOnEDT();
47                  if (!SwingUtilities.isEventDispatchThread()) {                  if (!SwingUtilities.isEventDispatchThread()) {
48                          LOGGER.error("Not on EDT");                          LOGGER.error("Not on EDT");
49                          throw new RuntimeException("Not on EDT!");                          throw new RuntimeException("Not on EDT!");
50                  }                  }
                   
51    
52                  mapPane.zoomTo(feature);                  mapPane.zoomTo(feature);
53                  mapPane.refresh();                  mapPane.refresh();
54    
55                    // TODO
56                    // Mark the selected Feature using a spacial style.. similar to the
57                    // selection stuff.
58                    // mapLayer.getStyle().addFeatureTypeStyle( new FeatureTypeStyle());
59    
60          }          }
61    
62          @Override          @Override

Legend:
Removed from v.152  
changed lines
  Added in v.153

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26