Revision 24232 trunk/extensions/extAnnotations/src/com/iver/cit/gvsig/fmap/layers/Annotation_Layer.java

View differences:

Annotation_Layer.java
181 181
	}
182 182
	private void drawAnnotations(BufferedImage image, Graphics2D g, ViewPort viewPort,
183 183
			Cancellable cancel,PrintRequestAttributeSet properties) {
184
		BufferedImage bi=new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB);
184
		BufferedImage bi=new BufferedImage(viewPort.getImageWidth(),viewPort.getImageHeight(),BufferedImage.TYPE_INT_ARGB);
185 185
		Graphics2D gBi=(Graphics2D)bi.getGraphics();
186 186
		Point2D offset=viewPort.getOffset();
187 187
		gBi.translate(-offset.getX(),-offset.getY());
......
318 318
//						g.drawRect((int)rPixels.getX(),(int)rPixels.getY(),(int)rPixels.getWidth(),(int)rPixels.getHeight());
319 319
//FGraphicUtilities.DrawAnnotation(gBi,
320 320
//		ati, sym, aux[0], metrics, false);
321
drawAnnotation(gBi,unit,this,l, p, vv[idTextField].toString(),viewPort,properties);
321
						drawAnnotation(gBi,unit,this,l, p, vv[idTextField].toString(),viewPort,properties);
322 322
					}
323 323
				}else{
324 324

  
......
352 352
									fpPixels,
353 353
									cancel);
354 354
						}
355
//						g.drawRect((int)pSearch.getX(),(int)(pSearch.getY()-rPixels.getHeight()),(int)rPixels.getWidth(),(int)rPixels.getHeight());
356
//FGraphicUtilities.DrawAnnotation(gBi,
357
//		ati, sym, aux[0], metrics, false);
358
drawAnnotation(gBi,unit,this,l, pSearch , vv[idTextField].toString(),viewPort,properties);
355
						drawAnnotation(gBi,unit,this,l, pSearch , vv[idTextField].toString(),viewPort,properties);
359 356
					}
360 357
				}
361 358
				//Al dibujar esta imagen sobre el graphics la trasparencia no puede existir.
362
				if (i%1000==0){
363
					g.drawImage(bi,0,0,null);
364
				}
359
				
360
					if (i%1000==0){
361
						if (image!=null)
362
							g.drawImage(bi,0,0,null);
363
					}
365 364
			}
366 365
			gBi.translate(offset.getX(),offset.getY());
367 366
			g.drawImage(bi,(int)offset.getX(),(int)offset.getY(),null);
......
458 457
	public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
459 458
			double scale, PrintRequestAttributeSet properties) throws ReadDriverException{
460 459
		if (isVisible() && isWithinScale(scale)) {
461
			Strategy strategy = StrategyManager.getStrategy(this);
462
			strategy.print(g, viewPort, cancel, properties);
460
			drawAnnotations(null,g, viewPort, cancel, properties);
463 461
		}
464 462
	}
465 463

  

Also available in: Unified diff