Revision 24759 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameView.java
FFrameView.java | ||
---|---|---|
58 | 58 |
import javax.print.attribute.PrintRequestAttributeSet; |
59 | 59 |
|
60 | 60 |
import org.cresques.cts.IProjection; |
61 |
import org.gvsig.fmap.data.ReadException;
|
|
61 |
import org.gvsig.fmap.dal.exception.ReadException;
|
|
62 | 62 |
import org.gvsig.fmap.geom.Geometry; |
63 | 63 |
import org.gvsig.fmap.geom.primitive.DefaultEnvelope; |
64 | 64 |
import org.gvsig.fmap.geom.primitive.Envelope; |
... | ... | |
294 | 294 |
double hextent = (scale * hview) / 100.0; |
295 | 295 |
double wextent = (scale * wview) / 100.0; |
296 | 296 |
|
297 |
if (m_fmap.getViewPort().getExtent()==null) |
|
298 |
return new DefaultEnvelope(2,new double[]{0,0},new double[]{0,0}); |
|
297 |
if (m_fmap.getViewPort().getExtent()==null) { |
|
298 |
return new DefaultEnvelope(2,new double[]{0,0},new double[]{0,0}); |
|
299 |
} |
|
299 | 300 |
double newx = m_fmap.getViewPort().getExtent().getCenterX() - |
300 | 301 |
(wextent / 2.0); |
301 | 302 |
double newy = m_fmap.getViewPort().getExtent().getCenterY() - |
... | ... | |
329 | 330 |
BufferedImage imgBase) |
330 | 331 |
throws ReadException { |
331 | 332 |
Rectangle2D.Double r = getBoundingBox(at); |
332 |
if (getRotation() != 0) |
|
333 |
if (getRotation() != 0) {
|
|
333 | 334 |
g.rotate(Math.toRadians(getRotation()), r.x + (r.width / 2), r.y |
334 | 335 |
+ (r.height / 2)); |
336 |
} |
|
335 | 337 |
if (intersects(rv, r)) { |
336 | 338 |
if (getMapContext() == null) { |
337 | 339 |
drawEmpty(g); |
... | ... | |
443 | 445 |
} |
444 | 446 |
} |
445 | 447 |
} |
446 |
if (getRotation() != 0) |
|
448 |
if (getRotation() != 0) {
|
|
447 | 449 |
g.rotate(Math.toRadians(-getRotation()), r.x + (r.width / 2), r.y |
448 | 450 |
+ (r.height / 2)); |
451 |
} |
|
449 | 452 |
|
450 | 453 |
if (getMapContext() != null) { |
451 | 454 |
setATMap(getMapContext().getViewPort() |
... | ... | |
455 | 458 |
} |
456 | 459 |
|
457 | 460 |
private Envelope calculateEnvelope() { |
458 |
if (p1==null||p2==null) |
|
461 |
if (p1==null||p2==null) {
|
|
459 | 462 |
return new DefaultEnvelope(2,new double[]{0,0},new double[]{0,0}); |
463 |
} |
|
460 | 464 |
Envelope r=new DefaultEnvelope(2,new double[]{p1.getX(),p1.getY()},new double[]{p2.getX(),p2.getY()}); |
461 | 465 |
return r; |
462 | 466 |
} |
... | ... | |
515 | 519 |
return getScaleView1(METROS); |
516 | 520 |
} |
517 | 521 |
*/ |
518 |
if (getMapContext()==null) |
|
519 |
return 0; |
|
522 |
if (getMapContext()==null) { |
|
523 |
return 0; |
|
524 |
} |
|
520 | 525 |
if (getTypeScale() == AUTOMATICO) { |
521 | 526 |
return FLayoutUtilities.getScaleView(getMapContext().getViewPort(), |
522 | 527 |
getBoundBox().width, getBoundingBox(null).width); |
... | ... | |
878 | 883 |
} |
879 | 884 |
|
880 | 885 |
public void refresh() { |
881 |
if (view!=null && (getTypeScale() == MANUAL || getTypeScale() == CONSTANTE )) |
|
886 |
if (view!=null && (getTypeScale() == MANUAL || getTypeScale() == CONSTANTE )) {
|
|
882 | 887 |
getMapContext().getViewPort().setEnvelope(getNewEnvelope(getScale())); |
888 |
} |
|
883 | 889 |
refresh=true; |
884 | 890 |
} |
885 | 891 |
|
... | ... | |
902 | 908 |
} |
903 | 909 |
|
904 | 910 |
public void cloneActions(IFFrame frame) { |
905 |
if (view ==null || view.getMapContext()==null) |
|
911 |
if (view ==null || view.getMapContext()==null) {
|
|
906 | 912 |
return; |
913 |
} |
|
907 | 914 |
if (m_bLinked) { |
908 | 915 |
if (getTypeScale() == AUTOMATICO) { |
909 | 916 |
view.getMapContext().getViewPort().addViewPortListener(this); |
Also available in: Unified diff