Revision 15557 trunk/extensions/extCatalogAndGazetteer/src/es/gva/cit/gvsig/gazetteer/loaders/FeatureLoader.java
FeatureLoader.java | ||
---|---|---|
47 | 47 |
import java.awt.geom.Rectangle2D; |
48 | 48 |
|
49 | 49 |
import org.cresques.cts.ICoordTrans; |
50 |
import org.cresques.cts.IDatum; |
|
51 | 50 |
import org.cresques.cts.IProjection; |
52 |
import org.cresques.cts.ProjectionPool; |
|
53 | 51 |
|
54 | 52 |
import com.iver.andami.PluginServices; |
55 | 53 |
import com.iver.cit.gvsig.fmap.MapContext; |
... | ... | |
57 | 55 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
58 | 56 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
59 | 57 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
60 |
import com.iver.cit.gvsig.fmap.core.symbols.ITextSymbol; |
|
61 |
import com.iver.cit.gvsig.fmap.core.symbols.SimpleTextSymbol; |
|
62 | 58 |
import com.iver.cit.gvsig.fmap.core.v02.FConstant; |
63 | 59 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
64 | 60 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
... | ... | |
67 | 63 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
68 | 64 |
|
69 | 65 |
import es.gva.cit.gazetteer.querys.Feature; |
70 |
import es.gva.cit.gazetteer.querys.Query; |
|
71 |
import es.gva.cit.gvsig.gazetteer.DeleteSearchesModule;
|
|
66 |
import es.gva.cit.gazetteer.querys.GazetteerQuery;
|
|
67 |
import es.gva.cit.gvsig.gazetteer.DeleteSearchesExtension;
|
|
72 | 68 |
|
73 | 69 |
|
74 | 70 |
/** |
... | ... | |
90 | 86 |
View activeView = |
91 | 87 |
(View) PluginServices.getMDIManager().getActiveWindow(); |
92 | 88 |
|
93 |
IProjection projection = null; |
|
94 |
if (sProjection != null){ |
|
95 |
projection = CRSFactory.getCRS(sProjection); |
|
96 |
} |
|
89 |
|
|
90 |
IProjection projection = CRSFactory.getCRS(sProjection); |
|
97 | 91 |
if (projection == null){ |
98 | 92 |
projection = activeView.getMapControl().getViewPort().getProjection(); |
99 | 93 |
} |
... | ... | |
111 | 105 |
* @return |
112 | 106 |
* true or false if fail |
113 | 107 |
*/ |
114 |
public boolean load(Feature feature,Query query) { |
|
108 |
public boolean load(Feature feature,GazetteerQuery query) {
|
|
115 | 109 |
addAndDrawLabel(feature, |
116 | 110 |
query.getOptions().getAspect().isKeepOld(), |
117 | 111 |
query.getOptions().getAspect().isPaintCurrent()); |
... | ... | |
148 | 142 |
new Double(viewPort.getImageHeight()).doubleValue(), |
149 | 143 |
MapContext.CHANGE[viewPort.getMapUnits()], |
150 | 144 |
MapContext.CHANGE[viewPort.getDistanceUnits()], |
151 |
dpi); |
|
145 |
dpi);
|
|
152 | 146 |
zoomExtent = new Rectangle2D.Double(point.getX() - extent.getWidth()/2, |
153 | 147 |
point.getY() - extent.getHeight()/2, |
154 | 148 |
extent.getWidth(), |
... | ... | |
177 | 171 |
} |
178 | 172 |
|
179 | 173 |
if (isMarkedPlaceClicked){ |
180 |
int idSymbol = lyr.addSymbol(getSymbol(feature.getName()));
|
|
174 |
int idSymbol = lyr.addSymbol(getSymbol()); |
|
181 | 175 |
|
182 | 176 |
IGeometry geom = ShapeFactory.createPoint2D(new FPoint2D(getReprojectedPoint(feature.getCoordinates()))); |
183 | 177 |
|
184 | 178 |
FGraphicLabel theLabel = new FGraphicLabel(geom, idSymbol, feature.getName()); |
185 | 179 |
lyr.addGraphic(theLabel); |
186 | 180 |
|
187 |
DeleteSearchesModule.setVisible();
|
|
181 |
DeleteSearchesExtension.setVisible();
|
|
188 | 182 |
PluginServices.getMainFrame().enableControls(); |
189 | 183 |
} |
190 | 184 |
|
... | ... | |
200 | 194 |
* @return |
201 | 195 |
* FSymbol |
202 | 196 |
*/ |
203 |
private ITextSymbol getSymbol(String text){ |
|
204 |
SimpleTextSymbol theSymbol = new SimpleTextSymbol(); |
|
205 |
theSymbol.setTextColor(Color.RED); |
|
206 |
theSymbol.setText(text); |
|
207 |
theSymbol.setIsShapeVisible(true); |
|
197 |
private FSymbol getSymbol(){ |
|
198 |
FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_TEXT); |
|
199 |
theSymbol.setColor(Color.RED); |
|
200 |
theSymbol.setStyle(FConstant.SYMBOL_STYLE_MARKER_CIRCLE); |
|
201 |
theSymbol.setFontColor(Color.BLACK); |
|
202 |
theSymbol.setSizeInPixels(true); |
|
203 |
theSymbol.setSize(10); |
|
208 | 204 |
return theSymbol; |
209 | 205 |
} |
210 | 206 |
|
Also available in: Unified diff