Revision 1282
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/MapControl.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap; |
42 | 42 |
|
43 |
import java.awt.Color; |
|
43 | 44 |
import java.awt.Dimension; |
44 | 45 |
import java.awt.Graphics; |
45 | 46 |
import java.awt.Graphics2D; |
... | ... | |
414 | 415 |
public void run() { |
415 | 416 |
try { |
416 | 417 |
synchronized (Drawer.class) { |
417 |
mapContext.draw(image, (Graphics2D) image.getGraphics(), |
|
418 |
cancel); |
|
418 |
Graphics2D g = image.createGraphics(); |
|
419 |
ViewPort viewPort = mapContext.getViewPort(); |
|
420 |
Color theBackColor = viewPort.getBackColor(); |
|
421 |
if (theBackColor == null) |
|
422 |
g.setColor(Color.WHITE); |
|
423 |
else |
|
424 |
g.setColor(theBackColor); |
|
425 |
g.fillRect(0, 0, viewPort.getImageWidth(), viewPort.getImageHeight()); |
|
419 | 426 |
|
427 |
mapContext.draw(image, g, cancel); |
|
428 |
|
|
420 | 429 |
timer.stop(); |
421 | 430 |
isCancelled = true; |
422 | 431 |
repaint(); |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/ViewPort.java | ||
---|---|---|
90 | 90 |
private ArrayList listeners = new ArrayList(); |
91 | 91 |
private Point2D offset = new Point2D.Double(0, 0); |
92 | 92 |
private Rectangle2D clip; |
93 |
private Color backColor = Color.WHITE; |
|
93 |
private Color backColor = null; //Color.WHITE;
|
|
94 | 94 |
private IProjection proj; |
95 | 95 |
private double dist1pixel; |
96 | 96 |
private double dist3pixel; |
... | ... | |
650 | 650 |
xml.putProperty("adjustedExtentH", adjustedExtent.getHeight()); |
651 | 651 |
} |
652 | 652 |
|
653 |
xml.putProperty("backColor", StringUtilities.color2String(backColor)); |
|
653 |
if (backColor != null) |
|
654 |
xml.putProperty("backColor", StringUtilities.color2String(backColor)); |
|
654 | 655 |
|
655 | 656 |
if (clip != null) { |
656 | 657 |
xml.putProperty("clipX", clip.getX()); |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/FMap.java | ||
---|---|---|
438 | 438 |
return; |
439 | 439 |
} |
440 | 440 |
|
441 |
g.setColor(viewPort.getBackColor()); |
|
442 |
g.fillRect(0, 0, viewPort.getImageWidth(), viewPort.getImageHeight()); |
|
443 |
|
|
444 | 441 |
// System.out.println("Viewport despues: " + viewPort); |
445 | 442 |
/* if ((viewPort.getImageWidth() <=0) || (viewPort.getImageHeight() <= 0)) |
446 | 443 |
{ |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameView.java | ||
---|---|---|
63 | 63 |
|
64 | 64 |
import org.apache.log4j.Logger; |
65 | 65 |
|
66 |
import java.awt.Color; |
|
66 | 67 |
import java.awt.Dimension; |
67 | 68 |
import java.awt.Graphics2D; |
68 | 69 |
import java.awt.Rectangle; |
... | ... | |
320 | 321 |
(int) r.width, (int) r.height)); |
321 | 322 |
|
322 | 323 |
try { |
324 |
ViewPort viewPort = this.getFMap().getViewPort(); |
|
325 |
Color theBackColor = viewPort.getBackColor(); |
|
326 |
if (theBackColor != null) |
|
327 |
{ |
|
328 |
g.setColor(theBackColor); |
|
329 |
g.fillRect((int) r.x, (int) r.y, viewPort.getImageWidth(), viewPort.getImageHeight()); |
|
330 |
} |
|
331 |
|
|
323 | 332 |
this.getFMap().draw(imgBase, g); |
324 | 333 |
} catch (com.iver.cit.gvsig.fmap.DriverException e) { |
325 | 334 |
// TODO Auto-generated catch block |
... | ... | |
329 | 338 |
|
330 | 339 |
if (rclip != null) { |
331 | 340 |
g.setClip(rclip.x, rclip.y, rclip.width, |
332 |
rclip.height); |
|
333 |
} |
|
341 |
rclip.height);
|
|
342 |
}
|
|
334 | 343 |
} else { |
335 | 344 |
drawDraft(g); |
336 | 345 |
} |
... | ... | |
637 | 646 |
* @see com.iver.cit.gvsig.fmap.ViewPortListener#backColorChanged(com.iver.cit.gvsig.fmap.ColorEvent) |
638 | 647 |
*/ |
639 | 648 |
public void backColorChanged(ColorEvent e) { |
649 |
m_fmap.getViewPort().setBackColor(e.getNewColor()); |
|
640 | 650 |
} |
641 | 651 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/Layout.java | ||
---|---|---|
422 | 422 |
*/ |
423 | 423 |
protected void paintComponent(Graphics g) { |
424 | 424 |
super.paintComponent(g); |
425 |
|
|
426 |
clipVisibleRect((Graphics2D) g); |
|
425 | 427 |
Rectangle rClip = g.getClipBounds(); |
428 |
if (rClip == null) System.err.println("clip = null"); |
|
426 | 429 |
switch (status) { |
427 | 430 |
case ZOOM_MAS: |
428 | 431 |
logger.debug("zoom mas"); |
... | ... | |
602 | 605 |
BufferedImage.TYPE_INT_ARGB); |
603 | 606 |
|
604 | 607 |
Graphics gimag = img.getGraphics(); |
605 |
// clipVisibleRect((Graphics2D) gimag);
|
|
608 |
clipVisibleRect((Graphics2D) gimag); |
|
606 | 609 |
|
607 | 610 |
if (initial) { |
608 | 611 |
fullRect(); |
609 | 612 |
initial = false; |
610 | 613 |
} |
611 |
|
|
612 | 614 |
try { |
613 | 615 |
layoutPaint.drawLayout((Graphics2D) gimag, img); |
614 | 616 |
} catch (DriverException e) { |
615 | 617 |
e.printStackTrace(); |
616 | 618 |
} |
617 |
|
|
619 |
|
|
620 |
g.setClip(rClip); |
|
618 | 621 |
layoutPaint.drawRectangle((Graphics2D) g); |
619 | 622 |
|
620 | 623 |
g.drawImage(img, 0, 0, this); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutDraw.java | ||
---|---|---|
242 | 242 |
} |
243 | 243 |
|
244 | 244 |
g.setColor(Color.BLUE); |
245 |
g.setClip(null); |
|
246 | 245 |
if (((unidadesX > unidadesMin) || (unidadesY > unidadesMin)) && |
247 | 246 |
layout.getIsDrawGrid()) { |
248 | 247 |
double ax = r.getMinX(); |
Also available in: Unified diff