Revision 21128 branches/v2_0_0_prep/libraries/libFMap/src/org/gvsig/fmap/mapcontext/rendering/legend/styling/AttrInTableLabelingStrategy.java
AttrInTableLabelingStrategy.java | ||
---|---|---|
18 | 18 |
import org.gvsig.fmap.core.geometries.utils.FConstant; |
19 | 19 |
import org.gvsig.fmap.core.geometries.utils.FLabel; |
20 | 20 |
import org.gvsig.fmap.geom.Geometry; |
21 |
import org.gvsig.fmap.geom.operation.CreateLabels; |
|
22 |
import org.gvsig.fmap.geom.operation.CreateLabelsOperationContext; |
|
23 |
import org.gvsig.fmap.geom.operation.DrawInts; |
|
24 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
|
25 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
|
21 | 26 |
import org.gvsig.fmap.geom.primitive.Point2D; |
22 | 27 |
|
23 | 28 |
import org.gvsig.fmap.mapcontext.MapContext; |
... | ... | |
98 | 103 |
// ReadableVectorial source = layer.getSource(); |
99 | 104 |
// SelectableDataSource recordSet = source.getRecordset(); |
100 | 105 |
Iterator iterator=collection.iterator(); |
106 |
CreateLabelsOperationContext cloc=new CreateLabelsOperationContext(); |
|
107 |
cloc.setDublicates(true); |
|
108 |
cloc.setPosition(0); |
|
101 | 109 |
while(iterator.hasNext()){ |
102 | 110 |
if (cancel.isCanceled()){ |
103 | 111 |
return; |
... | ... | |
156 | 164 |
sym.setText(feature.get(idTextField).toString()); |
157 | 165 |
sym.setRotation(rotation); |
158 | 166 |
|
159 |
FLabel[] aux = geom.createLabels(0, true); |
|
167 |
FLabel[] aux =(FLabel[])geom.invokeOperation(CreateLabels.CODE,cloc); |
|
168 |
// FLabel[] aux = geom.createLabels(0, true); |
|
160 | 169 |
for (int j = 0; j < aux.length; j++) { |
161 | 170 |
Point2D p = new Point2D(aux[j].getOrig()); |
162 | 171 |
p.transform(viewPort.getAffineTransform()); |
... | ... | |
166 | 175 |
} catch (ReadException e) { |
167 | 176 |
Logger.getAnonymousLogger().log(Level.SEVERE, "Could not draw annotation in the layer.\n" + |
168 | 177 |
e.getMessage()); |
178 |
} catch (GeometryOperationNotSupportedException e) { |
|
179 |
Logger.getAnonymousLogger().log(Level.SEVERE, "Could not draw annotation in the layer.\n" + |
|
180 |
e.getMessage()); |
|
181 |
} catch (GeometryOperationException e) { |
|
182 |
Logger.getAnonymousLogger().log(Level.SEVERE, "Could not draw annotation in the layer.\n" + |
|
183 |
e.getMessage()); |
|
169 | 184 |
} |
170 | 185 |
|
171 | 186 |
} |
Also available in: Unified diff