Revision 3464 trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/loaders/FeatureLoader.java
FeatureLoader.java | ||
---|---|---|
41 | 41 |
package es.gva.cit.gvsig.gazetteer.loaders; |
42 | 42 |
|
43 | 43 |
|
44 |
import java.awt.Color; |
|
45 |
import java.awt.Font; |
|
44 | 46 |
import java.awt.geom.Rectangle2D; |
45 | 47 |
|
46 | 48 |
import com.iver.andami.PluginServices; |
49 |
import com.iver.cit.gvsig.fmap.core.FMultiPoint2D; |
|
50 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
51 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
|
52 |
import com.iver.cit.gvsig.fmap.core.v02.FConstant; |
|
53 |
import com.iver.cit.gvsig.fmap.core.v02.FLabel; |
|
54 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
|
55 |
import com.iver.cit.gvsig.fmap.layers.FLyrText; |
|
56 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
57 |
import com.iver.cit.gvsig.fmap.layers.GraphicLayer; |
|
58 |
import com.iver.cit.gvsig.fmap.rendering.FGraphic; |
|
59 |
|
|
47 | 60 |
import es.gva.cit.gazetteer.querys.Feature; |
48 | 61 |
import es.gva.cit.gvsig.catalogClient.loaders.AbstractLoader; |
49 | 62 |
|
... | ... | |
56 | 69 |
public class FeatureLoader extends AbstractLoader{ |
57 | 70 |
|
58 | 71 |
/** |
59 |
* It make a zoom into gvSIG
|
|
72 |
* It make a zoom in gvSIG |
|
60 | 73 |
* @param |
61 | 74 |
* feature |
62 | 75 |
* @return |
... | ... | |
77 | 90 |
10000, |
78 | 91 |
10000)); |
79 | 92 |
} |
93 |
|
|
94 |
addFLyr(feature); |
|
80 | 95 |
return true; |
81 |
} |
|
96 |
}
|
|
82 | 97 |
|
98 |
/** |
|
99 |
* It adds a new Layer to the current view |
|
100 |
* @param feature |
|
101 |
* To obtain the coordinates |
|
102 |
*/ |
|
103 |
public void addFLyr(Feature feature){ |
|
104 |
GraphicLayer glayer = new GraphicLayer(); |
|
105 |
|
|
106 |
FSymbol theSymbol = new FSymbol(FConstant.SYMBOL_TYPE_TEXT); |
|
107 |
theSymbol.setColor(Color.RED); |
|
108 |
theSymbol.setDescription(feature.getName()); |
|
109 |
int idSymbol = glayer.addSymbol(theSymbol); |
|
110 |
|
|
111 |
IGeometry geom = ShapeFactory.createPoint2D(feature.getCoordinates().getX(), |
|
112 |
feature.getCoordinates().getY()); |
|
113 |
FGraphic theGraphic = new FGraphic(geom, idSymbol); |
|
114 |
|
|
115 |
glayer.addGraphic(theGraphic); |
|
116 |
glayer.setName(feature.getName()); |
|
117 |
|
|
118 |
addLayerToView(glayer); |
|
119 |
|
|
120 |
FLyrText tlayer = new FLyrText(); |
|
121 |
|
|
122 |
} |
|
83 | 123 |
} |
Also available in: Unified diff