Revision 9524 branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrText.java
FLyrText.java | ||
---|---|---|
50 | 50 |
import java.awt.image.BufferedImage; |
51 | 51 |
import java.util.ArrayList; |
52 | 52 |
|
53 |
import javax.print.attribute.PrintRequestAttributeSet; |
|
54 |
|
|
53 | 55 |
import org.cresques.cts.ICoordTrans; |
54 | 56 |
|
55 |
import com.hardcode.driverManager.DriverLoadException; |
|
56 | 57 |
import com.hardcode.gdbms.engine.instruction.FieldNotFoundException; |
57 | 58 |
import com.hardcode.gdbms.engine.values.DoubleValue; |
58 | 59 |
import com.hardcode.gdbms.engine.values.NullValue; |
... | ... | |
63 | 64 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
64 | 65 |
import com.iver.cit.gvsig.fmap.core.FShape; |
65 | 66 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
66 |
import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
|
|
67 |
import com.iver.cit.gvsig.fmap.core.ISymbol;
|
|
67 | 68 |
import com.iver.cit.gvsig.fmap.core.v02.FLabel; |
68 | 69 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
69 | 70 |
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes; |
... | ... | |
124 | 125 |
VectorialLegend l = (VectorialLegend) getLegend(); |
125 | 126 |
int idFieldHeightText = -1; |
126 | 127 |
int idFieldRotationText = -1; |
128 |
|
|
129 |
FSymbol defaultSym = (FSymbol) l.getDefaultSymbol(); |
|
127 | 130 |
|
128 | 131 |
if (l.getLabelHeightField() != null) { |
129 | 132 |
idFieldHeightText = ds.getFieldIndexByName(l |
130 | 133 |
.getLabelHeightField()); |
131 |
l.getDefaultSymbol().setFontSizeInPixels(false);
|
|
134 |
defaultSym.setFontSizeInPixels(false);
|
|
132 | 135 |
} |
133 | 136 |
|
134 | 137 |
if (l.getLabelRotationField() != null) { |
... | ... | |
187 | 190 |
// cuando no hay un campo de altura de texto |
188 | 191 |
// TODO: Todo esto cambiar? con el nuevo sistema de leyendas... |
189 | 192 |
if (l.getDefaultSymbol()!=null) |
190 |
lbls[j].setHeight(l.getDefaultSymbol().getFontSize());
|
|
193 |
lbls[j].setHeight(defaultSym.getFontSize());
|
|
191 | 194 |
} |
192 | 195 |
|
193 | 196 |
if (idFieldRotationText != -1) { |
... | ... | |
239 | 242 |
// double anchoReal; |
240 | 243 |
// double altoReal; |
241 | 244 |
// double escala; |
242 |
FSymbol theSymbol = null;
|
|
245 |
ISymbol theSymbol = null;
|
|
243 | 246 |
System.out.println("Dibujando etiquetas..."); |
244 | 247 |
|
245 | 248 |
for (numReg = 0; numReg < m_labels.size(); numReg++) { |
... | ... | |
259 | 262 |
|
260 | 263 |
FShape shp = new FPoint2D(theLabel.getOrig().getX(), theLabel |
261 | 264 |
.getOrig().getY()); |
262 |
FGraphicUtilities.DrawLabel(g, viewPort.getAffineTransform(), |
|
263 |
shp, theSymbol, theLabel); |
|
265 |
|
|
266 |
theLabel.draw(g, viewPort.getAffineTransform(), shp, theSymbol); |
|
267 |
// FGraphicUtilities.DrawLabel(g, viewPort.getAffineTransform(), |
|
268 |
// shp, theSymbol, theLabel); |
|
264 | 269 |
} |
265 | 270 |
} |
266 | 271 |
} |
... | ... | |
294 | 299 |
VectorialLegend l = (VectorialLegend) getLegend(); |
295 | 300 |
int idFieldHeightText = -1; |
296 | 301 |
int idFieldRotationText = -1; |
302 |
FSymbol defaultSym = (FSymbol) l.getDefaultSymbol(); |
|
297 | 303 |
|
298 | 304 |
if (l.getLabelHeightField() != null) { |
299 | 305 |
// l.setBWithHeightText(true); |
300 | 306 |
idFieldHeightText = ds.getFieldIndexByName(l |
301 | 307 |
.getLabelHeightField()); |
302 |
l.getDefaultSymbol().setFontSizeInPixels(false);
|
|
308 |
defaultSym.setFontSizeInPixels(false);
|
|
303 | 309 |
} |
304 | 310 |
/* |
305 | 311 |
* }else{ l.setBWithHeightText(false); } |
... | ... | |
337 | 343 |
continue; |
338 | 344 |
} |
339 | 345 |
|
340 |
theSymbol = getLegend().getDefaultSymbol();
|
|
346 |
theSymbol = defaultSym;
|
|
341 | 347 |
theLabel.setString(val.toString()); |
342 | 348 |
theLabel.setOrig(thePoint); |
343 | 349 |
|
... | ... | |
351 | 357 |
// cuando no hay un campo de altura de texto |
352 | 358 |
// TODO: Todo esto cambiar? con el nuevo sistema de |
353 | 359 |
// leyendas... |
354 |
if (l.getDefaultSymbol() != null) |
|
355 |
theLabel.setHeight(l.getDefaultSymbol() |
|
356 |
.getFontSize()); |
|
360 |
if (defaultSym != null) |
|
361 |
theLabel.setHeight(defaultSym.getFontSize()); |
|
357 | 362 |
} |
358 | 363 |
|
359 | 364 |
if (idFieldRotationText != -1) { |
... | ... | |
361 | 366 |
.getFieldValue(numReg, idFieldRotationText); |
362 | 367 |
theLabel.setRotation(rotation.getValue()); |
363 | 368 |
} |
364 |
|
|
365 |
FGraphicUtilities.DrawLabel(g, viewPort.getAffineTransform(), |
|
366 |
theShape, theSymbol, theLabel); |
|
369 |
theLabel.draw(g, viewPort.getAffineTransform(), theShape, theSymbol); |
|
367 | 370 |
} |
368 | 371 |
} |
369 | 372 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
... | ... | |
403 | 406 |
* com.iver.cit.gvsig.fmap.operations.Cancellable) |
404 | 407 |
*/ |
405 | 408 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
406 |
double scale) throws DriverException { |
|
409 |
double scale, PrintRequestAttributeSet properties) throws DriverException {
|
|
407 | 410 |
if (isVisible() && isWithinScale(scale)) { |
408 | 411 |
drawLabels(null, g, viewPort, cancel); |
409 | 412 |
} |
Also available in: Unified diff