pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: Replace column in table view
Date Fri, 30 Sep 2011 16:33:45 GMT
> I try to do:
> 
> 	@Override
> 	public Visual getRepresentation() {
> 		Picture picture = null;
> 		if (selectedIndex!=-1){
> 			Bounds headerBounds = getHeaderBounds(selectedIndex);
> 			BufferedImage bImg = new BufferedImage(headerBounds.width,
> headerBounds.height, BufferedImage.TYPE_INT_RGB);
> 		
> 			Graphics2D graphics =  bImg.createGraphics();
> 		
> 			graphics.translate(headerBounds.x, headerBounds.y);

I think you may need to translate to -headerBounds.x and -headerBounds.y.
			
> 			graphics.drawImage(bImg, headerBounds.x, 0, null);

Why are you calling drawImage() here?

> 			paint(graphics);
> 
> 			graphics.dispose();
> 	
> 			picture = new Picture(bImg); 
> 		}
> 		
> 		return picture;
> 	}
> But the black rectangle is shown like on the picture above... Code is wrong?
> 
> -----
> Thank you!
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Replace-column-in-table-view-tp3375080p3382628.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Mime
View raw message