Revision 110 trunk/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java
FFrameView.java | ||
---|---|---|
45 | 45 |
import org.gvsig.andami.messages.NotificationManager; |
46 | 46 |
import org.gvsig.app.project.Project; |
47 | 47 |
import org.gvsig.app.project.documents.layout.DefaultLayoutNotification; |
48 |
import org.gvsig.app.project.documents.layout.FLayoutFunctions; |
|
48 | 49 |
import org.gvsig.app.project.documents.layout.FLayoutUtilities; |
49 | 50 |
import org.gvsig.app.project.documents.layout.LayoutNotification; |
50 | 51 |
import org.gvsig.app.project.documents.view.DefaultViewDocument; |
... | ... | |
402 | 403 |
/* |
403 | 404 |
* We are not drawing if any layer is in editing mode |
404 | 405 |
*/ |
405 |
drawInEditing(g); |
|
406 |
drawMessage(g, Messages.getText( |
|
407 |
"_Cannot_draw_view_if_layers_in_editing_mode")); |
|
406 | 408 |
|
407 | 409 |
} else { |
408 | 410 |
if (getQuality() == PRESENTATION) { |
409 |
drawPresentation(g, at, rectangleLayout, rectangleView, imgBase); |
|
411 |
try { |
|
412 |
drawPresentation(g, at, rectangleLayout, rectangleView, imgBase); |
|
413 |
} catch (Exception exc) { |
|
414 |
drawMessage(g, FLayoutFunctions.getLastMessage(exc)); |
|
415 |
} |
|
416 |
|
|
410 | 417 |
} else { |
411 | 418 |
drawDraft(g); |
412 | 419 |
} |
... | ... | |
419 | 426 |
} |
420 | 427 |
} |
421 | 428 |
|
422 |
private void drawInEditing(Graphics2D g) {
|
|
429 |
private void drawMessage(Graphics2D g, String msg) {
|
|
423 | 430 |
|
424 | 431 |
Rectangle2D r = getBoundingBox(null); |
425 | 432 |
g.setColor(Color.lightGray); |
... | ... | |
435 | 442 |
Font f = new Font("SansSerif", Font.PLAIN, scale); |
436 | 443 |
g.setFont(f); |
437 | 444 |
|
438 |
String s = Messages.getText("_Cannot_draw_view_if_layers_in_editing_mode"); |
|
439 |
|
|
440 |
g.drawString(s, (int) (r.getCenterX() - ((s.length() * scale) / 4)), |
|
445 |
g.drawString(msg, (int) (r.getCenterX() - ((msg.length() * scale) / 4)), |
|
441 | 446 |
(int) (r.getCenterY())); |
442 | 447 |
} |
443 | 448 |
|
444 |
protected void drawPresentation(Graphics2D g, AffineTransform affineTransform, Rectangle2D.Double rectangleLayout, Rectangle2D rectangleView, BufferedImage imgBase){ |
|
449 |
protected void drawPresentation( |
|
450 |
Graphics2D g, |
|
451 |
AffineTransform affineTransform, |
|
452 |
Rectangle2D.Double rectangleLayout, |
|
453 |
Rectangle2D rectangleView, |
|
454 |
BufferedImage imgBase) throws Exception { |
|
455 |
|
|
445 | 456 |
Point mapOrigin = new Point((int)rectangleView.getMinX(), (int)rectangleView.getMaxY()); |
446 | 457 |
|
447 | 458 |
ViewPort viewPort = this.getMapContext().getViewPort(); |
... | ... | |
483 | 494 |
gimg.translate(-((int) rectangleLayout.getX()), |
484 | 495 |
-((int) rectangleLayout.getY())); |
485 | 496 |
*/ |
486 |
|
|
487 |
try { |
|
488 |
getMapContext().draw(m_image, gimg, getScale()); |
|
489 |
gimg.dispose(); |
|
490 |
} catch (ReadException e) { |
|
491 |
logger.error("Error reading the provider" , e); |
|
492 |
} catch (MapContextException mpex) { |
|
493 |
logger.error("Error reading the provider" , mpex); |
|
494 |
} |
|
497 |
|
|
498 |
getMapContext().draw(m_image, gimg, getScale()); |
|
499 |
gimg.dispose(); |
|
495 | 500 |
/* |
496 | 501 |
gimg.translate(((int) rectangleLayout.getX()), |
497 | 502 |
((int) rectangleLayout.getY())); |
Also available in: Unified diff