Revision 10627 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrText.java
FLyrText.java | ||
---|---|---|
54 | 54 |
|
55 | 55 |
import org.cresques.cts.ICoordTrans; |
56 | 56 |
|
57 |
import com.hardcode.gdbms.engine.instruction.FieldNotFoundException; |
|
57 |
import com.hardcode.gdbms.driver.exceptions.InitializeDriverException; |
|
58 |
import com.hardcode.gdbms.driver.exceptions.OpenDriverException; |
|
59 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
60 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
58 | 61 |
import com.hardcode.gdbms.engine.values.DoubleValue; |
59 | 62 |
import com.hardcode.gdbms.engine.values.NullValue; |
60 | 63 |
import com.hardcode.gdbms.engine.values.NumericValue; |
61 | 64 |
import com.hardcode.gdbms.engine.values.Value; |
62 |
import com.iver.cit.gvsig.fmap.DriverException;
|
|
65 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException;
|
|
63 | 66 |
import com.iver.cit.gvsig.fmap.ViewPort; |
64 | 67 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
65 | 68 |
import com.iver.cit.gvsig.fmap.core.FShape; |
... | ... | |
68 | 71 |
import com.iver.cit.gvsig.fmap.core.v02.FLabel; |
69 | 72 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
70 | 73 |
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes; |
71 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
|
72 | 74 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial; |
73 | 75 |
import com.iver.cit.gvsig.fmap.rendering.Legend; |
74 | 76 |
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend; |
... | ... | |
110 | 112 |
* @param lyrVect |
111 | 113 |
* @throws DriverException |
112 | 114 |
*/ |
113 |
public void createLabels(FLyrVect lyrVect) throws DriverException { |
|
115 |
public void createLabels(FLyrVect lyrVect) throws ReadDriverException {
|
|
114 | 116 |
|
115 | 117 |
assocLyrVect = lyrVect; |
116 | 118 |
SelectableDataSource ds=null; |
... | ... | |
212 | 214 |
|
213 | 215 |
ds.stop(); |
214 | 216 |
adapter.stop(); |
215 |
} catch (DriverIOException e) { |
|
216 |
e.printStackTrace(); |
|
217 |
throw new DriverException(e); |
|
218 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
219 |
e.printStackTrace(); |
|
220 |
throw new DriverException(e); |
|
221 |
} |
|
217 |
} catch (ExpansionFileReadException e) { |
|
218 |
throw new ReadDriverException(getName(),e); |
|
219 |
} catch (InitializeDriverException e) { |
|
220 |
throw new ReadDriverException(getName(),e); |
|
221 |
} |
|
222 | 222 |
|
223 | 223 |
} |
224 | 224 |
|
... | ... | |
279 | 279 |
* @throws DriverException |
280 | 280 |
*/ |
281 | 281 |
private void drawLabels2(BufferedImage image, Graphics2D g, |
282 |
ViewPort viewPort, Cancellable cancel) throws DriverException { |
|
282 |
ViewPort viewPort, Cancellable cancel) throws ReadDriverException {
|
|
283 | 283 |
int numReg; |
284 | 284 |
Rectangle2D elExtent = viewPort.getAdjustedExtent(); |
285 | 285 |
|
... | ... | |
294 | 294 |
|
295 | 295 |
SelectableDataSource ds=null; |
296 | 296 |
ds = assocLyrVect.getRecordset(); |
297 |
try { |
|
298 |
int fieldId = ds.getFieldIndexByName(legend.getLabelField()); |
|
297 |
int fieldId = ds.getFieldIndexByName(legend.getLabelField()); |
|
299 | 298 |
VectorialLegend l = (VectorialLegend) getLegend(); |
300 | 299 |
int idFieldHeightText = -1; |
301 | 300 |
int idFieldRotationText = -1; |
... | ... | |
369 | 368 |
theLabel.draw(g, viewPort.getAffineTransform(), theShape, theSymbol); |
370 | 369 |
} |
371 | 370 |
} |
372 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
373 |
throw new DriverException(e); |
|
374 |
} |
|
375 | 371 |
|
372 |
|
|
376 | 373 |
} |
377 | 374 |
|
378 | 375 |
/* |
... | ... | |
380 | 377 |
* |
381 | 378 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#getFullExtent() |
382 | 379 |
*/ |
383 |
public Rectangle2D getFullExtent() throws DriverException {
|
|
380 |
public Rectangle2D getFullExtent() throws ReadDriverException, ExpansionFileReadException {
|
|
384 | 381 |
return assocLyrVect.getFullExtent(); |
385 | 382 |
} |
386 | 383 |
|
... | ... | |
392 | 389 |
* com.iver.cit.gvsig.fmap.operations.Cancellable) |
393 | 390 |
*/ |
394 | 391 |
public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, |
395 |
Cancellable cancel, double scale) throws DriverException { |
|
392 |
Cancellable cancel, double scale) throws ReadDriverException {
|
|
396 | 393 |
if (isVisible() && isWithinScale(scale)) { |
397 | 394 |
drawLabels(image, g, viewPort, cancel); |
398 | 395 |
} |
... | ... | |
406 | 403 |
* com.iver.cit.gvsig.fmap.operations.Cancellable) |
407 | 404 |
*/ |
408 | 405 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
409 |
double scale, PrintRequestAttributeSet properties) throws DriverException { |
|
406 |
double scale, PrintRequestAttributeSet properties) throws ReadDriverException {
|
|
410 | 407 |
if (isVisible() && isWithinScale(scale)) { |
411 | 408 |
drawLabels(null, g, viewPort, cancel); |
412 | 409 |
} |
... | ... | |
417 | 414 |
* |
418 | 415 |
* @see com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial#setLegend(com.iver.cit.gvsig.fmap.rendering.VectorialLegend) |
419 | 416 |
*/ |
420 |
public void setLegend(VectorialLegend r) throws DriverException, |
|
421 |
FieldNotFoundException { |
|
417 |
public void setLegend(VectorialLegend r) { |
|
422 | 418 |
legend = r; |
423 | 419 |
} |
424 | 420 |
|
... | ... | |
454 | 450 |
* |
455 | 451 |
* @see com.iver.cit.gvsig.fmap.layers.layerOperations.Classifiable#getShapeType() |
456 | 452 |
*/ |
457 |
public int getShapeType() throws DriverException {
|
|
453 |
public int getShapeType() { |
|
458 | 454 |
return FShape.TEXT; |
459 | 455 |
} |
460 | 456 |
|
Also available in: Unified diff