root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / FLyrVect.java @ 214
History | View | Annotate | Download (6.33 KB)
1 |
/* Generated by Together */
|
---|---|
2 |
|
3 |
package com.iver.cit.gvsig.fmap.layers; |
4 |
|
5 |
import java.awt.Graphics2D; |
6 |
import java.awt.geom.Point2D; |
7 |
import java.awt.geom.Rectangle2D; |
8 |
import java.awt.image.BufferedImage; |
9 |
import java.util.BitSet; |
10 |
import java.util.HashMap; |
11 |
|
12 |
import com.iver.cit.gvsig.fmap.ViewPort; |
13 |
import com.iver.cit.gvsig.fmap.XMLEntity; |
14 |
import com.iver.cit.gvsig.fmap.core.FGeometry; |
15 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
16 |
import com.iver.cit.gvsig.fmap.operations.selection.Record; |
17 |
import com.iver.cit.gvsig.fmap.operations.strategies.FeatureSelectorVisitor; |
18 |
import com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor; |
19 |
import com.iver.cit.gvsig.fmap.operations.strategies.Strategy; |
20 |
import com.iver.cit.gvsig.fmap.operations.strategies.StrategyManager; |
21 |
import com.iver.cit.gvsig.fmap.rendering.Legend; |
22 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory; |
23 |
|
24 |
public class FLyrVect extends FLyrDefault implements Strategy{ |
25 |
/**
|
26 |
* COlecci?n de leyendas de la capa vectorial. Contendr? tantos elementos como tipos de
|
27 |
* features pueda tener la capa vectorial
|
28 |
*/
|
29 |
private HashMap legends = new HashMap(1); |
30 |
|
31 |
public void selectFromSelection(BitSet selection) { |
32 |
} |
33 |
|
34 |
/**
|
35 |
* A?ade una selecci?n a la selecci?n de la capa. No lanza nin?n evento, ya que se lanzan manualmente mediante el m?todo fireSelectionEvents
|
36 |
*/
|
37 |
public void addSelection(BitSet selection) { |
38 |
} |
39 |
|
40 |
/**
|
41 |
* Establece la selecci?n de la capa. No lanza nin?n evento, ya que se lanzan manualmente mediante el m?todo fireSelectionEvents
|
42 |
*/
|
43 |
public void setSelection(BitSet selection) { |
44 |
} |
45 |
|
46 |
/**
|
47 |
* Devuelve true si el ?ndice que se pasa como par?metro corresponde a un registro seleccionado y false en caso contrario
|
48 |
*/
|
49 |
public boolean isSelected(int index) { |
50 |
return selected.get(index);
|
51 |
} |
52 |
|
53 |
/**
|
54 |
* Elimina la selecci?n de la capa. No lanza nin?n evento, ya que se lanzan manualmente mediante el m?todo fireSelectionEvents
|
55 |
*/
|
56 |
public void clearSelection() { |
57 |
} |
58 |
|
59 |
public Legend getLegend(int shapeType) { |
60 |
Legend l = (Legend) legends.get(new Integer(shapeType)); |
61 |
|
62 |
//Leyenda por defecto
|
63 |
if (l == null){ |
64 |
l = LegendFactory.createUniqueSymbolLegend(LegendFactory.DEFAULT_LINE_SYMBOL); |
65 |
legends.put(new Integer(shapeType), l); |
66 |
} |
67 |
|
68 |
return l;
|
69 |
} |
70 |
|
71 |
public void setLegend(int shapeType, Legend r) { |
72 |
} |
73 |
|
74 |
/**
|
75 |
* Las propiedades que hay retornar son las relativas a la selecci?n, ponerle el legend como hijo
|
76 |
*/
|
77 |
public XMLEntity getLayerProperties() {
|
78 |
return new XMLEntity(); |
79 |
} |
80 |
|
81 |
public void addVectorialListener(VectorialListener listener) { |
82 |
} |
83 |
|
84 |
public void removeVectorialListener(VectorialListener listener) { |
85 |
} |
86 |
|
87 |
/**
|
88 |
* Cuando ocurre un evento de cambio en la selecci?n, ?ste puede ser uno de una gran cantidad de eventos. Con el fin de no propagar todos estos eventos, se realiza la propagaci?n de manera manual al final de la "r?faga" de eventos
|
89 |
*/
|
90 |
public void fireSelectionEvents() { |
91 |
} |
92 |
|
93 |
public VectorialAdapter getSource() {
|
94 |
return source;
|
95 |
} |
96 |
|
97 |
public void setSource(VectorialAdapter va) { |
98 |
source = va; |
99 |
} |
100 |
|
101 |
/**
|
102 |
* Crea una capa con las etiquetas de esta capa sobre el campo cuyo id se pasa como par?metro
|
103 |
*/
|
104 |
public FLyrVect createLabelLayer(int fieldId) { |
105 |
//TODO implementar bien
|
106 |
return null; |
107 |
} |
108 |
|
109 |
public void removeLabels() { |
110 |
} |
111 |
|
112 |
private BitSet selected ; |
113 |
|
114 |
/**
|
115 |
* @supplierCardinality 0..*
|
116 |
*/
|
117 |
private VectorialListener[] listeners; |
118 |
|
119 |
/**
|
120 |
* @clientCardinality 0..*
|
121 |
*/
|
122 |
private VectorialAdapter source;
|
123 |
|
124 |
/**
|
125 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#process(com.iver.cit.gvsig.fmap.FeatureSelectorVisitor)
|
126 |
*/
|
127 |
public void process(FeatureSelectorVisitor visitor) { |
128 |
} |
129 |
|
130 |
/**
|
131 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#processSelected(com.iver.cit.gvsig.fmap.FeatureVisitor)
|
132 |
*/
|
133 |
public void processSelected(FeatureVisitor visitor) { |
134 |
} |
135 |
|
136 |
/**
|
137 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#select(com.iver.cit.gvsig.fmap.FeatureSelectorVisitor)
|
138 |
*/
|
139 |
public void select(FeatureSelectorVisitor visitor) { |
140 |
} |
141 |
|
142 |
/**
|
143 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectFromSelection()
|
144 |
*/
|
145 |
public void selectFromSelection() { |
146 |
} |
147 |
|
148 |
/**
|
149 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectByPoint(java.awt.geom.Point2D, double)
|
150 |
*/
|
151 |
public void selectByPoint(Point2D p, double tolerance) { |
152 |
} |
153 |
|
154 |
/**
|
155 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectByRect(java.awt.geom.Rectangle2D)
|
156 |
*/
|
157 |
public void selectByRect(Rectangle2D rect) { |
158 |
} |
159 |
|
160 |
/**
|
161 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectByShape(com.iver.cit.gvsig.fmap.fshape.FGeometry, int)
|
162 |
*/
|
163 |
public void selectByShape(FGeometry g, int relationship) { |
164 |
} |
165 |
|
166 |
/**
|
167 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#queryByPoint(java.awt.geom.Point2D, double)
|
168 |
*/
|
169 |
public Record[] queryByPoint(Point2D p, double tolerance) { |
170 |
return null; |
171 |
} |
172 |
|
173 |
/**
|
174 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#queryByRect(java.awt.geom.Rectangle2D)
|
175 |
*/
|
176 |
public Record[] queryByRect(Rectangle2D rect) { |
177 |
return null; |
178 |
} |
179 |
|
180 |
/**
|
181 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#queryByShape(com.iver.cit.gvsig.fmap.fshape.FGeometry, int)
|
182 |
*/
|
183 |
public Record[] queryByShape(FGeometry g, int relationship) { |
184 |
return null; |
185 |
} |
186 |
|
187 |
/**
|
188 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#getSelectionBounds()
|
189 |
*/
|
190 |
public Rectangle2D getSelectionBounds() { |
191 |
return null; |
192 |
} |
193 |
|
194 |
/**
|
195 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.Strategy#createIndex()
|
196 |
*/
|
197 |
public void createIndex() { |
198 |
} |
199 |
|
200 |
/**
|
201 |
* @throws DriverIOException
|
202 |
* @see com.iver.cit.gvsig.fmap.operations.Operations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort)
|
203 |
*/
|
204 |
public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort) throws DriverIOException { |
205 |
Strategy strategy = StrategyManager.getStrategy(this);
|
206 |
|
207 |
strategy.draw(image, g, viewPort); |
208 |
} |
209 |
|
210 |
/**
|
211 |
* @throws DriverIOException
|
212 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#getFullExtent()
|
213 |
*/
|
214 |
public Rectangle2D getFullExtent() throws DriverIOException { |
215 |
source.start(); |
216 |
Rectangle2D ret = source.getFullExtent();
|
217 |
source.stop(); |
218 |
|
219 |
return ret;
|
220 |
} |
221 |
} |